Added new items to satellite editor view

This commit is contained in:
Arturo Gonzalez 2017-08-23 15:01:09 +02:00
parent 3291526195
commit dce27f3ac2
1 changed files with 53 additions and 5 deletions

View File

@ -33,21 +33,36 @@ if (isset($_GET["server"])) {
$id_server= get_parameter_get ("server");
// Headers
ui_print_page_header (__('Update Server'), "images/gm_servers.png", false, "servers", true);
$sql = sprintf("SELECT name, ip_address, description FROM tserver WHERE id_server = %d",$id_server);
$sql = sprintf("SELECT name, ip_address, description, server_type, exec_proxy FROM tserver WHERE id_server = %d",$id_server);
$row = db_get_row_sql ($sql);
echo '<form name="servers" method="POST" action="index.php?sec=gservers&sec2=godmode/servers/modificar_server&update=1">';
html_print_input_hidden ("server",$id_server);
$server_type = __('Standard');
if ($row["server_type"] == 13) {
$server_type = __('Satellite');
}
$exec_server_enable = __("No");
if ($row["exec_proxy"] == 1) {
$exec_server_enable = __('Yes');
}
$table->cellpadding=4;
$table->cellspacing=4;
$table->width='100%';
$table->class="databox filters";
$table->data[] = array (__('Name'),$row["name"]);
$table->data[] = array (__('IP Address'),html_print_input_text ('address',$row["ip_address"],'',50,0,true));
$table->data[] = array (__('Description'),html_print_input_text ('description',$row["description"],'',50,0,true));
html_print_table ($table);
$table->data[] = array (__('Name'), $row["name"]);
$table->data[] = array (__('IP Address'), html_print_input_text ('address',$row["ip_address"],'',50,0,true));
$table->data[] = array (__('Description'), html_print_input_text ('description',$row["description"],'',50,0,true));
if (enterprise_installed()) {
$table->data[] = array (__('Type'), $server_type);
$table->data[] = array (__('Exec Server Enable'), $exec_server_enable);
$table->data[] = array (__('Check Exec Server'), '<a id="check_exec_server">' . html_print_image ("images/dot_red.disabled.png", true) . '</a>');
}
html_print_table ($table);
echo '<div class="action-buttons" style="width: 100%">';
echo '<input type="submit" class="sub upd" value="'.__('Update').'">';
@ -141,3 +156,36 @@ else {
require($config['homedir'] . '/godmode/servers/servers.build_table.php');
}
?>
<script language="javascript" type="text/javascript">
$(document).ready (function () {
$("#check_exec_server img").on("click", function () {
$("#check_exec_server img").attr("src", "images/spinner.gif");
check_process("<?php echo $id_server;?>");
});
});
function check_process (id_server) {
var parameters = {};
parameters['page'] = 'enterprise/include/ajax/servers.ajax';
parameters['check_exec_server'] = 1;
parameters['id_server'] = id_server;
jQuery.post(
"ajax.php",
parameters,
function (data) {
if (data) {
$("#check_exec_server img").attr("src", "images/dot_green.png");
}
else {
$("#check_exec_server img").attr("src", "images/dot_red.png");
}
},
"json"
);
}
</script>