Changeset 642 for trunk/web/addons/job_monarch/js/monarch.js
- Timestamp:
- 08/04/09 21:22:56 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/js/monarch.js
r641 r642 707 707 if( records.length == 1 ) // TODO: if job state is running 708 708 { 709 jobid = records[0].get('jid'); 710 711 myPanel = createGraphPanel(); 712 nodeDatastore = createNodesDataStore( myparams.c, jobid ); 713 graphView = createGraphView( nodeDatastore, jobid ); 709 jobid = records[0].get('jid'); 710 711 var myPanel = createGraphPanel(); 712 var nodeDatastore = createNodesDataStore( myparams.c, jobid ); 713 var graphView = createGraphView( nodeDatastore, jobid ); 714 var graphTab = createGraphTab( graphView, jobid ); 714 715 715 716 //graphView.autoShow = true; 716 717 717 newtab = myPanel.add( graphView ); 718 //newtab = myPanel.add( graphView ); 719 var newtab = myPanel.add( graphTab ); 718 720 myPanel.setActiveTab( newtab ); 719 721 myPanel.doLayout(); … … 928 930 'task': "GETNODES", 929 931 'c': cluster, 930 'jid': jid 932 'jid': jid, 933 'metricname': 'load_one' 931 934 }, 932 935 reader: new Ext.data.JsonReader( … … 969 972 //id: 'jobPanel', 970 973 itemSelector: 'thumb', 974 region: 'center', 971 975 title: jid, 972 976 style: 'overflow:auto, heigth: auto', … … 990 994 } 991 995 996 function createGraphTab( view, jobid ) 997 { 998 var graphTab = 999 1000 new Ext.Panel( 1001 { 1002 title: jobid, 1003 layout: 'border', 1004 1005 items: 1006 [ 1007 view, 1008 { 1009 region: 'west', 1010 split: true, 1011 title: 'Job info', 1012 width: 200, 1013 layout: 'fit', 1014 //id: 'jobinfo-pane', 1015 collapsible: true, 1016 border: true 1017 } 1018 ] 1019 }); 1020 1021 return graphTab; 1022 } 1023 1024 992 1025 function createGraphPanel( view ) 993 1026 { … … 1005 1038 //id: 'tabPanel', 1006 1039 xtype: 'tabpanel', 1040 //layout: 'border', 1007 1041 //region: 'center', 1008 1042 //bodyStyle: 'background: transparent', … … 1012 1046 enableTabScroll:true, 1013 1047 resizeTabs: true, 1014 border: false,1048 //border: false, 1015 1049 bodyStyle: 'overflow:auto; background: transparent; heigth: auto', 1016 1050 minTabWidth: 60, … … 1039 1073 listeners: 1040 1074 { 1041 select:1075 // select: 1042 1076 1043 function(combo, record, index)1044 {1045 var metric = record.data.name;1046 1047 var parentPanel = this.findParentByType( 'tabpanel' );1077 // function(combo, record, index) 1078 // { 1079 // var metric = record.data.name; 1080 1081 // var parentPanel = this.findParentByType( 'tabpanel' ); 1048 1082 //var parentPanel = Ext.getCmp( this.el.up( 'div.x-tab-panel' ).id ); 1049 var my_dataview = parentPanel.getActiveTab();1050 1051 my_dataview.getStore().baseParams.metricname = metric;1052 my_dataview.getStore().reload();1053 }1083 // var my_dataview = parentPanel.getActiveTab().findByType(Ext.DataView); 1084 1085 // my_dataview.getStore().baseParams.metricname = metric; 1086 // my_dataview.getStore().reload(); 1087 // } 1054 1088 } 1055 1089 }) 1056 1090 ] 1091 1092 //listeners: 1093 //{ 1094 // tabchange: 1095 1096 // function( panel, tab ) 1097 // { 1098 // if( panel.rendered ) 1099 // { 1100 // combobox = tab.findParentByType( 'tabpanel' ); 1101 // alert( combobox.xtype ); 1102 // combobox.value = tab.getStore().baseParams.metricname; 1103 // } 1104 // } 1105 //} 1057 1106 }); 1058 1107 … … 1076 1125 //autoScroll: true, 1077 1126 //defaults: {autoScroll:true}, 1078 title: ' Node graph details',1127 title: 'Jobs', 1079 1128 //tbar: panel, 1080 items: panel,1129 items: [ panel ] 1081 1130 1082 1131 //listeners: … … 1106 1155 var nodeDatastore; 1107 1156 var graphView; 1157 var graphTab; 1108 1158 var myWindow; 1109 1159 var myPanel; … … 1155 1205 nodeDatastore = createNodesDataStore( myparams.c, graphJids[w][t] ); 1156 1206 graphView = createGraphView( nodeDatastore, graphJids[w][t] ); 1207 graphTab = createGraphTab( graphView, graphJids[w][t] ); 1157 1208 1158 1209 nodeDatastore.removeAll(); 1159 1210 1160 lastView = myPanel.add( graph View);1211 lastView = myPanel.add( graphTab ); 1161 1212 1162 1213 myPanel.doLayout();
Note: See TracChangeset
for help on using the changeset viewer.