mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
Merge pull request #2073 from serghey-rodin/feature/react-ui-and-api
Feature/react UI and api
This commit is contained in:
commit
a7c5714d85
39 changed files with 8 additions and 150 deletions
|
@ -13,7 +13,6 @@ import QS from 'qs';
|
||||||
|
|
||||||
import './EditCronJob.scss';
|
import './EditCronJob.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { useHistory } from 'react-router-dom';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import QS from 'qs';
|
import QS from 'qs';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import QS from 'qs';
|
||||||
|
|
||||||
import './EditDomainNameSystem.scss';
|
import './EditDomainNameSystem.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
import { andler } from 'src/actions/Session/sessionActions';
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import QS from 'qs';
|
||||||
|
|
||||||
import './EditInternetProtocol.scss';
|
import './EditInternetProtocol.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
import './AddMail.scss'
|
import './AddMail.scss'
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ import QS from 'qs';
|
||||||
|
|
||||||
import './EditMail.scss';
|
import './EditMail.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import { useHistory } from 'react-router-dom';
|
||||||
import Spinner from '../../Spinner/Spinner';
|
import Spinner from '../../Spinner/Spinner';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import QS from 'qs';
|
||||||
|
|
||||||
import './EditPackage.scss';
|
import './EditPackage.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
import './AddUser.scss';
|
import './AddUser.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import QS from 'qs';
|
||||||
|
|
||||||
import './EditUser.scss';
|
import './EditUser.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ import QS from 'qs';
|
||||||
import './EditWeb.scss';
|
import './EditWeb.scss';
|
||||||
import TextArea from '../../ControlPanel/AddItemLayout/Form/TextArea/TextArea';
|
import TextArea from '../../ControlPanel/AddItemLayout/Form/TextArea/TextArea';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
import HtmlParser from 'react-html-parser';
|
import HtmlParser from 'react-html-parser';
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import ControlPanelContent from '../ControlPanelContent/ControlPanelContent';
|
||||||
import WebLogs from '../WebLogs/WebLogs';
|
import WebLogs from '../WebLogs/WebLogs';
|
||||||
import LoginForm from 'src/components/Login/LoginForm';
|
import LoginForm from 'src/components/Login/LoginForm';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { setAuthToken } from 'src/utils/token';
|
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
||||||
import ServiceInfo from 'src/containers/ServiceInfo';
|
import ServiceInfo from 'src/containers/ServiceInfo';
|
||||||
import ForgotPassword from 'src/components/ForgotPassword';
|
import ForgotPassword from 'src/components/ForgotPassword';
|
||||||
|
@ -70,9 +69,13 @@ const App = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!Object.entries(session.i18n).length) {
|
if (!Object.entries(session.i18n).length) {
|
||||||
dispatch(checkAuthHandler()).then(token => {
|
dispatch(checkAuthHandler())
|
||||||
setLoading(false);
|
.then(token => {
|
||||||
});
|
setLoading(false);
|
||||||
|
}, (error) => {
|
||||||
|
console.error(error);
|
||||||
|
return history.push('/login');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, [dispatch, history, session]);
|
}, [dispatch, history, session]);
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import './MailAccounts.scss';
|
import './MailAccounts.scss';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { checkAuthHandler } from 'src/actions/Session/sessionActions';
|
|
||||||
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions';
|
||||||
|
|
||||||
export default function MailAccounts(props) {
|
export default function MailAccounts(props) {
|
||||||
|
|
|
@ -165,13 +165,8 @@ if (empty($_GET['domain'])) {
|
||||||
$v_ns8 = str_replace("'", "", $nameservers[7]);
|
$v_ns8 = str_replace("'", "", $nameservers[7]);
|
||||||
unset($output);
|
unset($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
// render_page($user, $TAB, 'add_dns');
|
|
||||||
} else {
|
} else {
|
||||||
// Display body for dns record
|
|
||||||
|
|
||||||
$v_domain = $_GET['domain'];
|
$v_domain = $_GET['domain'];
|
||||||
// render_page($user, $TAB, 'add_dns_rec');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
|
|
|
@ -63,8 +63,6 @@ if (!empty($_POST['ok'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render
|
|
||||||
// render_page($user, $TAB, 'add_firewall');
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'ok_msg' => $_SESSION['ok_msg'],
|
'ok_msg' => $_SESSION['ok_msg'],
|
||||||
'error_msg' => $_SESSION['error_msg']
|
'error_msg' => $_SESSION['error_msg']
|
||||||
|
|
|
@ -195,18 +195,6 @@ if (!empty($_POST['ok_acc'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
if (empty($_GET['domain'])) {
|
|
||||||
// Display body for mail domain
|
|
||||||
|
|
||||||
// render_page($user, $TAB, 'add_mail');
|
|
||||||
} else {
|
|
||||||
// Display body for mail account
|
|
||||||
|
|
||||||
$v_domain = $_GET['domain'];
|
|
||||||
// render_page($user, $TAB, 'add_mail_acc');
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'error_msg' => $_SESSION['error_msg'],
|
'error_msg' => $_SESSION['error_msg'],
|
||||||
'ok_msg' => $_SESSION['ok_msg']
|
'ok_msg' => $_SESSION['ok_msg']
|
||||||
|
|
|
@ -200,9 +200,6 @@ if (empty($v_bandwidth)) $v_bandwidth = "'1000'";
|
||||||
if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd';
|
if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd';
|
||||||
if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd';
|
if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd';
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'add_package');
|
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'web_system' => $_SESSION['WEB_SYSTEM'],
|
'web_system' => $_SESSION['WEB_SYSTEM'],
|
||||||
'web_templates' => $web_templates,
|
'web_templates' => $web_templates,
|
||||||
|
|
|
@ -122,10 +122,6 @@ if (!empty($_POST['save'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'edit_backup_exclusions');
|
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'web' => $v_web,
|
'web' => $v_web,
|
||||||
'dns' => $v_dns,
|
'dns' => $v_dns,
|
||||||
|
|
|
@ -75,9 +75,6 @@ if (!empty($_POST['save'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'edit_cron');
|
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'username' => $user,
|
'username' => $user,
|
||||||
'job' => $_GET['job'],
|
'job' => $_GET['job'],
|
||||||
|
|
|
@ -83,9 +83,6 @@ if (!empty($_POST['save'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'edit_db');
|
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'username' => $user,
|
'username' => $user,
|
||||||
'database' => $_GET['database'],
|
'database' => $_GET['database'],
|
||||||
|
|
|
@ -607,10 +607,6 @@ foreach ($sys_arr as $key => $value) {
|
||||||
$_SESSION[$key] = $value;
|
$_SESSION[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'edit_server');
|
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'hostname' => $v_hostname,
|
'hostname' => $v_hostname,
|
||||||
'timezones' => $v_timezones,
|
'timezones' => $v_timezones,
|
||||||
|
|
|
@ -12,9 +12,6 @@ exec (VESTA_CMD."v-list-user-backup-exclusions $user json", $output, $return_var
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_backup_exclusions');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -13,15 +13,11 @@ if (empty($_GET['backup'])){
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
$data = array_reverse($data,true);
|
$data = array_reverse($data,true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// render_page($user, $TAB, 'list_backup');
|
|
||||||
} else {
|
} else {
|
||||||
exec (VESTA_CMD."v-list-user-backup $user ".escapeshellarg($_GET['backup'])." json", $output, $return_var);
|
exec (VESTA_CMD."v-list-user-backup $user ".escapeshellarg($_GET['backup'])." json", $output, $return_var);
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
$data = array_reverse($data,true);
|
$data = array_reverse($data,true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// render_page($user, $TAB, 'list_backup_detail');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$backup = $_GET['backup'];
|
$backup = $_GET['backup'];
|
||||||
|
|
|
@ -14,9 +14,6 @@ $data = json_decode(implode('', $output), true);
|
||||||
$data = array_reverse($data,true);
|
$data = array_reverse($data,true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_cron');
|
|
||||||
|
|
||||||
if($panel[$user]['CRON_REPORTS'] == 'yes') {
|
if($panel[$user]['CRON_REPORTS'] == 'yes') {
|
||||||
$cron_reports = __('turn off notifications');
|
$cron_reports = __('turn off notifications');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -15,9 +15,6 @@ unset($output);
|
||||||
|
|
||||||
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
|
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_db');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -13,15 +13,11 @@ if (empty($_GET['domain'])){
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
$data = array_reverse($data, true);
|
$data = array_reverse($data, true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// render_page($user, $TAB, 'list_dns');
|
|
||||||
} else {
|
} else {
|
||||||
exec (VESTA_CMD."v-list-dns-records ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
|
exec (VESTA_CMD."v-list-dns-records ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
$data = array_reverse($data, true);
|
$data = array_reverse($data, true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// render_page($user, $TAB, 'list_dns_rec');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
|
|
|
@ -41,9 +41,6 @@ foreach ($data as $key => $value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_firewall');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,6 @@ foreach ($data as $key => $value) {
|
||||||
$data[$key]['delete_conf'] = __('DELETE_IP_CONFIRMATION', $key);
|
$data[$key]['delete_conf'] = __('DELETE_IP_CONFIRMATION', $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_ip');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,6 @@ foreach ($data as $key => $value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_log');
|
|
||||||
|
|
||||||
$object = (object)[];
|
$object = (object)[];
|
||||||
$object->data = $data;
|
$object->data = $data;
|
||||||
$object->user = $user;
|
$object->user = $user;
|
||||||
|
|
|
@ -14,8 +14,6 @@ if (empty($_GET['domain'])){
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
$favorites = $_SESSION['favourites']['MAIL'];
|
$favorites = $_SESSION['favourites']['MAIL'];
|
||||||
|
|
||||||
// render_page($user, $TAB, 'list_mail');
|
|
||||||
} else {
|
} else {
|
||||||
exec (VESTA_CMD."v-list-mail-accounts ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
|
exec (VESTA_CMD."v-list-mail-accounts ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
|
@ -23,8 +21,6 @@ if (empty($_GET['domain'])){
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
$favorites = $_SESSION['favourites']['MAIL_ACC'];
|
$favorites = $_SESSION['favourites']['MAIL_ACC'];
|
||||||
|
|
||||||
// render_page($user, $TAB, 'list_mail_acc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$uname_arr=posix_uname();
|
$uname_arr=posix_uname();
|
||||||
|
|
|
@ -29,9 +29,6 @@ foreach ($data as $key => $value) {
|
||||||
$data[$key]['delete_conf'] = __('DELETE_PACKAGE_CONFIRMATION', $key);
|
$data[$key]['delete_conf'] = __('DELETE_PACKAGE_CONFIRMATION', $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_packages');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,6 @@ exec (VESTA_CMD."v-list-sys-rrd json", $output, $return_var);
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_rrd');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -97,9 +97,6 @@ foreach ($sys as $key => $value) {
|
||||||
$sys[$key]['UPTIME'] = humanize_time($sys[$key]['UPTIME']);
|
$sys[$key]['UPTIME'] = humanize_time($sys[$key]['UPTIME']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_services');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,6 @@ foreach ($data as $key => $value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_stats');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,6 @@ exec (VESTA_CMD."v-list-sys-vesta-autoupdate plain", $output, $return_var);
|
||||||
$autoupdate = $output[0];
|
$autoupdate = $output[0];
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_updates');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,7 @@ if ($user == 'admin') {
|
||||||
}
|
}
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
$data = array_reverse($data,true);
|
$data = array_reverse($data,true);
|
||||||
// Render page
|
|
||||||
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
|
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
|
||||||
// render_page($user, $TAB, 'list_user');
|
|
||||||
|
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,7 @@ $data = json_decode(implode('', $output), true);
|
||||||
$data = array_reverse($data,true);
|
$data = array_reverse($data,true);
|
||||||
$ips = json_decode(shell_exec(VESTA_CMD.'v-list-sys-ips json'), 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);
|
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
|
||||||
// render_page($user, $TAB, 'list_web');
|
|
||||||
|
|
||||||
// Back uri
|
// Back uri
|
||||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
|
@ -30,10 +30,6 @@ $command = $_SESSION['user'] == 'admin'
|
||||||
exec (VESTA_CMD . $command, $output, $return_var);
|
exec (VESTA_CMD . $command, $output, $return_var);
|
||||||
$data = json_decode(implode('', $output), true);
|
$data = json_decode(implode('', $output), true);
|
||||||
|
|
||||||
|
|
||||||
// Render page
|
|
||||||
// render_page($user, $TAB, 'list_search');
|
|
||||||
|
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
++$i;
|
++$i;
|
||||||
|
|
||||||
|
|
|
@ -132,44 +132,6 @@ function check_return_code($return_var,$output) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_page($user, $TAB, $page) {
|
|
||||||
$__template_dir = dirname(__DIR__) . '/templates/';
|
|
||||||
$__pages_js_dir = dirname(__DIR__) . '/js/pages/';
|
|
||||||
|
|
||||||
// Header
|
|
||||||
include($__template_dir . 'header.html');
|
|
||||||
|
|
||||||
// Panel
|
|
||||||
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
|
|
||||||
|
|
||||||
// Extarct global variables
|
|
||||||
// I think those variables should be passed via arguments
|
|
||||||
//*
|
|
||||||
extract($GLOBALS, EXTR_SKIP);
|
|
||||||
/*/
|
|
||||||
$variables = array_filter($GLOBALS, function($key){return preg_match('/^(v_|[a-z])[a-z\d]+$/', $key);}, ARRAY_FILTER_USE_KEY);
|
|
||||||
extract($variables, EXTR_OVERWRITE);
|
|
||||||
//*/
|
|
||||||
|
|
||||||
// Body
|
|
||||||
if (($_SESSION['user'] !== 'admin') && (@include($__template_dir . "user/$page.html"))) {
|
|
||||||
// User page loaded
|
|
||||||
} else {
|
|
||||||
// Not admin or user page doesn't exist
|
|
||||||
// Load admin page
|
|
||||||
@include($__template_dir . "admin/$page.html");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Including common js files
|
|
||||||
@include_once(dirname(__DIR__) . '/templates/scripts.html');
|
|
||||||
// Including page specific js file
|
|
||||||
if(file_exists($__pages_js_dir.$page.'.js'))
|
|
||||||
echo '<script type="text/javascript" src="/js/pages/'.$page.'.js?'.JS_LATEST_UPDATE.'"></script>';
|
|
||||||
|
|
||||||
// Footer
|
|
||||||
include($__template_dir . 'footer.html');
|
|
||||||
}
|
|
||||||
|
|
||||||
function top_panel($user, $TAB) {
|
function top_panel($user, $TAB) {
|
||||||
global $panel;
|
global $panel;
|
||||||
$command = VESTA_CMD."v-list-user '".$user."' 'json'";
|
$command = VESTA_CMD."v-list-user '".$user."' 'json'";
|
||||||
|
@ -193,13 +155,6 @@ function top_panel($user, $TAB) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
|
|
||||||
if ( $user == 'admin' ) {
|
|
||||||
include(dirname(__FILE__).'/../templates/admin/panel.html');
|
|
||||||
} else {
|
|
||||||
include(dirname(__FILE__).'/../templates/user/panel.html');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function translate_date($date){
|
function translate_date($date){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue