function ajax_dashstatus() { $sinfo = Service::ServiceData(SInfo::DATA_Status_LV); $listeners = $sinfo->Get(SInfo::FLD_Listener); $body = ''; $running = 0; $broken = ''; foreach ($listeners as $lname => $l) { $body .= '<tr><td class="'; if (isset($l['addr'])) { $body .= 'success"><i class="fa fa-link"></i>'; $running++; $addr = $l['addr']; } else { $body .= 'danger"><i class="fa fa-unlink"></i>'; $broken++; $addr = $l['daddr']; } $body .= '</td><td>' . $lname . ' </td><td>' . $addr . '</td></tr>' . "\n"; } $vhosts = $sinfo->Get(SInfo::FLD_VHosts); $vrunning = 0; $vdisabled = ''; $verrors = ''; $vbody = ''; $note_stopped = DMsg::ALbl('service_stopped'); $note_running = DMsg::ALbl('service_running'); $note_suspendvh = DMsg::ALbl('service_suspendvh'); $note_enablevh = DMsg::ALbl('service_enablevh'); $note_disabled = DMsg::ALbl('service_disabled'); foreach ($vhosts as $vn => $vh) { $vbody .= '<tr data-vn="' . $vn . '"><td>'; if ($vh['running'] == -1) { $verrors++; $vbody .= '<span class="text-danger" title="' . $note_stopped . '"><i class="fa fa-ban"></i></span> '; $actions = ''; } elseif ($vh['running'] == 1) { $vrunning++; $vbody .= '<span class="text-success" title="' . $note_running . '"><i class="fa fa-rocket"></i></span> '; $actions = '<a class="btn btn-warning btn-xs" data-action="lstvhcontrol" data-lstact="disable" title="' . $note_suspendvh . '"><i class="fa fa-pause"></i></a>'; } else { $vdisabled++; $vbody .= '<span class="text-warning" title="' . $note_disabled . '"><i class="fa fa-stop"></i></span> '; $actions = '<a class="btn btn-success btn-xs" data-action="lstvhcontrol" data-lstact="enable" title="' . $note_enablevh . '"><i class="fa fa-play"></i></a>'; } $vbody .= '</td><td>' . htmlspecialchars(wordwrap($vn, 40, "\n", true)) . '</td><td>'; if (isset($vh['templ'])) { $vbody .= $vh['templ']; } $vbody .= '</td><td>'; if (isset($vh['domains'])) { $vbody .= htmlspecialchars(wordwrap(implode("\n", array_keys($vh['domains'])), 60, "\n", true)); } $vbody .= '</td><td>'; $vbody .= $actions; $vbody .= '</td></tr>'; } $res = array('l_running' => $running, 'l_broken' => $broken, 'v_running' => $vrunning, 'v_disabled' => $vdisabled, 'v_err' => $verrors, 'l_body' => $body, 'v_body' => $vbody); echo json_encode($res); }
protected function add_SERVICE_SUSPENDVH($id) { $attrs = array(DTblDefBase::NewCustFlagAttr('suspendedVhosts', NULL, DAttr::BM_HIDE | DAttr::BM_NOEDIT, true, 'vhname', NULL, NULL, 1)); $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_suspendvh'), $attrs); }
protected function add_LVT_SSL_CLVERIFY($id) { $attrs = array(DTblDefBase::NewSelAttr('clientVerify', DMsg::ALbl('l_clientverify'), array('0' => 'none', '1' => 'optional', '2' => 'require', '3' => 'optional_no_ca')), DTblDefBase::NewIntAttr('verifyDepth', DMsg::ALbl('l_verifydepth'), true, 0, 100), DTblDefBase::NewTextAttr('crlPath', DMsg::ALbl('l_crlpath'), 'cust'), DTblDefBase::NewTextAttr('crlFile', DMsg::ALbl('l_crlfile'), 'cust')); $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_clientverify'), $attrs); }
function print_step_4() { $manual_script = $this->check->pass_val['manual_script']; if ($manual_script == NULL) { // illegal entry return; } $buf = $this->form_start(); $ver = $this->check->pass_val['php_version']; $binname = 'lsphp-' . $ver; $repl = array('%%server_root%%' => SERVER_ROOT, '%%binname%%' => $binname, '%%phpver%%' => $ver[0]); $notes = '<ul><li>' . DMsg::UIStr('buildphp_binarylocnote', $repl) . '</li>'; if ($this->check->pass_val['extentions'] != '') { $notes1 = BuildTool::getExtensionNotes($this->check->pass_val['extentions']); $notes .= "\n" . $notes1 . '</ul>'; } $buf .= UIBase::info_divmesg($notes); $echo_cmd = 'echo "For security reason, please log in and manually run the pre-generated script to continue."'; exec($echo_cmd . ' > ' . $this->check->pass_val['log_file']); exec($echo_cmd . ' > ' . $this->check->pass_val['progress_file']); $repl = array('%%manual_script%%' => $manual_script); $buf .= UIBase::warn_divmesg(DMsg::UIStr('buildphp_manualrunnotice', $repl)); $buf .= ' <h5>' . DMsg::ALbl('buildphp_mainstatus') . ': <span id="statusgraphzone"><i class="txt-color-teal fa fa-gear fa-spin"></i></span></h5> <div> <pre class="lst-statuszone" id="statuszone"></pre> </div> <h5>' . DMsg::ALbl('buildphp_detaillog') . ': </h5> <div > <pre class="lst-logzone" id="logzone">' . $cmd . '</pre> </div>'; $buf .= $this->form_end(); echo $buf; }