本文整理汇总了PHP中Computer::getFormUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Computer::getFormUrl方法的具体用法?PHP Computer::getFormUrl怎么用?PHP Computer::getFormUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Computer
的用法示例。
在下文中一共展示了Computer::getFormUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showJobLogs
function showJobLogs()
{
$refresh_intervals = array("off" => __('Off', 'fusioninventory'), "1" => '1 ' . _n('second', 'seconds', 1), "5" => '5 ' . _n('second', 'seconds', 5), "10" => '10 ' . _n('second', 'seconds', 10), "60" => '1 ' . _n('minute', 'minutes', 1), "120" => '2 ' . _n('minute', 'minutes', 2), "300" => '5 ' . _n('minute', 'minutes', 5), "600" => '10 ' . _n('minute', 'minutes', 10));
echo "<div class='fusinv_panel'>";
echo " <div class='fusinv_form large'>";
$refresh_randid = $this->showDropdownFromArray(__("refresh interval", "fusioninventory"), null, $refresh_intervals, array('value' => 'off', 'width' => '20%'));
// Add a manual refresh button
echo " <div class='refresh_button submit'>";
echo " <span></span></div>";
echo " </div>";
// end of fusinv_form
echo "</div>";
//$pfTaskjob = new PluginFusioninventoryTaskjob();
//$taskjobs = $pfTaskjob->find(
// "`plugin_fusioninventory_tasks_id`='".$this->fields['id']."'",
// "id"
//);
// Template structure for tasks' blocks
echo implode("\n", array("<script id='template_task' type='x-tmpl-mustache'>", "<div id='{{task_id}}' class='task_block {{expanded}}'>", " <h3>" . __("Task", 'fusioninventory') . " <span class='task_name'>{{task_name}}</span></h3>", " <div class='jobs_block'></div>", "</div>", "</script>"));
// Template structure for jobs' blocks
echo implode("\n", array("<script id='template_job' type='x-tmpl-mustache'>", "<div id='{{job_id}}' class='job_block'>", " <div class='refresh_button submit'><span></span></div>", " <h3 class='job_name'>{{job_name}}</h3>", " <div class='targets_block'></div>", "</div>", "</script>"));
// Template structure for targets' blocks
echo implode("\n", array("<script id='template_target' type='x-tmpl-mustache'>", "<div id='{{target_id}}' class='target_block'>", " <div class='target_details'>", " <div class='target_infos'>", " <h4 class='target_name'>", " <a target='_blank' href={{target_link}}>", " {{target_name}}", " </a>", " </h4>", " <div class='target_stats'>", " </div>", " </div>", " <div class='progressbar'></div>", " </div>", " <div class='show_more'></div>", " <div class='agents_block'></div>", " <div class='show_more'></div>", "</script>"));
// Template structure for targets' statistics
echo implode("\n", array("<script id='template_target_stats' type='x-tmp-mustache'>", " <div class='{{stats_type}} stats_block'>", " </div>", "</script>"));
// Template for counters' blocks
echo implode("\n", array("<script id='template_counter_block' type='x-tmpl-mustache'>", "<div class='counter_block {{counter_type}} {{#counter_empty}}empty{{/counter_empty}}'>", "<a", " href='javascript:void(0)'", " class='' ", " title='" . __("Show/Hide details", "fusioninventory") . "'", " onclick='taskjobs.toggle_details_type(this, \"{{counter_type}}\", \"{{chart_id}}\")'", ">", "<div class='fold'></div>", "<span class='counter_name'>{{counter_type_name}}</span>", "<span class='counter_value'>{{counter_value}}</span>", "</div>", "</a>", "</script>"));
/*
* List of counter names
*/
echo implode("\n", array("<script type='text/javascript'>", " taskjobs.statuses_order = {", " last_executions : [", " 'agents_prepared',", " 'agents_running',", " 'agents_cancelled'", " ],", " last_finish_states : [", " 'agents_notdone',", " 'agents_success',", " 'agents_error'", " ]", " };", " taskjobs.statuses_names = {", " 'agents_notdone' : '" . __('Not done yet', 'fusioninventory') . "',", " 'agents_error' : '" . __('In error', 'fusioninventory') . "',", " 'agents_success' : '" . __('Successful', 'fusioninventory') . "',", " 'agents_running' : '" . __('Running', 'fusioninventory') . "',", " 'agents_prepared' : '" . __('Prepared', 'fusioninventory') . "',", " 'agents_cancelled' : '" . __('Cancelled', 'fusioninventory') . "',", " };", " taskjobs.logstatuses_names = " . json_encode(PluginFusioninventoryTaskjoblog::dropdownStateValues()) . ";", "</script>"));
// Template for agents' blocks
echo implode("\n", array("<script id='template_agent' type='x-tmpl-mustache'>", "<div class='agent_block' id='{{agent_id}}'>", " <div class='status {{status.last_exec}}'></span>", " <div class='status {{status.last_finish}}'></span>", "</div>", "</script>"));
// Display empty block for each jobs display which will be rendered later by mustache.js
echo implode("\n", array("<div class='tasks_block'>", "</div>"));
if (isset($this->fields['id'])) {
$task_id = $this->fields['id'];
} else {
$task_id = json_encode(array());
}
$pfAgent = new PluginFusioninventoryAgent();
$Computer = new Computer();
echo implode("\n", array("<script type='text/javascript'>", " taskjobs.agents_url = '" . $pfAgent->getFormUrl() . "'", " taskjobs.computers_url = '" . $Computer->getFormUrl() . "'", " taskjobs.init_templates();", " taskjobs.init_refresh_form(", " '" . $this->getBaseUrlFor('fi.job.logs') . "',", " " . $task_id . ",", " 'dropdown_" . $refresh_randid . "'", " );", " taskjobs.update_logs_timeout(", " '" . $this->getBaseUrlFor('fi.job.logs') . "',", " " . $task_id . ",", " 'dropdown_" . $refresh_randid . "'", " );", "</script>"));
}