Example #1
0
function main()
{
    $x = new StdClass();
    $x->daemons = get_daemon_status();
    $x->jobs = get_job_status();
    if (get_int('xml', true)) {
        show_status_xml($x);
    } else {
        show_status_html($x);
    }
}
Example #2
0
$rowid = $_GET['rowid'];
# check if we have to print the <tr> elements (we do not print them if this file is called from a AJAX call
if (isset($_GET["print_tr"])) {
    $print_tr = $_GET["print_tr"];
} else {
    $print_tr = true;
    // default true
}
$filelink = OC_Helper::linkTo('files', '', array("dir" => "{$file}/results/{$job}"));
$output_file = get_job_output_file($file, $job);
$jobinfo = get_job_info($file, $job);
// obtain the precedent status
$precstatus = isset($jobinfo['status']) ? $jobinfo['status'] : JobStatus::$RUNNING;
$qsub_jobname = $jobinfo["qsub_jobname"];
// obtain the current status (potentially slow operation, calls ssh/qstat)
$status = get_job_status($jobinfo);
$sgequeued = 0;
$sgerunning = 0;
if ($status == JobStatus::$FINISHED || $status === JobStatus::$KILLED) {
    if ($precstatus !== $status) {
        $jobinfo['status'] = $status;
        // get_job_status returned FINISHED or KILLED, we save that info in the job JSON
        save_job_info($file, $job, $jobinfo);
    }
    if (!isset($jobinfo["usedspace"])) {
        // calculate space used by temp dir + results
        $usedspace = get_job_disk_usage(OC_User::getUser(), $file, $job);
        if (!$usedspace) {
            $usedspace = "--";
        }
        $jobinfo['usedspace'] = $usedspace;
                    </div>
                </div>
                <?php 
if (!empty($user_saved_jobs_db_results)) {
    ?>
                <div class="row list" id="job-manager-main-lists">
                    <?php 
    $url = get_permalink(get_page_by_title('Job Manager View/Edit'));
    $user_jobs = $user_saved_jobs_db_results;
    foreach ($user_jobs as $user_job) {
        $html = '<div class="col-md-4">';
        $html .= '<a href="' . $url . $user_job->id . '">';
        $html .= '<div class="job-manager-job" data-job-id="' . $user_job->id . '">';
        $html .= '<div class="job-title">' . $user_job->job_title . '</div>';
        $html .= '<div class="job-company">' . $user_job->job_company . '</div>';
        $html .= '<div class="job-status"> Status: ' . get_job_status($user_job->job_status) . '</div>';
        $html .= '<i class="delete-job-icon fa fa-trash-o"></i>';
        $html .= '<div style="clear:both"></div>';
        $html .= '</div>';
        $html .= '</a>';
        $html .= '</div>';
        echo $html;
    }
    ?>
                </div>
               <?php 
} else {
    ?>
               <div class="empty-jobs-message">
                   <i id="no-jobs-icon" class="fa fa-briefcase"></i><span class="no-jobs-message">No jobs</span>
                </div>
<?php

/*
 * refresh_job_status
 * Created on: Feb 4, 2013 4:11:53 PM
 * 
 * Copyright 2013 EnginSoft S.p.A.
 * All rights reserved
 */
require_once 'neurocloud/lib/common.php';
if (isset($_POST["study"]) && isset($_POST["jobid"])) {
    $study = $_POST["study"];
    $jobid = $_POST["jobid"];
    echo get_job_status(get_job_info($study, $jobid));
} else {
    echo "ERROR";
}
exit;