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-04-26 20:34:41
|
Author: jstevens Date: 2007-04-26 16:34:42 -0400 (Thu, 26 Apr 2007) New Revision: 4895 Modified: trunk/Products/ZenEvents/Availability.py trunk/Products/ZenEvents/EventManagerBase.py trunk/Products/ZenModel/Device.py trunk/Products/ZenReports/reports/Performance_Reports/Availability_Report.rpt Log: Adding filtering and systems column to device availability report Modified: trunk/Products/ZenEvents/Availability.py =================================================================== --- trunk/Products/ZenEvents/Availability.py 2007-04-26 20:23:36 UTC (rev 4894) +++ trunk/Products/ZenEvents/Availability.py 2007-04-26 20:34:42 UTC (rev 4895) @@ -39,8 +39,9 @@ security.setDefaultAccess('allow') "Simple record for holding availability information" - def __init__(self, device, component, downtime, total): + def __init__(self, device, component, downtime, total, systems=''): self.device = device + self.systems = systems self.component = component self.availability = max(0, 1 - (downtime / total)) @@ -158,15 +159,19 @@ if not self.component: for d in dmd.Devices.getSubDevices(): devices.setdefault( (d.id, self.component), 0) + deviceLookup = dict([(d.id, d) for d in deviceList]) result = [] for (d, c), v in devices.items(): - result.append( Availability(d, c, v, total) ) + dev = deviceLookup.get(d, None) + sys = (dev and dev.getSystemNamesString()) or '' + result.append( Availability(d, c, v, total, sys) ) # add in the devices that have the component, but no events if self.component: for d in deviceList: for c in d.getMonitoredComponents(): if c.name().find(self.component) >= 0: - a = Availability(d.id, c.name(), 0, total) + a = Availability(d.id, c.name(), 0, total, + d.getSystemsString()) result.append(a) return result Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-04-26 20:23:36 UTC (rev 4894) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-04-26 20:34:42 UTC (rev 4895) @@ -633,7 +633,7 @@ def getAvailability(self, state, **kw): import Availability - for name in "device", "component", "eventClass": + for name in "device", "component", "eventClass", "systems": if hasattr(state, name): kw.setdefault(name, getattr(state, name)) try: Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-04-26 20:23:36 UTC (rev 4894) +++ trunk/Products/ZenModel/Device.py 2007-04-26 20:34:42 UTC (rev 4895) @@ -590,6 +590,12 @@ return map(lambda x: x.getOrganizerName(), self.systems()) + security.declareProtected('View', 'getSystemNamesString') + def getSystemNamesString(self, sep=', '): + """get the system names for this device as a string""" + return sep.join(self.getSystemNames()) + + security.declareProtected('View', 'getDeviceGroupNames') def getDeviceGroupNames(self): """get the device group names for this device""" Modified: trunk/Products/ZenReports/reports/Performance_Reports/Availability_Report.rpt =================================================================== --- trunk/Products/ZenReports/reports/Performance_Reports/Availability_Report.rpt 2007-04-26 20:23:36 UTC (rev 4894) +++ trunk/Products/ZenReports/reports/Performance_Reports/Availability_Report.rpt 2007-04-26 20:34:42 UTC (rev 4895) @@ -87,14 +87,21 @@ </table> </form> -<table class="zentable" cellpadding="3" cellspacing="1"> - <tr><th class="tabletitle" colspan="3">Device Availability</th></tr> +<form method="POST" tal:attributes="action request/URL;" + tal:define="tabletitle string:Device Availability; + showfilterbox python:True; + tblcolspan string:4"> +<tal:block metal:use-macro="here/zenuimacros/macros/zentable"> +<tal:block metal:fill-slot="zentablecontents"> + <tr> <th tal:replace="structure python:tm.getTableHeader( tableName,'device','Device')"/> <th tal:replace="structure python:tm.getTableHeader( tableName,'component','Component')"/> <th tal:replace="structure python:tm.getTableHeader( + tableName,'systems','Systems')"/> + <th tal:replace="structure python:tm.getTableHeader( tableName,'availability','Availability')"/> </tr> <tal:block tal:repeat="avail batch"> @@ -111,6 +118,8 @@ tal:condition="not:comp" tal:content="avail/component"/> <td class="tablevalues" + tal:content="avail/systems" /> + <td class="tablevalues" tal:condition="comp"> <a tal:content="avail/component" tal:attributes="href comp/getPrimaryUrlPath"/> @@ -123,7 +132,10 @@ <form metal:use-macro="here/zenTableNavigation/macros/navtool"/> </td> </tr> -</table> + +</tal:block> +</tal:block> +</form> </span> </tal:block> </tal:block> |
From: <sv...@ze...> - 2007-04-26 20:23:38
|
Author: marc Date: 2007-04-26 16:23:36 -0400 (Thu, 26 Apr 2007) New Revision: 4894 Modified: trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt Log: #1324 * Table/Form Removed Modified: trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt 2007-04-26 20:00:37 UTC (rev 4893) +++ trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt 2007-04-26 20:23:36 UTC (rev 4894) @@ -7,93 +7,6 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> -<form action="_" method="post" tal:attributes="action here/REQUEST/URL1"> - -<input type="hidden" name="zenScreenName" - tal:attributes="value template/id" /> - - -<tal:block tal:define="tabletitle string:Device Management;"> -<tal:block metal:use-macro="here/zenuimacros/macros/zentable"> -<tal:block metal:fill-slot="zentablecontents"> - -<!-- BEGIN TABLE CONTENTS --> - <tal:block metal:use-macro="here/userCommandsMacros/macros/runCommand" /> - <tr> - <td class="tableheader" align="left">Device Class Path</td> - <td class="tableheader" align="left" colspan=3> - <select class="tableheader" name="moveTarget" - tal:define=" - dcs here/deviceMoveTargets; - curdc here/getDeviceClassName" - > - <option tal:repeat="dc dcs" - tal:attributes="value dc; selected python:dc==curdc" - tal:content="dc">/Server/Linux</option> - </select> - <input type="hidden" name="deviceNames" - tal:attributes="value here/getId" /> - <input class="tableheader" type="submit" name="moveDevices:method" - value="Change" /> - </td> - </tr> - <tr> - <td class=tableheader>Run configuration collection against this device</td> - <td class=tableheader> - <input class="tableheader" type="submit" name="collectDevice:method" - value=" Collect Configuration " /> - </td> - </tr> - <tr> - <td class=tableheader>Reset the manage ip of this device</td> - <td class=tableheader> - <input class="tableheader" type="text" name="ip" size="15" - onkeypress="return submitViaEnter(event, 'setManageIp');" - tal:attributes="value here/getManageIp"/> - <input class="tableheader" type="submit" name="setManageIp:method" - value=" reset ip " /> - </td> - </tr> - <tr> - <td class=tableheader>Reset the SNMP Community of this device</td> - <td class=tableheader> - <input class="tableheader" type="submit" - name="manage_snmpCommunity:method" value=" reset community " /> - </td> - </tr> - <tr> - <td class=tableheader>Change the name of this device</td> - <td class=tableheader> - <input class="tableheader" type="text" name="newId" size="25" - onkeypress="return submitViaEnter(event, 'renameDevice')" /> - <input class="tableheader" type="submit" name="renameDevice:method" - value=" rename device " /> - </td> - </tr> - <tr> - <td class=tableheader>Clear heartbeat events on this device</td> - <td class=tableheader> - <input class="tableheader" type="submit" - name="manage_deleteHeartbeat:method" value=" Clear " /> - </td> - </tr> - <tr> - <td class=tableheader>Delete this device from the database</td> - <td class=tableheader> - <input class="tableheader" type="submit" name="deleteDevice:method" - value=" Delete Device " /> - </td> - </tr> -<!-- END TABLE CONTENTS --> - -</tal:block> -</tal:block> -</tal:block> - -</form> - -<span metal:use-macro="here/templates/macros/contentSeparator"/> - <span metal:use-macro="here/userCommandsMacros/macros/userCommandsTable" /> <span metal:use-macro="here/templates/macros/contentSeparator"/> @@ -105,7 +18,6 @@ metal:define-macro="adminRolesTable"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> - <tal:block tal:define=" objects here/adminRoles/objectValuesAll; editable here/isManager; @@ -169,7 +81,7 @@ </tr> </tal:block> <tr> - <td colspan="5" class="tableheader"> + <td colspan="0" class="tableheader"> <span metal:use-macro="here/zenTableNavigation/macros/navbody" /> </td> </tr> |
From: <sv...@ze...> - 2007-04-26 20:00:45
|
Author: ian Date: 2007-04-26 16:00:37 -0400 (Thu, 26 Apr 2007) New Revision: 4893 Modified: trunk/Products/ZenEvents/EventManagerBase.py trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt trunk/Products/ZenModel/EventView.py Log: * fixes #1305: Made history page respect date fields Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-04-26 19:54:48 UTC (rev 4892) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-04-26 20:00:37 UTC (rev 4893) @@ -942,6 +942,7 @@ security.declareProtected('View','getJSONEventsInfo') def getJSONEventsInfo(self, context, offset=0, count=50, getTotalCount=True, + startdate=None, enddate=None, filter='', severity=2, state=1, orderby='', **kwargs): """ Event data in JSON format. @@ -950,7 +951,7 @@ data, totalCount = self.getEventListME(context, offset=offset, rows=count, resultFields=fields, getTotalCount=getTotalCount, filter=filter, severity=severity, - state=state, orderby=orderby) + state=state, orderby=orderby, startdate=startdate, enddate=enddate) results = [x.getDataForJSON(fields) + [x.getCssClass()] for x in data] return simplejson.dumps((results, totalCount)) Modified: trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt 2007-04-26 19:54:48 UTC (rev 4892) +++ trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt 2007-04-26 20:00:37 UTC (rev 4893) @@ -10,24 +10,6 @@ src="/zport/portal_skins/zenevents/zeneventsfuncs.js"></script> <script type="text/javascript" src="/zport/portal_skins/zenmodel/datePicker.js"> </script> -<script type="text/javascript"> -function datePickerClosed(targetInput) { - if (targetInput.name == "startdate") { - startdate = targetInput.value; - enddateInput = targetInput.form.enddate; - } else { - startdate = targetInput.form.startdate.value; - enddateInput = targetInput; - } - var sdate = getFieldDate(startdate); - var edate = getFieldDate(enddateInput.value); - if (sdate.getTime() + 86400000 >= edate.getTime()) { - edate = new Date(sdate.getTime() + 86400000); - enddateInput.value = getDateString(edate); - } - return true; -}; -</script> <form method="post" tal:attributes="action here/absolute_url_path" name="history_events" @@ -67,8 +49,6 @@ tal:attributes="value here/todayDate"/> <input class="tableheader" type="button" value="select" onclick="displayDatePicker('enddate');" /> - <input class="tableheader" type="submit" name="search" value=" Search " - onclick="getTablePage(this.form);return false;"/> </div> </tal:block> @@ -106,6 +86,31 @@ '${here/absolute_url_path}', 1 ); });"> </script> + +<script type="text/javascript"> +function datePickerClosed(targetInput) { + if (targetInput.name == "startdate") { + startdate = targetInput.value; + enddateInput = targetInput.form.enddate; + } else { + startdate = targetInput.form.startdate.value; + enddateInput = targetInput; + } + var sdate = getFieldDate(startdate); + var edate = getFieldDate(enddateInput.value); + if (sdate.getTime() + 86400000 >= edate.getTime()) { + edate = new Date(sdate.getTime() + 86400000); + enddateInput.value = getDateString(edate); + } + myzengrid.refreshWithParams({ + startdate:$('startdate').value, + enddate:$('enddate').value + }); + return true; + +}; +</script> + </td></tr> <!-- END TABLE CONTENTS --> Modified: trunk/Products/ZenModel/EventView.py =================================================================== --- trunk/Products/ZenModel/EventView.py 2007-04-26 19:54:48 UTC (rev 4892) +++ trunk/Products/ZenModel/EventView.py 2007-04-26 20:00:37 UTC (rev 4893) @@ -48,6 +48,7 @@ def getJSONHistoryEventsInfo(self, offset=0, count=50, fields=[], getTotalCount=True, + startdate=None, enddate=None, filter='', severity=2, state=1, orderby='', REQUEST=None): """Return the current event list for this managed entity. |
From: <sv...@ze...> - 2007-04-26 19:54:47
|
Author: marc Date: 2007-04-26 15:54:48 -0400 (Thu, 26 Apr 2007) New Revision: 4892 Modified: trunk/Products/ZenRelations/ZenPropertyManager.py Log: #1315 * It was comparing a tuple against a list, converting to tuples before a compare Modified: trunk/Products/ZenRelations/ZenPropertyManager.py =================================================================== --- trunk/Products/ZenRelations/ZenPropertyManager.py 2007-04-26 19:47:42 UTC (rev 4891) +++ trunk/Products/ZenRelations/ZenPropertyManager.py 2007-04-26 19:54:48 UTC (rev 4892) @@ -214,8 +214,12 @@ if pfilt(name): if self.zenPropIsPassword(name) and self._onlystars(value): continue - if getattr(self, name, None) != value: + if name == 'zCollectorPlugins': + if tuple(getattr(self, name, ())) != tuple(value): + self.setZenProperty(name, value) + elif getattr(self, name, None) != value: self.setZenProperty(name, value) + return self.callZenScreen(REQUEST) |
From: <sv...@ze...> - 2007-04-26 19:47:43
|
Author: ian Date: 2007-04-26 15:47:42 -0400 (Thu, 26 Apr 2007) New Revision: 4891 Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js Log: * fixes #1322: Connected the appropriate evids to the event detail mag glasses Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 19:33:44 UTC (rev 4890) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 19:47:42 UTC (rev 4891) @@ -192,7 +192,9 @@ this.rowHeight = 32; this.checkedArray = new Array(); this.url = this.absurl + '/' + url; - this.lastparams = {}; + this.lastparams = this.isHistory?{startdate:$('startdate').value, + enddate:$('enddate').value }: + {}; this.fields = []; this.fieldMapping = { summary: -2, @@ -496,8 +498,8 @@ return false; }, populateTable: function(data) { - var zem = this.isHistory?'/zport/dmd/ZenEventHistory': - '/zport/dmd/ZenEventManager'; + var zem = this.isHistory?this.absurl+'/ZenEventHistory': + this.absurl+'/ZenEventManager'; var tableLength = data.length > this.numRows ? this.numRows : data.length; if (tableLength != this.rowEls.length){ @@ -526,9 +528,10 @@ var lastcol = yo[yo.length-1]; setElementClass(divs[yo.length-1], 'event_detail'); disconnectAll(divs[yo.length-1]); - connect(divs[yo.length-1], 'onclick', function() { - eventWindow(zem, evid); - }); + var geteventwindow = function(zeml, evidl) { + return function() { eventWindow(zeml, evidl) } + } + connect(divs[yo.length-1], 'onclick', geteventwindow(zem, evid)); divs[yo.length-1].title = "View detailed information" + " about this event." for (j=isManager?1:0;j<yo.length-1;j++) { |
From: <sv...@ze...> - 2007-04-26 19:33:44
|
Author: marc Date: 2007-04-26 15:33:44 -0400 (Thu, 26 Apr 2007) New Revision: 4890 Modified: trunk/Products/ZenEvents/EventClass.py trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/skins/zenmodel/templates.pt Log: #1319 * When no tabs are present, the global context menu does not appear * Event Console not showing tabs * Device List not showing tabs * DeviceClasses show tabs * EventClasses show tabs Modified: trunk/Products/ZenEvents/EventClass.py =================================================================== --- trunk/Products/ZenEvents/EventClass.py 2007-04-26 19:29:35 UTC (rev 4889) +++ trunk/Products/ZenEvents/EventClass.py 2007-04-26 19:33:44 UTC (rev 4890) @@ -135,7 +135,8 @@ def zentinelTabs(self, templateName): - if templateName == 'viewEvents': return [] + if self.id == self.dmdRootName and templateName == 'viewEvents': + return [] return super(EventClass, self).zentinelTabs(templateName) Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2007-04-26 19:29:35 UTC (rev 4889) +++ trunk/Products/ZenModel/DeviceClass.py 2007-04-26 19:33:44 UTC (rev 4890) @@ -133,7 +133,8 @@ def zentinelTabs(self, templateName): - if templateName == 'deviceList': return [] + if self.id == self.dmdRootName and templateName == 'deviceList': + return [] return super(DeviceClass, self).zentinelTabs(templateName) Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-26 19:29:35 UTC (rev 4889) +++ trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-26 19:33:44 UTC (rev 4890) @@ -268,10 +268,11 @@ <!-- ====================================================== tabsPane ====================================================== --> -<div id="tabsPane" metal:define-macro="tabsPane"> - <table class="tabtable" cellpadding="0" cellspacing="0" +<div id="tabsPane" metal:define-macro="tabsPane" tal:define="ztabs python:here.zentinelTabs(template.id); tabnames python:[x['name'] for x in ztabs]"> + <table class="tabtable" cellpadding="0" cellspacing="0" + tal:condition="ztabs"> <tr> <td tal:repeat="tab ztabs" tal:attributes="class python:tab.get('selected', None) |
From: <sv...@ze...> - 2007-04-26 19:29:38
|
Author: ian Date: 2007-04-26 15:29:35 -0400 (Thu, 26 Apr 2007) New Revision: 4889 Added: trunk/Products/ZenWidgets/skins/zenui/img/arrow.u.gif Modified: trunk/Products/ZenWidgets/skins/zenui/css/zengrid.css trunk/Products/ZenWidgets/skins/zenui/img/arrow.d.gif trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js Log: * Added sorting to the zengrid widget Modified: trunk/Products/ZenWidgets/skins/zenui/css/zengrid.css =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/css/zengrid.css 2007-04-26 19:07:48 UTC (rev 4888) +++ trunk/Products/ZenWidgets/skins/zenui/css/zengrid.css 2007-04-26 19:29:35 UTC (rev 4889) @@ -42,19 +42,20 @@ cursor: pointer; } .zg_headers { + height: 20px; position: relative; left: 1px; - height: 20px !important; } .zg_headers td.cell { font-weight: bold; padding 0; border: medium none; border-right: 1px solid #888; - height:20px !important; + height:20px; } .zg_headers td.cell div.cell_inner { - height:20px !important; + height:20px; + width: 85%; } div.event_detail { background: transparent url(img/event_detail.png) top left; @@ -71,6 +72,7 @@ color: white; } div.cell_inner { + background-color: transparent; padding:0 3px;margin:0; overflow:hidden; height: 32px; Modified: trunk/Products/ZenWidgets/skins/zenui/img/arrow.d.gif =================================================================== (Binary files differ) Added: trunk/Products/ZenWidgets/skins/zenui/img/arrow.u.gif Property changes on: trunk/Products/ZenWidgets/skins/zenui/img/arrow.u.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 19:07:48 UTC (rev 4888) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 19:29:35 UTC (rev 4889) @@ -194,8 +194,17 @@ this.url = this.absurl + '/' + url; this.lastparams = {}; this.fields = []; + this.fieldMapping = { + summary: -2, + firstTime: 0, + lastTime: 0, + component: -1, + count: +3 + } this.lastOffset = 0; this.lastPixelOffset = this.lastPixelOffset || 0; + var isMSIE//@cc_on=1; + this.rowSizePlus = this.rowHeight+(isMSIE?5:3); this.buildHTML(); this.selectstatus = 'none'; this.clearFirst = false; @@ -285,13 +294,6 @@ }, getColLengths: function() { var lens = new Array(); - this.fieldMapping = { - summary: -2, - firstTime: 0, - lastTime: 0, - component: -1, - count: +3 - } this.fieldOffsetTotal = 0; for (i=0;i<this.fields.length;i++) { var field = this.fields[i]; @@ -375,8 +377,8 @@ if (parseFloat(w)<3) w=String(3); return createDOM( 'col', {width: w+'%'}, null) }, widths); - cols[0].width='0*'; - cols[cols.length-1].width='32'; + updateNodeAttributes(cols[0], {width:'0*'}); + updateNodeAttributes(cols[cols.length-1], {width:'32'}); colgroup = createDOM('colgroup', {span:widths.length, height:'32px'}, cols); return colgroup; @@ -384,15 +386,45 @@ connectHeaders: function(cells) { for(i=isManager?1:0;i<cells.length;i++) { setStyle(cells[i], {'cursor':'pointer'}); - connect(cells[i], 'onclick', - bind(function(e) { - var cell = e.src(); - var f = cell.getElementsByTagName('div')[0].innerHTML; - this.refreshWithParams({'orderby': f }); - }, this) - ); + connect(cells[i], 'onclick', this.toggleSortOrder); } }, + toggleSortOrder: function(e) { + var cell = e.src(); + var f = cell.getElementsByTagName('div')[0].innerHTML; + var headcells = this.headers.getElementsByTagName('td'); + var clearcell = function(cell){setStyle(cell,{'background':null,'color':null})} + map(clearcell, headcells); + if (this.lastparams) { + switch(this.lastparams['orderby']) { + case (f + ' ASC'): + setStyle(cell, { + 'background':'#888 url(img/arrow.d.gif) right no-repeat', + 'color':'white' + }); + this.refreshWithParams({'orderby': f + ' DESC'}); + return; + case (f + ' DESC'): + clearcell(cell); + this.refreshWithParams({'orderby': ''}); + return; + default: + setStyle(cell, { + 'background':'#888 url(img/arrow.u.gif) right no-repeat', + 'color':'white' + }); + this.refreshWithParams({'orderby':f + ' ASC'}); + return; + } + } else { + setStyle(cell, { + 'background':'#888 url(img/arrow.u.gif) right no-repeat', + 'color':'white' + }); + this.refreshWithParams({'orderby':f + ' ASC'}); + } + + }, refreshWidths: function() { var widths = this.getColLengths(); var parentwidth = getElementDimensions(this.viewport).w; @@ -408,10 +440,8 @@ var numcols = this.fields.length; var fields = map(function(x){return x[0]}, this.fields); this.refreshWidths(); - this.colgroup = swapDOM(this.colgroup, this.getColgroup()); this.headcolgroup = swapDOM(this.headcolgroup, this.getColgroup()); - var headerrow = this.getBlankRow('head'); replaceChildNodes(this.headers.getElementsByTagName('tbody')[0], headerrow); @@ -444,7 +474,7 @@ {h:parseInt(this.rowToPixel(numrows))} ); var scrollHeight = parseInt(this.rowToPixel(numrows)); - if (scrollHeight<=getElementDimensions(this.zgtable).h) { + if (scrollHeight<=getElementDimensions(this.zgtable).h-2) { setStyle(this.scrollbar, {'display':'none'}); } else { setElementDimensions(this.scrollbar, {h:scrollHeight}); @@ -491,11 +521,9 @@ mydata = concat([''],mydata); divs[0].innerHTML = chkbox; setStyle(divs[0], {'width':'20px'}); - //setElementClass(firstcol, 'cell ' + mydata[mydata.length-1]) connect($(evid), 'onclick', this.markAsChecked); } var lastcol = yo[yo.length-1]; - //setElementClass(lastcol, 'cell ' + mydata[mydata.length-1]) setElementClass(divs[yo.length-1], 'event_detail'); disconnectAll(divs[yo.length-1]); connect(divs[yo.length-1], 'onclick', function() { @@ -507,9 +535,6 @@ var cellwidth = this.abswidths[j] divs[j].innerHTML = mydata[j]; yo[j].title = mydata[j]; - //var newClass = 'cell ' + mydata[mydata.length-1]; - //if (yo[j].className!=newClass) - //setElementClass(yo[j], newClass) } } @@ -553,10 +578,8 @@ TFOOT(null, null) ]); this.viewport = DIV( {id: getId('viewport')}, this.zgtable ); - this.statusBar = DIV( {id:getId('statusbar'), class:'zg_statusbar'}, - SPAN({id:'currentRows'}, String(0+1 + '-' + - parseInt(parseInt(0)+parseInt(this.numRows)) + - ' of ' + this.buffer.totalRows)), + this.statusBar = DIV( {id:getId('statusbar'), 'class':'zg_statusbar'}, + SPAN({id:'currentRows'}, String(0+1 +'-'+ parseInt(parseInt(0)+parseInt(this.numRows)) + ' of ' + this.buffer.totalRows)), [ 'Select: ', UL(null, [ @@ -567,7 +590,7 @@ ]) ] ); - this.headers = TABLE( {id: getId('headers'), class:"zg_headers", + this.headers = TABLE( {id: getId('headers'), 'class':"zg_headers", cellspacing:0, cellpadding:0}, [ this.headcolgroup, TBODY(null, null) @@ -586,6 +609,7 @@ }); setStyle(this.innercont, { 'width':'100%' + }); setStyle(this.viewport, { 'width':'98%', @@ -593,11 +617,12 @@ 'overflow':'hidden', 'float':'left', 'border':'1px solid black', - 'border-right':'medium none' + 'border-right':'medium none', + 'border-bottom':'medium none' }); addElementClass(this.viewport, 'leftfloat'); setStyle(this.scrollbar, - { 'border': '1px solid black', + { //'border': '1px solid black', 'border-left': 'medium none', 'overflow': 'auto', 'z-index':'300', @@ -622,10 +647,10 @@ ); }, rowToPixel: function(row) { - return row * (this.rowHeight+4); + return row * (this.rowSizePlus); }, pixelToRow: function(pixel) { - var prow = parseInt(pixel/(this.rowHeight+4)); + var prow = parseInt(pixel/(this.rowSizePlus)); return Math.max(0, prow); }, scrollToPixel: function(pixel) { @@ -633,8 +658,8 @@ if (diff==0.00) return; var sign = Math.abs(diff)/diff; pixel = sign<0? - Math.ceil(pixel/(this.rowHeight+4))*(this.rowHeight+4): - Math.floor(pixel/(this.rowHeight+4))*(this.rowHeight+4); + Math.ceil(pixel/(this.rowSizePlus))*(this.rowSizePlus): + Math.floor(pixel/(this.rowSizePlus))*(this.rowSizePlus); var newOffset = this.pixelToRow(pixel); this.updateStatusBar(newOffset); if (newOffset==0) this.refreshTable(newOffset); @@ -702,14 +727,16 @@ }, showLoading: function() { clearTimeout(this.isLoading); - this.isLoading = setTimeout( bind(function() { - var p = this.getViewportCenter(); - var d = getElementDimensions(this.loadingbox); - var pos = {x:p.x-(d.w/2),y:p.y-(d.h/2)}; - this.loadingbox.style.top = pos.y; - this.loadingbox.style.left = pos.x; - this.loadingbox.show(p); - }, this), 500); + var isIE//@cc_on=1; + if(isIE) createLoggingPane(); +// //this.isLoading = setTimeout( bind(function() { +// //var p = this.getViewportCenter(); +// var d = getElementDimensions(this.loadingbox); +// var pos = {x:p.x-(d.w/2),y:p.y-(d.h/2)}; +// //this.loadingbox.style.top = pos.y; +// //this.loadingbox.style.left = pos.x; +// this.loadingbox.show(p); +// }, this), 500); }, killLoading: function() { clearTimeout(this.isLoading); @@ -717,9 +744,30 @@ this.loadingbox.hide(); } }, - resizeColumn: function(index, pixeldiff) { + resizeColumn: function(index, fromindex, pixeldiff) { var cols = this.colgroup.getElementsByTagName('col'); - var old = cols(index).width; + var hcols = this.headcolgroup.getElementsByTagName('col'); + var oldint = parseFloat(cols[index].width); + var oldfint = parseFloat(cols[fromindex].width); + var parentwidth = getElementDimensions(this.viewport).w; + var old = (oldint/100.00) * parentwidth; + var fold = (oldfint/100.00) * parentwidth; + var neww = (old + pixeldiff)/parentwidth * 100.00; + var feww = (pixeldiff - fold)/parentwidth * 100.00; + var tofield = this.fields[index][0]; + var toval = this.fieldMapping[tofield]; + var fromfield = this.fields[fromindex][0]; + var fromval = this.fieldMapping[fromfield]; + if (pixeldiff>0&&(neww<0||feww>0)) + neww=toval; + if (pixeldiff<0&&(feww<0||neww>0)) + neww=fromval; + neww = oldint-neww; + this.fieldMapping[tofield] = Math.max(toval-neww, oldint); + this.fieldMapping[fromfield] = Math.min(fromval+neww, -oldint); + this.colgroup = swapDOM(this.colgroup, this.getColgroup()); + this.headcolgroup = swapDOM(this.headcolgroup, this.getColgroup()); + //this.refreshTable(this.lastOffset); } } |
From: <sv...@ze...> - 2007-04-26 19:07:53
|
Author: marc Date: 2007-04-26 15:07:48 -0400 (Thu, 26 Apr 2007) New Revision: 4888 Modified: trunk/Products/ZenModel/Device.py Log: #1315 * When blank zSnmpCommunity is not created Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-04-26 19:02:07 UTC (rev 4887) +++ trunk/Products/ZenModel/Device.py 2007-04-26 19:07:48 UTC (rev 4888) @@ -772,7 +772,8 @@ """edit device relations and attributes""" self.hw.tag = tag self.hw.serialNumber = serialNumber - if self.zSnmpCommunity != zSnmpCommunity: + if (zSnmpCommunity and + self.zSnmpCommunity != zSnmpCommunity): self.setZenProperty("zSnmpCommunity", zSnmpCommunity) if self.zSnmpPort != zSnmpPort: self.setZenProperty("zSnmpPort", zSnmpPort) |
From: <sv...@ze...> - 2007-04-26 19:02:07
|
Author: edahl Date: 2007-04-26 15:02:07 -0400 (Thu, 26 Apr 2007) New Revision: 4887 Added: trunk/Products/ZenModel/migrate/zpropscleanup.py Modified: trunk/Products/ZenModel/migrate/__init__.py trunk/Products/ZenModel/migrate/zCollectorPlugins.py Log: * migration code to cleanup some zproperties and add default plugin lists Modified: trunk/Products/ZenModel/migrate/__init__.py =================================================================== --- trunk/Products/ZenModel/migrate/__init__.py 2007-04-26 19:00:56 UTC (rev 4886) +++ trunk/Products/ZenModel/migrate/__init__.py 2007-04-26 19:02:07 UTC (rev 4887) @@ -79,3 +79,4 @@ import evenbetterstandarderrormessage import zCollectorPlugins import zenpackdatasources +import zpropscleanup Modified: trunk/Products/ZenModel/migrate/zCollectorPlugins.py =================================================================== --- trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-26 19:00:56 UTC (rev 4886) +++ trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-26 19:02:07 UTC (rev 4887) @@ -12,14 +12,141 @@ ########################################################################### import Migrate from Acquisition import aq_base +from Products.ZenModel.DeviceClass import DeviceClass class zCollectorPlugins(Migrate.Step): version = Migrate.Version(1, 2, 0) + clist = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.InterfaceMap', + 'zenoss.snmp.RouteMap', + ) + def cutover(self, dmd): if not hasattr(aq_base(dmd.Devices), 'zCollectorPlugins'): - dmd.Devices._setProperty("zCollectorPlugins", [], type='lines') + dmd.Devices._setProperty("zCollectorPlugins", clist, type='lines') + if not dmd.Devices.zCollectorPlugins: + dmd.Devices.zCollectorPlugins = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.InterfaceMap', + 'zenoss.snmp.RouteMap', + ) + if not dmd.Devices.Server.zCollectorPlugins: + dmd.Devices.Server.zCollectorPlugins = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.DellDeviceMap', + 'zenoss.snmp.HPDeviceMap', + 'zenoss.snmp.InterfaceMap', + 'zenoss.snmp.RouteMap', + 'zenoss.snmp.IpServiceMap', + 'zenoss.snmp.HRFileSystemMap', + 'zenoss.snmp.HRSWInstalledMap', + 'zenoss.snmp.HRSWRunMap', + 'zenoss.snmp.CpuMap', + 'zenoss.snmp.DellCPUMap', + 'zenoss.snmp.DellPCIMap', + 'zenoss.snmp.HPCPUMap', + ) + if not aq_base(hasattr(dmd.Devices.Server,'Scan')): + scan = DeviceClass('Scan') + dmd.Devices.Server._setObject('Scan',scan) + + if not dmd.Devices.Server.Scan.zCollectorPlugins: + dmd.Devices.Server.Scan.zCollectorPlugins = ( + 'zenoss.portscan.IpServiceMap', + ) + + if not aq_base(hasattr(dmd.Devices.Server,'Cmd')): + cmd = DeviceClass('Cmd') + dmd.Devices.Server._setObject('Cmd', cmd) + + if not dmd.Devices.Server.Cmd._getOb('zCollectorPlugins',False): + dmd.Devices.Server.Cmd.zCollectorPlugins = ( + 'zenoss.cmd.uname', + 'zenoss.cmd.df', + 'zenoss.cmd.linux.ifconfig', + 'zenoss.cmd.linux.memory', + 'zenoss.cmd.linux.netstat_an', + 'zenoss.cmd.linux.netstat_rn', + 'zenoss.cmd.linux.process', + 'zenoss.cmd.darwin.cpu', + 'zenoss.cmd.darwin.ifconfig', + 'zenoss.cmd.darwin.memory', + 'zenoss.cmd.darwin.netstat_an', + 'zenoss.cmd.darwin.process', + 'zenoss.cmd.darwin.swap', + ) + + + if not dmd.Devices.Server.Linux._getOb('zCollectorPlugins',False): + dmd.Devices.Server.Linux.zCollectorPlugins = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.DellDeviceMap', + 'zenoss.snmp.HPDeviceMap', + 'zenoss.snmp.InterfaceMap', + 'zenoss.snmp.RouteMap', + 'zenoss.snmp.IpServiceMap', + 'zenoss.snmp.HRFileSystemMap', + 'zenoss.snmp.HRSWRunMap', + 'zenoss.snmp.CpuMap', + 'zenoss.snmp.DellCPUMap', + 'zenoss.snmp.DellPCIMap', + 'zenoss.snmp.HPCPUMap', + ) + + if not dmd.Devices.Server.Windows._getOb('zCollectorPlugins',False): + dmd.Devices.Server.Windows.zCollectorPlugins = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.DellDeviceMap', + 'zenoss.snmp.HPDeviceMap', + 'zenoss.snmp.InterfaceMap', + 'zenoss.snmp.RouteMap', + 'zenoss.snmp.IpServiceMap', + 'zenoss.snmp.HRFileSystemMap', + 'zenoss.snmp.HRSWInstalledMap', + 'zenoss.snmp.HRSWRunMap', + 'zenoss.snmp.CpuMap', + 'zenoss.snmp.DellCPUMap', + 'zenoss.snmp.DellPCIMap', + 'zenoss.snmp.HPCPUMap', + 'zenoss.snmp.InformantHardDiskMap', + ) + + if not dmd.Devices.Power._getOb('zCollectorPlugins',False): + dmd.Devices.Power.zCollectorPlugins = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.APCDeviceMap', + 'zenoss.snmp.PowerwareDeviceMap', + ) + + if not dmd.Devices.Network._getOb('zCollectorPlugins',False): + dmd.Devices.Network.Router.zCollectorPlugins = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.InterfaceMap', + 'zenoss.snmp.RouteMap', + ) + + if not dmd.Devices.Network.Router.Cisco._getOb( + 'zCollectorPlugins',False): + dmd.Devices.Network.Router.Cisco.zCollectorPlugins = ( + 'zenoss.snmp.NewDeviceMap', + 'zenoss.snmp.DeviceMap', + 'zenoss.snmp.CiscoMap', + 'zenoss.snmp.InterfaceMap', + 'zenoss.snmp.CiscoHSRP', + 'zenoss.snmp.RouteMap', + ) + zCollectorPlugins() Added: trunk/Products/ZenModel/migrate/zpropscleanup.py |
From: <sv...@ze...> - 2007-04-26 19:01:02
|
Author: edahl Date: 2007-04-26 15:00:56 -0400 (Thu, 26 Apr 2007) New Revision: 4886 Modified: trunk/Products/ZenRelations/RelCopySupport.py Log: * missing import masking exception Modified: trunk/Products/ZenRelations/RelCopySupport.py =================================================================== --- trunk/Products/ZenRelations/RelCopySupport.py 2007-04-26 18:57:38 UTC (rev 4885) +++ trunk/Products/ZenRelations/RelCopySupport.py 2007-04-26 19:00:56 UTC (rev 4886) @@ -22,6 +22,7 @@ __version__ = '$Revision: 1.15 $' +import sys import types # base class for RelCopyContainer |
From: <sv...@ze...> - 2007-04-26 18:57:46
|
Author: edahl Date: 2007-04-26 14:57:15 -0400 (Thu, 26 Apr 2007) New Revision: 4884 Added: trunk/Products/ZenReports/plugins/swinventory.py Log: * new backend for software reprot Added: trunk/Products/ZenReports/plugins/swinventory.py |
From: <sv...@ze...> - 2007-04-26 18:57:46
|
Author: jstevens Date: 2007-04-26 14:57:38 -0400 (Thu, 26 Apr 2007) New Revision: 4885 Modified: trunk/Products/ZenUtils/CheckRelations.py Log: Now subclasses ZenScriptBase instead of ZCmdBase Modified: trunk/Products/ZenUtils/CheckRelations.py =================================================================== --- trunk/Products/ZenUtils/CheckRelations.py 2007-04-26 18:57:15 UTC (rev 4884) +++ trunk/Products/ZenUtils/CheckRelations.py 2007-04-26 18:57:38 UTC (rev 4885) @@ -27,9 +27,9 @@ from Products.ZenUtils.Utils import getAllConfmonObjects -from ZCmdBase import ZCmdBase +from ZenScriptBase import ZenScriptBase -class CheckRelations(ZCmdBase): +class CheckRelations(ZenScriptBase): def rebuild(self): repair = self.options.repair @@ -53,7 +53,7 @@ def buildOptions(self): - ZCmdBase.buildOptions(self) + ZenScriptBase.buildOptions(self) self.parser.add_option('-r', '--repair', dest='repair', action="store_true", @@ -69,5 +69,5 @@ if __name__ == "__main__": - tmbk = CheckRelations() + tmbk = CheckRelations(connect=True) tmbk.rebuild() |
From: <sv...@ze...> - 2007-04-26 18:57:32
|
Author: jstevens Date: 2007-04-26 14:57:02 -0400 (Thu, 26 Apr 2007) New Revision: 4883 Modified: trunk/bin/zenchkrels Log: No longer called as a daemon Modified: trunk/bin/zenchkrels =================================================================== --- trunk/bin/zenchkrels 2007-04-26 18:15:34 UTC (rev 4882) +++ trunk/bin/zenchkrels 2007-04-26 18:57:02 UTC (rev 4883) @@ -10,4 +10,4 @@ # For complete information please visit: http://www.zenoss.com/oss/ ############################################################################# . $ZENHOME/bin/zenfunctions -$PYTHON $ZENHOME/Products/ZenUtils/CheckRelations.py $* +$PYTHON $ZENHOME/Products/ZenUtils/CheckRelations.py "$CMD" $* |
From: <sv...@ze...> - 2007-04-26 18:15:45
|
Author: marc Date: 2007-04-26 14:15:34 -0400 (Thu, 26 Apr 2007) New Revision: 4882 Modified: trunk/Products/ZenModel/migrate/menus.py Log: #1314 * Moved "Lock" menu item Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-26 17:33:48 UTC (rev 4881) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-26 18:15:34 UTC (rev 4882) @@ -147,22 +147,6 @@ isdialog=True, allowed_classes = ['ZenPackable'], ), - dict(action='dialog_lock', - allowed_classes=['Device', - 'OperatingSystem', - 'WinService', - 'FileSystem', - 'HardDisk', - 'IpInterface', - 'IpService', - 'OSProcess', - 'IpRouteEntry'], - description='Lock', - ordering=10.0, - id='lockObject', - isdialog=True, - permissions=('Change Device',) - ), dict(action='dialog_deleteComponent', allowed_classes=['WinService', 'FileSystem', @@ -1057,6 +1041,22 @@ permissions=('Change Device',), allowed_classes = ('Device','OperatingSystem'), ), + dict(action='dialog_lock', + allowed_classes=['Device', + 'OperatingSystem', + 'WinService', + 'FileSystem', + 'HardDisk', + 'IpInterface', + 'IpService', + 'OSProcess', + 'IpRouteEntry'], + description='Lock', + ordering=10.0, + id='lockObject', + isdialog=True, + permissions=('Change Device',) + ), ], 'Add': [ dict( |
From: <sv...@ze...> - 2007-04-26 17:33:48
|
Author: jstevens Date: 2007-04-26 13:33:48 -0400 (Thu, 26 Apr 2007) New Revision: 4881 Modified: trunk/Products/ZenReports/reports/Performance_Reports/Interface_Utilization.rpt Log: refs #1204 * Added filter to Interface_Utilization report Modified: trunk/Products/ZenReports/reports/Performance_Reports/Interface_Utilization.rpt =================================================================== --- trunk/Products/ZenReports/reports/Performance_Reports/Interface_Utilization.rpt 2007-04-26 16:02:10 UTC (rev 4880) +++ trunk/Products/ZenReports/reports/Performance_Reports/Interface_Utilization.rpt 2007-04-26 17:33:48 UTC (rev 4881) @@ -16,8 +16,13 @@ <tal:block metal:use-macro="here/reportMacros/macros/utilizationForm"/> -<table class="zentable" cellpadding="3" cellspacing="1"> - <tr><th class="tabletitle" colspan="7">Monitored Interfaces</th></tr> +<form method="POST" tal:attributes="action request/URL; name string:deviceList" + tal:define="tabletitle string:Monitored Interfaces; + showfilterbox python:True; + tblcolspan string:7"> +<tal:block metal:use-macro="here/zenuimacros/macros/zentable"> +<tal:block metal:fill-slot="zentablecontents"> + <tr> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'device','Device')"/> @@ -53,10 +58,13 @@ <form metal:use-macro="here/zenTableNavigation/macros/navtool"/> </td> </tr> -</table> </tal:block> </tal:block> +</form> </tal:block> </tal:block> </tal:block> + +</tal:block> +</tal:block> |
From: <sv...@ze...> - 2007-04-26 16:02:14
|
Author: marc Date: 2007-04-26 12:02:10 -0400 (Thu, 26 Apr 2007) New Revision: 4880 Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_renameDevice.pt Log: #1246 * added check on renaming a device Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_renameDevice.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_renameDevice.pt 2007-04-26 15:53:44 UTC (rev 4879) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_renameDevice.pt 2007-04-26 16:02:10 UTC (rev 4880) @@ -6,8 +6,13 @@ <p> What would you like to name this device?<br/> +<span id="errmsg" style="color:red;"></span> <br/> -<input type="text" name="newId" size="25"/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="newId" + onblur="checkValidId(this.id)"><br/><br/> </p> <br/> <div id="dialog_buttons"> |
From: <sv...@ze...> - 2007-04-26 15:53:44
|
Author: marc Date: 2007-04-26 11:53:44 -0400 (Thu, 26 Apr 2007) New Revision: 4879 Modified: trunk/Products/ZenModel/DataRoot.py trunk/Products/ZenModel/ZenModelRM.py 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_addMenuItem.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addOIDMapping.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcessClass.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addReport.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addReportClass.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addTemplate.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addTrap.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addWinService.pt trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt trunk/Products/ZenUtils/js/zenutils.js trunk/Products/ZenWidgets/skins/zenui/dialog_addDataSource.pt trunk/Products/ZenWidgets/skins/zenui/dialog_addGraph.pt trunk/Products/ZenWidgets/skins/zenui/dialog_addManufacturer.pt trunk/Products/ZenWidgets/skins/zenui/dialog_addMonitor.pt trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt trunk/Products/ZenWidgets/skins/zenui/dialog_addOrganizer.pt trunk/Products/ZenWidgets/skins/zenui/dialog_addThreshold.pt trunk/Products/ZenWidgets/skins/zenui/dialog_addZenPack.pt Log: #1246 * made checkValidId available * Modified dialogs to use checkValidId * connected inputs to checkValidId Modified: trunk/Products/ZenModel/DataRoot.py =================================================================== --- trunk/Products/ZenModel/DataRoot.py 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/DataRoot.py 2007-04-26 15:53:44 UTC (rev 4879) @@ -18,12 +18,13 @@ name space. """ -import re +import re, sys from AccessControl import ClassSecurityInfo from AccessControl import getSecurityManager from OFS.OrderedFolder import OrderedFolder from OFS.CopySupport import CopyError, eNotSupported +from OFS.ObjectManager import checkValidId from ImageFile import ImageFile from Globals import HTMLFile, DTMLFile from Globals import InitializeClass @@ -38,6 +39,8 @@ import DateTime import socket +from urllib import unquote + from AccessControl import Permissions as permissions from ZenModelRM import ZenModelRM @@ -218,6 +221,21 @@ ZenModelRM.__init__(self, id, title) + def checkValidId(self, new_id): + """Checks a valid id""" + try: + checkValidId(self, unquote(new_id)) + return True + except: + return str(sys.exc_info()[1]) + + + def getResultFields(self): + """Result fields for dashboard. + """ + return ('device','summary','lastTime','count') + + def getEventCount(self, **kwargs): """Return the current event list for this managed entity. """ Modified: trunk/Products/ZenModel/ZenModelRM.py =================================================================== --- trunk/Products/ZenModel/ZenModelRM.py 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/ZenModelRM.py 2007-04-26 15:53:44 UTC (rev 4879) @@ -35,7 +35,6 @@ from Products.ZenRelations.ImportRM import ImportRM from Products.ZenRelations.RelationshipManager import RelationshipManager - class ZenModelRM(ZenModelBase, RelationshipManager, Historical, ZenPacker): """ Base class for all Persistent classes that have relationships. @@ -55,7 +54,6 @@ self.createdTime = DateTime(time.time()) RelationshipManager.__init__(self, id, title, buildRelations) - security.declareProtected('Manage DMD', 'rename') def rename(self, newId, REQUEST=None): """Delete device from the DMD""" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -4,9 +4,13 @@ What would you like to name your FileSystem?<br/> </p> <input type="hidden" name="userCreated" value="True"> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input name="id"><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> </p> <div id="dialog_buttons"> <input type="submit" name="addFileSystem:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -4,9 +4,13 @@ What would you like to name your IpInterface?<br/> </p> <input type="hidden" name="userCreated" value="True"> +<span id="errmsg" style="color:red;"></span> <br/> -<p style="text-align:center;"> -<input type="text" name="id"> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> </p> <div id="dialog_buttons"> <input type="submit" name="addIpInterface:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -2,8 +2,13 @@ <br/> <form method="post" tal:attributes="action here/absolute_url" name="addComponent"> <input type="hidden" name="userCreated" value="True"> +<span id="errmsg" style="color:red;"></span> +<br/> <p style="text-align:right;"> -Destination: <input name="dest"><br/><br/> +<span id="new_id_label">Destination: </span> +<input id="new_id" + name="dest" + onblur="checkValidId(this.id)"><br/><br/> Next Hop: <input name="nexthopid"><br/><br/> Interface: <select name="interface" tal:define="interfaces here/os/interfaces/objectValuesAll"> Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpService.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addIpService.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addIpService.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -4,9 +4,13 @@ What would you like to name your IpService?<br/> </p> <input type="hidden" name="userCreated" value="True"> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input name="id"><br/><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> Protocol: <select name="protocol"> <option tal:repeat="e python:('udp','tcp')" tal:content="e" tal:attributes="value e"/> Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addMenuItem.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addMenuItem.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addMenuItem.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -2,11 +2,16 @@ <p> What would you like to name your Menu Item?<br/> </p> +<span id="errmsg" style="color:red;"></span> +<br/> <p style="text-align:right;"> -ID: <input name="id"><br/> -Description: <input name="description"><br/> -Action: <input name="action"><br/> -Ordering: <input name="ordering" size="5"><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> +Description: <input name="description"><br/><br/> +Action: <input name="action"><br/><br/> +Ordering: <input name="ordering" size="5"><br/><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addZenMenuItem:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addOIDMapping.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addOIDMapping.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addOIDMapping.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -3,9 +3,13 @@ <p> What would you like to name your OID Mapping?<br/> </p> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input type="text" name="id"><br/><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> OID: <input type="text" name="oid"><br/><br/> Type: <input type="text" name="nodetype"> </p> Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -4,9 +4,13 @@ What would you like to name your OSProcess?<br/> </p> <input type="hidden" name="userCreated" value="True"> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input type="text" name="id"><br/><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> Process Class: <select name="className" tal:define="targets python:here.getDmdRoot('Processes').getOrganizerNames()"> <option tal:repeat="target targets" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcessClass.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcessClass.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcessClass.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -3,8 +3,13 @@ <p> What would you like to name your OSProcess?<br/> </p> +<span id="errmsg" style="color:red;"></span> +<br/> <p style="text-align:right;"> -Name: <input type="text" name="id"><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addOSProcessClass:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addReport.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addReport.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addReport.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -2,9 +2,13 @@ <p> What would you like to name your Report?<br/> </p> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input type="text" name="id"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addDeviceReport:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addReportClass.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addReportClass.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addReportClass.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -2,9 +2,13 @@ <p> What would you like to name your Report Organizer?<br/> </p> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input type="text" name="id"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addReportClass:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addTemplate.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addTemplate.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addTemplate.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -2,8 +2,13 @@ <p> What would you like to name your Template?<br/> </p> +<span id="errmsg" style="color:red;"></span> +<br/> <p style="text-align:right;"> -Name: <input type="text" name="id"/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addRRDTemplate:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addTrap.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addTrap.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addTrap.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -3,9 +3,13 @@ <p> What would you like to name your Trap?<br/> </p> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input type="text" name="id"><br/><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> OID: <input type="text" name="oid"><br/><br/> Type: <input type="text" name="nodetype"> </p> Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addWinService.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addWinService.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addWinService.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -4,9 +4,13 @@ What would you like to name your WinService?<br/> </p> <input type="hidden" name="userCreated" value="True"> +<span id="errmsg" style="color:red;"></span> <br/> <p style="text-align:right;"> -Name: <input name="id"><br/><br/> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> Description: <input name="description"><br/><br/> </p> <div id="dialog_buttons"> Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -11,7 +11,6 @@ <tal:block tal:define=" message request/message | string:State at time:; - editable editable; tabletitle string:${message} ${here/getNowString}; menu_id string:Lockable; editable python:manager and userCreated"> Modified: trunk/Products/ZenUtils/js/zenutils.js =================================================================== --- trunk/Products/ZenUtils/js/zenutils.js 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenUtils/js/zenutils.js 2007-04-26 15:53:44 UTC (rev 4879) @@ -44,3 +44,26 @@ event.preventDefault(); event.returnValue = false; } + +function checkValidId(input_id){ + var errmsg = $('errmsg'); + var input = $(input_id); + var label = $(input_id+'_label'); + var new_id = escape(input.value); + + errmsg.innerHTML = ""; + Morph(input_id, {"style": {"color": "black"}}); + Morph(label.id, {"style": {"color": "white"}}); + + d = callLater(0, doXHR, 'checkValidId', {queryString:{'new_id':new_id}}); + d.addCallback(function (r) { + if (r.responseText != 'True') { + Morph(input_id, {"style": {"color": "red"}}); + Morph(label.id, {"style": {"color": "red"}}); + errmsg.innerHTML = r.responseText; + shake(input); + shake(label); + shake(errmsg); + } + }); +} Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addDataSource.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addDataSource.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addDataSource.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -1,19 +1,19 @@ <h2>Add a New DataSource:</h2> <form tal:attributes="action here/absolute_url_path;" method="post" name="addDataSource"> <input type="hidden" name="zenScreenName" value="here/absolute_url_path"/> -<table> -<tr><td>Name: </td><td><input name="id"/></td></tr> -<tr> - <td>Type: </td> - <td> - <select name='dsOption'> - <option tal:repeat="option here/getDataSourceOptions" - tal:attributes="value python: option[1]" - tal:content="python: option[0]" /> - </select> - </td> -</tr> -</table> +<span id="errmsg" style="color:red;"></span> +<br/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/><br/> +Type: <select name='dsOption'> + <option tal:repeat="option here/getDataSourceOptions" + tal:attributes="value python: option[1]" + tal:content="python: option[0]" /> +</select> +</p> <br> <div align="center"> <input type="submit" name="manage_addRRDDataSource:method" value="Add"/> Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addGraph.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addGraph.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addGraph.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -1,10 +1,16 @@ <h2>Add a New Graph:</h2> <form tal:attributes="action here/absolute_url_path;" method="post" name="addGraph"> <input type="hidden" name="zenScreenName" value="here/absolute_url_path"/> -<table> -<tr><td>Name: </td><td><input name="id"/></td></tr> -</table> -<br> + +<span id="errmsg" style="color:red;"></span> +<br/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/> +</p> + <div align="center"> <input type="submit" name="manage_addRRDGraph:method" value="Add"/> <input id="dialog_cancel" type="button" value="Cancel" Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addManufacturer.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addManufacturer.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addManufacturer.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -1,10 +1,14 @@ <h2>Add Manufacturer</h2> <p> -What would you like to name this manufacturer? +What would you like to name this manufacturer?<br/> </p> +<span id="errmsg" style="color:red;"></span> <br/> -<p style="text-align:center;"> -<input type="text" name="manufacturerName"/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="manufacturerName" + onblur="checkValidId(this.id)"><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addManufacturer:method" Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addMonitor.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addMonitor.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addMonitor.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -1,10 +1,14 @@ <h2>Add Monitor</h2> <p> -What would you like to name this monitor? +What would you like to name this monitor?<br/> </p> +<span id="errmsg" style="color:red;"></span> <br/> -<p style="text-align:center;"> -<input type="text" name="id"/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addMonitor:method" Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -1,7 +1,14 @@ <h2>Add Network</h2> -<table> -<tr><td>Name: </td><td><input name="newPath"/></td></tr> -</table> + +<span id="errmsg" style="color:red;"></span> +<br/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="newPath" + onblur="checkValidId(this.id)"><br/> +</p> + <div id="dialog_buttons"> <input type="submit" name="manage_addOrganizer:method" value="Add Network" Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addOrganizer.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addOrganizer.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addOrganizer.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -2,9 +2,13 @@ <p> What would you like to name this organizer? </p> +<span id="errmsg" style="color:red;"></span> <br/> -<p style="text-align:center;"> -<input type="text" name="newPath"/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="newPath" + onblur="checkValidId(this.id)"><br/> </p> <div id="dialog_buttons"> <input type="submit" name="manage_addOrganizer:method" Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addThreshold.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addThreshold.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addThreshold.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -1,10 +1,15 @@ <h2>Add a New Theshold:</h2> <form tal:attributes="action here/absolute_url_path;" method="post" name="addThreshold"> <input type="hidden" name="zenScreenName" value="here/absolute_url_path"/> -<table> -<tr><td>Name: </td><td><input name="id"/></td></tr> -</table> -<br> + +<span id="errmsg" style="color:red;"></span> +<br/> +<p style="text-align:right;"> +<span id="new_id_label">ID: </span> +<input id="new_id" + name="id" + onblur="checkValidId(this.id)"><br/> + <div align="center"> <input type="submit" name="manage_addRRDThreshold:method" value="Add"/> <input id="dialog_cancel" type="button" value="Cancel" Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addZenPack.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addZenPack.pt 2007-04-26 15:02:56 UTC (rev 4878) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addZenPack.pt 2007-04-26 15:53:44 UTC (rev 4879) @@ -1,8 +1,17 @@ <h2>Create a new ZenPack:</h2> <form tal:attributes="action here/absolute_url_path;" method="post" name="addZenPack"> -<input type="hidden" name="zenScreenName" value="/zport/dmd/viewZenPacks"/> +<input type="hidden" name="zenScreenName" value="/zport/dmd/viewZenPacks"/> + +<span id="errmsg" style="color:red;"></span> + <table> -<tr><td>Name: </td><td><input name="id"/></td></tr> +<tr><td> + <span id="new_id_label">ID: </span>: +</td><td> + <input id="new_id" + name="id" + onblur="checkValidId(this.id)"> +</td></tr> <tr><td>Author: </td><td><input name="author"/></td></tr> <tr><td>Organization: </td><td><input name="organization"/></td></tr> <tr><td>Version: </td><td><input name="version"/></td></tr> |
From: <sv...@ze...> - 2007-04-26 15:02:58
|
Author: edahl Date: 2007-04-26 11:02:56 -0400 (Thu, 26 Apr 2007) New Revision: 4878 Modified: trunk/Products/ZenEvents/EventClass.py trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/skins/zenmodel/templates.pt Log: * reorg the left nav Modified: trunk/Products/ZenEvents/EventClass.py =================================================================== --- trunk/Products/ZenEvents/EventClass.py 2007-04-26 14:46:18 UTC (rev 4877) +++ trunk/Products/ZenEvents/EventClass.py 2007-04-26 15:02:56 UTC (rev 4878) @@ -78,15 +78,15 @@ 'icon' : 'EventClass.gif', 'product' : 'ZenEvents', 'factory' : 'manage_addEventClass', - 'immediate_view' : 'viewEvents', + 'immediate_view' : 'eventClassStatus', 'actions' : ( - { 'id' : 'events' - , 'name' : 'Events' - , 'action' : 'viewEvents' - , 'permissions' : ( - Permissions.view, ) - }, +# { 'id' : 'events' +# , 'name' : 'Events' +# , 'action' : 'viewEvents' +# , 'permissions' : ( +# Permissions.view, ) +# }, { 'id' : 'classes' , 'name' : 'Classes' , 'action' : 'eventClassStatus' @@ -133,6 +133,12 @@ ) severities = dict([(b, a) for a, b in severityConversions]) + + def zentinelTabs(self, templateName): + if templateName == 'viewEvents': return [] + return super(EventClass, self).zentinelTabs(templateName) + + def getSubEventClasses(self): """Return all EventClass objects below this one. """ Modified: trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-04-26 14:46:18 UTC (rev 4877) +++ trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-04-26 15:02:56 UTC (rev 4878) @@ -1,4 +1,4 @@ -<tal:block metal:use-macro="here/templates/macros/page2"> +<tal:block metal:use-macro="here/templates/macros/page3"> <tal:block metal:fill-slot="contentPane"> <link type="text/css" rel="stylesheet" href="css/zengrid.css"/> Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2007-04-26 14:46:18 UTC (rev 4877) +++ trunk/Products/ZenModel/DeviceClass.py 2007-04-26 15:02:56 UTC (rev 4878) @@ -102,14 +102,9 @@ 'icon' : 'DeviceClass_icon.gif', 'product' : 'ZenModel', 'factory' : 'manage_addDeviceClass', - 'immediate_view' : 'deviceList', + 'immediate_view' : 'deviceOrganizerStatus', 'actions' : ( - { 'id' : 'devicelist' - , 'name' : 'Devices' - , 'action' : 'deviceList' - , 'permissions' : ( permissions.view, ) - }, { 'id' : 'classes' , 'name' : 'Classes' , 'action' : 'deviceOrganizerStatus' @@ -137,6 +132,11 @@ security = ClassSecurityInfo() + def zentinelTabs(self, templateName): + if templateName == 'deviceList': return [] + return super(DeviceClass, self).zentinelTabs(templateName) + + def getPeerDeviceClassNames(self, pyclass=None): "Return a list of all device paths that have the python class pyclass" if pyclass == None: @@ -552,7 +552,7 @@ devs._setProperty("zPythonClass", "") # production state threshold at which to start monitoring boxes - devs._setProperty("zProdStateThreshold", 500, type="int") + devs._setProperty("zProdStateThreshold", 300, type="int") # Display the ifdescripion field or not devs._setProperty("zIfDescription", False, type="boolean") Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-26 14:46:18 UTC (rev 4877) +++ trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-26 15:02:56 UTC (rev 4878) @@ -215,13 +215,17 @@ <p id="mainviews">Main Views</p> <ul> <li><a href="/zport/dmd/Dashboard">Dashboard</a></li> + <li><a href="/zport/dmd/Events/viewEvents">Event Console</a></li> + <li><a href="/zport/dmd/Devices/deviceList">Device List</a></li> + <li><a href="/zport/dmd/Networks">Networks</a></li> + </ul> + <p id="mainviews">Classes</p> + <ul> <li><a href="/zport/dmd/Events">Events</a></li> <li><a href="/zport/dmd/Devices">Devices</a></li> <li><a href="/zport/dmd/Services">Services</a></li> <li><a href="/zport/dmd/Processes">Processes</a></li> - <li><a href="/zport/dmd/Networks">Networks</a></li> - <li><a href="/zport/dmd/Manufacturers">Manufacturers</a></li> - <li><a href="/zport/dmd/Mibs">Mibs</a></li> + <li><a href="/zport/dmd/Manufacturers">Products</a></li> </ul> <p id="browseby">Browse By</p> @@ -238,10 +242,14 @@ <ul> <li><a href="/zport/dmd/DeviceLoader/addDevice">Add Device</a></li> <li><a href="/zport/dmd/ZenEventManager/addEvent">Add Event</a></li> + <li><a href="/zport/dmd/Monitors">Monitors</a></li> + <li><a href="/zport/dmd/ZenEventManager">Event Manager</a></li> + <li><a href="/zport/dmd/Mibs">Mibs</a></li> + </ul> + <p id="Management">Administration</p> + <ul> <li><a href="/zport/dmd/ZenUsers/manageUserFolder">Users</a></li> - <li><a href="/zport/dmd/Monitors">Monitors</a></li> <li><a href="/zport/dmd/editSettings">Settings</a></li> - <li><a href="/zport/dmd/ZenEventManager">Event Manager</a></li> <li><a href="/zport/dmd/About">About</a></li> </ul> </tal:block> |
From: <sv...@ze...> - 2007-04-26 14:46:17
|
Author: jstevens Date: 2007-04-26 10:46:18 -0400 (Thu, 26 Apr 2007) New Revision: 4877 Modified: trunk/Products/ZenEvents/Event.py trunk/Products/ZenEvents/ZenEventClasses.py trunk/Products/ZenHub/PBDaemon.py trunk/Products/ZenHub/services/PerformanceConfig.py trunk/Products/ZenModel/migrate/smtpsnpp.py trunk/Products/ZenUtils/CmdBase.py trunk/Products/ZenUtils/Utils.py Log: Working on reducing dependencies for files used by pbdeamon and zenweb. Modified: trunk/Products/ZenEvents/Event.py =================================================================== --- trunk/Products/ZenEvents/Event.py 2007-04-26 14:43:49 UTC (rev 4876) +++ trunk/Products/ZenEvents/Event.py 2007-04-26 14:46:18 UTC (rev 4877) @@ -19,12 +19,9 @@ import time import socket -from ZenEventClasses import Heartbeat, Unknown - +from ZenEventClasses import * from Exceptions import * -Severities = 'Clear Debug Info Warning Error Critical'.split() -Clear, Debug, Info, Warning, Error, Critical = range(6) def buildEventFromDict(evdict): """Build an event object from a dictionary. Modified: trunk/Products/ZenEvents/ZenEventClasses.py =================================================================== --- trunk/Products/ZenEvents/ZenEventClasses.py 2007-04-26 14:43:49 UTC (rev 4876) +++ trunk/Products/ZenEvents/ZenEventClasses.py 2007-04-26 14:46:18 UTC (rev 4877) @@ -39,3 +39,6 @@ Status_WinService = "/Status/WinService" Status_XmlRpc = "/Status/XmlRpc" Unknown = "/Unknown" + +Severities = 'Clear Debug Info Warning Error Critical'.split() +Clear, Debug, Info, Warning, Error, Critical = range(6) Modified: trunk/Products/ZenHub/PBDaemon.py =================================================================== --- trunk/Products/ZenHub/PBDaemon.py 2007-04-26 14:43:49 UTC (rev 4876) +++ trunk/Products/ZenHub/PBDaemon.py 2007-04-26 14:46:18 UTC (rev 4877) @@ -23,7 +23,6 @@ #from Products.ZenUtils.Step import Step import Products.ZenEvents.Event as Event from Products.ZenUtils.PBUtil import ReconnectingPBClientFactory -from Products.ZenHub.zenhub import PB_PORT import socket @@ -31,10 +30,12 @@ from twisted.cred import credentials from twisted.spread import pb -from Products.ZenEvents.ZenEventClasses import App_Start, App_Stop, Heartbeat +from Products.ZenEvents.ZenEventClasses import App_Start, App_Stop, \ + Clear, Warning from socket import getfqdn +PB_PORT = 8789 DEFAULT_HUB_HOST = 'localhost' DEFAULT_HUB_PORT = PB_PORT @@ -44,13 +45,13 @@ startEvent = { 'eventClass': App_Start, 'summary': 'started', - 'severity': Event.Clear, + 'severity': Clear, } stopEvent = { 'eventClass':App_Stop, 'summary': 'stopped', - 'severity': Event.Warning, + 'severity': Warning, } @@ -114,6 +115,8 @@ def getServiceNow(self, svcName): + if not self.services.has_key(svcName): + self.log.error('getServiceNow returning FakeRemote for %s' % svcName) return self.services.get(svcName, None) or FakeRemote() @@ -140,7 +143,7 @@ self.log.error('Could not retrieve service %s' % serviceName) if serviceName in self.service: del self.services[serviceName] - return error + #return error d = self.perspective.callRemote('getService', serviceName, self.options.monitor, @@ -213,7 +216,7 @@ # Maybe this is overkill and if we have an operable # event service we should just log events that don't get sent # and then drop them. - self.log.error('Error sending event') + self.log.error('Error sending event: %s' % error) self.eventQueue.append(event) if event: self.eventQueue.append(event) Modified: trunk/Products/ZenHub/services/PerformanceConfig.py =================================================================== --- trunk/Products/ZenHub/services/PerformanceConfig.py 2007-04-26 14:43:49 UTC (rev 4876) +++ trunk/Products/ZenHub/services/PerformanceConfig.py 2007-04-26 14:46:18 UTC (rev 4877) @@ -12,7 +12,7 @@ ########################################################################### #! /usr/bin/env python -from HubService import HubService +from Products.ZenHub.HubService import HubService from Products.ZenModel.Device import Device from Acquisition import aq_parent, aq_base Modified: trunk/Products/ZenModel/migrate/smtpsnpp.py =================================================================== --- trunk/Products/ZenModel/migrate/smtpsnpp.py 2007-04-26 14:43:49 UTC (rev 4876) +++ trunk/Products/ZenModel/migrate/smtpsnpp.py 2007-04-26 14:46:18 UTC (rev 4877) @@ -17,9 +17,26 @@ ''' import Migrate -import Products.ZenUtils.Utils as Utils import os.path +def parseconfig(options): + """parse a config file which has key value pairs delimited by white space""" + if not os.path.exists(options.configfile): + print >>sys.stderr, "WARN: config file %s not found skipping" % ( + options.configfile) + return + lines = open(options.configfile).readlines() + for line in lines: + if line.lstrip().startswith('#'): continue + if line.strip() == '': continue + key, value = line.split(None, 1) + value = value.rstrip('\r\n') + key = key.lower() + defval = getattr(options, key, None) + if defval: value = type(defval)(value) + setattr(options, key, value) + + class OptionsBucket: pass @@ -30,7 +47,7 @@ options = OptionsBucket() options.configfile = os.path.join( os.environ['ZENHOME'], 'etc', 'zenactions.conf') - Utils.parseconfig(options) + parseconfig(options) if not hasattr(dmd, 'smtpHost'): dmd.smtpHost = getattr(options, 'smtphost', '') or 'localhost' if not hasattr(dmd, 'smtpPort'): Modified: trunk/Products/ZenUtils/CmdBase.py =================================================================== --- trunk/Products/ZenUtils/CmdBase.py 2007-04-26 14:43:49 UTC (rev 4876) +++ trunk/Products/ZenUtils/CmdBase.py 2007-04-26 14:46:18 UTC (rev 4877) @@ -26,8 +26,25 @@ import logging.config from optparse import OptionParser -from Utils import parseconfig +def parseconfig(options): + """parse a config file which has key value pairs delimited by white space""" + if not os.path.exists(options.configfile): + print >>sys.stderr, "WARN: config file %s not found skipping" % ( + options.configfile) + return + lines = open(options.configfile).readlines() + for line in lines: + if line.lstrip().startswith('#'): continue + if line.strip() == '': continue + key, value = line.split(None, 1) + value = value.rstrip('\r\n') + key = key.lower() + defval = getattr(options, key, None) + if defval: value = type(defval)(value) + setattr(options, key, value) + + class DMDError: pass class CmdBase: Modified: trunk/Products/ZenUtils/Utils.py =================================================================== --- trunk/Products/ZenUtils/Utils.py 2007-04-26 14:43:49 UTC (rev 4876) +++ trunk/Products/ZenUtils/Utils.py 2007-04-26 14:46:18 UTC (rev 4877) @@ -221,24 +221,6 @@ return 1 -def parseconfig(options): - """parse a config file which has key value pairs delimited by white space""" - if not os.path.exists(options.configfile): - print >>sys.stderr, "WARN: config file %s not found skipping" % ( - options.configfile) - return - lines = open(options.configfile).readlines() - for line in lines: - if line.lstrip().startswith('#'): continue - if line.strip() == '': continue - key, value = line.split(None, 1) - value = value.rstrip('\r\n') - key = key.lower() - defval = getattr(options, key, None) - if defval: value = type(defval)(value) - setattr(options, key, value) - - def lookupClass(productName, classname=None): """look in sys.modules for our class""" import sys |
From: <sv...@ze...> - 2007-04-26 14:43:47
|
Author: jstevens Date: 2007-04-26 10:43:49 -0400 (Thu, 26 Apr 2007) New Revision: 4876 Modified: trunk/Products/ZenEvents/MySqlSendEvent.py Log: refs #1311 Modified: trunk/Products/ZenEvents/MySqlSendEvent.py =================================================================== --- trunk/Products/ZenEvents/MySqlSendEvent.py 2007-04-26 14:42:24 UTC (rev 4875) +++ trunk/Products/ZenEvents/MySqlSendEvent.py 2007-04-26 14:43:49 UTC (rev 4876) @@ -85,12 +85,12 @@ dedupid = map(self.escape, dedupid) event.dedupid = "|".join(dedupid) - if getattr(event, "message", False): - event.summary = event.message[:128] - if getattr(event, "summary", False): - event.message = event.summary - event.summary = event.summary[:128] - + # If either message or summary is empty then try to copy from the other. + # Make sure summary is truncated to 128 + if not getattr(event, 'message', False): + event.message = getattr(event, 'summary', '') + event.summary = (getattr(event, 'summary', '') or event.message)[:128] + cleanup = lambda : None evid = None try: |
From: <sv...@ze...> - 2007-04-26 14:42:25
|
Author: jstevens Date: 2007-04-26 10:42:24 -0400 (Thu, 26 Apr 2007) New Revision: 4875 Modified: trunk/Products/ZenModel/AdministrativeRoleable.py Log: was missing an include of types Modified: trunk/Products/ZenModel/AdministrativeRoleable.py =================================================================== --- trunk/Products/ZenModel/AdministrativeRoleable.py 2007-04-26 14:29:12 UTC (rev 4874) +++ trunk/Products/ZenModel/AdministrativeRoleable.py 2007-04-26 14:42:24 UTC (rev 4875) @@ -15,6 +15,8 @@ Created by Marc Irlandez on 2007-04-05. """ + +import types from AccessControl import ClassSecurityInfo from Products.ZenModel.AdministrativeRole import AdministrativeRole |
From: <sv...@ze...> - 2007-04-26 14:29:24
|
Author: jstevens Date: 2007-04-26 10:29:12 -0400 (Thu, 26 Apr 2007) New Revision: 4874 Modified: trunk/Products/ZenEvents/EventManagerBase.py trunk/Products/ZenEvents/skins/zenevents/addEvent.pt Log: fixes #1311 * Event summary and message don't stomp on each other anymore * Add Event page has summary field now Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-04-26 14:18:44 UTC (rev 4873) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-04-26 14:29:12 UTC (rev 4874) @@ -1182,6 +1182,7 @@ ''' eventDict = dict( summary = REQUEST['summary'], + message = REQUEST['message'], device = REQUEST['device'], component = REQUEST['component'], severity = REQUEST['severity'], Modified: trunk/Products/ZenEvents/skins/zenevents/addEvent.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/addEvent.pt 2007-04-26 14:18:44 UTC (rev 4873) +++ trunk/Products/ZenEvents/skins/zenevents/addEvent.pt 2007-04-26 14:29:12 UTC (rev 4874) @@ -18,12 +18,22 @@ <!-- BEGIN TABLE CONTENTS --> <tr> <td class="tableheader" align="left"> + Summary + </td> + <td class="tablevalues" align="left"> + <input class="tablevalues" type="text" + size="50" name="summary" maxlen="128" + tal:attributes="value event/summary | nothing" /> + </td> + </tr> + <tr> + <td class="tableheader" align="left"> Message </td> <td class="tablevalues" align="left"> - <textarea rows="3" cols="60" name="summary" + <textarea rows="3" cols="60" name="message" class="tablevalues" - tal:content="event/summary | nothing"></textarea> + tal:content="event/message | nothing"></textarea> </td> </tr> <tr> |
From: <sv...@ze...> - 2007-04-26 14:19:10
|
Author: ecn Date: 2007-04-26 10:18:44 -0400 (Thu, 26 Apr 2007) New Revision: 4873 Modified: trunk/Products/ZenModel/skins/zenmodel/zenrrdzoom.js trunk/Products/ZenRRD/RenderServer.py Log: fixed #1190: zenrrdzoom uses new compressed urls Modified: trunk/Products/ZenModel/skins/zenmodel/zenrrdzoom.js =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/zenrrdzoom.js 2007-04-26 12:59:31 UTC (rev 4872) +++ trunk/Products/ZenModel/skins/zenmodel/zenrrdzoom.js 2007-04-26 14:18:44 UTC (rev 4873) @@ -11,10 +11,10 @@ var zoom_factor = 1.5; var pan_factor = 3; // Fraction of graph to move var drange_re = /&drange=([0-9]*)/; -var end_re = /--end%3Dnow-([0-9]*)s%7C/; -var width_re = /--width%3D([0-9]*)%7C/; +var end_re = /&end=now-([0-9]*)s/; +var width_re = /&width=([0-9]*)/; var height_re = /--height%3D([0-9]*)%7C/; -var start_re = /--start%3Dend-([0-9]*)s%7C/; +var start_re = /&start=end-([0-9]*)s/; var comment_re = /COMMENT%3A.*?%5Cc%7C/; var dashes_re = /(--.*?%7C)([^\-])/; @@ -125,14 +125,14 @@ startString : function(s) { s = s || this.start; - var x = "--start=end-" + String(s) + "s|"; - return escape(x); + var x = "&start=end-" + String(s) + "s"; + return x; }, endString : function(e) { e = e || this.end; - var x = "--end=now-" + String(e) + "s|"; - return escape(x); + var x = "&end=now-" + String(e) + "s"; + return x; }, setZoom : function(e) { @@ -193,16 +193,16 @@ newurl = href.replace(end_re, end_url); newurl = newurl.replace(start_re, start_url); } else { - newurl = href.replace("--height", start_url+end_url+'--height'); + newurl = href+=start_url+end_url; }; newurl = newurl.replace(drange_re, "&drange=" + String(this.drange)); this.setDates(); this.setComment(); - dashes = dashes_re.exec(newurl); - comurl = newurl.replace(dashes[1], dashes[1] + this.comment); - newurl = newurl.match(comment_re)? - newurl.replace(comment_re, this.comment): - comurl; + //dashes = dashes_re.exec(newurl); + //comurl = newurl.replace(dashes[1], dashes[1] + this.comment); + //newurl = newurl.match(comment_re)? + //newurl.replace(comment_re, this.comment): + //comurl; this.url = newurl; }, Modified: trunk/Products/ZenRRD/RenderServer.py =================================================================== --- trunk/Products/ZenRRD/RenderServer.py 2007-04-26 12:59:31 UTC (rev 4872) +++ trunk/Products/ZenRRD/RenderServer.py 2007-04-26 14:18:44 UTC (rev 4873) @@ -83,13 +83,15 @@ security.declareProtected('View', 'render') - def render(self, gopts=None, drange=None, remoteUrl=None, width=None, + def render(self, gopts=None, start=None, end=None, drange=None, remoteUrl=None, width=None, ftype='PNG', REQUEST=None): """render a graph and return it""" gopts = zlib.decompress(urlsafe_b64decode(gopts)) gopts = gopts.split('|') gopts = [g for g in gopts if g] gopts.append('--width=%s' % width) + gopts.append('--start=%s' % start) + gopts.append('--end=%s' % end) drange = int(drange) id = self.graphId(gopts, drange, ftype) graph = self.getGraph(id, ftype, REQUEST) |
From: <sv...@ze...> - 2007-04-26 13:01:00
|
Author: ian Date: 2007-04-26 08:59:31 -0400 (Thu, 26 Apr 2007) New Revision: 4872 Modified: trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js Log: * Fixed bug preventing events from loading when left pane link is clicked Modified: trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-04-26 12:35:58 UTC (rev 4871) +++ trunk/Products/ZenEvents/skins/zenevents/viewEvents.pt 2007-04-26 12:59:31 UTC (rev 4872) @@ -109,16 +109,17 @@ </div> -<script> +<script tal:content="string: var mybuffer, myzengrid; addLoadEvent( function() { mybuffer = new ZenGridBuffer(); myzengrid = new ZenGrid('gridcontainer', - 'getJSONEventsInfo', 'mygrid', mybuffer); + 'getJSONEventsInfo', 'mygrid', mybuffer, '${here/absolute_url_path}'); + connect('filter', 'onkeyup', myzengrid.doEventLivesearch); connect('state', 'onchange', myzengrid.refreshFromFormElement); connect('severity', 'onchange', myzengrid.refreshFromFormElement); -}); +});"> </script> </td></tr> <!-- END TABLE CONTENTS --> Modified: trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt =================================================================== --- trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt 2007-04-26 12:35:58 UTC (rev 4871) +++ trunk/Products/ZenEvents/skins/zenevents/viewHistoryEvents.pt 2007-04-26 12:59:31 UTC (rev 4872) @@ -97,16 +97,14 @@ </div> -<script> +<script tal:content="string: var mybuffer, myzengrid; addLoadEvent( function() { mybuffer = new ZenGridBuffer(); myzengrid = new ZenGrid('gridcontainer', - 'getJSONHistoryEventsInfo', 'mygrid', mybuffer); - //connect('filter', 'onkeyup', myzengrid.doEventLivesearch); - //connect('state', 'onchange', myzengrid.refreshFromFormElement); - //connect('severity', 'onchange', myzengrid.refreshFromFormElement); -}); + 'getJSONHistoryEventsInfo', 'mygrid', mybuffer, + '${here/absolute_url_path}', 1 ); +});"> </script> </td></tr> <!-- END TABLE CONTENTS --> Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 12:35:58 UTC (rev 4871) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 12:59:31 UTC (rev 4872) @@ -181,8 +181,9 @@ var ZenGrid = Class.create(); ZenGrid.prototype = { - __init__: function(container, url, gridId, buffer, isHistory) { + __init__: function(container, url, gridId, buffer, absurl, isHistory) { bindMethods(this); + this.absurl = absurl; this.isHistory = isHistory || 0; this.container = $(container); this.gridId = gridId; @@ -190,7 +191,7 @@ this.numRows = 10; this.rowHeight = 32; this.checkedArray = new Array(); - this.url = url; + this.url = this.absurl + '/' + url; this.lastparams = {}; this.fields = []; this.lastOffset = 0; @@ -420,9 +421,9 @@ this.setTableNumRows(this.numRows); this.lock.release(); }, this); - fieldparams = {}; + fieldparams = {}; if (this.isHistory) fieldparams['history'] = 1; - var x = loadJSONDoc('getJSONFields', fieldparams); + var x = loadJSONDoc(this.absurl + '/getJSONFields', fieldparams); x.addCallback(bind(function(r){ this.fields=concat(r,[[' ','']]); if (isManager) this.fields = concat([[' ','']], this.fields); |
From: <sv...@ze...> - 2007-04-26 12:35:59
|
Author: ian Date: 2007-04-26 08:35:58 -0400 (Thu, 26 Apr 2007) New Revision: 4871 Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js Log: * A few small tweaks of the totals calculation and scrolling timeout Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 11:42:22 UTC (rev 4870) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js 2007-04-26 12:35:58 UTC (rev 4871) @@ -207,9 +207,13 @@ updatelock = this.lock.acquire(); updatelock.addCallback(bind(function(r){ this.refreshTable(this.lastOffset); - this.updateStatusBar(this.lastOffset); this.lock.release(); }, this)); + statuslock = this.lock.acquire(); + statuslock.addCallback(bind(function(r){ + //this.updateStatusBar(this.lastOffset); + this.lock.release(); + }, this)); this.addMouseWheelListening(); connect(this.scrollbar, 'onscroll', this.handleScroll); }, @@ -337,6 +341,7 @@ popLock = this.lock.acquire(); popLock.addCallback(bind(function() { this.lock.release(); + this.updateStatusBar(offset); this.populateTable(this.buffer.getRows(offset, this.numRows)); }, this)); }, @@ -631,18 +636,17 @@ Math.floor(pixel/(this.rowHeight+4))*(this.rowHeight+4); var newOffset = this.pixelToRow(pixel); this.updateStatusBar(newOffset); - this.refreshTable(newOffset); + if (newOffset==0) this.refreshTable(newOffset); + clearTimeout(this.scrollTimeout); + this.scrollTimeout = setTimeout ( + bind(function() { + this.refreshTable(newOffset); + }, this), 100); this.lastPixelOffset = pixel; }, handleScroll: function() { this.showLoading(); - //clearTimeout(this.scrollTimeout); - this.nextScrollPosition = this.scrollbar.scrollTop || 0; - if (this.nextScrollPosition==0) this.scrollToPixel(this.nextScrollPosition); - //this.scrollTimeout = setTimeout ( - //bind(function() { - this.scrollToPixel(this.nextScrollPosition) - //}, this), 0); + this.scrollToPixel(this.scrollbar.scrollTop||0) }, refreshFromFormElement: function(e) { node = e.src(); @@ -680,8 +684,9 @@ }, updateStatusBar: function(rownum) { $('currentRows').innerHTML = rownum+1 + '-' + - parseInt(parseInt(rownum)+parseInt(this.numRows)) + - ' of ' + this.buffer.totalRows; + parseInt(parseInt(rownum)+ + Math.min(parseInt(this.numRows), parseInt(this.buffer.totalRows)) + ) + ' of ' + this.buffer.totalRows; }, markAsChecked: function(e) { var node = e.src(); @@ -710,6 +715,10 @@ if (this.loadingbox) { this.loadingbox.hide(); } + }, + resizeColumn: function(index, pixeldiff) { + var cols = this.colgroup.getElementsByTagName('col'); + var old = cols(index).width; } } |