mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-27 14:03:53 +03:00
This commit is contained in:
parent
81439890e1
commit
3e036adbca
@ -19,7 +19,7 @@ encoding//src/uds/REST/methods/networks.py=utf-8
|
|||||||
encoding//src/uds/REST/methods/osmanagers.py=utf-8
|
encoding//src/uds/REST/methods/osmanagers.py=utf-8
|
||||||
encoding//src/uds/REST/methods/providers.py=utf-8
|
encoding//src/uds/REST/methods/providers.py=utf-8
|
||||||
encoding//src/uds/REST/methods/services.py=utf-8
|
encoding//src/uds/REST/methods/services.py=utf-8
|
||||||
encoding//src/uds/REST/methods/services_pool.py=utf-8
|
encoding//src/uds/REST/methods/services_pools.py=utf-8
|
||||||
encoding//src/uds/REST/methods/system.py=utf-8
|
encoding//src/uds/REST/methods/system.py=utf-8
|
||||||
encoding//src/uds/REST/methods/transports.py=utf-8
|
encoding//src/uds/REST/methods/transports.py=utf-8
|
||||||
encoding//src/uds/REST/methods/user_services.py=utf-8
|
encoding//src/uds/REST/methods/user_services.py=utf-8
|
||||||
|
@ -48,7 +48,7 @@ import logging
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class ServicesPool(ModelHandler):
|
class ServicesPools(ModelHandler):
|
||||||
model = DeployedService
|
model = DeployedService
|
||||||
detail = {
|
detail = {
|
||||||
'services': AssignedService,
|
'services': AssignedService,
|
||||||
@ -99,42 +99,42 @@ class ServicesPool(ModelHandler):
|
|||||||
g = self.addDefaultFields([], ['name', 'comments'])
|
g = self.addDefaultFields([], ['name', 'comments'])
|
||||||
|
|
||||||
for f in [{
|
for f in [{
|
||||||
'name': 'service',
|
'name': 'service_id',
|
||||||
'values': [ gui.choiceItem(v.id, v.name) for v in Service.objects.all() ],
|
'values': [ gui.choiceItem(v.id, v.name) for v in Service.objects.all() ],
|
||||||
'label': ugettext('Base service'),
|
'label': ugettext('Base service'),
|
||||||
'tooltip': ugettext('Service used as base of this service pool'),
|
'tooltip': ugettext('Service used as base of this service pool'),
|
||||||
'type': gui.InputField.CHOICE_TYPE,
|
'type': gui.InputField.CHOICE_TYPE,
|
||||||
'order': 100, # At end
|
'order': 100, # At end
|
||||||
},{
|
},{
|
||||||
'name': 'osmanager',
|
'name': 'osmanager_id',
|
||||||
'values': [ gui.choiceItem(v.id, v.name) for v in OSManager.objects.all() ],
|
'values': [gui.choiceItem(-1, '')] + [ gui.choiceItem(v.id, v.name) for v in OSManager.objects.all() ],
|
||||||
'label': ugettext('OS Manager'),
|
'label': ugettext('OS Manager'),
|
||||||
'tooltip': ugettext('OS Manager used as base of this service pool'),
|
'tooltip': ugettext('OS Manager used as base of this service pool'),
|
||||||
'type': gui.InputField.CHOICE_TYPE,
|
'type': gui.InputField.CHOICE_TYPE,
|
||||||
'order': 101, # At end
|
'order': 101, # At end
|
||||||
},{
|
},{
|
||||||
'name': 'initial_services',
|
'name': 'initial_srvs',
|
||||||
'value': '0',
|
'value': '0',
|
||||||
'label': ugettext('Initial available services'),
|
'label': ugettext('Initial available services'),
|
||||||
'tooltip': ugettext('Services created initially for this service pool'),
|
'tooltip': ugettext('Services created initially for this service pool'),
|
||||||
'type': gui.InputField.NUMERIC_TYPE,
|
'type': gui.InputField.NUMERIC_TYPE,
|
||||||
'order': 102, # At end
|
'order': 102, # At end
|
||||||
},{
|
},{
|
||||||
'name': 'cached_services',
|
'name': 'cache_l1_srvs',
|
||||||
'value': '0',
|
'value': '0',
|
||||||
'label': ugettext('Services to keep in cache'),
|
'label': ugettext('Services to keep in cache'),
|
||||||
'tooltip': ugettext('Services keeped in cache for improved user service assignation'),
|
'tooltip': ugettext('Services keeped in cache for improved user service assignation'),
|
||||||
'type': gui.InputField.NUMERIC_TYPE,
|
'type': gui.InputField.NUMERIC_TYPE,
|
||||||
'order': 103, # At end
|
'order': 103, # At end
|
||||||
},{
|
},{
|
||||||
'name': 'cached_services_l2',
|
'name': 'cache_l2_srvs',
|
||||||
'value': '0',
|
'value': '0',
|
||||||
'label': ugettext('Services to keep in L2 cache'),
|
'label': ugettext('Services to keep in L2 cache'),
|
||||||
'tooltip': ugettext('Services keeped in cache of level2 for improved service generation'),
|
'tooltip': ugettext('Services keeped in cache of level2 for improved service generation'),
|
||||||
'type': gui.InputField.NUMERIC_TYPE,
|
'type': gui.InputField.NUMERIC_TYPE,
|
||||||
'order': 104, # At end
|
'order': 104, # At end
|
||||||
},{
|
},{
|
||||||
'name': 'max_services',
|
'name': 'max_srvs',
|
||||||
'value': '0',
|
'value': '0',
|
||||||
'label': ugettext('Maximum number of services to provide'),
|
'label': ugettext('Maximum number of services to provide'),
|
||||||
'tooltip': ugettext('Maximum number of service (assigned and L1 cache) that can be created for this service'),
|
'tooltip': ugettext('Maximum number of service (assigned and L1 cache) that can be created for this service'),
|
@ -110,8 +110,8 @@ class BaseModelHandler(Handler):
|
|||||||
self.addField(gui, {
|
self.addField(gui, {
|
||||||
'name': 'small_name',
|
'name': 'small_name',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'label': _('Small name'),
|
'label': _('Short name'),
|
||||||
'tooltip': _('Small name of this element'),
|
'tooltip': _('Short name of this element'),
|
||||||
'required': True,
|
'required': True,
|
||||||
'length': 128,
|
'length': 128,
|
||||||
'order': -97,
|
'order': -97,
|
||||||
|
@ -498,7 +498,7 @@ api.authenticators.search = function(id, type, term, success_fnc, fail_fnc) {
|
|||||||
api.osmanagers = new BasicModelRest('osmanagers');
|
api.osmanagers = new BasicModelRest('osmanagers');
|
||||||
api.transports = new BasicModelRest('transports');
|
api.transports = new BasicModelRest('transports');
|
||||||
api.networks = new BasicModelRest('networks');
|
api.networks = new BasicModelRest('networks');
|
||||||
api.servicesPool = new BasicModelRest('servicespool');
|
api.servicesPools = new BasicModelRest('servicespools');
|
||||||
|
|
||||||
api.configuration = new BasicModelRest('config');
|
api.configuration = new BasicModelRest('config');
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/* jshint strict: true */
|
/* jshint strict: true */
|
||||||
gui.servicesPool = new GuiElement(api.servicesPool, 'servicespool');
|
gui.servicesPools = new GuiElement(api.servicesPools, 'servicespools');
|
||||||
|
|
||||||
|
|
||||||
gui.servicesPool.link = function(event) {
|
gui.servicesPools.link = function(event) {
|
||||||
"use strict";
|
"use strict";
|
||||||
gui.clearWorkspace();
|
gui.clearWorkspace();
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ gui.servicesPool.link = function(event) {
|
|||||||
gui.doLog('Select', counter.toString(), val, value);
|
gui.doLog('Select', counter.toString(), val, value);
|
||||||
};
|
};
|
||||||
|
|
||||||
var tableId = gui.servicesPool.table({
|
var tableId = gui.servicesPools.table({
|
||||||
container : 'deployed-services-placeholder',
|
container : 'deployed-services-placeholder',
|
||||||
rowSelect : 'single',
|
rowSelect : 'single',
|
||||||
buttons : [ 'new', 'edit', 'delete', { text: gettext('Test'), css: 'disabled', click: testClick, select: testSelect }, 'xls' ],
|
buttons : [ 'new', 'edit', 'delete', { text: gettext('Test'), css: 'disabled', click: testClick, select: testSelect }, 'xls' ],
|
||||||
@ -89,7 +89,7 @@ gui.servicesPool.link = function(event) {
|
|||||||
// Shows/hides cache
|
// Shows/hides cache
|
||||||
if( service.info.uses_cache || service.info.uses_cache_l2 ) {
|
if( service.info.uses_cache || service.info.uses_cache_l2 ) {
|
||||||
$('#cache-placeholder_tab').removeClass('hidden');
|
$('#cache-placeholder_tab').removeClass('hidden');
|
||||||
cachedItems = new GuiElement(api.servicesPool.detail(servPool.id, 'cache'), 'cache');
|
cachedItems = new GuiElement(api.servicesPools.detail(servPool.id, 'cache'), 'cache');
|
||||||
var cachedItemsTable = cachedItems.table({
|
var cachedItemsTable = cachedItems.table({
|
||||||
container : 'cache-placeholder',
|
container : 'cache-placeholder',
|
||||||
rowSelect : 'single'
|
rowSelect : 'single'
|
||||||
@ -102,7 +102,7 @@ gui.servicesPool.link = function(event) {
|
|||||||
// Shows/hides groups
|
// Shows/hides groups
|
||||||
if( service.info.must_assign_manually === false ) {
|
if( service.info.must_assign_manually === false ) {
|
||||||
$('#groups-placeholder_tab').removeClass('hidden');
|
$('#groups-placeholder_tab').removeClass('hidden');
|
||||||
groups = new GuiElement(api.servicesPool.detail(servPool.id, 'groups'), 'groups');
|
groups = new GuiElement(api.servicesPools.detail(servPool.id, 'groups'), 'groups');
|
||||||
var groupsTable = groups.table({
|
var groupsTable = groups.table({
|
||||||
container : 'groups-placeholder',
|
container : 'groups-placeholder',
|
||||||
rowSelect : 'single',
|
rowSelect : 'single',
|
||||||
@ -117,14 +117,14 @@ gui.servicesPool.link = function(event) {
|
|||||||
$('#groups-placeholder_tab').addClass('hidden');
|
$('#groups-placeholder_tab').addClass('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
var assignedServices = new GuiElement(api.servicesPool.detail(servPool.id, 'services'), 'services');
|
var assignedServices = new GuiElement(api.servicesPools.detail(servPool.id, 'services'), 'services');
|
||||||
var assignedServicesTable = assignedServices.table({
|
var assignedServicesTable = assignedServices.table({
|
||||||
container: 'assigned-services-placeholder',
|
container: 'assigned-services-placeholder',
|
||||||
rowSelect: 'single',
|
rowSelect: 'single',
|
||||||
});
|
});
|
||||||
prevTables.push(assignedServicesTable);
|
prevTables.push(assignedServicesTable);
|
||||||
|
|
||||||
var transports = new GuiElement(api.servicesPool.detail(servPool.id, 'transports'), 'transports');
|
var transports = new GuiElement(api.servicesPools.detail(servPool.id, 'transports'), 'transports');
|
||||||
var transportsTable = transports.table({
|
var transportsTable = transports.table({
|
||||||
container: 'transports-placeholder',
|
container: 'transports-placeholder',
|
||||||
rowSelect: 'single',
|
rowSelect: 'single',
|
||||||
@ -142,7 +142,7 @@ gui.servicesPool.link = function(event) {
|
|||||||
var publications = null;
|
var publications = null;
|
||||||
if( service.info.needs_publication ) {
|
if( service.info.needs_publication ) {
|
||||||
$('#publications-placeholder_tab').removeClass('hidden');
|
$('#publications-placeholder_tab').removeClass('hidden');
|
||||||
var pubApi = api.servicesPool.detail(servPool.id, 'publications');
|
var pubApi = api.servicesPools.detail(servPool.id, 'publications');
|
||||||
publications = new GuiElement(pubApi, 'publications');
|
publications = new GuiElement(pubApi, 'publications');
|
||||||
var publicationsTable = publications.table({
|
var publicationsTable = publications.table({
|
||||||
container : 'publications-placeholder',
|
container : 'publications-placeholder',
|
||||||
@ -177,7 +177,7 @@ gui.servicesPool.link = function(event) {
|
|||||||
$('#publications-placeholder_tab').addClass('hidden');
|
$('#publications-placeholder_tab').addClass('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
var logTable = gui.servicesPool.logTable(servPool.id, {
|
var logTable = gui.servicesPools.logTable(servPool.id, {
|
||||||
container : 'logs-placeholder',
|
container : 'logs-placeholder',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -206,9 +206,9 @@ gui.servicesPool.link = function(event) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onNew: function(type, table, refreshFnc) {
|
onNew: gui.methods.typedNew(gui.servicesPools, gettext('New service pool'), gettext('Error creating service pool')),
|
||||||
gui.methods.typedNew(gui.servicesPool, gettext('New service pool'), gettext('Error deleting service pool'))(type, table, refreshFnc);
|
onEdit: gui.methods.typedEdit(gui.servicesPools, gettext('Edit service pool'), gettext('Error saving service pool')),
|
||||||
}
|
onDelete: gui.methods.del(gui.servicesPools, gettext('Delete service pool'), gettext('Error deleting service pool')),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -179,7 +179,7 @@
|
|||||||
cleanup: true,
|
cleanup: true,
|
||||||
}, {
|
}, {
|
||||||
id : 'lnk-deployed_services',
|
id : 'lnk-deployed_services',
|
||||||
exec : gui.servicesPool.link,
|
exec : gui.servicesPools.link,
|
||||||
cleanup: true,
|
cleanup: true,
|
||||||
}, {
|
}, {
|
||||||
id : 'lnk-clear_cache',
|
id : 'lnk-clear_cache',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user