/[cvs]/nfo/php/libs/org.netfrag.app/YAA/JobDetails.php
ViewVC logotype

Contents of /nfo/php/libs/org.netfrag.app/YAA/JobDetails.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Tue May 13 15:10:32 2003 UTC (21 years, 2 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +15 -8 lines
fixed deprecated stuff

1 <?
2 /*
3 ## -------------------------------------------------------------------------
4 ## $Id: JobDetails.php,v 1.1 2003/02/22 16:19:08 joko Exp $
5 ## -------------------------------------------------------------------------
6 ## $Log: JobDetails.php,v $
7 ## Revision 1.1 2003/02/22 16:19:08 joko
8 ## YAA - Yet Another Admin
9 ## + initial commit
10 ##
11 ## -------------------------------------------------------------------------
12 */
13
14
15 // ----------------------------------------------------------
16 // View/Item: job detail area
17
18 class YAA_JobDetails extends InfoTable {
19
20 var $jobs;
21 var $backend;
22 var $lift;
23
24 function YAA_JobDetails($jobname, $action = '') {
25 $this->backend = new TsBackend();
26 //$this->lift = new Data_Lift( array( metatype => 'job' ) );
27 $this->lift = mkObject('Data::Lift', undef, array( metatype => 'job' ) );
28
29 // execute action
30 if ($action == 'run') {
31 $this->run($jobname);
32 }
33
34 return $this->_do($jobname, $action);
35 }
36
37 function run($jobname) {
38 //print "runTask: $jobname<br/>";
39 $this->backend->runTask($jobname);
40 }
41
42 function _do($taskname, $action) {
43
44 // frontend
45 $caption = "Job Status for: $taskname | Action: $action";
46 $this->set_title($caption);
47 $this->set_cellpadding(10);
48
49
50 // get status and prepare data
51 //print "FETCH!<br/>";
52 $taskinfo = $this->backend->getTaskInfo($taskname);
53 #exit;
54
55 //print Dumper($taskinfo);
56
57 // get and modify description
58 //$description = $taskinfo[metadata][description];
59 //if (is_array($taskinfo)) {
60 $this->lift->set($taskinfo);
61 $this->lift->to('html');
62 $this->lift->add(array( name => $key ) );
63 $out = $this->lift->get();
64 //$description = $out[description];
65 //}
66
67 if ($taskinfo[status][running]) {
68 $status_text = "[running]";
69 $status_symbol = "<img src=\"img/cube.gif\" width=\"80\" />";
70 } else {
71 $status_text = "[not running]";
72 $status_symbol = "<img src=\"img/widgets/tree/minustop.gif\" width=\"80\" /> <br/>FIXME: Build an icon for symbolizing this.";
73 }
74
75 // actions
76 /*
77 $prefix = "&nbsp;";
78 $actions = container(
79 $prefix, rAction( 'run', array( job => $taskname )), html_br(),
80 $prefix, rAction( 'show log', array( job => $taskname )), html_br()
81 );
82 */
83 $controlbox = new VerticalCSSNavTable('Actions:');
84 $controlbox->add( url::query( array( ap => "pcontrol", action => 'status', job => $taskname )), 'status' );
85 $controlbox->add( url::query( array( ap => "pcontrol", action => 'run', job => $taskname )), 'run' );
86
87 // build box
88 //$box .= "<br/><br/>";
89 //$jobtable->add_row( $description, container( html_b("actions:&nbsp;&nbsp;&nbsp;"), html_br(), $actions ), container($status, html_br(), $box) );
90 $this->add_row( $controlbox, container($out[description], html_br(), $out[steps]) );
91 $this->add_row( html_b("STATUS"), container($status_text, html_br(), $status_symbol) );
92 //$jobtable->add_row(Dumper($taskinfo[status]), "-");
93
94
95 /*
96 if (is_array($this->jobs[target])) {
97
98 foreach($this->jobs[target] as $key => $job) {
99
100 $this->lift->set($job);
101 $this->lift->to('html');
102 $this->lift->add(array( name => $key ) );
103
104 $out = $this->lift->get();
105
106 $controlbox = new VerticalCSSNavTable('Actions:');
107 $controlbox->add( httpQuery( array( action => 'status', job => $out[name] )), 'status' );
108 $controlbox->add( httpQuery( array( action => 'run', job => $out[name] )), 'run' );
109
110 $this->add_row(
111 $controlbox,
112 container(html_b($out[name]), html_br(), html_br(), html_b('description:'), html_br(), $out[description], html_br(), $out[steps])
113 );
114 }
115 */
116
117 /*
118 } else {
119 $this->add("Diese Anfrage f&uuml;hrte zu keinem Ergebnis.<br/> Bitte w&auml;hlen Sie in der Liste links eine andere Job-Kategorie aus.<br/>");
120
121 }
122 */
123
124 }
125
126 }
127
128
129 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed