From 3c956e94dfb571b749a8167b8b0f44ea8c01c46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Tue, 10 Dec 2013 23:21:29 +0000 Subject: [PATCH] * Fixed dropdown to include icons (for "new") * Added Os managers (client & server) --- server/src/uds/REST/methods/osmanagers.py | 25 +++++++++++++++++- server/src/uds/REST/methods/providers.py | 4 +-- server/src/uds/REST/model.py | 8 ++++++ server/src/uds/models.py | 3 +++ .../WindowsOsManager/wosmanager.png | Bin 6211 -> 4371 bytes .../src/uds/static/adm/js/gui-d-osmanagers.js | 23 ++++++++++++++++ .../src/uds/static/adm/js/gui-definition.js | 22 --------------- server/src/uds/templates/uds/admin/index.html | 1 + .../templates/uds/admin/tmpl/comp/alert.html | 6 ----- .../uds/admin/tmpl/comp/dropdown.html | 2 +- 10 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 server/src/uds/static/adm/js/gui-d-osmanagers.js delete mode 100644 server/src/uds/templates/uds/admin/tmpl/comp/alert.html diff --git a/server/src/uds/REST/methods/osmanagers.py b/server/src/uds/REST/methods/osmanagers.py index b640eaef..c433f3aa 100644 --- a/server/src/uds/REST/methods/osmanagers.py +++ b/server/src/uds/REST/methods/osmanagers.py @@ -32,8 +32,10 @@ ''' from __future__ import unicode_literals -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext, ugettext_lazy as _ from uds.models import OSManager + +from uds.REST import NotFound, RequestError from uds.core.osmanagers import factory from uds.REST.model import ModelHandler @@ -46,6 +48,7 @@ logger = logging.getLogger(__name__) class OsManagers(ModelHandler): model = OSManager + save_fields = ['name', 'comments'] table_title = _('Current OS Managers') table_fields = [ @@ -62,3 +65,23 @@ class OsManagers(ModelHandler): 'type': type_.type(), 'comments': osm.comments, } + + def checkDelete(self, item): + if item.deployedServices.count() > 0: + raise RequestError(ugettext('Can\'t delete an OSManager with deployed services associated')) + + def checkSave(self, item): + if item.deployedServices.count() > 0: + raise RequestError(ugettext('Can\'t modify an OSManager with deployed services associated')) + + + # Types related + def enum_types(self): + return factory().providers().values() + + # Gui related + def getGui(self, type_): + try: + return self.addDefaultFields(factory().lookup(type_).guiDescription(), ['name', 'comments']) + except: + raise NotFound('type not found') diff --git a/server/src/uds/REST/methods/providers.py b/server/src/uds/REST/methods/providers.py index 33c304e9..718dfc7b 100644 --- a/server/src/uds/REST/methods/providers.py +++ b/server/src/uds/REST/methods/providers.py @@ -34,7 +34,7 @@ from __future__ import unicode_literals from django.utils.translation import ugettext, ugettext_lazy as _ from uds.models import Provider -from services import Services +from services import Services as DetailServices from uds.core import services from uds.REST import NotFound, RequestError @@ -47,7 +47,7 @@ logger = logging.getLogger(__name__) class Providers(ModelHandler): model = Provider - detail = { 'services': Services } + detail = { 'services': DetailServices } save_fields = ['name', 'comments'] table_title = _('Service providers') diff --git a/server/src/uds/REST/model.py b/server/src/uds/REST/model.py index aaf36dfb..590e5b4f 100644 --- a/server/src/uds/REST/model.py +++ b/server/src/uds/REST/model.py @@ -369,6 +369,11 @@ class ModelHandler(BaseModelHandler): def checkDelete(self, item): pass + # Save related, checks if the item can be saved + # If it can't be saved, raises an exception + def checkSave(self, item): + pass + # End overridable # Helper to process detail @@ -491,6 +496,9 @@ class ModelHandler(BaseModelHandler): except Exception: raise RequestError('incorrect invocation to PUT') + if not deleteOnError: + self.checkSave(item) # Will raise an exception if item can't be saved (only for modify operations..) + # Store associated object if needed try: if self._params.has_key('data_type'): # Needs to store instance diff --git a/server/src/uds/models.py b/server/src/uds/models.py index 87531a59..da5ad8c7 100644 --- a/server/src/uds/models.py +++ b/server/src/uds/models.py @@ -34,6 +34,7 @@ from __future__ import unicode_literals from django.db import models +from django.db import IntegrityError from django.db.models import signals from uds.core.jobs.JobsFactory import JobsFactory from uds.core.Environment import Environment @@ -364,6 +365,8 @@ class OSManager(models.Model): :note: If destroy raises an exception, the deletion is not taken. ''' toDelete = kwargs['instance'] + if toDelete.deployedServices.count() > 0: + raise IntegrityError('Can\'t remove os managers with assigned deployed services') # Only tries to get instance if data is not empty if toDelete.data != '': s = toDelete.getInstance() diff --git a/server/src/uds/osmanagers/WindowsOsManager/wosmanager.png b/server/src/uds/osmanagers/WindowsOsManager/wosmanager.png index cefdb8071de3d91cf033b49a33e5422d49c739e8..39d76055d04ca8640ebe0217fbf5cb66736caec1 100644 GIT binary patch literal 4371 zcmV+u5$x`XP)*qGyVQxMpbvl5VwoSju4CO?minrtVFz7Ut9gkfddbGxs0VGP0mRk@n=neXB@VoSR?pJMXyNP6j}+^@l62x?=M3XI^&7(&Eybna@v8Pwg`Eh5n#Ft7`K> z!i+mpYBphN{gky(wUAO4Rdvnks)m~5rl?v_^p% zIq3+fYKSq~>t6rHvo62#($7Ba;tS^wA3oa4S<9x$A!n7QPSRv0rR+_U$tja^mYg-@ ztTC%aQ;%jA%{-Wyn7ODamJKz-9UMmxM1-6(XPdrsZGd*63&{pPKo`^+Z~J@>iK zlUr`t<0ln?Z8LN83p;jR8Ot6>;pPrfhyz3r4+IOuLNEt05OKi395W@WVOdejm>M}N zS+lDe?v8tFe24)z=Za@t{r}9A{DzPC-+lBma#9f}V%ZBJ#MC5h znnaV5VF1&CP(Kpi#3 z&D%f=2-2k!XihC~^KxxhGIc{=4xPKv6cIggDW0ZE$C zq^Pza)VzIG+sFWj1O%Zd3e1J9in|kHDCZY;6ae!JJ5CNjQIx$@Cp0Tf-Lzg-BPaE& zBOqPssCAz20GVRC#q;i%Iqrs=w%0hgg0vA(hvnttvb4O+=Ei2MdcD{>vUidZD9hfk zt`QM$nue5BG#fdqsCAxJBj=22oBOJ{O&zuNdhK(>N=s?)^c@k&tni>B)TYAHcVUN)mk9dk#yvJ_faVl zTpYTdkWDcRoY?QT0Q!ST8P%;P3P3s%7j<3Z?w*kkTmsy{fn2sCvaqzIT9P1B%i?(TBJI7hvW#8$(# zBd?lvy})rD5g8bR=(J04a%wnd*G1Tlb&k{zG9x?VU~)PDOij%^SpaS0TU%Qxs=)-N zV*uceIUOmTQAEb)amj4&d-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$(~k;nw4SaKa+cKiD0W&lD!!S9_>(c?PQ`ugI`U^AQF z;@$W=kf`N>u=h$=20Q#dajxZ;ZhB5;2Sa6FxsH9{fl-?Z3IU1-EcUJ9qM*Lzd3S>M zneRSIo#m_1$S+UCMqur_wDn=DbAyJ_-b&jsX~HE3zYUj7gwb@{q={qPUA2Km>aQy@ zPA?lA-wP0uFeFi5!%wS1IqJ@zT8>T+O2iY&F+=lelj)DkJUX=ljV2wP&0WItY$pQ& z22bPXS}iRNQQWFIrRjXsF8agffJ|LrDHnKgW(wvOjarlsuCt2RhKU90E`wP>u;e1l z=QoFh;JG|z3$-|pJ|3uxCRN7xcC~rh@rdXj>)T1GA>1MVpV^!nq%o9qVaD1(1jduJ zXssL4H;kYJXko~ks+xPgi%=a_GL*SJkOZ!|nuV(4jAMZ0dXoA90j z0?-3|Zd@jY+O%Baz+_6EkELNq=QA?Dj$X%S*ymb1sC_<#Izq6lEpX^n9co(O&IIbQ#svBZ!gVqmvzSJp%S z*1cjs^3TXk-WVNQ#3cJp>*C0}ZQgSiK3A(f;+wS8`E?d8pKk|HOgucFZnUG%PEWf| z*XODhh7QgM1QHe;3Ihg6kKfepeJI&NWU)N7w8R~;;HLR-cbki`cNM;$5sp8eo*ay* n5Q)SS@WYoWKWu&fZ3hy7>AiNM+VYq07vH*ChR8|{+wlJZ-@||u diff --git a/server/src/uds/static/adm/js/gui-d-osmanagers.js b/server/src/uds/static/adm/js/gui-d-osmanagers.js new file mode 100644 index 00000000..251f3aeb --- /dev/null +++ b/server/src/uds/static/adm/js/gui-d-osmanagers.js @@ -0,0 +1,23 @@ +//------------------------ +// Os managers +//------------------------ +gui.osmanagers = new GuiElement(api.osmanagers, 'osm'); +gui.osmanagers.link = function(event) { + "use strict"; + // Cleans up memory used by other datatables + $.each($.fn.dataTable.fnTables(), function(undefined, tbl){ + $(tbl).dataTable().fnDestroy(); + }); + gui.clearWorkspace(); + gui.appendToWorkspace(gui.breadcrumbs('Os Managers')); + + gui.osmanagers.table({ + rowSelect : 'single', + buttons : [ 'new', 'edit', 'delete', 'xls' ], + onNew : gui.methods.typedNew(gui.osmanagers, gettext('New OSManager'), gettext('Error creating OSManager')), + onEdit: gui.methods.typedEdit(gui.osmanagers, gettext('Edit OSManager'), gettext('Error processing OSManager')), + onDelete: gui.methods.del(gui.osmanagers, gettext('Delete OSManager'), gettext('Error deleting OSManager')), + }); + + return false; +}; diff --git a/server/src/uds/static/adm/js/gui-definition.js b/server/src/uds/static/adm/js/gui-definition.js index 1ba190cc..2d8b6849 100644 --- a/server/src/uds/static/adm/js/gui-definition.js +++ b/server/src/uds/static/adm/js/gui-definition.js @@ -26,28 +26,6 @@ gui.dashboard.link = function(event) { }; - -//------------------------ -// Os managers -//------------------------ -gui.osmanagers = new GuiElement(api.osmanagers, 'osm'); -gui.osmanagers.link = function(event) { - "use strict"; - // Cleans up memory used by other datatables - $.each($.fn.dataTable.fnTables(), function(undefined, tbl){ - $(tbl).dataTable().fnDestroy(); - }); - gui.clearWorkspace(); - gui.appendToWorkspace(gui.breadcrumbs('Os Managers')); - - gui.osmanagers.table({ - rowSelect : 'single', - buttons : [ 'edit', 'delete', 'xls' ], - }); - - return false; -}; - gui.connectivity = { transports : new GuiElement(api.transports, 'trans'), networks : new GuiElement(api.networks, 'nets'), diff --git a/server/src/uds/templates/uds/admin/index.html b/server/src/uds/templates/uds/admin/index.html index b780c9dd..6badec30 100644 --- a/server/src/uds/templates/uds/admin/index.html +++ b/server/src/uds/templates/uds/admin/index.html @@ -101,6 +101,7 @@ +