You can subscribe to this list here.
2007 |
Jan
|
Feb
(65) |
Mar
(276) |
Apr
(544) |
May
(638) |
Jun
(225) |
Jul
(204) |
Aug
(294) |
Sep
(532) |
Oct
(506) |
Nov
(324) |
Dec
(359) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(208) |
Feb
(225) |
Mar
(248) |
Apr
(388) |
May
(222) |
Jun
(47) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@ze...> - 2007-03-23 20:49:16
|
Author: ecn Date: 2007-03-23 16:49:13 -0400 (Fri, 23 Mar 2007) New Revision: 4370 Added: trunk/Products/ZenModel/ZenPacker.py trunk/Products/ZenWidgets/skins/zenui/dialog_addZenPack.pt trunk/Products/ZenWidgets/skins/zenui/dialog_removeZenPacks.pt Modified: trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt trunk/Products/ZenEvents/skins/zenevents/eventMappingList.pt trunk/Products/ZenModel/DataRoot.py trunk/Products/ZenModel/ManufacturerRoot.py trunk/Products/ZenModel/MibBase.py trunk/Products/ZenModel/ZenModelRM.py trunk/Products/ZenModel/ZenPack.py trunk/Products/ZenModel/ZenPackLoader.py trunk/Products/ZenModel/ZenPackable.py trunk/Products/ZenModel/ZenossInfo.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt trunk/Products/ZenModel/skins/zenmodel/monitorList.pt trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt trunk/Products/ZenModel/skins/zenmodel/viewPackDetail.pt trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt trunk/Products/ZenModel/skins/zenmodel/viewZenPacks.pt trunk/Products/ZenUtils/zenpack.py Log: * zenpack: add export, swoopy menus, add/delete Modified: trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -31,6 +31,7 @@ <tal:block tal:define=" objects here/children; tableName string:children; + menu_id string:EventClass_list; batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:SubClasses; "> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -126,6 +127,7 @@ <tal:block tal:define=" objects here/instances; tableName string:eventinstances; + menu_id string:EventMapping_list; batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:EventClass Mappings; "> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> Modified: trunk/Products/ZenEvents/skins/zenevents/eventMappingList.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/eventMappingList.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenEvents/skins/zenevents/eventMappingList.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -5,6 +5,7 @@ <tal:block tal:define=" objects here/getInstances; tableName string:eventmappinglist; + menu_id string:EventMapping_list; batch python:here.ZenTableManager.getBatch(tableName, objects); tblcolspan string:4; showfilterbox python:True; Modified: trunk/Products/ZenModel/DataRoot.py =================================================================== --- trunk/Products/ZenModel/DataRoot.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/DataRoot.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -125,6 +125,11 @@ , 'action' : 'dataRootManage' , 'permissions' : ('Manage DMD',) }, + { 'id' : 'packs' + , 'name' : 'ZenPacks' + , 'action' : 'viewZenPacks' + , 'permissions' : ( "Manage DMD", ) + }, { 'id' : 'viewHistory' , 'name' : 'Changes' , 'action' : 'viewHistory' @@ -413,5 +418,38 @@ ''' return self.emailFrom or 'zenossuser_%s@%s' % ( getSecurityManager().getUser().getId(), socket.getfqdn()) - + + def manage_addZenPack(self, id, + author="", + organization="", + version="", + REQUEST = None): + """make a new ZenPack""" + from ZenPack import ZenPackBase + pack = ZenPackBase(id) + pack.author = author + pack.organization = organization + pack.version = version + self.packs._setObject(id, pack) + import os + zp = os.path.join(os.environ['ZENHOME'], 'Products', id) + if not os.path.isdir(zp): + os.makedirs(zp) + for d in ['objects', 'skins', 'modeler/plugins', + 'reports', 'daemons']: + os.makedirs(os.path.join(zp, d)) + if REQUEST is not None: + return self.callZenScreen(REQUEST, redirect=True) + + def removeZenPacks(self, ids=(), REQUEST = None): + """remove a ZenPack""" + import os + zp = os.path.join(os.environ['ZENHOME'], 'bin', 'zenpack') + import os + for pack in ids: + os.system('%s run --remove %s' % (zp, pack)) + self._p_jar.sync() + if REQUEST is not None: + return self.callZenScreen(REQUEST) + InitializeClass(DataRoot) Modified: trunk/Products/ZenModel/ManufacturerRoot.py =================================================================== --- trunk/Products/ZenModel/ManufacturerRoot.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/ManufacturerRoot.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -28,6 +28,7 @@ PrimaryPathBTreeFolder2 from ZenModelBase import ZenModelBase +from ZenPacker import ZenPacker from Products.ZenUtils.Search import makeCaseSensitiveKeywordIndex def manage_addManufacturerRoot(context, REQUEST=None): @@ -42,7 +43,7 @@ #addManufacturerRoot = DTMLFile('dtml/addManufacturerRoot',globals()) -class ManufacturerRoot(ZenModelBase, PrimaryPathBTreeFolder2): +class ManufacturerRoot(ZenModelBase, PrimaryPathBTreeFolder2, ZenPacker): """ The root organizer for manufacturers. May become a BtreeFolder2 at some point (to scale better). Has interface to manage Manufacturers Modified: trunk/Products/ZenModel/MibBase.py =================================================================== --- trunk/Products/ZenModel/MibBase.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/MibBase.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -11,6 +11,8 @@ default_catalog = 'mibSearch' + _relations = ZenPackable._relations[:] + moduleName = "" nodetype = "" oid = "" Modified: trunk/Products/ZenModel/ZenModelRM.py =================================================================== --- trunk/Products/ZenModel/ZenModelRM.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/ZenModelRM.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -23,12 +23,13 @@ #from Products.ZCatalog.CatalogAwareness import CatalogAware from ZenModelBase import ZenModelBase +from ZenPacker import ZenPacker from Products.ZenUtils.Utils import getSubObjects from Products.ZenRelations.ImportRM import ImportRM from Products.ZenRelations.RelationshipManager import RelationshipManager -class ZenModelRM(ZenModelBase, RelationshipManager, Historical): +class ZenModelRM(ZenModelBase, RelationshipManager, Historical, ZenPacker): """ Base class for all Persistent classes that have relationships. Provides RelationshipManagement, Customized PropertyManagement, @@ -311,19 +312,3 @@ self.reindex_all(item) return 'done!' - security.declareProtected('Manage DMD', 'addToZenPack') - def addToZenPack(self, ids=(), organizerPaths=(), pack=None, REQUEST=None): - "Add elements from a displayed list of objects to a ZenPack" - ids = list(ids) + list(organizerPaths) - if ids and pack: - pack = self.dmd.packs._getOb(pack) - for id in ids: - obj = self._getOb(id) - obj.buildRelations() - if pack.objectPaths: - pack.objectPaths = pack.objectPaths[:] - else: - pack.objectPaths = [] - pack.packables._setObject(id, obj) - if REQUEST: - return self.callZenScreen(REQUEST) Modified: trunk/Products/ZenModel/ZenPack.py =================================================================== --- trunk/Products/ZenModel/ZenPack.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/ZenPack.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -16,6 +16,21 @@ __doc__="ZenPacks base definitions" +def eliminateDuplicates(objs): + def compare(x, y): + return cmp(x.getPrimaryPath(), y.getPrimaryPath()) + objs.sort(compare) + result = [] + for obj in objs: + for alreadyInList in result: + path = alreadyInList.getPrimaryPath() + if obj.getPrimaryPath()[:len(path)] == path: + break + else: + result.append(obj) + return result + + class ZenPack(ZenModelRM): '''The root of all ZenPacks: has no implementation, but sits here to be the target of the Relation''' @@ -39,6 +54,7 @@ factory_type_information = ( { 'immediate_view' : 'viewPackDetail', + 'factory' : 'manage_addZenPack', 'actions' : ( { 'id' : 'viewPackDetail' @@ -50,6 +66,9 @@ }, ) + def remove(self, app=None): + pass + def manage_deletePackable(self, packables=(), REQUEST=None): "Delete objects from this ZenPack" from sets import Set @@ -59,14 +78,84 @@ self.packables.removeRelation(obj) if REQUEST: return self.callZenScreen(REQUEST) - + def manage_exportPack(self, REQUEST=None): + "Export the ZenPack to the /export directory" + from StringIO import StringIO + from Acquisition import aq_base + xml = StringIO() + xml.write("""<?xml version="1.0"?>\n""") + xml.write("<objects>\n") + packables = eliminateDuplicates(self.packables()) + for obj in packables: + obj = aq_base(obj) + xml.write('<!-- %r -->\n' % (obj.getPrimaryPath(),)) + obj.exportXml(xml,['devices','networks', 'pack'],True) + xml.write("</objects>\n") + path = zenPackPath(self.id, 'objects') + if not os.path.isdir(path): + os.makeDirs(path) + objects = file(os.path.join(path, 'objects.xml'), 'w') + objects.write(xml.getvalue()) + objects.close() + path = zenPackPath(self.id, 'skins') + if not os.path.isdir(path): + os.makeDirs(path) + init = zenPackPath(self.id, '__init__.py') + if not os.path.isfile(init): + fp = file(init, 'w') + fp.write( +''' +import Globals +from Products.CMFCore.DirectoryView import registerDirectory +registerDirectory("skins", globals()) + +from Products.ZenModel.ZenPack import ZenPackBase + +class ZenPack(ZenPackBase): + author = %r + organization = %r + version = %r + +# register any other classes here +''' % (self.author, self.organization, self.version)) + + fp.close() + zenhome = os.getenv('ZENHOME') + path = os.path.join(zenhome, 'export') + if not os.path.isdir(path): + os.makeDirs(path) + from zipfile import ZipFile, ZIP_DEFLATED + zf = ZipFile(os.path.join(path, '%s.zip' % self.id), 'w', ZIP_DEFLATED) + base = zenPackPath() + for p, ds, fd in os.walk(zenPackPath(self.id)): + if p.split('/')[-1].startswith('.'): continue + for f in fd: + if f.startswith('.'): continue + if f.endswith('.pyc'): continue + filename = os.path.join(p, f) + zf.write(filename, filename[len(base)+1:]) + zf.close() + if REQUEST: + REQUEST['message'] = '%s has been exported' % self.id + return self.callZenScreen(REQUEST) + from Products.ZenModel.ZenPackLoader import * def zenPackPath(*parts): return os.path.join(os.environ['ZENHOME'], 'Products', *parts) class ZenPackBase(ZenPack): + + author = '' + organization = '' + version = '0.1' + + _properites = ( + dict(id='author', type='string', mode='w'), + dict(id='organization', type='string', mode='w'), + dict(id='version', type='string', mode='w'), + ) zope.interface.implements(interfaces.IZenPack) loaders = (ZPLObject(), ZPLReport(), ZPLDaemons(), ZPLSkins()) @@ -96,5 +185,4 @@ return result - InitializeClass(ZenPack) Modified: trunk/Products/ZenModel/ZenPackLoader.py =================================================================== --- trunk/Products/ZenModel/ZenPackLoader.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/ZenPackLoader.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -67,6 +67,7 @@ log.debug('Now adding %s', obj.getPrimaryUrlPath()) try: obj.buildRelations() + obj.removeRelation('pack') obj.addRelation('pack', pack) except Exception, ex: log.exception("Error adding pack to %s", @@ -87,18 +88,25 @@ def unload(self, pack, app): + from Products.ZenRelations.Exceptions import ObjectNotFound dmd = app.zport.dmd - for obj in pack.packables(): + objs = pack.packables() + objs.sort(lambda x, y: cmp(x.getPrimaryPath(), y.getPrimaryPath())) + objs.reverse() + for obj in objs: path = obj.getPrimaryPath() path, id = path[:-1], path[-1] - try: - obj = dmd.getObjByPath(path) - obj._delObject(id) - except (AttributeError, KeyError), ex: - log.warning("Unable to remove %s on %s", id, - '/'.join(path)) + obj = dmd.getObjByPath(path) + if len(path) > 3: # leave /Services, /Devices, etc. + try: + try: + obj._delObject(id) + except ObjectNotFound: + obj._delOb(id) + except (AttributeError, KeyError), ex: + log.warning("Unable to remove %s on %s", id, + '/'.join(path)) - def list(self, pack, app): return [obj.getPrimaryUrlPath() for obj in pack.packables()] Modified: trunk/Products/ZenModel/ZenPackable.py =================================================================== --- trunk/Products/ZenModel/ZenPackable.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/ZenPackable.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -16,3 +16,4 @@ _relations = ( ("pack", ToOne(ToMany, "ZenPack", "packables")), ) + Added: trunk/Products/ZenModel/ZenPacker.py Modified: trunk/Products/ZenModel/ZenossInfo.py =================================================================== --- trunk/Products/ZenModel/ZenossInfo.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/ZenossInfo.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -54,11 +54,6 @@ , 'action' : 'zenossVersions' , 'permissions' : ( "Manage DMD", ) }, - { 'id' : 'packs' - , 'name' : 'ZenPacks' - , 'action' : 'viewZenPacks' - , 'permissions' : ( "Manage DMD", ) - }, ) }, ) Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -1,6 +1,7 @@ ################################################################# -# # Copyright (c) 2007 Zenoss, Inc. All rights reserved. # +# Copyright (c) 2007 Zenoss, Inc. All rights reserved. +# ################################################################# __doc__=''' @@ -19,6 +20,14 @@ zenhome = os.environ['ZENHOME'] menuxml = os.path.join(zenhome, "Products/ZenModel/data/menus.xml") +ZenPackItem = dict( + id= 'addToZenPack', + description='Add to ZenPack...', + action= 'dialog_addToZenPack', + permissions=('View',), + isdialog = True, + ) + class MenuRelations(Migrate.Step): version = Migrate.Version(1, 2, 0) @@ -67,6 +76,14 @@ 'description': 'PerfConf', 'id': 'objRRDTemplate', 'permissions': ('Change Device',)}, + dict( + id= 'addToZenPack', + description='Add to ZenPack...', + action= 'dialog_addToZenPack', + permissions=('View',), + isdialog = True, + allowed_classes = ['ZenPackable'], + ), {'action': 'dialog_lock', 'allowed_classes': ['Device', 'WinService' @@ -224,14 +241,35 @@ 'id': 'serviceClassEdit', 'permissions': ('Manage DMD',)}, ], - 'DeviceOrganizer_list':[ + 'DeviceOrganizer_list': [ZenPackItem], + 'Service_list': [ZenPackItem], + 'ServiceOrganizer_list': [ZenPackItem], + 'OSProcess_list': [ZenPackItem], + 'OSProcessOrganizer_list': [ZenPackItem], + 'Manufacturer_list': [ZenPackItem], + 'Mib_list': [ZenPackItem], + 'MibOrganizer_list': [ZenPackItem], + 'EventClass_list': [ZenPackItem], + 'EventMapping_list': [ZenPackItem], + 'PerformanceMonitor_list': [ZenPackItem], + 'StatusMonitorsMonitor_list': [ZenPackItem], + # doesn't work: + # 'ReportClass_list': [ZenPackItem], + 'ZenPack_list':[ dict( - id= 'addToZenPack', - description='Add to ZenPack...', - action= 'dialog_addToZenPack', - permissions=('View',), - isdialog = True - ) + id= 'addZenPack', + description='Create a new ZenPack...', + action= 'dialog_addZenPack', + permissions=('Manage DMD',), + isdialog = True, + ), + dict( + id= 'removeZenPack', + description='Delete ZenPack', + permissions=('Manage DMD',), + action= 'dialog_removeZenPacks', + isdialog=True, + ), ], 'Device_list':[ dict( Modified: trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -3,6 +3,7 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <tal:block tal:define="objects here/children; + menu_id string:MibOrganizer_list; tableName string:children; showfilterbox python:True; tabletitle string:Sub-Folders; @@ -93,6 +94,7 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <tal:block tal:define="objects here/mibs; + menu_id string:Mib_list; tableName string:mibslist; showfilterbox python:True; tabletitle string:Mibs; Modified: trunk/Products/ZenModel/skins/zenmodel/monitorList.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/monitorList.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/monitorList.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -9,6 +9,7 @@ <tal:block tal:define="objects python:submonitor.objectSubValues(); + menu_id python:submonitor.id + 'Monitor_list'; tableName string:monitorlist; submonname python:test(submonitor.id=='Performance', 'Performance Monitors', 'Status Monitors'); Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -5,6 +5,7 @@ <tal:block tal:define="objects here/children; + menu_id string:OSProcessOrganizer_list; tableName string:children; showfilterbox python:True; tabletitle string:Sub-Folders; @@ -80,6 +81,7 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <tal:block tal:define="objects here/osProcessClasses; + menu_id string:OSProcess_list; tableName string:osprocessclasseslist; showfilterbox python:True; tabletitle string:Processes; Modified: trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -4,6 +4,7 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <tal:block tal:define="objects here/children; + menu_id string:ServiceOrganizer_list; tableName string:children; showfilterbox python:True; tabletitle string:Sub-Folders; @@ -84,6 +85,7 @@ <tal:block tal:define="objects here/serviceclasses; + menu_id string:Service_list; tableName string:serviceclasseslist; showfilterbox python:True; tabletitle string:Services; Modified: trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -3,7 +3,7 @@ <form method="post" tal:attributes="action here/absolute_url_path"> - <tal:block tal:define=" tabletitle string:Manufacturer"> + <tal:block tal:define="tabletitle string:Manufacturer;"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= Modified: trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -3,6 +3,7 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <tal:block tal:define=" tableName string:manufacturers; + menu_id string:Manufacturer_list; objects python:here.objectValues(spec='Manufacturer'); showfilterbox python:True; tabletitle string:Manufacturers; Modified: trunk/Products/ZenModel/skins/zenmodel/viewPackDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewPackDetail.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/viewPackDetail.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -43,6 +43,9 @@ <input class="tableheader" type="submit" name="SelectButton" value="Select All" onClick="toggleSelect(this.form);return false"/> + | + <input class="tableheader" type="submit" + name="manage_exportPack:method" value=" Export " /> </tr> <tr> <td class="tableheader" align='center'> @@ -56,7 +59,6 @@ </tal:block> </tal:block> - </form> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -6,6 +6,7 @@ <tal:block tal:define="tableName string:reportorgs; + menu_id string:ReportClass_list; objects here/children; showfilterbox python:True; batch python:here.ZenTableManager.getBatch(tableName,objects); Modified: trunk/Products/ZenModel/skins/zenmodel/viewZenPacks.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewZenPacks.pt 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenModel/skins/zenmodel/viewZenPacks.pt 2007-03-23 20:49:13 UTC (rev 4370) @@ -1,15 +1,17 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> - <form method="POST" tal:attributes="action request/URL;" + <form method="POST" name="zenPackList" tal:attributes="action here/absolute_url_path;" tal:define="tableName string:packlist; objects container/dmd/packs; batch python:container.dmd.ZenTableManager.getBatch(tableName,objects);"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + <input type="hidden" name="tableName" tal:attributes="value tableName"/> - <tal:block tal:define=" tabletitle string:Loaded Zen Packs"> + <tal:block tal:define=" tabletitle string:Loaded Zen Packs; + menu_id string:ZenPack_list; " > <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -24,11 +26,22 @@ <tal:block metal:fill-slot="zentablecontents"> <!-- BEGIN TABLE CONTENTS --> - + <tr> + <th class="tableheader"/> + <th class="tableheader">Pack</th> + <th class="tableheader">Author</th> + <th class="tableheader">Organization</th> + <th class="tableheader">Version</th> + <th class="tableheader">#</th> + </tr> <tr tal:repeat='pack objects'> <td class="tablevalues"> + <input type="checkbox" name="ids:list" + tal:attributes="value pack/id"/> + </td> + <td class="tablevalues"> <a tal:attributes="href pack/getPrimaryUrlPath" tal:content="pack/id"/> </td> @@ -39,6 +52,9 @@ <a tal:attributes="href pack/url" tal:content="pack/organization"/> </td> <td class="tablevalues"> + <a tal:attributes="href pack/url" tal:content="pack/version"/> + </td> + <td class="tablevalues"> <a tal:attributes="href pack/getPrimaryUrlPath" tal:content="python:len(pack.packables())"/> </td> Modified: trunk/Products/ZenUtils/zenpack.py =================================================================== --- trunk/Products/ZenUtils/zenpack.py 2007-03-23 20:31:13 UTC (rev 4369) +++ trunk/Products/ZenUtils/zenpack.py 2007-03-23 20:49:13 UTC (rev 4370) @@ -99,6 +99,9 @@ if not os.path.exists(fullname): os.makedirs(fullname) else: + base = os.path.dirname(fullname) + if not os.path.isdir(base): + os.makedirs(base) file(fullname, 'wb').write(zf.read(name)) return packName Added: trunk/Products/ZenWidgets/skins/zenui/dialog_addZenPack.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_removeZenPacks.pt |
From: <sv...@ze...> - 2007-03-23 20:31:12
|
Author: marc Date: 2007-03-23 16:31:13 -0400 (Fri, 23 Mar 2007) New Revision: 4369 Modified: trunk/Products/ZenModel/OSProcess.py trunk/Products/ZenModel/WinService.py Log: #748 * Added manage_add* methods Modified: trunk/Products/ZenModel/OSProcess.py =================================================================== --- trunk/Products/ZenModel/OSProcess.py 2007-03-23 20:26:49 UTC (rev 4368) +++ trunk/Products/ZenModel/OSProcess.py 2007-03-23 20:31:13 UTC (rev 4369) @@ -14,6 +14,15 @@ from OSComponent import OSComponent from ZenPackable import ZenPackable +def manage_addOSProcess(context, id, title = None, REQUEST = None): + """make a device""" + d = OSProcess(id, title) + context._setObject(id, d) + + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(context.absolute_url() + +'/manage_main') + class OSProcess(OSComponent, Commandable, ZenPackable): """Hardware object""" portal_type = meta_type = 'OSProcess' Modified: trunk/Products/ZenModel/WinService.py =================================================================== --- trunk/Products/ZenModel/WinService.py 2007-03-23 20:26:49 UTC (rev 4368) +++ trunk/Products/ZenModel/WinService.py 2007-03-23 20:31:13 UTC (rev 4369) @@ -12,6 +12,15 @@ from Service import Service +def manage_addWinService(context, id, title = None, REQUEST = None): + """make a device""" + d = WinService(id, title) + context._setObject(id, d) + + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(context.absolute_url() + +'/manage_main') + class WinService(Service): """Windows Service Class """ |
From: <sv...@ze...> - 2007-03-23 20:26:53
|
Author: marc Date: 2007-03-23 16:26:49 -0400 (Fri, 23 Mar 2007) New Revision: 4368 Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addIpService.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addWinService.pt trunk/Products/ZenModel/skins/zenmodel/dialog_deleteComponent.pt trunk/Products/ZenModel/skins/zenmodel/locked-delete-icon.png trunk/Products/ZenModel/skins/zenmodel/locked-update-icon.png trunk/Products/ZenWidgets/skins/zenui/dialog_lockDevices.pt Removed: trunk/Products/ZenModel/skins/zenmodel/emblem-readonly.png Modified: trunk/Products/DataCollector/ApplyDataMap.py trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/DeviceComponent.py trunk/Products/ZenModel/OSComponent.py trunk/Products/ZenModel/OperatingSystem.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt trunk/Products/ZenWidgets/skins/zenui/dialog_lock.pt Log: #748 * More dialogs, More menus, Some add templates Modified: trunk/Products/DataCollector/ApplyDataMap.py =================================================================== --- trunk/Products/DataCollector/ApplyDataMap.py 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/DataCollector/ApplyDataMap.py 2007-03-23 20:26:49 UTC (rev 4368) @@ -286,7 +286,7 @@ and (self.datacollector and getattr(self.datacollector, 'generateEvents', False) and getattr(self.datacollector, 'dmd', None))): - self.logChange(device, Change_Set_Blocked, 'Locked from deletion') + self.logChange(device, Change_Set_Blocked, 'Locked from updates and deletion') else: self.logChange(device, Change_Add, "adding object %s to relationship %s" % ( Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/DeviceClass.py 2007-03-23 20:26:49 UTC (rev 4368) @@ -624,4 +624,34 @@ if REQUEST: return self.callZenScreen(REQUEST) + def unlockDevices(self, sendEventWhenBlocked=None, REQUEST=None): + """Unlock devices""" + if not deviceNames: return self() + if type(deviceNames) in types.StringTypes: deviceNames = (deviceNames,) + for devname in deviceNames: + dev = self.findDevice(devname) + dev.unlock(sendEventWhenBlocked) + if REQUEST: + return self.callZenScreen(REQUEST) + + def lockDevicesFromDeletion(self, sendEventWhenBlocked=None, REQUEST=None): + """Lock devices from being deleted""" + if not deviceNames: return self() + if type(deviceNames) in types.StringTypes: deviceNames = (deviceNames,) + for devname in deviceNames: + dev = self.findDevice(devname) + dev.lockFromDeletion(sendEventWhenBlocked) + if REQUEST: + return self.callZenScreen(REQUEST) + + def lockDevicesFromUpdates(self, sendEventWhenBlocked=None, REQUEST=None): + """Lock devices from being deleted or updated""" + if not deviceNames: return self() + if type(deviceNames) in types.StringTypes: deviceNames = (deviceNames,) + for devname in deviceNames: + dev = self.findDevice(devname) + dev.lockFromUpdates(sendEventWhenBlocked) + if REQUEST: + return self.callZenScreen(REQUEST) + InitializeClass(DeviceClass) Modified: trunk/Products/ZenModel/DeviceComponent.py =================================================================== --- trunk/Products/ZenModel/DeviceComponent.py 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/DeviceComponent.py 2007-03-23 20:26:49 UTC (rev 4368) @@ -16,6 +16,7 @@ from AccessControl import ClassSecurityInfo from Acquisition import aq_base from Lockable import Lockable +from Products.ZenEvents.ZenEventClasses import Change_Add,Change_Remove,Change_Set class DeviceComponent(Lockable): """ @@ -158,6 +159,5 @@ """ super(DeviceComponent,self).manage_beforeDelete(item, container) self.unindex_object() - - + InitializeClass(DeviceComponent) Modified: trunk/Products/ZenModel/OSComponent.py =================================================================== --- trunk/Products/ZenModel/OSComponent.py 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/OSComponent.py 2007-03-23 20:26:49 UTC (rev 4368) @@ -18,3 +18,45 @@ """ os = self.os() if os: return os.device() + + def manage_deleteComponent(self, REQUEST=None): + """ + Delete OSComponent + """ + url = None + if REQUEST is not None: + url = self.device().os.absolute_url() + self.getPrimaryParent()._delObject(self.id) + ''' + eventDict = { + 'eventClass': Change_Remove, + 'device': self.device().id, + 'component': self.id or '', + 'summary': 'Deleted by user: %s' % 'user', + 'severity': Event.Info, + } + self.dmd.ZenEventManager.sendEvent(eventDict) + ''' + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(url) + + def manage_updateComponent(context, datamap, REQUEST=None): + """ + Update OSComponent + """ + url = None + if REQUEST is not None: + url = self.device().os.absolute_url() + self.getPrimaryParent()._updateObject(self, datamap) + ''' + eventDict = { + 'eventClass': Change_Set, + 'device': self.device().id, + 'component': self.id or '', + 'summary': 'Updated by user: %s' % 'user', + 'severity': Event.Info, + } + self.dmd.ZenEventManager.sendEvent(eventDict) + ''' + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(url) \ No newline at end of file Modified: trunk/Products/ZenModel/OperatingSystem.py =================================================================== --- trunk/Products/ZenModel/OperatingSystem.py 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/OperatingSystem.py 2007-03-23 20:26:49 UTC (rev 4368) @@ -23,7 +23,14 @@ from ZenDate import ZenDate from Exceptions import * +from IpInterface import manage_addIpInterface +from WinService import manage_addWinService +from IpService import manage_addIpService +from OSProcess import manage_addOSProcess +from IpRouteEntry import manage_addIpRouteEntry +from FileSystem import manage_addFileSystem + class OperatingSystem(Software): totalSwap = 0L @@ -104,5 +111,46 @@ """ return self.getPrimaryParent() + def addIpInterface(self, id, REQUEST=None): + """Add an IpInterface. + """ + manage_addIpInterface(self, id) + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + def addWinService(self, id, REQUEST=None): + """Add an WinService. + """ + manage_addWinService(self, id) + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + + def addOSProcess(self, id, REQUEST=None): + """Add an OSProcess. + """ + manage_addOSProcess(self, id) + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + + def addIpService(self, id, REQUEST=None): + """Add an IpInterface. + """ + manage_addIpService(self, id) + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + + def addFileSystem(self, id, REQUEST=None): + """Add an FileSystem. + """ + manage_addFileSystem(self, id) + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + + def addIpRouteEntry(self, id, REQUEST=None): + """Add an IpRouteEntry. + """ + manage_addIpRouteEntry(self, id) + if REQUEST is not None: + REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + InitializeClass(OperatingSystem) Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-23 20:26:49 UTC (rev 4368) @@ -67,6 +67,32 @@ 'description': 'PerfConf', 'id': 'objRRDTemplate', 'permissions': ('Change Device',)}, + {'action': 'dialog_lock', + 'allowed_classes': ['Device', + 'WinService' + 'FileSystem', + 'HardDisk', + 'IpInterface', + 'IpService', + 'OSProcess', + 'IpRouteEntry'], + 'description': 'Lock', + 'id': 'lockObject', + 'isdialog': True, + 'permissions': ('Change Device',)}, + {'action': 'dialog_delete', + 'allowed_classes': ['Device', + 'WinService' + 'FileSystem', + 'HardDisk', + 'IpInterface', + 'IpService', + 'OSProcess', + 'IpRouteEntry'], + 'description': 'Delete', + 'id': 'deleteObject', + 'isdialog': True, + 'permissions': ('Change Device',)}, {'action': 'editStatusMonitorConf', 'allowed_classes': ['StatusMonitorConf'], 'description': 'Edit', @@ -245,21 +271,66 @@ ), dict( id= 'lockDevices', - description='Change lock on devices...', + description='Change lock...', action= 'dialog_lockDevices', permissions=('Change Device',), isdialog = True ) ], - 'Lockable':[ + 'IpInterface':[ dict( - id= 'lockObject', - description='Change lock...', - action= 'dialog_lock', + id= 'addIpInterface', + description='Add IpInterface...', + action= 'dialog_addIpInterface', + isdialog = True, permissions=('Change Device',), - isdialog = True ) ], + 'WinService':[ + dict( + id= 'addWinService', + description='Add WinService...', + action= 'dialog_addWinService', + isdialog = True, + permissions=('Change Device',), + ) + ], + 'OSProcess':[ + dict( + id= 'addOSProcess', + description='Add OSProcess...', + action= 'dialog_addOSProcess', + isdialog = True, + permissions=('Change Device',), + ) + ], + 'IpService':[ + dict( + id= 'addIpService', + description='Add IpService...', + action= 'dialog_addIpService', + isdialog = True, + permissions=('Change Device',), + ) + ], + 'FileSystem':[ + dict( + id= 'addFileSystem', + description='Add File System...', + action= 'dialog_addFileSystem', + isdialog = True, + permissions=('Change Device',), + ) + ], + 'IpRouteEntry':[ + dict( + id= 'addIpRouteEntry', + description='Add Route...', + action= 'dialog_addIpRouteEntry', + isdialog = True, + permissions=('Change Device',), + ) + ], 'Event_list':[ dict( id= 'acknowledgeEvents', Modified: trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt 2007-03-23 20:26:49 UTC (rev 4368) @@ -80,6 +80,8 @@ <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getSnmpStatusNumber','Critical/Error','cmp')">Critical/Error </th> + <th class=tableheader align=left>Delete lock</th> + <th class=tableheader align=left>Update lock</th> </tr> <tal:block tal:repeat="device batch"> <tr tal:define="odd repeat/device/odd" @@ -120,6 +122,12 @@ </tr> </table> </td> + <td class=tablevalues> + <img tal:condition="device/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> + <td class=tablevalues> + <img tal:condition="device/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> </tr> </tal:block> </tbody> Modified: trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt 2007-03-23 20:26:49 UTC (rev 4368) @@ -1,12 +1,15 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> - +<form method="post" tal:attributes="action here/absolute_url" + name="addComponent"/> + <tal:block tal:define="unused here/cacheComponents; tableName string:interfacelist; objects here/os/interfaces/objectValuesAll; tabletitle string:Interfaces; - batch python:here.ZenTableManager.getBatch(tableName,objects);" + batch python:here.ZenTableManager.getBatch(tableName,objects); + menu_id string:IpInterface" metal:define-macro="interfaceList"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -27,8 +30,7 @@ <th tal:condition="here/zIfDescription" tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'description','Descr')"/> - <th class="tableheader" align="center">Delete lock</th> - <th class="tableheader" align="center">Update lock</th> + <th class="tableheader" align="center">Lock</th> </tr> <tr tal:condition="not:batch"> <th class="tableheader" align="left"> @@ -78,11 +80,9 @@ A really nice interface </td> <td class="tablevalues" align="center"> - <img tal:condition="intf/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + <img tal:condition="intf/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="intf/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class="tablevalues" align="center"> - <img tal:condition="intf/isLockedFromUpdates" border="0" src="emblem-readonly.png"> - </td> </tr> </tal:block> <tr> @@ -101,7 +101,8 @@ objects here/os/winservices/objectValuesAll; tabletitle string:Win Services; batch python:here.ZenTableManager.getBatch(tableName,objects, - sortedHeader='caption');"> + sortedHeader='caption'); + menu_id string:WinService"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="zentablecontents"> @@ -118,8 +119,7 @@ tableName,'name','Name')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getStatus','Status','cmp')"/> - <th class="tableheader" align="center">Delete lock</th> - <th class="tableheader" align="center">Update lock</th> + <th class="tableheader" align="center">Lock</th> </tr> <tal:block tal:repeat="srv batch"> <tr tal:define="odd repeat/srv/odd" @@ -134,11 +134,9 @@ tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> <td class="tablevalues" align="center"> - <img tal:condition="srv/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + <img tal:condition="srv/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="srv/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class="tablevalues" align="center"> - <img tal:condition="srv/isLockedFromUpdates" border="0" src="emblem-readonly.png"> - </td> </tr> </tal:block> <tr> @@ -159,7 +157,8 @@ objects here/os/processes/objectValuesAll; tabletitle string:OS Processes; batch python:here.ZenTableManager.getBatch(tableName,objects, - sortedHeader='getOSProcessClass');" + sortedHeader='getOSProcessClass'); + menu_id string:OSProcess" tal:condition="objects"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -188,8 +187,7 @@ tableName,'getFailSeverityString','Fail Severity')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getStatus','Status','cmp')"/> - <th class="tableheader" align="center">Delete lock</th> - <th class="tableheader" align="center">Update lock</th> + <th class="tableheader" align="center">Lock</th> </tr> <tal:block tal:repeat="proc batch"> <tr tal:define="odd repeat/proc/odd" @@ -204,11 +202,9 @@ tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> <td class="tablevalues" align="center"> - <img tal:condition="proc/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + <img tal:condition="proc/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="proc/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class="tablevalues" align="center"> - <img tal:condition="proc/isLockedFromUpdates" border="0" src="emblem-readonly.png"> - </td> </tr> </tal:block> <tr> @@ -230,7 +226,8 @@ objects here/os/ipservices/objectValuesAll; tabletitle string:IP Services; batch python:here.ZenTableManager.getBatch(tableName,objects, - sortedHeader='getPort');" + sortedHeader='getPort'); + menu_id string:IpService" tal:condition="objects"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -256,8 +253,7 @@ </th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getStatus','Status','cmp')"/> - <th class="tableheader" align="center">Delete lock</th> - <th class="tableheader" align="center">Update lock</th> + <th class="tableheader" align="center">Lock</th> </tr> <tal:block tal:repeat="srv batch"> <tr tal:define="odd repeat/srv/odd" @@ -276,11 +272,9 @@ tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> <td class="tablevalues" align="center"> - <img tal:condition="srv/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + <img tal:condition="srv/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="srv/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class="tablevalues" align="center"> - <img tal:condition="srv/isLockedFromUpdates" border="0" src="emblem-readonly.png"> - </td> </tr> </tal:block> <tr> @@ -301,7 +295,8 @@ objects here/os/filesystems/objectValuesAll; tabletitle string:File Systems; batch python:here.ZenTableManager.getBatch(tableName,objects, - sortedHeader='mount');" + sortedHeader='mount'); + menu_id string:FileSystem" tal:condition="objects"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -329,8 +324,7 @@ tableName,'storageDevice','Storage Device')">Device </th> --> - <th class="tableheader" align="center">Delete lock</th> - <th class="tableheader" align="center">Update lock</th> + <th class="tableheader" align="center">Lock</th> </tr> <tr tal:condition="not:objects"> <th class="tableheader" align="left"> @@ -362,11 +356,9 @@ </td> --> <td class="tablevalues" align="center"> - <img tal:condition="fsys/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + <img tal:condition="fsys/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="fsys/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class="tablevalues" align="center"> - <img tal:condition="fsys/isLockedFromUpdates" border="0" src="emblem-readonly.png"> - </td> </tr> </tal:block> <tr> @@ -387,7 +379,8 @@ tal:define="tableName string:routeTablelist; objects here/os/routes/objectValuesAll; tabletitle string:Routes; - batch python:here.ZenTableManager.getBatch(tableName,objects);"> + batch python:here.ZenTableManager.getBatch(tableName,objects); + menu_id string:Route"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="zentablecontents"> @@ -403,6 +396,7 @@ tableName,'routeproto','Protocol')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'routetype','Type')"/> + <th class="tableheader" align="center">Lock</th> </tr> <tr tal:condition="not:batch"> <th class="tableheader" align="left"> @@ -420,6 +414,10 @@ <td class="tablevalues" tal:content="route/getInterfaceNameString"/> <td class="tablevalues" tal:content="route/routeproto"/> <td class="tablevalues" tal:content="route/routetype"/> + <td class="tablevalues" align="center"> + <img tal:condition="route/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="route/isLockedFromUpdates" border="0" src="locked-update-icon.png"> + </td> </tr> </tal:block> <tr> Modified: trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-03-23 20:26:49 UTC (rev 4368) @@ -62,21 +62,14 @@ </td> </tr> <tr> - <td class=tableheader align=left>Delete lock</td> + <td class=tableheader align=left>Locks</td> <td class=tablevalues> - <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + <img tal:condition="here/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="here/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class=tableheader align=left>Update lock</td> - <td class=tablevalues> - <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> - </td> + <td class=tableheader align=left>Lock warning</td> + <td class=tablevalues tal:content="here/lockWarning">Send event when blocked</td> </tr> - <tr> - <td class=tableheader align=left>Lock warnings</td> - <td class=tablevalues colspan=3 tal:content="here/lockWarning"> - - - </td> - </tr> <!-- END TABLE CONTENTS --> </tal:block> Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpService.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addWinService.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_deleteComponent.pt Deleted: trunk/Products/ZenModel/skins/zenmodel/emblem-readonly.png Added: trunk/Products/ZenModel/skins/zenmodel/locked-delete-icon.png Property changes on: trunk/Products/ZenModel/skins/zenmodel/locked-delete-icon.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Products/ZenModel/skins/zenmodel/locked-update-icon.png Property changes on: trunk/Products/ZenModel/skins/zenmodel/locked-update-icon.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-03-23 20:26:49 UTC (rev 4368) @@ -10,8 +10,7 @@ tal:attributes="value template/id" /> <tal:block metal:define-macro="objectperf" tal:define=" - tabletitle string:IpInterface; - menu_id string:Lockable"> + tabletitle string:IpInterface;"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="zentablecontents"> @@ -19,9 +18,25 @@ <!-- BEGIN TABLE CONTENTS --> <tr> <td class=tableheader align=left>Name</td> - <td class=tablevalues tal:content="here/name">eth0</td> + <td class=tablevalues tal:condition="not:here/isManager" + tal:content="here/name">eth0</td> + <td class=tablevalues tal:condition="here/isManager"> + <input tal:attributes="class string:tablevalues; + type string:text; + size string:50; + name string:name; + value here/name"> + </td> <td class=tableheader align=left>MAC Address</td> - <td class=tablevalues tal:content="here/macaddress">00:11:22:AA:BB:CC</td> + <td class=tablevalues tal:condition="not:here/isManager" + tal:content="here/macaddress">00:11:22:AA:BB:CC</td> + <td class=tablevalues tal:condition="here/isManager"> + <input tal:attributes="class string:tablevalues; + type string:text; + size string:50; + name string:macaddress; + value here/macaddress"> + </td> </tr> <tr> <td class="tableheader">Monitor</td> @@ -51,49 +66,94 @@ </tr> <tr> <td class=tableheader align=left>Operational Status</td> - <td class="tablevalues" + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="python:here.operStatus==1 and 'Up' or 'Down'"> Up </td> + <td class="tablevalues" tal:condition="here/isManager"> + <select class="tablevalues" name="operStatus" + tal:condition="here/isManager"> + <option tal:repeat="e python:(1,0)" tal:content="python:e==1 and 'Up' or 'Down'" + tal:attributes="value e; selected python:e==here.operStatus"/> + </select> + </td> <td class=tableheader align=left>Administrative Status</td> - <td class="tablevalues" + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="python:here.adminStatus==1 and 'Up' or 'Down'"> Up </td> + <td class="tablevalues" tal:condition="here/isManager"> + <select class="tablevalues" name="adminStatus" + tal:condition="here/isManager"> + <option tal:repeat="e python:(1,0)" tal:content="python:e==1 and 'Up' or 'Down'" + tal:attributes="value e; selected python:e==here.adminStatus"/> + </select> + </td> </tr> <tr> <td class=tableheader align=left>Type</td> - <td class=tablevalues tal:content="here/type">Ethernet</td> + <td class=tablevalues tal:condition="not:here/isManager" + tal:content="here/type">Ethernet</td> + <td class=tablevalues tal:condition="here/isManager"> + <input tal:attributes="class string:tablevalues; + type string:text; + size string:50; + name string:type; + value here/type"> + </td> <td class=tableheader align=left>Speed</td> - <td class=tablevalues tal:content="here/speed">100000000</td> + <td class=tablevalues tal:condition="not:here/isManager" + tal:content="here/speed">100000000</td> + <td class=tablevalues tal:condition="here/isManager"> + <input tal:attributes="class string:tablevalues; + type string:text; + size string:50; + name string:speed; + value here/speed"> + </td> </tr> <tr> <td class=tableheader align=left>MTU</td> - <td class=tablevalues tal:content="here/mtu">1500</td> + <td class=tablevalues tal:condition="not:here/isManager" + tal:content="here/mtu">1500</td> + <td class=tablevalues tal:condition="here/isManager"> + <input tal:attributes="class string:tablevalues; + type string:text; + size string:50; + name string:mtu; + value here/mtu"> + </td> <td class=tableheader align=left>SNMP Index</td> - <td class=tablevalues tal:content="here/ifindex">100000000</td> + <td class=tablevalues tal:condition="not:here/isManager" + tal:content="here/ifindex">100000000</td> + <td class=tablevalues tal:condition="here/isManager"> + <input tal:attributes="class string:tablevalues; + type string:text; + size string:50; + name string:ifindex; + value here/ifindex"> + </td> </tr> <tr> <td class=tableheader align=left>Description</td> - <td class=tablevalues colspan=3 tal:content="here/description"> - A nice interface - </td> + <td class=tablevalues colspan=3 tal:condition="not:here/isManager" + tal:content="here/description">A nice interface</td> + <td class=tablevalues colspan=3 tal:condition="here/isManager"> + <input tal:attributes="class string:tablevalues; + type string:text; + size string:50; + name string:description; + value here/description"> + </td> </tr> <tr> - <td class=tableheader align=left>Delete lock</td> + <td class=tableheader align=left>Locks</td> <td class=tablevalues> - <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + <img tal:condition="here/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="here/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class=tableheader align=left>Update lock</td> - <td class=tablevalues> - <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> - </td> - </tr> - <tr> <td class=tableheader align=left>Lock warnings</td> - <td class=tablevalues colspan=3 tal:content="here/lockWarning"> - Send event when blocked - </td> + <td class=tablevalues tal:content="here/lockWarning">Send event when blocked</td> </tr> <tr tal:condition="here/isManager"> <td align="left" class="tableheader" colspan="4"> Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_lock.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_lock.pt 2007-03-23 18:18:01 UTC (rev 4367) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_lock.pt 2007-03-23 20:26:49 UTC (rev 4368) @@ -1,26 +1,27 @@ -<h2>Change lock</h2> +<h2>Edit Lock</h2> <p> Which lock status would you like to set on this object?<br/> <br/> <input tal:attributes="name string:sendEventWhenBlocked; type string:checkbox; checked here/sendEventWhenBlocked" - />Send warnings when actions are blocked<br/> + />Send event when actions are blocked by a lock<br/> </p> <br/> +<br/> <div id="dialog_buttons"> <input type="submit" name="lockFromUpdates:method" value="Lock from deletion and updates" tal:attributes="onclick string:return $$('dialog').submit_form( - 'lockableForm', '${here/absolute_url_path}')" /> + 'lockableForm', '${here/absolute_url_path}')" /><br/> <input type="submit" name="lockFromDeletion:method" value="Lock from deletion" tal:attributes="onclick string:return $$('dialog').submit_form( - 'lockableForm', '${here/absolute_url_path}')" /> + 'lockableForm', '${here/absolute_url_path}')" /><br/> <input type="submit" name="unlock:method" value="Unlock" tal:attributes="onclick string:return $$('dialog').submit_form( - 'lockableForm', '${here/absolute_url_path}')" /> + 'lockableForm', '${here/absolute_url_path}')" /><br/> <input id="dialog_cancel" type="button" value="Cancel" onclick="$('dialog').hide()"/> </div> Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lockDevices.pt |
From: <sv...@ze...> - 2007-03-23 18:18:01
|
Author: ian Date: 2007-03-23 14:18:01 -0400 (Fri, 23 Mar 2007) New Revision: 4367 Modified: trunk/Products/ZenModel/ZenMenuable.py trunk/Products/ZenUtils/Utils.py Log: * Created a function that will compare an object's base classes against a list of class names. * Implemented in ZenMenuable objects. Modified: trunk/Products/ZenModel/ZenMenuable.py =================================================================== --- trunk/Products/ZenModel/ZenMenuable.py 2007-03-23 17:53:15 UTC (rev 4366) +++ trunk/Products/ZenModel/ZenMenuable.py 2007-03-23 18:18:01 UTC (rev 4367) @@ -3,6 +3,7 @@ from Globals import InitializeClass from Acquisition import aq_base, aq_parent, aq_chain from Products.ZenRelations.RelSchema import * +from Products.ZenUtils.Utils import cmpClassNames from zExceptions import NotFound @@ -104,8 +105,8 @@ or (not getattr(i, 'isglobal', True) and \ not context==i.getMenuItemOwner())\ or (i.allowed_classes and not \ - context.__class__.__name__ in i.allowed_classes)\ - or context.__class__.__name__ in i.banned_classes: + cmpClassNames(context, i.allowed_classes))\ + or cmpClassNames(context, i.banned_classes): continue menu[i.id] = i keys = menus.keys() Modified: trunk/Products/ZenUtils/Utils.py =================================================================== --- trunk/Products/ZenUtils/Utils.py 2007-03-23 17:53:15 UTC (rev 4366) +++ trunk/Products/ZenUtils/Utils.py 2007-03-23 18:18:01 UTC (rev 4367) @@ -19,6 +19,7 @@ import logging import re import socket +from sets import Set log = logging.getLogger("zen.Utils") from Acquisition import aq_base @@ -479,3 +480,17 @@ def localInterfaceCheck(context, intname): """Test to see if ips on an in should not be included in the network map.""" return re.search(getattr(context, 'zLoaclInterfaceNames', '^$'), intname) + + +def cmpClassNames(obj, classnames): + """ Check to see if an object's base classes + are in a list of class names. Like isinstance(), + but without requiring an instance to compare against. + """ + finalnames = Set() + x = list(obj.__class__.__bases__) + while x: + thisclass = x.pop() + x.extend(thisclass.__bases__) + finalnames.add(thisclass.__name__) + return not not Set(classnames).intersection(finalnames) |
From: <sv...@ze...> - 2007-03-23 17:53:16
|
Author: chris Date: 2007-03-23 13:53:15 -0400 (Fri, 23 Mar 2007) New Revision: 4366 Modified: trunk/inst/GNUmakefile Log: undid the last commit. prefixed LIBDIR with DESTDIR in order to accomodate RPM builds Modified: trunk/inst/GNUmakefile =================================================================== --- trunk/inst/GNUmakefile 2007-03-23 17:23:32 UTC (rev 4365) +++ trunk/inst/GNUmakefile 2007-03-23 17:53:15 UTC (rev 4366) @@ -258,7 +258,7 @@ rrdtool-install : build/$(RRDTOOL)/Makefile $(MSG) ; cd $(<D) ; $(MAKE) install $(LOG) - @cd build/$(RRDTOOL)/bindings/python ; LIBDIR=$(ZENHOME)/lib ; export LIBDIR ; $(PYINSTALLCMD) + @cd build/$(RRDTOOL)/bindings/python ; LIBDIR=$(DESTDIR)/$(ZENHOME)/lib $(PYINSTALLCMD) @rm -rf $(DESTDIR)$(ZENHOME)/share/rrdtool/examples winexe-install: build/$(WINEXE)/.unpacked |
From: <sv...@ze...> - 2007-03-23 17:23:33
|
Author: chris Date: 2007-03-23 13:23:32 -0400 (Fri, 23 Mar 2007) New Revision: 4365 Modified: trunk/inst/GNUmakefile Log: export LIBDIR so that we can build Modified: trunk/inst/GNUmakefile =================================================================== --- trunk/inst/GNUmakefile 2007-03-23 15:49:54 UTC (rev 4364) +++ trunk/inst/GNUmakefile 2007-03-23 17:23:32 UTC (rev 4365) @@ -258,7 +258,7 @@ rrdtool-install : build/$(RRDTOOL)/Makefile $(MSG) ; cd $(<D) ; $(MAKE) install $(LOG) - @cd build/$(RRDTOOL)/bindings/python ; LIBDIR=$(ZENHOME)/lib $(PYINSTALLCMD) + @cd build/$(RRDTOOL)/bindings/python ; LIBDIR=$(ZENHOME)/lib ; export LIBDIR ; $(PYINSTALLCMD) @rm -rf $(DESTDIR)$(ZENHOME)/share/rrdtool/examples winexe-install: build/$(WINEXE)/.unpacked |
From: <sv...@ze...> - 2007-03-23 15:49:54
|
Author: chris Date: 2007-03-23 11:49:54 -0400 (Fri, 23 Mar 2007) New Revision: 4364 Removed: tags/zenoss-1.2.0/ Log: accidentally created. this should not be here yet |
From: <sv...@ze...> - 2007-03-23 15:42:30
|
Author: chris Date: 2007-03-23 11:42:27 -0400 (Fri, 23 Mar 2007) New Revision: 4363 Added: tags/zenoss-1.2.0/ Log: * auto-build of zenoss-1.2.0 by zenpkg Copied: tags/zenoss-1.2.0 (from rev 4362, trunk) |
From: <sv...@ze...> - 2007-03-23 15:41:24
|
Author: chris Date: 2007-03-23 11:41:24 -0400 (Fri, 23 Mar 2007) New Revision: 4362 Modified: trunk/inst/zenoss.spec Log: use the fs directory and copy all files underneath it to the operating system (rather than targetting cron.* and logrotate.d) Modified: trunk/inst/zenoss.spec =================================================================== --- trunk/inst/zenoss.spec 2007-03-23 15:38:57 UTC (rev 4361) +++ trunk/inst/zenoss.spec 2007-03-23 15:41:24 UTC (rev 4362) @@ -171,24 +171,22 @@ cp ${ZEN_BUILD_DIR}/shared-functions.sh ${ZEN_INST_DIR}/bin cp ${ZEN_BUILD_DIR}/install-functions.sh ${ZEN_INST_DIR}/bin -# copy the cron scripts into /etc/cron.XXX -cd ${ZEN_BUILD_DIR} -for script in \ - `find cron -type f | grep -v .svn` +# copy filesystem scripts to the real filesystem +cd ${ZEN_BUILD_DIR}/fs +for file in \ + `find . -type f | grep -v .svn` do - DEST=${RPM_BUILD_ROOT}/etc/${script} + DEST=${RPM_BUILD_ROOT}/etc/${file} DIR=`dirname $DEST` if [ ! -d ${DIR} ]; then mkdir -p ${DIR} fi - cp ${script} ${DEST} + cp ${file} ${DEST} done -# copy the logrotate script into /etc/logrotate.d +# update ZENHOME in the /etc/logrotate.d scripts LOGROTATE_DIR=${RPM_BUILD_ROOT}/etc/logrotate.d -mkdir -p ${LOGROTATE_DIR} -cp ${ZEN_BUILD_DIR}/logrotate.d/* ${LOGROTATE_DIR} for file in \ `ls ${LOGROTATE_DIR}` do |
From: <sv...@ze...> - 2007-03-23 15:38:59
|
Author: chris Date: 2007-03-23 11:38:57 -0400 (Fri, 23 Mar 2007) New Revision: 4361 Modified: trunk/scripts/zenpkg Log: cp -r fs instead of logrotate.d and cron Modified: trunk/scripts/zenpkg =================================================================== --- trunk/scripts/zenpkg 2007-03-23 15:38:19 UTC (rev 4360) +++ trunk/scripts/zenpkg 2007-03-23 15:38:57 UTC (rev 4361) @@ -136,7 +136,7 @@ os.chdir(tagname) dest = "%s/%s" % (TEMP_DIR, tagname) run("mkdir -p %s" % dest) - run("cp -r logrotate.d cron conf externallibs %s" % dest) + run("cp -r fs conf externallibs %s" % dest) run("cp *-functions.sh %s" % dest) run("cp GNUmakefile %s" % dest) run("cp -r %s %s" % (opts.LIBZENOSS_ROOT, dest)) |
From: <sv...@ze...> - 2007-03-23 15:38:18
|
Author: chris Date: 2007-03-23 11:38:19 -0400 (Fri, 23 Mar 2007) New Revision: 4360 Removed: trunk/inst/fs/etc/cron/ Log: adios |
From: <sv...@ze...> - 2007-03-23 15:37:57
|
Author: chris Date: 2007-03-23 11:37:57 -0400 (Fri, 23 Mar 2007) New Revision: 4359 Added: trunk/inst/fs/etc/cron.daily/ trunk/inst/fs/etc/cron.weekly/ Removed: trunk/inst/fs/etc/cron/cron.daily/ trunk/inst/fs/etc/cron/cron.weekly/ Log: moved cron/cron.* to cron.*. somehow we goofed on the installation location of these guys Copied: trunk/inst/fs/etc/cron.daily (from rev 4358, trunk/inst/fs/etc/cron/cron.daily) Copied: trunk/inst/fs/etc/cron.weekly (from rev 4358, trunk/inst/fs/etc/cron/cron.weekly) |
From: <sv...@ze...> - 2007-03-23 15:37:17
|
Author: chris Date: 2007-03-23 11:37:14 -0400 (Fri, 23 Mar 2007) New Revision: 4358 Added: trunk/inst/fs/ trunk/inst/fs/etc/ trunk/inst/fs/etc/cron/ trunk/inst/fs/etc/logrotate.d/ Removed: trunk/inst/cron/ trunk/inst/logrotate.d/ Log: moved logrotate.d and cron into the fs directory Copied: trunk/inst/fs/etc/cron (from rev 4357, trunk/inst/cron) Copied: trunk/inst/fs/etc/logrotate.d (from rev 4357, trunk/inst/logrotate.d) |
From: <sv...@ze...> - 2007-03-23 12:28:18
|
Author: edahl Date: 2007-03-23 08:27:50 -0400 (Fri, 23 Mar 2007) New Revision: 4357 Modified: trunk/Products/ZenEvents/zensyslog.py Log: * fix bogus variable name Modified: trunk/Products/ZenEvents/zensyslog.py =================================================================== --- trunk/Products/ZenEvents/zensyslog.py 2007-03-23 00:18:51 UTC (rev 4356) +++ trunk/Products/ZenEvents/zensyslog.py 2007-03-23 12:27:50 UTC (rev 4357) @@ -59,7 +59,7 @@ ipaddr, port = client_address if self.options.logorig: self.olog.info(msg) - lookupPointer(host,timeout=(1,)).addBoth(self.gotHostname, (msg,ipaddr,time.time()) ) + lookupPointer(ipaddr,timeout=(1,)).addBoth(self.gotHostname, (msg,ipaddr,time.time()) ) def gotHostname(self, host, data): |
From: <sv...@ze...> - 2007-03-23 00:18:52
|
Author: ian Date: 2007-03-22 20:18:51 -0400 (Thu, 22 Mar 2007) New Revision: 4356 Modified: trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js trunk/Products/ZenWidgets/skins/zenui/javascript/selection.js Log: * Fixed bug disabling multiselect of checkboxes after ajax update Modified: trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js 2007-03-23 00:00:47 UTC (rev 4355) +++ trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js 2007-03-23 00:18:51 UTC (rev 4356) @@ -37,6 +37,7 @@ /* this won't work on IE */ evbody.innerHTML = html; document.forms.control.resetStart.value = 0; + connectCheckboxListeners(); }; var statusCount = 0; Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/selection.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/selection.js 2007-03-23 00:00:47 UTC (rev 4355) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/selection.js 2007-03-23 00:18:51 UTC (rev 4356) @@ -7,7 +7,6 @@ var inputs = getElementsByTagAndClassName('input', null); return filter(isCheckbox, inputs); } -addLoadEvent(function(){checkboxes = getCheckboxes();}); function selectCheckboxRange(start, end) { a = end>start?start:end; @@ -36,15 +35,14 @@ currentCheckbox = t; } -function connectCheckboxListeners(box) { - connect(box, 'onkeypress', handleChange); - disconnectAll(box, 'onclick'); - connect(box, 'onclick', handleChange); +function connectCheckboxListeners() { +checkboxes = getCheckboxes(); + for (i=0; i<checkboxes.length; i++){ + var box = checkboxes[i]; + connect(box, 'onkeypress', handleChange); + disconnectAll(box, 'onclick'); + connect(box, 'onclick', handleChange); + } } -addLoadEvent(function() { -var checks = getCheckboxes(); -for (i=0; i<checks.length; i++){ - connectCheckboxListeners(checks[i]); -} -}) +addLoadEvent(connectCheckboxListeners); |
From: <sv...@ze...> - 2007-03-23 00:01:10
|
Author: ian Date: 2007-03-22 20:00:47 -0400 (Thu, 22 Mar 2007) New Revision: 4355 Added: trunk/Products/ZenWidgets/skins/zenui/dialog_createEventMap.pt trunk/Products/ZenWidgets/skins/zenui/dialog_moveEventsToHistory.pt trunk/Products/ZenWidgets/skins/zenui/javascript/selection.js Modified: trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/templates.pt trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt Log: * Moved viewEvents buttons to menus: Export, History, Map * Added shift-to-select-multiple to all checkboxes in the app Modified: trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-03-22 20:41:27 UTC (rev 4354) +++ trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-03-23 00:00:47 UTC (rev 4355) @@ -4,15 +4,6 @@ <script type="text/javascript" src="/zport/js/zenutils.js"></script> <script type="text/javascript" src="/zport/portal_skins/zenevents/zeneventsfuncs.js"></script> -<script> -function goExport(url) { - var sev = document.getElementById("severity").value; - var state = document.getElementById("state").value; - var filter = document.getElementById("filter").value; - url = url + "/exportEvents?state=" + state + "&severity=" + sev + "&filter=" + filter; - parent.location = url; -} -</script> <form name="control" method="post" tal:attributes="action here/absolute_url_path" tal:define=" @@ -91,28 +82,9 @@ <tal:block metal:define-macro="editor"> <tr tal:condition="here/isManager"> <td class="tableheader" tal:attributes="colspan evcolspan"> - <input class="tableheader" type="submit" - name="manage_deleteEvents:method" value="History" /> - | - <input class="tableheader" type="submit" value="Map:" - name="manage_createEventMap:method"/> - <select class="tableheader" name="eventClass" - tal:define="orgs here/Events/getOrganizerNames"> - <option value=""></option> - <option tal:repeat="org orgs" tal:content="org" - tal:attributes="value org">/App/Start</option> - </select> - | <input class="tableheader" type="submit" name="SelectButton" value="Select All" onClick="toggleSelect(this.form);return false"/> - | - <input class="tableheader" type="button" - name="export" value="Export All" - tal:define="severity request/severity | string:2; - state request/state | string:1; - filter request/filter | string:;" - tal:attributes="onClick string:goExport('${request/URL1}');" /> </td> </tr> </tal:block> Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-22 20:41:27 UTC (rev 4354) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-23 00:00:47 UTC (rev 4355) @@ -268,6 +268,26 @@ '"control", "manage_ackEvents")'), permissions=('Manage DMD',) ), + dict( + id= 'historifyEvents', + description='Move Events to History...', + action= 'dialog_moveEventsToHistory', + permissions=('Manage DMD',), + isdialog= True + ), + dict( + id= 'exportAllEvents', + description='Download as CSV', + action= 'javascript:goExport()', + permissions=('View',) + ), + dict( + id= 'createEventMap', + description='Map Events to Class...', + action= 'dialog_createEventMap', + permissions=('Manage DMD',), + isdialog= True + ), ], 'HistoryEvent_list':[ dict( Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-03-22 20:41:27 UTC (rev 4354) +++ trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-03-23 00:00:47 UTC (rev 4355) @@ -15,6 +15,7 @@ <tal:block metal:use-macro="here/templates/macros/head1"/> <tal:block metal:define-slot="head-local"/> <tal:block metal:use-macro="here/zenuimacros/macros/jsutils"/> + <script src="javascript/selection.js"></script> </head> <body> <tal:block metal:use-macro="here/dialogmacros/macros/dialog_with_buttons"/> Added: trunk/Products/ZenWidgets/skins/zenui/dialog_createEventMap.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_moveEventsToHistory.pt Added: trunk/Products/ZenWidgets/skins/zenui/javascript/selection.js Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-22 20:41:27 UTC (rev 4354) +++ trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-23 00:00:47 UTC (rev 4355) @@ -157,7 +157,7 @@ tableName, here.ZenTableManager.getTableState(tableName), request); message request/SESSION/message | nothing;"> -<input type="text" name="filter" +<input type="text" name="filter" id="filter" onfocus="select(this)" tal:attributes="value ts/filter | string:; onkeypress python:test(tableName, 'submitViaEnter(event)', @@ -289,6 +289,14 @@ f.submit(); } +var goExport = function() { + var sev = $('severity').value; + var state = $('state').value; + var filter = $('filter').value; + url = '${here/getPrimaryUrlPath}/'+ 'exportEvents?state=' + state + + '&severity=' + sev + '&filter=' + filter; + parent.location = url; +} ">s</script> </tal:block> |
From: <sv...@ze...> - 2007-03-22 20:41:31
|
Author: abray Date: 2007-03-22 16:41:27 -0400 (Thu, 22 Mar 2007) New Revision: 4354 Modified: trunk/inst/docs/ZenossAdminGuide1.1.x.doc Log: unify-update Modified: trunk/inst/docs/ZenossAdminGuide1.1.x.doc =================================================================== (Binary files differ) |
From: <sv...@ze...> - 2007-03-22 20:40:58
|
Author: abray Date: 2007-03-22 16:40:49 -0400 (Thu, 22 Mar 2007) New Revision: 4353 Modified: trunk/inst/docs/ZenossDevGuide Log: re-orgupdate Modified: trunk/inst/docs/ZenossDevGuide =================================================================== (Binary files differ) |
From: <sv...@ze...> - 2007-03-22 20:40:16
|
Author: marc Date: 2007-03-22 16:40:09 -0400 (Thu, 22 Mar 2007) New Revision: 4352 Modified: trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt Log: #748 * yest another GUI fix Modified: trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-03-22 20:37:23 UTC (rev 4351) +++ trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-03-22 20:40:09 UTC (rev 4352) @@ -119,9 +119,9 @@ <td class=tablevalues> <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> </td> + </tr> + <tr> <td class=tableheader align=left>Update lock</td> - </tr> - <tr> <td class=tablevalues> <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> </td> Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-03-22 20:37:23 UTC (rev 4351) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-03-22 20:40:09 UTC (rev 4352) @@ -88,9 +88,9 @@ <td class=tablevalues> <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> </td> - <td class=tableheader align=left>Update lock</td> </tr> <tr> + <td class=tableheader align=left>Update lock</td> <td class=tablevalues> <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> </td> |
From: <sv...@ze...> - 2007-03-22 20:37:38
|
Author: marc Date: 2007-03-22 16:37:23 -0400 (Thu, 22 Mar 2007) New Revision: 4351 Modified: trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt Log: #748 * GUI fixes Modified: trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-03-22 20:26:34 UTC (rev 4350) +++ trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-03-22 20:37:23 UTC (rev 4351) @@ -3,7 +3,7 @@ <form method="post" tal:attributes="action here/absolute_url_path" name="lockableForm"/> - + <form method=post tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" @@ -120,6 +120,8 @@ <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> </td> <td class=tableheader align=left>Update lock</td> + </tr> + <tr> <td class=tablevalues> <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> </td> Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt 2007-03-22 20:26:34 UTC (rev 4350) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt 2007-03-22 20:37:23 UTC (rev 4351) @@ -1,11 +1,7 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> -<form method="post" tal:attributes="action here/absolute_url_path" - name="lockableForm"/> - -<tal:block tal:define=" tabletitle string:Process Class; - menu_id string:Lockable"> +<tal:block tal:define=" tabletitle string:Process Class"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -42,22 +38,6 @@ <th class="tableheader">Description</th> <td class="tablevalues" colspan="3" tal:content="here/description"/> </tr> - <tr> - <td class=tableheader align=left>Delete lock</td> - <td class=tablevalues> - <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> - </td> - <td class=tableheader align=left>Update lock</td> - <td class=tablevalues> - <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> - </td> - </tr> - <tr> - <td class=tableheader align=left>Lock warnings</td> - <td class=tablevalues colspan=3 tal:content="here/lockWarning"> - Send event when blocked - </td> - </tr> <!-- END TABLE CONTENTS --> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-03-22 20:26:34 UTC (rev 4350) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-03-22 20:37:23 UTC (rev 4351) @@ -1,6 +1,9 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<form method="post" tal:attributes="action here/absolute_url_path" + name="lockableForm"/> + <form method=post tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" @@ -10,7 +13,8 @@ <tal:block tal:define=" message request/message | string:State at time:; editable here/isManager; - tabletitle string:${message} ${here/getNowString}"> + tabletitle string:${message} ${here/getNowString}; + menu_id string:Lockable"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -80,6 +84,24 @@ tal:content="here/getFailSeverityString"/> </tr> <tr> + <td class=tableheader align=left>Delete lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class=tableheader align=left>Update lock</td> + </tr> + <tr> + <td class=tablevalues> + <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> + </tr> + <tr> + <td class=tableheader align=left>Lock warnings</td> + <td class=tablevalues tal:content="here/lockWarning"> + Send event when blocked + </td> + </tr> + <tr> <td align="left" class="tableheader" colspan="2"> <input class="tableheader" type="submit" value=" Save " name="manage_editOSProcess:method" /> |
From: <sv...@ze...> - 2007-03-22 20:26:40
|
Author: marc Date: 2007-03-22 16:26:34 -0400 (Thu, 22 Mar 2007) New Revision: 4350 Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lock.pt Log: #748 * lock dialog Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lock.pt |
From: <sv...@ze...> - 2007-03-22 20:21:11
|
Author: marc Date: 2007-03-22 16:20:51 -0400 (Thu, 22 Mar 2007) New Revision: 4349 Added: trunk/Products/ZenModel/skins/zenmodel/emblem-readonly.png Modified: trunk/Products/ZenModel/Lockable.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt Log: #748 * Lots o' GUI stuff Modified: trunk/Products/ZenModel/Lockable.py =================================================================== --- trunk/Products/ZenModel/Lockable.py 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/Lockable.py 2007-03-22 20:20:51 UTC (rev 4349) @@ -54,14 +54,35 @@ def unsetSendEventWhenBlockedFlag(self): self.sendEventWhenBlockedFlag = False - def unlock(self): + def unlock(self, sendEventWhenBlocked=None, REQUEST=None): + """Unlock object""" self.modelerLock = UNLOCKED + if sendEventWhenBlocked: + self.setSendEventWhenBlockedFlag() + else: + self.unsetSendEventWhenBlockedFlag() + if REQUEST: + return self.callZenScreen(REQUEST) - def lockFromDeletion(self): + def lockFromDeletion(self, sendEventWhenBlocked=None, REQUEST=None): + """Lock object from being deleted""" self.modelerLock = DELETE_LOCKED + if sendEventWhenBlocked: + self.setSendEventWhenBlockedFlag() + else: + self.unsetSendEventWhenBlockedFlag() + if REQUEST: + return self.callZenScreen(REQUEST) - def lockFromUpdates(self): + def lockFromUpdates(self, sendEventWhenBlocked=None, REQUEST=None): + """Lock object from being deleted or updated""" self.modelerLock = UPDATE_LOCKED + if sendEventWhenBlocked: + self.setSendEventWhenBlockedFlag() + else: + self.unsetSendEventWhenBlockedFlag() + if REQUEST: + return self.callZenScreen(REQUEST) def lockStatus(self): ''' Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-22 20:20:51 UTC (rev 4349) @@ -242,8 +242,24 @@ action= 'dialog_removeDevices', permissions=('Change Device',), isdialog = True + ), + dict( + id= 'lockDevices', + description='Change lock on devices...', + action= 'dialog_lockDevices', + permissions=('Change Device',), + isdialog = True ) ], + 'Lockable':[ + dict( + id= 'lockObject', + description='Change lock...', + action= 'dialog_lock', + permissions=('Change Device',), + isdialog = True + ) + ], 'Event_list':[ dict( id= 'acknowledgeEvents', Modified: trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -27,6 +27,8 @@ <th tal:condition="here/zIfDescription" tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'description','Descr')"/> + <th class="tableheader" align="center">Delete lock</th> + <th class="tableheader" align="center">Update lock</th> </tr> <tr tal:condition="not:batch"> <th class="tableheader" align="left"> @@ -75,6 +77,12 @@ class="tablevalues" tal:content="intf/description"> A really nice interface </td> + <td class="tablevalues" align="center"> + <img tal:condition="intf/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class="tablevalues" align="center"> + <img tal:condition="intf/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> </tr> </tal:block> <tr> @@ -110,6 +118,8 @@ tableName,'name','Name')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getStatus','Status','cmp')"/> + <th class="tableheader" align="center">Delete lock</th> + <th class="tableheader" align="center">Update lock</th> </tr> <tal:block tal:repeat="srv batch"> <tr tal:define="odd repeat/srv/odd" @@ -123,6 +133,12 @@ <td tal:define="status srv/getStatus" tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> + <td class="tablevalues" align="center"> + <img tal:condition="srv/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class="tablevalues" align="center"> + <img tal:condition="srv/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> </tr> </tal:block> <tr> @@ -172,6 +188,8 @@ tableName,'getFailSeverityString','Fail Severity')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getStatus','Status','cmp')"/> + <th class="tableheader" align="center">Delete lock</th> + <th class="tableheader" align="center">Update lock</th> </tr> <tal:block tal:repeat="proc batch"> <tr tal:define="odd repeat/proc/odd" @@ -185,6 +203,12 @@ <td tal:define="status proc/getStatus" tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> + <td class="tablevalues" align="center"> + <img tal:condition="proc/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class="tablevalues" align="center"> + <img tal:condition="proc/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> </tr> </tal:block> <tr> @@ -232,6 +256,8 @@ </th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getStatus','Status','cmp')"/> + <th class="tableheader" align="center">Delete lock</th> + <th class="tableheader" align="center">Update lock</th> </tr> <tal:block tal:repeat="srv batch"> <tr tal:define="odd repeat/srv/odd" @@ -249,6 +275,12 @@ <td tal:define="status srv/getStatus" tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> + <td class="tablevalues" align="center"> + <img tal:condition="srv/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class="tablevalues" align="center"> + <img tal:condition="srv/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> </tr> </tal:block> <tr> @@ -297,6 +329,8 @@ tableName,'storageDevice','Storage Device')">Device </th> --> + <th class="tableheader" align="center">Delete lock</th> + <th class="tableheader" align="center">Update lock</th> </tr> <tr tal:condition="not:objects"> <th class="tableheader" align="left"> @@ -327,6 +361,12 @@ tal:content="fsys/storageDevice">vol </td> --> + <td class="tablevalues" align="center"> + <img tal:condition="fsys/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class="tablevalues" align="center"> + <img tal:condition="fsys/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> </tr> </tal:block> <tr> Modified: trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -1,9 +1,12 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<form method="post" tal:attributes="action here/absolute_url_path" + name="lockableForm"/> <tal:block metal:define-macro="deviceStatusInfo" - tal:define=" tabletitle string:Status; "> + tal:define=" tabletitle string:Status; + menu_id string:Lockable"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -59,17 +62,21 @@ </td> </tr> <tr> - <td class="tableheader">Modeler Lock</td> - <td class="tablevalues" - tal:content="python:here.lockStatus()"> - Unlocked + <td class=tableheader align=left>Delete lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> </td> - <td class="tableheader">Lock Warning</td> - <td class="tablevalues" - tal:content="python:here.lockWarning()"> - Do not send event on block + <td class=tableheader align=left>Update lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> </td> </tr> + <tr> + <td class=tableheader align=left>Lock warnings</td> + <td class=tablevalues colspan=3 tal:content="here/lockWarning"> + - + </td> + </tr> <!-- END TABLE CONTENTS --> </tal:block> Added: trunk/Products/ZenModel/skins/zenmodel/emblem-readonly.png Property changes on: trunk/Products/ZenModel/skins/zenmodel/emblem-readonly.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -1,6 +1,9 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<form method="post" tal:attributes="action here/absolute_url_path" + name="lockableForm"/> + <form method=post tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" @@ -8,7 +11,8 @@ <tal:block tal:define="message request/message | string:State at time:; - tabletitle string:${message} ${here/getNowString}"> + tabletitle string:${message} ${here/getNowString}; + menu_id string:Lockable"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -111,6 +115,22 @@ <td class="tablevalues" tal:content="here/description"/> </tr> <tr> + <td class=tableheader align=left>Delete lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class=tableheader align=left>Update lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> + </tr> + <tr> + <td class=tableheader align=left>Lock warnings</td> + <td class=tablevalues tal:content="here/lockWarning"> + Send event when blocked + </td> + </tr> + <tr> <td align="left" class="tableheader" colspan="2"> <input class="tableheader" type="submit" value=" Save " name="manage_editService:method" /> Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -1,9 +1,12 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<form method="post" tal:attributes="action here/absolute_url_path" + name="lockableForm"/> - <tal:block tal:define=" tabletitle string:Process Class"> - <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> +<tal:block tal:define=" tabletitle string:Process Class; + menu_id string:Lockable"> +<tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -39,7 +42,22 @@ <th class="tableheader">Description</th> <td class="tablevalues" colspan="3" tal:content="here/description"/> </tr> - + <tr> + <td class=tableheader align=left>Delete lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class=tableheader align=left>Update lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> + </tr> + <tr> + <td class=tableheader align=left>Lock warnings</td> + <td class=tablevalues colspan=3 tal:content="here/lockWarning"> + Send event when blocked + </td> + </tr> <!-- END TABLE CONTENTS --> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -1,15 +1,21 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<form method="post" tal:attributes="action here/absolute_url_path" + name="lockableForm"/> + <form method=post tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> -<table metal:define-macro="objectperf" - border=0 cellpadding=3 width=100% - align="center" bgcolor="#ffffff" cellspacing=1 - > - <tr><th class=tabletitle align=left colspan=4>File System</th></tr> + +<tal:block metal:define-macro="objectperf" tal:define=" + tabletitle string:File System; + menu_id string:Lockable"> +<tal:block metal:use-macro="here/zenuimacros/macros/zentable"> + +<tal:block metal:fill-slot="zentablecontents"> + <tr> <td class=tableheader align=left>Mount Point</td> <td class=tablevalues tal:content="here/mount">/usr</td> @@ -62,13 +68,33 @@ <td class=tableheader align=left>Snmp Index</td> <td class=tablevalues tal:content="here/snmpindex">1</td> </tr> + <tr> + <td class=tableheader align=left>Delete lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class=tableheader align=left>Update lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> + </tr> + <tr> + <td class=tableheader align=left>Lock warnings</td> + <td class=tablevalues colspan=3 tal:content="here/lockWarning"> + Send event when blocked + </td> + </tr> <tr tal:condition="here/isManager"> <td align="left" class="tableheader" colspan="4"> <input class="tableheader" type="submit" value=" Save " name="zmanage_editProperties:method" /> </td> </tr> -</table> + +</tal:block> +</tal:block> +</tal:block> + </form> <br/> <tal:block tal:condition="here/monitored" > Modified: trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -1,13 +1,17 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<form method="post" tal:attributes="action here/absolute_url_path" + name="lockableForm"/> + <form method=post tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> <tal:block metal:define-macro="objectperf" tal:define=" - tabletitle string:IpInterface; "> + tabletitle string:IpInterface; + menu_id string:Lockable"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="zentablecontents"> @@ -75,12 +79,29 @@ A nice interface </td> </tr> + <tr> + <td class=tableheader align=left>Delete lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class=tableheader align=left>Update lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> + </tr> + <tr> + <td class=tableheader align=left>Lock warnings</td> + <td class=tablevalues colspan=3 tal:content="here/lockWarning"> + Send event when blocked + </td> + </tr> <tr tal:condition="here/isManager"> <td align="left" class="tableheader" colspan="4"> <input class="tableheader" type="submit" value=" Save " name="zmanage_editProperties:method" /> </td> </tr> + <!-- END TABLE CONTENTS --> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -1,6 +1,9 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<form method="post" tal:attributes="action here/absolute_url_path" + name="lockableForm"/> + <form method=post tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" @@ -8,7 +11,8 @@ <tal:block tal:define="message request/message | string:State at time:; - tabletitle string:${message} ${here/getNowString}"> + tabletitle string:${message} ${here/getNowString}; + menu_id string:Lockable"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -84,6 +88,22 @@ <td class="tablevalues" colspan="3" tal:content="here/pathName"/> </tr> <tr> + <td class=tableheader align=left>Delete lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + </td> + <td class=tableheader align=left>Update lock</td> + <td class=tablevalues> + <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + </td> + </tr> + <tr> + <td class=tableheader align=left>Lock warnings</td> + <td class=tablevalues colspan=3 tal:content="here/lockWarning"> + Send event when blocked + </td> + </tr> + <tr> <td align="left" class="tableheader" colspan="4"> <input class="tableheader" type="submit" value=" Save " name="manage_editService:method" /> Modified: trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt 2007-03-22 18:55:47 UTC (rev 4348) +++ trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt 2007-03-22 20:20:51 UTC (rev 4349) @@ -24,7 +24,7 @@ <div style="text-align:center"> <h2>Loading...</h2> <br/> -<img src="spinning_wheel_throbber.gif"/> +<img src="img/spinning_wheel_throbber.gif"/> </div> </tal:block> </tal:block> |
From: <sv...@ze...> - 2007-03-22 18:56:24
|
Author: ian Date: 2007-03-22 14:55:47 -0400 (Thu, 22 Mar 2007) New Revision: 4348 Modified: trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/templates.pt trunk/Products/ZenUtils/js/zenutils.js trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt Log: * Moved event acknowledgement into the menu Modified: trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-03-22 17:06:13 UTC (rev 4347) +++ trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-03-22 18:55:47 UTC (rev 4348) @@ -29,7 +29,7 @@ page string:getEventListPage; "> <tal:block metal:define-macro="eventTable"> -<tal:block tal:define="tabletitle string:Event List"> +<tal:block tal:define="tabletitle string:Event List;menu_id string:Event_list"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!-- Custom filter widgets --> @@ -91,9 +91,6 @@ <tal:block metal:define-macro="editor"> <tr tal:condition="here/isManager"> <td class="tableheader" tal:attributes="colspan evcolspan"> - <input class="tableheader" type="submit" value="Acknowledge" - name="manage_ackEvents:method"/> - | <input class="tableheader" type="submit" name="manage_deleteEvents:method" value="History" /> | Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-22 17:06:13 UTC (rev 4347) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-22 18:55:47 UTC (rev 4348) @@ -244,6 +244,15 @@ isdialog = True ) ], + 'Event_list':[ + dict( + id= 'acknowledgeEvents', + description='Acknowledge Events', + action= ('javascript:submitFormToMethod(' + '"control", "manage_ackEvents")'), + permissions=('Manage DMD',) + ), + ], 'HistoryEvent_list':[ dict( id= 'undeleteHistoryEvents', Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-03-22 17:06:13 UTC (rev 4347) +++ trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-03-22 18:55:47 UTC (rev 4348) @@ -14,6 +14,7 @@ <head> <tal:block metal:use-macro="here/templates/macros/head1"/> <tal:block metal:define-slot="head-local"/> + <tal:block metal:use-macro="here/zenuimacros/macros/jsutils"/> </head> <body> <tal:block metal:use-macro="here/dialogmacros/macros/dialog_with_buttons"/> Modified: trunk/Products/ZenUtils/js/zenutils.js =================================================================== --- trunk/Products/ZenUtils/js/zenutils.js 2007-03-22 17:06:13 UTC (rev 4347) +++ trunk/Products/ZenUtils/js/zenutils.js 2007-03-22 18:55:47 UTC (rev 4348) @@ -8,6 +8,7 @@ return d.addCallback(evalJSONRequest); } + var cancelWithTimeout = function (deferred, timeout) { var canceller = callLater(timeout, function () { // cancel the deferred after timeout seconds @@ -19,4 +20,4 @@ canceller.cancel(); return res; }); -}; +}; Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-22 17:06:13 UTC (rev 4347) +++ trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-22 18:55:47 UTC (rev 4348) @@ -25,7 +25,9 @@ <div class="menu_bottom"> </div> <ul> <li tal:repeat="item python:here.getMenus(menu, here)"> -<a tal:define="mypath string:${basepath}/${item/action}; +<a tal:define="mypath python:test(item.action.startswith('javascript'), + item.action, + '%s/%s' % (basepath, item.action)); actionpath python:test(item.isdialog, 'javascript:$(\'dialog\').show(\'%s\')' % mypath, mypath)" @@ -196,10 +198,12 @@ <div class="menu_bottom"> </div> <ul class="zenMenu" tal:attributes="id string:${menu_id}_list"> <li tal:repeat="item menuitems"> -<a tal:define="mypath string:${basepath}/${item/action}; +<a tal:define="mypath python:test(item.action.startswith('javascript'), + item.action, + '%s/%s' % (basepath, item.action)); actionpath python:test(item.isdialog, - 'javascript:$(\'dialog\').show(\'%s\')' % mypath, - mypath)" + 'javascript:$(\'dialog\').show(\'%s\')' % mypath, + mypath)" tal:attributes="href actionpath" tal:content="item/description">description</a> </li> @@ -268,3 +272,24 @@ </tr> </table> </tal:block> + + +<!--================================================= + Javascript utilities that are easier with templating + =================================================--> + +<tal:block metal:define-macro="jsutils"> +<script tal:content="string: + +var submitFormToMethod = function(formname, method) { +//Basically for use in menu items, to obviate creating dummy forms +//or menu items that are actually buttons. + f = document.forms[formname]; + f.action = '${here/getPrimaryUrlPath}/' + method; + f.submit(); +} + + +">s</script> +</tal:block> + |
From: <sv...@ze...> - 2007-03-22 17:06:11
|
Author: ian Date: 2007-03-22 13:06:13 -0400 (Thu, 22 Mar 2007) New Revision: 4347 Added: trunk/Products/ZenWidgets/skins/zenui/dialog_undeleteHistoryEvents.pt Modified: trunk/Products/ZenEvents/CustomEventView.py trunk/Products/ZenEvents/EventManagerBase.py trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js trunk/Products/ZenModel/EventView.py trunk/Products/ZenModel/ZenMenu.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenWidgets/skins/zenui/css/menus.css Log: * Moved undeletion of history events into a menu. Modified: trunk/Products/ZenEvents/CustomEventView.py =================================================================== --- trunk/Products/ZenEvents/CustomEventView.py 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenEvents/CustomEventView.py 2007-03-22 17:06:13 UTC (rev 4347) @@ -146,7 +146,9 @@ """Delete events form this managed entity. """ self.getEventManager().manage_undeleteEvents(evids) - if REQUEST: return self.callZenScreen(REQUEST) + if REQUEST: + REQUEST['message'] = "%s events undeleted." % len(evids) + return self.callZenScreen(REQUEST) security.declareProtected('Manage Events','manage_deleteHeartbeat') Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-03-22 17:06:13 UTC (rev 4347) @@ -1071,10 +1071,13 @@ if type(evids) == type(''): evids = [evids] if evids: + l = len(evids) evids = ",".join([ "'%s'" % evid for evid in evids]) whereClause = ' where evid in (%s)' % evids self.undeleteEvents(whereClause, 'Undeleted by user') - if REQUEST: return self.callZenScreen(REQUEST) + if REQUEST: + REQUEST['message'] = "%s events undeleted." % l + return self.callZenScreen(REQUEST) security.declareProtected('Manage Events','manage_deleteAllEvents') def manage_deleteAllEvents(self, devname, REQUEST=None): Modified: trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt 2007-03-22 17:06:13 UTC (rev 4347) @@ -38,6 +38,7 @@ </script> <form method="post" tal:attributes="action here/absolute_url_path" + name="history_events" tal:define=" whereclause request/ev_whereclause | here/eventWhere | string:; orderby request/ev_orderby | here/eventOrderby | string:; @@ -54,10 +55,12 @@ <tal:block tal:define=" tabletitle string:Event History; +menu_id string:HistoryEvent_list; "> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="filterslot"> + <div style="position:absolute;right:50px;top:0px;z-index:2007;"> <input type='hidden' name='table' value='history'/> Start Date: @@ -87,9 +90,6 @@ <tal:block metal:define-macro="histeditor"> <tr tal:condition="here/isManager"> <td class="tableheader" tal:attributes="colspan evcolspan"> - <input class="tableheader" type="submit" value="Undelete" - name="manage_undeleteEvents:method"/> - | <input class="tableheader" type="submit" value="Map:" name="manage_createEventMap:method"/> <select class="tableheader" name="eventClass" Modified: trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenEvents/skins/zenevents/zeneventsfuncs.js 2007-03-22 17:06:13 UTC (rev 4347) @@ -213,6 +213,8 @@ var refreshData = function() { //logger.debuggingBookmarklet(true) //log("loading"); + var eventsurl = eventsurl | null; + if (!eventsurl) return; var defr = cancelWithTimeout( loadJSONDoc(eventsurl), cancelSecs); defr.addCallback(updateEventsListing); Modified: trunk/Products/ZenModel/EventView.py =================================================================== --- trunk/Products/ZenModel/EventView.py 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenModel/EventView.py 2007-03-22 17:06:13 UTC (rev 4347) @@ -106,7 +106,9 @@ """Delete events form this managed entity. """ self.getEventManager().manage_undeleteEvents(evids) - if REQUEST: return self.callZenScreen(REQUEST) + if REQUEST: + REQUEST['message'] = '%s events undeleted.' % len(evids) + return self.callZenScreen(REQUEST) security.declareProtected('Manage Events','manage_deleteHeartbeat') Modified: trunk/Products/ZenModel/ZenMenu.py =================================================================== --- trunk/Products/ZenModel/ZenMenu.py 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenModel/ZenMenu.py 2007-03-22 17:06:13 UTC (rev 4347) @@ -38,7 +38,7 @@ security.declareProtected('Change Device', 'manage_addZenMenuItem') def manage_addZenMenuItem(self, id=None, description='', action='', - permissions=(Permissions.view,), isglobal=True, + permissions=(Permissions.view,), isdialog=False, isglobal=True, banned_classes=(), allowed_classes=(), REQUEST=None): """ Add a menu item to a menu """ mi = None @@ -50,9 +50,10 @@ mi.description = description mi.action = action mi.permissions = permissions + mi.isdialog = isdialog mi.isglobal = isglobal - mi.banned_classes=list(banned_classes) - mi.allowed_classes=list(allowed_classes) + mi.banned_classes = list(banned_classes) + mi.allowed_classes = list(allowed_classes) return mi security.declareProtected('Change Device', 'manage_deleteZenMenuItem') Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-22 17:06:13 UTC (rev 4347) @@ -203,7 +203,8 @@ id= 'addToZenPack', description='Add to ZenPack...', action= 'dialog_addToZenPack', - permissions=('View',) + permissions=('View',), + isdialog = True ) ], 'Device_list':[ @@ -211,33 +212,47 @@ id= 'moveclass', description='Move to Class...', action= 'dialog_moveDevices', - permissions=('Change Device',) + permissions=('Change Device',), + isdialog = True ), dict( id= 'setGroups', description='Set Groups...', action= 'dialog_setGroups', - permissions=('Change Device',) + permissions=('Change Device',), + isdialog = True ), dict( id= 'setSystems', description='Set Systems...', action= 'dialog_setSystems', - permissions=('Change Device',) + permissions=('Change Device',), + isdialog = True ), dict( id= 'setLocation', description='Set Location...', action= 'dialog_setLocation', - permissions=('Change Device',) + permissions=('Change Device',), + isdialog = True ), dict( id= 'removeDevices', description='Delete devices...', action= 'dialog_removeDevices', - permissions=('Change Device',) + permissions=('Change Device',), + isdialog = True ) ], + 'HistoryEvent_list':[ + dict( + id= 'undeleteHistoryEvents', + description='Undelete Events...', + action= 'dialog_undeleteHistoryEvents', + permissions=('Manage DMD',), + isdialog = True + ) + ], }) Modified: trunk/Products/ZenWidgets/skins/zenui/css/menus.css =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/css/menus.css 2007-03-22 17:05:02 UTC (rev 4346) +++ trunk/Products/ZenWidgets/skins/zenui/css/menus.css 2007-03-22 17:06:13 UTC (rev 4347) @@ -8,7 +8,7 @@ .contextmenu * , .littlemenu * { padding: 0; - font-size: 12pt; + font-size: 12px; margin:0; font-weight: normal; } Added: trunk/Products/ZenWidgets/skins/zenui/dialog_undeleteHistoryEvents.pt |
From: <sv...@ze...> - 2007-03-22 17:05:05
|
Author: ian Date: 2007-03-22 13:05:02 -0400 (Thu, 22 Mar 2007) New Revision: 4346 Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt Log: * Made the menu template respect the isdialog attribute. Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-22 14:13:54 UTC (rev 4345) +++ trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-22 17:05:02 UTC (rev 4346) @@ -4,7 +4,6 @@ <div class="menu" tal:define=" menu_ids menu_ids | python:['Edit','Actions']; - pathtrans here/REQUEST/PATH_TRANSLATED; basepath here/getPrimaryUrlPath"> <div tal:attributes="id string:contextmenu_btn"> <a class="tabletitle"> </a> @@ -13,7 +12,6 @@ <div style="position:absolute;" class="invisible" id="contextmenu_items"> <div class="menu_top"> </div> <div class="menu_bottom"> </div> - <ul class="zenMenu"> <tal:block tal:repeat="menu menu_ids"> <li tal:condition="python:here.getMenus(menu, here)"> @@ -27,7 +25,11 @@ <div class="menu_bottom"> </div> <ul> <li tal:repeat="item python:here.getMenus(menu, here)"> -<a tal:attributes="href string:${basepath}/${item/action}" +<a tal:define="mypath string:${basepath}/${item/action}; + actionpath python:test(item.isdialog, + 'javascript:$(\'dialog\').show(\'%s\')' % mypath, + mypath)" + tal:attributes="href actionpath" tal:content="item/description">description</a> </li> </ul> @@ -193,10 +195,13 @@ <div class="menu_top"> </div> <div class="menu_bottom"> </div> <ul class="zenMenu" tal:attributes="id string:${menu_id}_list"> - <li tal:repeat="i menuitems"> - <a tal:attributes="href - string:javascript:$$('dialog').show('${basepath}/${i/action}')" - tal:content="i/description">description</a> + <li tal:repeat="item menuitems"> +<a tal:define="mypath string:${basepath}/${item/action}; + actionpath python:test(item.isdialog, + 'javascript:$(\'dialog\').show(\'%s\')' % mypath, + mypath)" + tal:attributes="href actionpath" + tal:content="item/description">description</a> </li> </ul> </div> |