Updated and improved API respones.

This commit is contained in:
Alexander 2021-10-31 23:24:42 +02:00
commit 859e65647f
33 changed files with 254 additions and 18 deletions

View file

@ -12,6 +12,9 @@ exec (VESTA_CMD."v-list-user-backup-exclusions $user json", $output, $return_var
$data = json_decode(implode('', $output), true);
unset($output);
// Render page
// render_page($user, $TAB, 'list_backup_exclusions');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -13,11 +13,15 @@ if (empty($_GET['backup'])){
$data = json_decode(implode('', $output), true);
$data = array_reverse($data,true);
unset($output);
// render_page($user, $TAB, 'list_backup');
} else {
exec (VESTA_CMD."v-list-user-backup $user ".escapeshellarg($_GET['backup'])." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data,true);
unset($output);
// render_page($user, $TAB, 'list_backup_detail');
}
$backup = $_GET['backup'];

View file

@ -14,6 +14,9 @@ $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true);
unset($output);
// Render page
// render_page($user, $TAB, 'list_cron');
if($panel[$user]['CRON_REPORTS'] == 'yes') {
$cron_reports = __('turn off notifications');
} else {

View file

@ -15,6 +15,9 @@ unset($output);
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
// Render page
// render_page($user, $TAB, 'list_db');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -13,11 +13,15 @@ if (empty($_GET['domain'])){
$data = json_decode(implode('', $output), true);
$data = array_reverse($data, true);
unset($output);
// render_page($user, $TAB, 'list_dns');
} else {
exec (VESTA_CMD."v-list-dns-records ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data, true);
unset($output);
// render_page($user, $TAB, 'list_dns_rec');
}
foreach ($data as $key => $value) {

View file

@ -41,6 +41,9 @@ foreach ($data as $key => $value) {
}
}
// Render page
// render_page($user, $TAB, 'list_firewall');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -31,6 +31,9 @@ foreach ($data as $key => $value) {
$data[$key]['delete_conf'] = __('DELETE_IP_CONFIRMATION', $key);
}
// Render page
// render_page($user, $TAB, 'list_ip');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -24,6 +24,9 @@ foreach ($data as $key => $value) {
}
}
// Render page
// render_page($user, $TAB, 'list_log');
$object = (object)[];
$object->data = $data;
$object->user = $user;

View file

@ -14,6 +14,8 @@ if (empty($_GET['domain'])){
unset($output);
$favorites = $_SESSION['favourites']['MAIL'];
// render_page($user, $TAB, 'list_mail');
} else {
exec (VESTA_CMD."v-list-mail-accounts ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
@ -21,6 +23,8 @@ if (empty($_GET['domain'])){
unset($output);
$favorites = $_SESSION['favourites']['MAIL_ACC'];
// render_page($user, $TAB, 'list_mail_acc');
}
$uname_arr=posix_uname();

View file

@ -29,6 +29,9 @@ foreach ($data as $key => $value) {
$data[$key]['delete_conf'] = __('DELETE_PACKAGE_CONFIRMATION', $key);
}
// Render page
// render_page($user, $TAB, 'list_packages');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -18,6 +18,9 @@ exec (VESTA_CMD."v-list-sys-rrd json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
// Render page
// render_page($user, $TAB, 'list_rrd');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -97,6 +97,9 @@ foreach ($sys as $key => $value) {
$sys[$key]['UPTIME'] = humanize_time($sys[$key]['UPTIME']);
}
// Render page
// render_page($user, $TAB, 'list_services');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -42,6 +42,9 @@ foreach ($data as $key => $value) {
}
}
// Render page
// render_page($user, $TAB, 'list_stats');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -21,6 +21,9 @@ exec (VESTA_CMD."v-list-sys-vesta-autoupdate plain", $output, $return_var);
$autoupdate = $output[0];
unset($output);
// Render page
// render_page($user, $TAB, 'list_updates');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -14,7 +14,9 @@ if ($user == 'admin') {
}
$data = json_decode(implode('', $output), true);
$data = array_reverse($data,true);
// Render page
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
// render_page($user, $TAB, 'list_user');
$_SESSION['back'] = $_SERVER['REQUEST_URI'];

View file

@ -13,7 +13,9 @@ $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true);
$ips = json_decode(shell_exec(VESTA_CMD.'v-list-sys-ips json'), true);
// Render page
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
// render_page($user, $TAB, 'list_web');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
@ -77,15 +79,23 @@ foreach ($data as $key => $value) {
$data[$key]['FTP'] = $data[$key]['FTP_USER'];
}
$data[$key]['PROXY_SYSTEM'] = !empty($_SESSION['PROXY_SYSTEM']);
$data[$key]['PROXY_SUPPORT'] = 'no';
if (!empty($data[$key]['PROXY'])) {
$data[$key]['PROXY_SUPPORT'] = 'yes';
}
$data[$key]['WEB_BACKEND'] = !empty($_SESSION['WEB_BACKEND']);
$data[$key]['BACKEND_SUPPORT'] = 'no';
if (!empty($data[$key]['BACKEND'])) {
$data[$key]['BACKEND_SUPPORT'] = 'yes';
}
$data[$key]['PROXY_SUPPORT'] = 'no';
if (!empty($data[$key]['PROXY'])) {
$data[$key]['PROXY_SUPPORT'] = 'yes';
}
$data[$key]['U_BANDWIDTH_SIZE'] = humanize_usage_size($data[$key]['U_BANDWIDTH']);
$data[$key]['U_BANDWIDTH_MEASURE'] = humanize_usage_measure($data[$key]['U_BANDWIDTH']);
$data[$key]['U_DISK_SIZE'] = humanize_usage_size($data[$key]['U_DISK']);
$data[$key]['U_DISK_MEASURE'] = humanize_usage_measure($data[$key]['U_DISK']);
$data[$key]['delete_confirmation'] = __('DELETE_DOMAIN_CONFIRMATION', $key);