|
Lines 135-145
define([
Link Here
|
| 135 |
var columns = [{ |
135 |
var columns = [{ |
| 136 |
name: 'service', |
136 |
name: 'service', |
| 137 |
label: _('Name'), |
137 |
label: _('Name'), |
| 138 |
width: '200px' |
138 |
width: '200px' |
| 139 |
}, { |
139 |
}, { |
| 140 |
name: 'isRunning', |
140 |
name: 'isRunning', |
| 141 |
label: _('Status'), |
141 |
label: _('Status'), |
| 142 |
width: 'adjust', |
142 |
width: 'auto', |
| 143 |
formatter: lang.hitch(this, function(value) { |
143 |
formatter: lang.hitch(this, function(value) { |
| 144 |
if (value === true) { |
144 |
if (value === true) { |
| 145 |
return _('running'); |
145 |
return _('running'); |
|
Lines 150-156
define([
Link Here
|
| 150 |
}, { |
150 |
}, { |
| 151 |
name: 'autostart', |
151 |
name: 'autostart', |
| 152 |
label: _('Start type'), |
152 |
label: _('Start type'), |
| 153 |
width: '100px', |
153 |
width: 'auto', |
| 154 |
formatter: lang.hitch(this, function(value) { |
154 |
formatter: lang.hitch(this, function(value) { |
| 155 |
if (value == 'no') { |
155 |
if (value == 'no') { |
| 156 |
return _('Never'); |
156 |
return _('Never'); |
|
Lines 163-169
define([
Link Here
|
| 163 |
}, { |
163 |
}, { |
| 164 |
name: 'description', |
164 |
name: 'description', |
| 165 |
label: _('Description'), |
165 |
label: _('Description'), |
| 166 |
width: 'auto', |
166 |
width: 'auto', |
| 167 |
formatter: lang.hitch(this, function(value) { |
167 |
formatter: lang.hitch(this, function(value) { |
| 168 |
if (value === null) { |
168 |
if (value === null) { |
| 169 |
return '-'; |
169 |
return '-'; |
|
Lines 203-208
define([
Link Here
|
| 203 |
this._page.startup(); |
203 |
this._page.startup(); |
| 204 |
}, |
204 |
}, |
| 205 |
|
205 |
|
|
|
206 |
reloadGrid: function() { |
| 207 |
data = this._searchWidget.get('value'); |
| 208 |
this._grid.filter(data); |
| 209 |
}, |
| 210 |
|
| 206 |
_changeState: function(data, command, confirmMessage, errorMessage) { |
211 |
_changeState: function(data, command, confirmMessage, errorMessage) { |
| 207 |
confirmMessage += '<ul>'; |
212 |
confirmMessage += '<ul>'; |
| 208 |
array.forEach(data, function(idata) { |
213 |
array.forEach(data, function(idata) { |
|
Lines 213-236
define([
Link Here
|
| 213 |
dialog.confirm(confirmMessage, [{ |
218 |
dialog.confirm(confirmMessage, [{ |
| 214 |
label: _('OK'), |
219 |
label: _('OK'), |
| 215 |
callback: lang.hitch(this, function() { |
220 |
callback: lang.hitch(this, function() { |
| 216 |
this.standby(true); |
221 |
this.standbyDuring(tools.umcpCommand(command, data)).then(lang.hitch(this, function(response) { |
| 217 |
tools.umcpCommand(command, data).then( |
222 |
if (response.result.success === false) { |
| 218 |
lang.hitch(this, function(response) { |
223 |
errorMessage += '<ul>'; |
| 219 |
this.standby(false); |
224 |
array.forEach(response.result.objects, function(item) { |
| 220 |
if (response.result.success === false) { |
225 |
errorMessage += '<li>' + item + '</li>'; |
| 221 |
errorMessage += '<ul>'; |
226 |
}); |
| 222 |
array.forEach(response.result.objects, function(item) { |
227 |
errorMessage += '</ul>'; |
| 223 |
errorMessage += '<li>' + item + '</li>'; |
228 |
dialog.alert(errorMessage); |
| 224 |
}); |
229 |
} |
| 225 |
errorMessage += '</ul>'; |
230 |
this.reloadGrid(); |
| 226 |
dialog.alert(errorMessage); |
231 |
})); |
| 227 |
} |
|
|
| 228 |
data = this._searchWidget.get('value'); |
| 229 |
this._grid.filter(data); |
| 230 |
}), lang.hitch(this, function() { |
| 231 |
this.standby(false); |
| 232 |
}) |
| 233 |
); |
| 234 |
}) |
232 |
}) |
| 235 |
}, { |
233 |
}, { |
| 236 |
'default': true, |
234 |
'default': true, |