mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Server management
This commit is contained in:
parent
7535a1b6be
commit
cbb8c593aa
2 changed files with 238 additions and 12 deletions
|
@ -45,9 +45,24 @@ exec (VESTA_CMD."v-list-remote-dns-hosts json", $output, $return_var);
|
||||||
$dns_cluster = json_decode(implode('', $output), true);
|
$dns_cluster = json_decode(implode('', $output), true);
|
||||||
unset($output);
|
unset($output);
|
||||||
foreach ($dns_cluster as $key => $value) {
|
foreach ($dns_cluster as $key => $value) {
|
||||||
$v_dns_cluster='yes';
|
$v_dns_cluster = 'yes';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List MySQL hosts
|
||||||
|
exec (VESTA_CMD."v-list-database-hosts mysql json", $output, $return_var);
|
||||||
|
$v_mysql_hosts = json_decode(implode('', $output), true);
|
||||||
|
unset($output);
|
||||||
|
foreach ($v_mysql_hosts as $key => $value) {
|
||||||
|
$v_mysql = 'yes';
|
||||||
|
}
|
||||||
|
|
||||||
|
// List PostgreSQL hosts
|
||||||
|
exec (VESTA_CMD."v-list-database-hosts pgsql json", $output, $return_var);
|
||||||
|
$v_pgsql_hosts = json_decode(implode('', $output), true);
|
||||||
|
unset($output);
|
||||||
|
foreach ($v_pgsql_hosts as $key => $value) {
|
||||||
|
$v_psql = 'yes';
|
||||||
|
}
|
||||||
|
|
||||||
// List backup settings
|
// List backup settings
|
||||||
$v_backup_dir = "/backup";
|
$v_backup_dir = "/backup";
|
||||||
|
@ -142,6 +157,46 @@ if (!empty($_POST['save'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update mysql pasword
|
||||||
|
if (empty($_SESSION['error_msg'])) {
|
||||||
|
if (!empty($_POST['v_mysql_password'])) {
|
||||||
|
exec (VESTA_CMD."v-change-database-host-password mysql localhost root '".escapeshellarg($_POST['v_mysql_password'])."'", $output, $return_var);
|
||||||
|
check_return_code($return_var,$output);
|
||||||
|
unset($output);
|
||||||
|
$v_db_adv = 'yes';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Update webmail url
|
||||||
|
if (empty($_SESSION['error_msg'])) {
|
||||||
|
if ($_POST['v_mail_url'] != $_SESSION['MAIL_URL']) {
|
||||||
|
exec (VESTA_CMD."v-change-sys-config-value MAIL_URL '".escapeshellarg($_POST['v_mail_url'])."'", $output, $return_var);
|
||||||
|
check_return_code($return_var,$output);
|
||||||
|
unset($output);
|
||||||
|
$v_mail_adv = 'yes';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update phpMyAdmin url
|
||||||
|
if (empty($_SESSION['error_msg'])) {
|
||||||
|
if ($_POST['v_mysql_url'] != $_SESSION['DB_PMA_URL']) {
|
||||||
|
exec (VESTA_CMD."v-change-sys-config-value DB_PMA_URL '".escapeshellarg($_POST['v_mysql_url'])."'", $output, $return_var);
|
||||||
|
check_return_code($return_var,$output);
|
||||||
|
unset($output);
|
||||||
|
$v_db_adv = 'yes';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update phpPgAdmin url
|
||||||
|
if (empty($_SESSION['error_msg'])) {
|
||||||
|
if ($_POST['v_psql_url'] != $_SESSION['DB_PGA_URL']) {
|
||||||
|
exec (VESTA_CMD."v-change-sys-config-value DB_PGA_URL '".escapeshellarg($_POST['v_pgsql_url'])."'", $output, $return_var);
|
||||||
|
check_return_code($return_var,$output);
|
||||||
|
unset($output);
|
||||||
|
$v_db_adv = 'yes';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Disable local backup
|
// Disable local backup
|
||||||
if (empty($_SESSION['error_msg'])) {
|
if (empty($_SESSION['error_msg'])) {
|
||||||
|
|
|
@ -171,6 +171,18 @@
|
||||||
<br><br>
|
<br><br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text">
|
||||||
|
<?php print __('Backend Pool Mode') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_web_backend_pool" value="<?php echo $_SESSION['WEB_BACKEND_POOL']; ?>" disabled>
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -206,16 +218,30 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($v_dns_cluster != 'yes') {?>
|
|
||||||
<select class="vst-list" name="v_dns_cluster" disabled>
|
<select class="vst-list" name="v_dns_cluster" disabled>
|
||||||
<option value='no'><?php print __('no'); ?></option>
|
<option value='no'><?php print __('no'); ?></option>
|
||||||
|
<option value='yes' <?php if($v_dns_cluster == 'yes') echo 'selected' ?> ><?php print __('yes'); ?></option>
|
||||||
</select>
|
</select>
|
||||||
<?php } else { ?>
|
<br><br><br>
|
||||||
<textarea size="20" class="vst-textinput" name="v_dns_cluster"><?php foreach ($dns_cluster as $key => $value) echo $key . "\n"; ?></textarea>
|
</td>
|
||||||
<?php } ?>
|
</tr>
|
||||||
|
<?php if ($v_dns_cluster = 'yes') {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($dns_cluster as $key => $value) {
|
||||||
|
$i++;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Host'). ' #'.$i ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_dns_remote_host" value="<?php echo $key; ?>" disabled>
|
||||||
<br><br>
|
<br><br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php }} ?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -269,9 +295,14 @@
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vst-text input-label">
|
<td class="vst-text">
|
||||||
<?php print __('NONE');?>
|
<?php print __('Webmail URL') ?>
|
||||||
<br><br><br>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_mail_url" value="<?php echo $_SESSION['MAIL_URL']; ?>">
|
||||||
|
<br><br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -289,13 +320,153 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vst-text input-label step-left">
|
<td class="vst-text input-label step-left">
|
||||||
<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="db">
|
<table style="display:<?php if (empty($v_db_adv)) echo 'none';?> ;" id="db">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vst-text input-label">
|
<td class="vst-text input-label">
|
||||||
<?php print __('NONE');?>
|
<?php print __('MySQL Support');?>
|
||||||
<br><br><br>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<select class="vst-list" name="v_mysql" disabled>
|
||||||
|
<option value='no'><?php print __('no'); ?></option>
|
||||||
|
<option value='yes' <?php if($v_mysql == 'yes') echo 'selected' ?> ><?php print __('yes'); ?></option>
|
||||||
|
</select>
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php if ($v_mysql == 'yes') { ?>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text">
|
||||||
|
<?php print __('phpMyAdmin URL') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_mysql_url" value="<?php echo $_SESSION['DB_PMA_URL']; ?>">
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ($v_mysql == 'yes') {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($v_mysql_hosts as $key => $value) {
|
||||||
|
$i++;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Host'). ' #'.$i ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_mysql_host" value="<?php echo $key; ?>" disabled>
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Password') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_mysql_password" value="">
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Maximum Number Of Databases') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_mysql_max" value="<?php echo $value['MAX_DB']; ?>" disabled>
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Current Number Of Databases') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_mysql_max" value="<?php echo $value['U_DB_BASES']; ?>" disabled>
|
||||||
|
<br><br><br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php }} ?>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text input-label">
|
||||||
|
<?php print __('PostgreSQL Support');?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<select class="vst-list" name="v_pgsql" disabled>
|
||||||
|
<option value='no'><?php print __('no'); ?></option>
|
||||||
|
<option value='yes' <?php if($v_pgsql == 'yes') echo 'selected' ?> ><?php print __('yes'); ?></option>
|
||||||
|
</select>
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php if ($v_pgsql == 'yes') { ?>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text">
|
||||||
|
<?php print __('phpPgAdmin URL') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_pgsql_url" value="<?php echo $_SESSION['DB_PGA_URL']; ?>">
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ($v_pgsql == 'yes') {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($v_pgsql_hosts as $key => $value) {
|
||||||
|
$i++;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Host'). ' #'.$i ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_pgsql_host" value="<?php echo $key; ?>" disabled>
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Maximum Number Of Databases') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_psql_max" value="<?php echo $value['MAX_DB']; ?>" disabled>
|
||||||
|
<br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="vst-text step-left">
|
||||||
|
<?php print __('Current Number Of Databases') ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-left">
|
||||||
|
<input type="text" size="20" class="vst-input" name="v_pgsql_max" value="<?php echo $value['U_DB_BASES']; ?>" disabled>
|
||||||
|
<br><br><br><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php }} ?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -433,7 +604,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vst-text input-label step-top">
|
<td class="vst-text input-label step-top">
|
||||||
<a href="javascript:elementHideShow('vesta');" class="vst-text">
|
<a href="javascript:elementHideShow('vesta');" class="vst-text">
|
||||||
<b><?php print __('Vesta Control Panel Plugins');?> <img src="/images/arrow.png"></b>
|
<b><?php print __('Vesta Control Panel Plugins');?> <span style="color:#ff6701;font-size:10px; padding:0 10px;">preview</span><img src="/images/arrow.png"></b>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue