mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-26 10:03:50 +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/providers.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/transports.py=utf-8
|
||||
encoding//src/uds/REST/methods/user_services.py=utf-8
|
||||
|
@ -48,7 +48,7 @@ import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class ServicesPool(ModelHandler):
|
||||
class ServicesPools(ModelHandler):
|
||||
model = DeployedService
|
||||
detail = {
|
||||
'services': AssignedService,
|
||||
@ -99,42 +99,42 @@ class ServicesPool(ModelHandler):
|
||||
g = self.addDefaultFields([], ['name', 'comments'])
|
||||
|
||||
for f in [{
|
||||
'name': 'service',
|
||||
'name': 'service_id',
|
||||
'values': [ gui.choiceItem(v.id, v.name) for v in Service.objects.all() ],
|
||||
'label': ugettext('Base service'),
|
||||
'tooltip': ugettext('Service used as base of this service pool'),
|
||||
'type': gui.InputField.CHOICE_TYPE,
|
||||
'order': 100, # At end
|
||||
},{
|
||||
'name': 'osmanager',
|
||||
'values': [ gui.choiceItem(v.id, v.name) for v in OSManager.objects.all() ],
|
||||
'name': 'osmanager_id',
|
||||
'values': [gui.choiceItem(-1, '')] + [ gui.choiceItem(v.id, v.name) for v in OSManager.objects.all() ],
|
||||
'label': ugettext('OS Manager'),
|
||||
'tooltip': ugettext('OS Manager used as base of this service pool'),
|
||||
'type': gui.InputField.CHOICE_TYPE,
|
||||
'order': 101, # At end
|
||||
},{
|
||||
'name': 'initial_services',
|
||||
'name': 'initial_srvs',
|
||||
'value': '0',
|
||||
'label': ugettext('Initial available services'),
|
||||
'tooltip': ugettext('Services created initially for this service pool'),
|
||||
'type': gui.InputField.NUMERIC_TYPE,
|
||||
'order': 102, # At end
|
||||
},{
|
||||
'name': 'cached_services',
|
||||
'name': 'cache_l1_srvs',
|
||||
'value': '0',
|
||||
'label': ugettext('Services to keep in cache'),
|
||||
'tooltip': ugettext('Services keeped in cache for improved user service assignation'),
|
||||
'type': gui.InputField.NUMERIC_TYPE,
|
||||
'order': 103, # At end
|
||||
},{
|
||||
'name': 'cached_services_l2',
|
||||
'name': 'cache_l2_srvs',
|
||||
'value': '0',
|
||||
'label': ugettext('Services to keep in L2 cache'),
|
||||
'tooltip': ugettext('Services keeped in cache of level2 for improved service generation'),
|
||||
'type': gui.InputField.NUMERIC_TYPE,
|
||||
'order': 104, # At end
|
||||
},{
|
||||
'name': 'max_services',
|
||||
'name': 'max_srvs',
|
||||
'value': '0',
|
||||
'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'),
|
@ -110,8 +110,8 @@ class BaseModelHandler(Handler):
|
||||
self.addField(gui, {
|
||||
'name': 'small_name',
|
||||
'type': 'text',
|
||||
'label': _('Small name'),
|
||||
'tooltip': _('Small name of this element'),
|
||||
'label': _('Short name'),
|
||||
'tooltip': _('Short name of this element'),
|
||||
'required': True,
|
||||
'length': 128,
|
||||
'order': -97,
|
||||
|
@ -498,7 +498,7 @@ api.authenticators.search = function(id, type, term, success_fnc, fail_fnc) {
|
||||
api.osmanagers = new BasicModelRest('osmanagers');
|
||||
api.transports = new BasicModelRest('transports');
|
||||
api.networks = new BasicModelRest('networks');
|
||||
api.servicesPool = new BasicModelRest('servicespool');
|
||||
api.servicesPools = new BasicModelRest('servicespools');
|
||||
|
||||
api.configuration = new BasicModelRest('config');
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* 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";
|
||||
gui.clearWorkspace();
|
||||
|
||||
@ -62,7 +62,7 @@ gui.servicesPool.link = function(event) {
|
||||
gui.doLog('Select', counter.toString(), val, value);
|
||||
};
|
||||
|
||||
var tableId = gui.servicesPool.table({
|
||||
var tableId = gui.servicesPools.table({
|
||||
container : 'deployed-services-placeholder',
|
||||
rowSelect : 'single',
|
||||
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
|
||||
if( service.info.uses_cache || service.info.uses_cache_l2 ) {
|
||||
$('#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({
|
||||
container : 'cache-placeholder',
|
||||
rowSelect : 'single'
|
||||
@ -102,7 +102,7 @@ gui.servicesPool.link = function(event) {
|
||||
// Shows/hides groups
|
||||
if( service.info.must_assign_manually === false ) {
|
||||
$('#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({
|
||||
container : 'groups-placeholder',
|
||||
rowSelect : 'single',
|
||||
@ -117,14 +117,14 @@ gui.servicesPool.link = function(event) {
|
||||
$('#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({
|
||||
container: 'assigned-services-placeholder',
|
||||
rowSelect: 'single',
|
||||
});
|
||||
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({
|
||||
container: 'transports-placeholder',
|
||||
rowSelect: 'single',
|
||||
@ -142,7 +142,7 @@ gui.servicesPool.link = function(event) {
|
||||
var publications = null;
|
||||
if( service.info.needs_publication ) {
|
||||
$('#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');
|
||||
var publicationsTable = publications.table({
|
||||
container : 'publications-placeholder',
|
||||
@ -177,7 +177,7 @@ gui.servicesPool.link = function(event) {
|
||||
$('#publications-placeholder_tab').addClass('hidden');
|
||||
}
|
||||
|
||||
var logTable = gui.servicesPool.logTable(servPool.id, {
|
||||
var logTable = gui.servicesPools.logTable(servPool.id, {
|
||||
container : 'logs-placeholder',
|
||||
});
|
||||
|
||||
@ -206,9 +206,9 @@ gui.servicesPool.link = function(event) {
|
||||
}
|
||||
});
|
||||
},
|
||||
onNew: function(type, table, refreshFnc) {
|
||||
gui.methods.typedNew(gui.servicesPool, gettext('New service pool'), gettext('Error deleting service pool'))(type, table, refreshFnc);
|
||||
}
|
||||
onNew: gui.methods.typedNew(gui.servicesPools, gettext('New service pool'), gettext('Error creating service pool')),
|
||||
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,
|
||||
}, {
|
||||
id : 'lnk-deployed_services',
|
||||
exec : gui.servicesPool.link,
|
||||
exec : gui.servicesPools.link,
|
||||
cleanup: true,
|
||||
}, {
|
||||
id : 'lnk-clear_cache',
|
||||
|
Loading…
x
Reference in New Issue
Block a user