1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Server module for HiPanel |
4
|
|
|
* |
5
|
|
|
* @link https://github.com/hiqdev/hipanel-module-server |
6
|
|
|
* @package hipanel-module-server |
7
|
|
|
* @license BSD-3-Clause |
8
|
|
|
* @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/) |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace hipanel\modules\server\grid; |
12
|
|
|
|
13
|
|
|
use hipanel\widgets\gridLegend\BaseGridLegend; |
14
|
|
|
use hipanel\widgets\gridLegend\GridLegendInterface; |
15
|
|
|
use Yii; |
16
|
|
|
|
17
|
|
|
class ServerGridLegend extends BaseGridLegend implements GridLegendInterface |
18
|
|
|
{ |
19
|
|
|
public function items() |
20
|
|
|
{ |
21
|
|
|
return [ |
22
|
|
|
[ |
23
|
|
|
'label' => Yii::t('hipanel:server', 'unused: UU'), |
24
|
|
|
'columns' => ['actions'], |
25
|
|
|
], |
26
|
|
|
[ |
27
|
|
|
'label' => Yii::t('hipanel:server', 'setup: SETUP'), |
28
|
|
|
'columns' => ['actions'], |
29
|
|
|
], |
30
|
|
|
[ |
31
|
|
|
'label' => Yii::t('hipanel:server', 'delivery: DLVR'), |
32
|
|
|
'color' => '#50c878', |
33
|
|
|
'rule' => $this->model->type === 'delivery', |
|
|
|
|
34
|
|
|
'columns' => ['actions'], |
35
|
|
|
], |
36
|
|
|
[ |
37
|
|
|
'label' => Yii::t('hipanel:server', 'reserved: RSVD'), |
38
|
|
|
'color' => '#339966', |
39
|
|
|
'rule' => $this->model->type === 'reserved', |
40
|
|
|
'columns' => ['actions'], |
41
|
|
|
], |
42
|
|
|
[ |
43
|
|
|
'label' => Yii::t('hipanel:server', 'dedicated: DSS'), |
44
|
|
|
'color' => '#AAFFAA', |
45
|
|
|
'rule' => $this->model->type === 'dedicated', |
46
|
|
|
'columns' => ['actions'], |
47
|
|
|
], |
48
|
|
|
[ |
49
|
|
|
'label' => Yii::t('hipanel:server', 'unmanaged: DSU'), |
50
|
|
|
'color' => '#AAFFAA', |
51
|
|
|
'rule' => $this->model->type === 'unmanaged', |
52
|
|
|
'columns' => ['actions'], |
53
|
|
|
], |
54
|
|
|
[ |
55
|
|
|
'label' => Yii::t('hipanel:server', 'virtual: SH'), |
56
|
|
|
'color' => '#CCCCFF', |
57
|
|
|
'rule' => $this->model->type === 'virtual', |
58
|
|
|
'columns' => ['actions'], |
59
|
|
|
], |
60
|
|
|
[ |
61
|
|
|
'label' => Yii::t('hipanel:server', 'system: IU'), |
62
|
|
|
'color' => '#FFFF99', |
63
|
|
|
'rule' => $this->model->type === 'system', |
64
|
|
|
'columns' => ['actions'], |
65
|
|
|
], |
66
|
|
|
[ |
67
|
|
|
'label' => Yii::t('hipanel:server', 'remote: RS'), |
68
|
|
|
'color' => '#CCFFCC', |
69
|
|
|
'rule' => $this->model->type === 'remote', |
70
|
|
|
'columns' => ['actions'], |
71
|
|
|
], |
72
|
|
|
[ |
73
|
|
|
'label' => Yii::t('hipanel:server', 'vdsmaster: VM'), |
74
|
|
|
'color' => '#DD7700', |
75
|
|
|
'rule' => $this->model->type === 'vdsmaster', |
76
|
|
|
'columns' => ['actions'], |
77
|
|
|
], |
78
|
|
|
[ |
79
|
|
|
'label' => Yii::t('hipanel:server', 'vds: VDS'), |
80
|
|
|
'color' => '#FFBB00', |
81
|
|
|
'rule' => $this->model->type === 'vds', |
82
|
|
|
'columns' => ['actions'], |
83
|
|
|
], |
84
|
|
|
[ |
85
|
|
|
'label' => Yii::t('hipanel:server', 'avdsnode: aVDSnode'), |
86
|
|
|
'color' => '#b8860b', |
87
|
|
|
'rule' => $this->model->type === 'avdsnode', |
88
|
|
|
'columns' => ['actions'], |
89
|
|
|
], |
90
|
|
|
[ |
91
|
|
|
'label' => Yii::t('hipanel:server', 'avds: XEN'), |
92
|
|
|
'color' => '#eedc82', |
93
|
|
|
'rule' => $this->model->type === 'avds', |
94
|
|
|
'columns' => ['actions'], |
95
|
|
|
], |
96
|
|
|
[ |
97
|
|
|
'label' => Yii::t('hipanel:server', 'ovds: OpenVZ'), |
98
|
|
|
'columns' => ['actions'], |
99
|
|
|
], |
100
|
|
|
[ |
101
|
|
|
'label' => Yii::t('hipanel:server', 'svds: XENSSD'), |
102
|
|
|
'columns' => ['actions'], |
103
|
|
|
], |
104
|
|
|
[ |
105
|
|
|
'label' => Yii::t('hipanel:server', 'cdn: vCDN.service'), |
106
|
|
|
'color' => '#6699FF', |
107
|
|
|
'rule' => $this->model->type === 'cdn', |
108
|
|
|
'columns' => ['actions'], |
109
|
|
|
], |
110
|
|
|
[ |
111
|
|
|
'label' => Yii::t('hipanel:server', 'cdnv2: vCDN.node'), |
112
|
|
|
'color' => '#6699FF', |
113
|
|
|
'rule' => $this->model->type === 'cdnv2', |
114
|
|
|
'columns' => ['actions'], |
115
|
|
|
], |
116
|
|
|
[ |
117
|
|
|
'label' => Yii::t('hipanel:server', 'cdnpix: pCDN.service'), |
118
|
|
|
'color' => '#c9a0dc', |
119
|
|
|
'rule' => $this->model->type === 'cdnpix', |
120
|
|
|
'columns' => ['actions'], |
121
|
|
|
], |
122
|
|
|
[ |
123
|
|
|
'label' => Yii::t('hipanel:server', 'cdnstat: pCDN.node'), |
124
|
|
|
'color' => '#c9a0dc', |
125
|
|
|
'rule' => $this->model->type === 'cdnstat', |
126
|
|
|
'columns' => ['actions'], |
127
|
|
|
], |
128
|
|
|
[ |
129
|
|
|
'label' => Yii::t('hipanel:server', 'cloudstorage: CLDStor.node '), |
130
|
|
|
'color' => '#aaccee', |
131
|
|
|
'rule' => $this->model->type === 'cloudstorage', |
132
|
|
|
'columns' => ['actions'], |
133
|
|
|
], |
134
|
|
|
[ |
135
|
|
|
'label' => Yii::t('hipanel:server', 'jail: JL'), |
136
|
|
|
'color' => '#AAFFFF', |
137
|
|
|
'rule' => $this->model->type === 'jail', |
138
|
|
|
'columns' => ['actions'], |
139
|
|
|
], |
140
|
|
|
[ |
141
|
|
|
'label' => Yii::t('hipanel:server', 'nic: NC'), |
142
|
|
|
'color' => '#FFFFDD', |
143
|
|
|
'rule' => $this->model->type === 'nic', |
144
|
|
|
'columns' => ['actions'], |
145
|
|
|
], |
146
|
|
|
[ |
147
|
|
|
'label' => Yii::t('hipanel:server', 'uplink1: U1'), |
148
|
|
|
'color' => '#EBEBCD', |
149
|
|
|
'rule' => $this->model->type === 'uplink1', |
150
|
|
|
'columns' => ['actions'], |
151
|
|
|
], |
152
|
|
|
[ |
153
|
|
|
'label' => Yii::t('hipanel:server', 'uplink2: U2'), |
154
|
|
|
'color' => '#EBEBCD', |
155
|
|
|
'rule' => $this->model->type === 'uplink2', |
156
|
|
|
'columns' => ['actions'], |
157
|
|
|
], |
158
|
|
|
[ |
159
|
|
|
'label' => Yii::t('hipanel:server', 'uplink3: U3'), |
160
|
|
|
'color' => '#EBEBCD', |
161
|
|
|
'rule' => $this->model->type === 'uplink3', |
162
|
|
|
'columns' => ['actions'], |
163
|
|
|
], |
164
|
|
|
[ |
165
|
|
|
'label' => Yii::t('hipanel:server', 'total: TOTAL'), |
166
|
|
|
'color' => '#a3a375', |
167
|
|
|
'rule' => $this->model->type === 'total', |
168
|
|
|
'columns' => ['actions'], |
169
|
|
|
], |
170
|
|
|
[ |
171
|
|
|
'label' => Yii::t('hipanel:server', 'transit: TS'), |
172
|
|
|
'color' => '#EBEBCD', |
173
|
|
|
'rule' => $this->model->type === 'transit', |
174
|
|
|
'columns' => ['actions'], |
175
|
|
|
], |
176
|
|
|
[ |
177
|
|
|
'label' => Yii::t('hipanel:server', 'stock: STOCK'), |
178
|
|
|
'columns' => ['actions'], |
179
|
|
|
], |
180
|
|
|
[ |
181
|
|
|
'label' => Yii::t('hipanel:server', 'deleted: DEL'), |
182
|
|
|
'color' => '#CCCCCC', |
183
|
|
|
'rule' => $this->model->type === 'deleted', |
184
|
|
|
'columns' => ['actions'], |
185
|
|
|
], |
186
|
|
|
[ |
187
|
|
|
'label' => Yii::t('hipanel:server', 'office: OFFICE'), |
188
|
|
|
'columns' => ['actions'], |
189
|
|
|
], |
190
|
|
|
]; |
191
|
|
|
} |
192
|
|
|
} |
193
|
|
|
|