1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright(c) 2018 Thamtech, LLC |
4
|
|
|
* @link https://github.com/thamtech/yii2-scheduler |
5
|
|
|
* @license https://opensource.org/licenses/MIT |
6
|
|
|
* |
7
|
|
|
* |
8
|
|
|
* Task View |
9
|
|
|
* |
10
|
|
|
* @var yii\web\View $this |
11
|
|
|
* @var thamtech\scheduler\models\SchedulerTask $model |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
use yii\helpers\Html; |
15
|
|
|
use thamtech\scheduler\models\SchedulerTask; |
16
|
|
|
use yii\bootstrap\Tabs; |
|
|
|
|
17
|
|
|
use yii\grid\GridView; |
18
|
|
|
use yii\widgets\DetailView; |
19
|
|
|
|
20
|
|
|
|
21
|
|
|
$this->title = $model->__toString(); |
22
|
|
|
$this->params['breadcrumbs'][] = ['label' => SchedulerTask::label(2), 'url' => ['index']]; |
23
|
|
|
$this->params['breadcrumbs'][] = $model->__toString(); |
24
|
|
|
?> |
25
|
|
|
<div class="task-view"> |
26
|
|
|
|
27
|
|
|
<h1><?=$this->title ?></h1> |
28
|
|
|
|
29
|
|
|
<?php $this->beginBlock('main'); ?> |
30
|
|
|
<?= DetailView::widget([ |
31
|
|
|
'model' => $model, |
32
|
|
|
'attributes' => [ |
33
|
|
|
'id', |
34
|
|
|
'name', |
35
|
|
|
'display_name', |
36
|
|
|
'description', |
37
|
|
|
'schedule', |
38
|
|
|
'status', |
39
|
|
|
[ |
40
|
|
|
'attribute' => 'started_at', |
41
|
|
|
'format' => 'raw', |
42
|
|
|
'value' => $model->status_id == SchedulerTask::STATUS_RUNNING ? $model->started_at : '', |
43
|
|
|
], |
44
|
|
|
'last_run', |
45
|
|
|
'next_run', |
46
|
|
|
], |
47
|
|
|
]) ?> |
48
|
|
|
<?php $this->endBlock(); ?> |
49
|
|
|
|
50
|
|
|
|
51
|
|
|
|
52
|
|
|
<?php $this->beginBlock('logs'); ?> |
53
|
|
|
<div class="table-responsive"> |
54
|
|
|
<?php \yii\widgets\Pjax::begin(['id' => 'logs']); ?> |
55
|
|
|
<?= GridView::widget([ |
56
|
|
|
'layout' => '{summary}{pager}{items}{pager}', |
57
|
|
|
'dataProvider' => $logDataProvider, |
58
|
|
|
'pager' => [ |
59
|
|
|
'class' => yii\widgets\LinkPager::className(), |
|
|
|
|
60
|
|
|
'firstPageLabel' => Yii::t('app', 'First'), |
61
|
|
|
'lastPageLabel' => Yii::t('app', 'Last'), |
62
|
|
|
], |
63
|
|
|
'columns' => [ |
64
|
|
|
'started_at:datetime', |
65
|
|
|
'ended_at:datetime', |
66
|
|
|
[ |
67
|
|
|
'label' => 'Duration', |
68
|
|
|
'value' => function ($m) { |
69
|
|
|
return $m->getDuration(); |
70
|
|
|
} |
71
|
|
|
], |
72
|
|
|
[ |
73
|
|
|
'label' => 'Result', |
74
|
|
|
'format' => 'raw', |
75
|
|
|
'contentOptions' => function ($m) { |
76
|
|
|
return ['class' => $m->error == 0 ? 'text-success' : 'text-danger']; |
77
|
|
|
}, |
78
|
|
|
'value' => function ($m) { |
79
|
|
|
$icon = $m->error == 0 ? 'ok-circle' : 'remove-circle'; |
80
|
|
|
$text = $m->error == 0 ? 'Success' : 'Failure'; |
81
|
|
|
|
82
|
|
|
return Html::tag('span', '', ['class' => 'glyphicon glyphicon-' . $icon]) . ' ' . $text; |
83
|
|
|
} |
84
|
|
|
], |
85
|
|
|
[ |
86
|
|
|
'class' => 'yii\grid\ActionColumn', |
87
|
|
|
'visibleButtons' => [ |
88
|
|
|
'update' => false, |
89
|
|
|
'delete' => false, |
90
|
|
|
], |
91
|
|
|
'buttons' => [ |
92
|
|
|
'view' => function ($url, $model, $key) { |
|
|
|
|
93
|
|
|
return Html::a('View Details', ['view-log', 'id' => $model->id]); |
94
|
|
|
} |
95
|
|
|
], |
96
|
|
|
], |
97
|
|
|
], |
98
|
|
|
]); ?> |
99
|
|
|
<?php \yii\widgets\Pjax::end(); ?> |
100
|
|
|
</div> |
101
|
|
|
<?php $this->endBlock(); ?> |
102
|
|
|
|
103
|
|
|
<?= Tabs::widget([ |
104
|
|
|
'encodeLabels' => false, |
105
|
|
|
'id' => 'customer', |
106
|
|
|
'items' => [ |
107
|
|
|
'overview' => [ |
108
|
|
|
'label' => Yii::t('app', 'Overview'), |
109
|
|
|
'content' => $this->blocks['main'], |
110
|
|
|
'active' => true, |
111
|
|
|
], |
112
|
|
|
'logs' => [ |
113
|
|
|
'label' => 'Logs', |
114
|
|
|
'content' => $this->blocks['logs'], |
115
|
|
|
], |
116
|
|
|
] |
117
|
|
|
]);?> |
118
|
|
|
</div> |
119
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths