mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
fixed user services states strings
This commit is contained in:
parent
1189554a20
commit
e05ae6e3eb
@ -94,7 +94,7 @@ class AssignedService(DetailHandler):
|
||||
{'revision': {'title': _('Revision')}},
|
||||
{'unique_id': {'title': 'Unique ID'}},
|
||||
{'friendly_name': {'title': _('Friendly name')}},
|
||||
{'state': {'title': _('State'), 'type': 'dict', 'dict': State.dictionary()}},
|
||||
{'state': {'title': _('State')}},
|
||||
{'owner': {'title': _('Owner')}},
|
||||
]
|
||||
|
||||
@ -147,7 +147,7 @@ class CachedService(AssignedService):
|
||||
{'revision': {'title': _('Revision')}},
|
||||
{'unique_id': {'title': 'Unique ID'}},
|
||||
{'friendly_name': {'title': _('Friendly name')}},
|
||||
{'state': {'title': _('State'), 'type': 'dict', 'dict': State.dictionary()}},
|
||||
{'state': {'title': _('State')}},
|
||||
{'cache_level': {'title': _('Cache level')}},
|
||||
]
|
||||
|
||||
|
@ -75,6 +75,40 @@ gui.servicesPools.link = function(event) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Fill "State" for cached and assigned services
|
||||
var fillState = function(data) {
|
||||
$.each(data, function(index, value){
|
||||
if(value.state == 'U') {
|
||||
if( value.os_state != '' && value.os_state != 'U')
|
||||
value.state = gettext('Waiting OS');
|
||||
else
|
||||
value.state = gettext('Ready');
|
||||
return;
|
||||
}
|
||||
if(value.state == 'R'){
|
||||
value.state = gettext('Waiting for removal');
|
||||
return;
|
||||
}
|
||||
if(value.state == 'M'){
|
||||
value.state = gettext('Removing');
|
||||
return;
|
||||
}
|
||||
if(value.state == 'S'){
|
||||
value.state = gettext('Removed');
|
||||
return;
|
||||
}
|
||||
if(value.state == 'E'){
|
||||
value.state = gettext('Error');
|
||||
return;
|
||||
}
|
||||
if(value.state == 'P'){
|
||||
value.state = gettext('Generating');
|
||||
return;
|
||||
}
|
||||
value.state = gettext('Unknown');
|
||||
});
|
||||
};
|
||||
|
||||
// Fills up the list of available services
|
||||
api.providers.allServices(function(services){
|
||||
@ -156,6 +190,9 @@ gui.servicesPools.link = function(event) {
|
||||
container : 'cache-placeholder_tbl',
|
||||
buttons : [ 'delete', 'xls' ],
|
||||
rowSelect : 'single',
|
||||
onData: function(data) {
|
||||
fillState(data);
|
||||
},
|
||||
onRowSelect : function(selected) {
|
||||
var cached = selected[0];
|
||||
if( prevCacheLogTbl ) {
|
||||
|
Loading…
Reference in New Issue
Block a user