Changeset 566 for trunk/web2
- Timestamp:
- 01/23/09 14:36:56 (15 years ago)
- Location:
- trunk/web2/addons/job_monarch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web2/addons/job_monarch/jobstore.php
r564 r566 20 20 // 21 21 $jid = isset($_POST['jid']) ? $_POST['jid'] : null; 22 $jids = isset($_POST['jids']) ? $_POST['jids'] : null; 22 23 $owner = isset($_POST['owner']) ? $_POST['owner'] : null; 23 24 $status = isset($_POST['status']) ? $_POST['status'] : null; 24 25 $queue = isset($_POST['queue']) ? $_POST['queue'] : null; 25 26 $host = isset($_POST['host']) ? $_POST['host'] : null; 27 28 if( $jids != null ) 29 { 30 $jobids = explode( ",", $jids ); 31 } 32 else 33 { 34 $jobids = null; 35 } 26 36 27 37 global $c, $clustername, $cluster; … … 76 86 switch($task) 77 87 { 78 case " LISTING":79 get List();88 case "GETJOBS": 89 getJobs(); 80 90 break; 81 case " SUMMARY":82 get Summary();91 case "GETNODES": 92 getNodes(); 83 93 break; 84 94 default: … … 366 376 } 367 377 368 function getList() 378 function getNodes() 379 { 380 global $jobs, $jobids, $clustername; 381 382 $display_nodes = array(); 383 384 if( !$jobids ) 385 { 386 return 1; 387 } 388 foreach( $jobs as $jobid => $jobattrs ) 389 { 390 if( in_array( $jobid, $jobids ) ) 391 { 392 foreach( $jobattrs['nodes'] as $jobnode ) 393 { 394 if( !in_array( $jobnode, $display_nodes) ) 395 { 396 $display_nodes[] = $jobnode; 397 } 398 } 399 } 400 } 401 //print_r( $display_nodes ); 402 $node_results = array(); 403 $result_count = count( $display_nodes ); 404 foreach( $display_nodes as $dnode ) 405 { 406 407 $nr = array(); 408 $nr['c'] = $clustername; 409 $nr['h'] = $dnode; 410 $nr['x'] = '5'; 411 $nr['v'] = '0'; 412 413 $node_results[] = $nr; 414 } 415 $jsonresults = JEncode( $node_results ); 416 417 echo '{"total":"'. $result_count .'","results":'. $jsonresults .'}'; 418 } 419 420 function getJobs() 369 421 { 370 422 global $jobs, $hearbeat, $pstart, $pend; -
trunk/web2/addons/job_monarch/js/jobgrid.js
r564 r566 342 342 id: 'JobsDataStore', 343 343 proxy: JobProxy, 344 baseParams: { task: " LISTING" },344 baseParams: { task: "GETJOBS" }, 345 345 reader: new Ext.data.JsonReader({ 346 346 root: 'results', … … 497 497 }); 498 498 499 NodesDataStore = new Ext.data.Store({ 500 id: 'NodesDataStore', 501 proxy: JobProxy, 502 autoLoad: false, 503 baseParams: { task: "GETNODES" }, 504 reader: new Ext.data.JsonReader({ 505 root: 'results', 506 totalProperty: 'total', 507 id: 'id' 508 },[ 509 {name: 'c', type: 'string', mapping: 'c'}, 510 {name: 'h', type: 'string', mapping: 'h'}, 511 {name: 'v', type: 'string', mapping: 'v'}, 512 {name: 'x', type: 'string', mapping: 'x'}, 513 ]), 514 listeners: { 515 'beforeload': { 516 scope: this, 517 fn: function() { 518 var jids; 519 520 var row_records = CheckJobs.getSelections(); 521 522 for(var i=0; i<row_records.length; i++ ) 523 { 524 rsel = row_records[i]; 525 if( !jids ) 526 { 527 jids = rsel.get('jid'); 528 } 529 else 530 { 531 jids = jids + ',' + rsel.get('jid'); 532 } 533 } 534 NodesDataStore.baseParams.jids = jids; 535 NodesDataStore.baseParams.c = myparams.c; 536 } 537 } 538 } 539 }); 540 541 function ShowGraphs( Button, Event ) { 542 543 var GraphView = new Ext.DataView({ 544 itemSelector: 'thumb', 545 style:'overflow:auto', 546 multiSelect: true, 547 store: NodesDataStore, 548 tpl: new Ext.XTemplate( 549 '<tpl for=".">', 550 '<div class="thumb"><img src="../../graph.php?z=small&h={h}&x={x}&v={v}&c={c}" border="0"></div>', 551 '</tpl>' 552 ) 553 }); 554 555 var images = new Ext.Panel({ 556 id:'images', 557 title:'My Images', 558 region:'center', 559 margins: '5 5 5 0', 560 layout:'fit', 561 items: GraphView 562 }); 563 564 if(!win){ 565 win = new Ext.Window({ 566 width : 500, 567 height : 300, 568 closeAction :'hide', 569 items: [ images ] 570 }); 571 } 572 NodesDataStore.load(); 573 win.show(); 574 } 575 499 576 JobListingEditorGrid = new Ext.grid.EditorGridPanel({ 500 577 id: 'JobListingEditorGrid', … … 523 600 'click': { 524 601 scope: this, 525 fn: function() { 526 if(!win){ 527 win = new Ext.Window({ 528 width : 500, 529 height : 300, 530 closeAction :'hide', 531 }); 532 } 533 win.show( this ); 534 alert( CheckJobs.getSelections() ); 535 } 602 fn: ShowGraphs 536 603 } 537 604 }
Note: See TracChangeset
for help on using the changeset viewer.