Changeset 117
- Timestamp:
- 03/25/08 13:06:39 (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 modified
-
controllers/services.php (modified) (2 diffs)
-
images/icons/chart_bar.png (added)
-
images/tab_npc.gif (modified) (previous)
-
js/src/monitoring/hosts/hostgroupGrid.js (modified) (1 diff)
-
js/src/monitoring/hosts/hostgroupOverview.js (modified) (1 diff)
-
js/src/monitoring/services/servicegroupGrid.js (modified) (1 diff)
-
js/src/monitoring/services/servicegroupOverview.js (modified) (1 diff)
-
js/src/monitoring/services/services.js (modified) (6 diffs)
-
models/NpcServices.php (modified) (1 diff)
-
models/NpcServicestatus.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/controllers/services.php
r113 r117 183 183 .'o.name1 AS host_name,' 184 184 .'o.name2 AS service_description,' 185 .'g.local_graph_id,' 185 186 .'ss.*') 186 187 ->from('NpcServicestatus ss') … … 188 189 ->leftJoin('ss.Service s') 189 190 ->leftJoin('ss.Instance i') 191 ->leftJoin('ss.Graph g') 190 192 ->where("$where") 191 193 ->orderby( 'i.instance_name ASC, host_name ASC, service_description ASC' ), -
trunk/js/src/monitoring/hosts/hostgroupGrid.js
r107 r117 148 148 tab.addListener(listeners); 149 149 150 grid.on('rowclick', npc.hostGridClick); 150 // Double click action 151 grid.on('rowdblclick', npc.hostGridClick); 151 152 153 // Right click action 154 grid.on('rowcontextmenu', npc.hostContextMenu); 152 155 }; -
trunk/js/src/monitoring/hosts/hostgroupOverview.js
r107 r117 167 167 tab.addListener(listeners); 168 168 169 grid.on('rowclick', hgOverviewClick); 169 grid.on('rowdblclick', hgOverviewClick); 170 171 // Right click action 172 grid.on('rowcontextmenu', npc.hostContextMenu); 170 173 171 174 function hgOverviewClick(grid, rowIndex, e) { -
trunk/js/src/monitoring/services/servicegroupGrid.js
r107 r117 161 161 tab.addListener(listeners); 162 162 163 grid.on('rowclick', npc.serviceGridClick); 163 // Double click action 164 grid.on('rowdblclick', npc.serviceGridClick); 164 165 166 // Right click action 167 grid.on('rowcontextmenu', npc.serviceContextMenu); 165 168 }; -
trunk/js/src/monitoring/services/servicegroupOverview.js
r107 r117 167 167 tab.addListener(listeners); 168 168 169 grid.on('rowclick', sgOverviewClick); 169 grid.on('rowdblclick', sgOverviewClick); 170 171 // Right click action 172 grid.on('rowcontextmenu', npc.serviceContextMenu); 170 173 171 174 function sgOverviewClick(grid, rowIndex, e) { -
trunk/js/src/monitoring/services/services.js
r113 r117 41 41 }; 42 42 43 function renderGraphIcon(val, p, record){ 44 var icon = ''; 45 if (val) { 46 // <img id="graph'+val+'" src="/graph_image.php?action=view&local_graph_id='+val+'&rra_id=1" style="position:absolute;left:0;top:0;"/> 47 icon = '<img src="images/icons/chart_bar.png">'; 48 } 49 return String.format('{0}', icon); 50 }; 51 43 52 var store = new Ext.data.GroupingStore({ 44 53 url:url, … … 49 58 root:'data' 50 59 }, [ 51 'host_object_id', 60 'instance_name', 61 {name: 'host_object_id', type: 'int'}, 52 62 'host_name', 53 'service_id',54 'service_object_id',63 {name: 'service_object_id', type: 'int'}, 64 {name: 'local_graph_id', type: 'int'}, 55 65 'service_description', 56 66 'acknowledgement', … … 82 92 dataIndex:'current_state', 83 93 renderer:npc.serviceStatusImage, 94 width:30 95 },{ 96 header:"Graph", 97 dataIndex:'local_graph_id', 98 renderer:renderGraphIcon, 99 width:30 100 },{ 101 header:"Instance", 102 dataIndex:'instance_name', 103 hidden:true, 84 104 width:45 85 105 },{ … … 87 107 dataIndex:'last_check', 88 108 renderer: npc.formatDate, 89 width:1 10109 width:100 90 110 },{ 91 111 header:"Next Check", 92 112 dataIndex:'next_check', 93 113 renderer: npc.formatDate, 94 width:1 10114 width:100 95 115 },{ 96 116 header:"Duration", … … 119 139 id: id + '-grid', 120 140 autoHeight:true, 121 autoExpandColumn: ' service_description',141 autoExpandColumn: 'plugin_output', 122 142 store:store, 123 143 autoScroll: true, … … 184 204 // Right click action 185 205 grid.on('rowcontextmenu', npc.serviceContextMenu); 206 207 // If the graph icon is clicked popup the associated graph 208 grid.on('cellclick', function(grid, rowIndex, columnIndex) { 209 var record = grid.getStore().getAt(rowIndex); 210 var fieldName = grid.getColumnModel().getDataIndex(columnIndex); 211 var data = record.get(fieldName); 212 213 if (fieldName == 'local_graph_id' && !Ext.getCmp('serviceGraph'+data)) { 214 var win = new Ext.Window({ 215 title:record.data.host_name + ': ' + record.data.service_description, 216 id:'serviceGraph'+data, 217 layout:'fit', 218 modal:false, 219 closable: true, 220 html: '<img src="/graph_image.php?action=view&local_graph_id='+data+'&rra_id=1">', 221 width:600 222 }).show(); 223 } 224 }); 186 225 }; -
trunk/models/NpcServices.php
r97 r117 34 34 $this->hasOne('NpcHoststatus as Hoststatus', array('local' => 'host_object_id', 'foreign' => 'host_object_id')); 35 35 $this->hasOne('NpcServicestatus as Status', array('local' => 'service_object_id', 'foreign' => 'service_object_id')); 36 $this->hasOne('NpcServiceGraphs as Graph', array('local' => 'service_object_id', 'foreign' => 'service_object_id')); 36 37 $this->hasMany('NpcComments as Comment', array('local' => 'service_object_id', 'foreign' => 'object_id')); 37 38 $this->hasMany('NpcServicechecks as Check', array('local' => 'service_object_id', 'foreign' => 'service_object_id')); -
trunk/models/NpcServicestatus.php
r97 r117 8 8 $this->hasOne('NpcObjects as Object', array('local' => 'service_object_id', 'foreign' => 'object_id')); 9 9 $this->hasOne('NpcServices as Service', array('local' => 'service_object_id', 'foreign' => 'service_object_id')); 10 //$this->hasMany('NpcServicegroupMembers as ServicegroupMembers', array('local' => 'service_object_id', 'foreign' => 'service_object_id'));10 $this->hasOne('NpcServiceGraphs as Graph', array('local' => 'service_object_id', 'foreign' => 'service_object_id')); 11 11 $this->hasMany('NpcServicegroups as Servicegroups', array('local' => 'service_object_id', 'foreign' => 'servicegroup_id', 'refClass' => 'NpcServicegroupMembers')); 12 12 }