示例#1
0
 foreach ($lnorder->seq() as $fl) {
     $f = str_starts_with($fl[0], $Pset->directory_slash) ? substr($fl[0], strlen($Pset->directory_slash)) : $fl[0];
     $notelinks[] = '<a href="#L' . $fl[1] . '_' . html_id_encode($fl[0]) . '" onclick="return gotoline61(this)" class="noteref61' . (!$fl[2] && !$Info->user_can_see_grades ? " hiddennote61" : "") . '">' . htmlspecialchars($f) . ':' . substr($fl[1], 1) . '</a>';
 }
 if (count($notelinks)) {
     ContactView::echo_group("notes", join(", ", $notelinks));
 }
 // print runners
 $crunners = $Info->commit_info("run");
 $runclasses = [];
 foreach ($Pset->runners as $r) {
     if (!$Me->can_view_run($Pset, $r, $User) || isset($runclasses[$r->runclass])) {
         continue;
     }
     $checkt = defval($crunners, $r->runclass);
     $rj = $checkt ? ContactView::runner_json($Info, $checkt) : null;
     if (!$rj && !$Me->can_run($Pset, $r, $User)) {
         continue;
     }
     echo '<div id="run61out_' . $r->runclass . '"';
     if (!$rj || !isset($rj->timestamp)) {
         echo ' style="display:none"';
     }
     echo '><h3><a class="fold61" href="#" onclick="', "return runfold61('{$r->runclass}')", '">', '<span class="foldarrow">&#x25B6;</span>&nbsp;', htmlspecialchars($r->output_title), '</a></h3>', '<div class="run61" id="run61_', $r->runclass, '" style="display:none"';
     if ($Pset->directory_noslash !== "") {
         echo ' data-pa-directory="', htmlspecialchars($Pset->directory_noslash), '"';
     }
     if ($rj && isset($rj->timestamp)) {
         echo ' data-pa-timestamp="', $rj->timestamp, '"';
     }
     if ($rj && isset($rj->data) && ($pos = strpos($rj->data, "\n\n"))) {
示例#2
0
}
$checkt = time();
// maybe eval
if (!$Runner->command && $Runner->eval) {
    $json = ContactView::runner_generic_json($Info, $checkt);
    $json->done = true;
    $json->status = "done";
    runner_eval($Runner, $Info, $json);
    $Conf->ajaxExit($json);
}
// otherwise run
try {
    $rs = new RunnerState($Info, $Runner, $Queue);
    // recent
    if (@$_REQUEST["check"] == "recent" && count($rs->logged_checkts)) {
        $Conf->ajaxExit(ContactView::runner_json($Info, $rs->logged_checkts[0], $Offset));
    } else {
        if (@$_REQUEST["check"] == "recent") {
            quit("no logs yet");
        }
    }
    if ($rs->is_recent_job_running()) {
        quit("recent job still running");
    }
    // run
    $rs->start();
    // save information about execution
    $Info->update_commit_info(array("run" => array($Runner->name => $rs->checkt)));
    $Conf->ajaxExit(array("ok" => true, "done" => false, "status" => "working", "repoid" => $Info->repo->repoid, "pset" => $Info->pset->id, "timestamp" => $rs->checkt));
} catch (Exception $e) {
    quit($e->getMessage());