mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Fix /edit/server/ always says database unsupported
This commit is contained in:
parent
656d34ed0b
commit
6faead081b
3 changed files with 65 additions and 71 deletions
|
@ -28,12 +28,12 @@ json_list() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "{"
|
echo "["
|
||||||
for type in $(echo $DB_SYSTEM |sed -e 's/,/\n/'); do
|
for type in $(echo $DB_SYSTEM |sed -e 's/,/\n/'); do
|
||||||
if [ -e "$VESTA/conf/$type.conf" ]; then
|
if [ -e "$VESTA/conf/$type.conf" ]; then
|
||||||
for str in $(cat $VESTA/conf/$type.conf); do
|
for str in $(cat $VESTA/conf/$type.conf); do
|
||||||
eval $str
|
eval $str
|
||||||
echo -n ' "'$HOST'": {
|
echo -n ' {
|
||||||
"HOST": "'$HOST'",
|
"HOST": "'$HOST'",
|
||||||
"TYPE": "'$type'",
|
"TYPE": "'$type'",
|
||||||
"CHARSETS": "'$CHARSETS'",
|
"CHARSETS": "'$CHARSETS'",
|
||||||
|
@ -54,7 +54,7 @@ json_list() {
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo '}'
|
echo ']'
|
||||||
}
|
}
|
||||||
|
|
||||||
# SHELL list function
|
# SHELL list function
|
||||||
|
|
|
@ -46,21 +46,15 @@ foreach ($dns_cluster as $key => $value) {
|
||||||
$v_dns_cluster = 'yes';
|
$v_dns_cluster = 'yes';
|
||||||
}
|
}
|
||||||
|
|
||||||
// List MySQL hosts
|
// List Database hosts
|
||||||
exec (VESTA_CMD."v-list-database-hosts mysql json", $output, $return_var);
|
exec (VESTA_CMD."v-list-database-hosts json", $output, $return_var);
|
||||||
$v_mysql_hosts = json_decode(implode('', $output), true);
|
$db_hosts = json_decode(implode('', $output), true);
|
||||||
unset($output);
|
unset($output);
|
||||||
foreach ($v_mysql_hosts as $key => $value) {
|
$v_mysql_hosts = array_values(array_filter($db_hosts, function($host){return $host['TYPE'] === 'mysql';}));
|
||||||
$v_mysql = 'yes';
|
$v_mysql = count($v_mysql_hosts) ? 'yes' : 'no';
|
||||||
}
|
$v_pgsql_hosts = array_values(array_filter($db_hosts, function($host){return $host['TYPE'] === 'pgsql';}));
|
||||||
|
$v_pgsql = count($v_pgsql_hosts) ? 'yes' : 'no';
|
||||||
// List PostgreSQL hosts
|
unset($db_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_pgsql = 'yes';
|
|
||||||
}
|
|
||||||
|
|
||||||
// List backup settings
|
// List backup settings
|
||||||
$v_backup_dir = "/backup";
|
$v_backup_dir = "/backup";
|
||||||
|
|
|
@ -336,7 +336,7 @@
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if ($v_mysql == 'yes') {
|
<?php if ($v_mysql == 'yes') {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($v_mysql_hosts as $key => $value) {
|
foreach ($v_mysql_hosts as $value) {
|
||||||
$i++;
|
$i++;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -346,7 +346,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="step-left">
|
<td class="step-left">
|
||||||
<input type="text" size="20" class="vst-input" name="v_mysql_host" value="<?php echo $key; ?>" disabled>
|
<input type="text" size="20" class="vst-input" name="v_mysql_host" value="<?=$value['HOST']?>" disabled>
|
||||||
<br><br>
|
<br><br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -416,7 +416,7 @@
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if ($v_pgsql == 'yes') {
|
<?php if ($v_pgsql == 'yes') {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($v_pgsql_hosts as $key => $value) {
|
foreach ($v_pgsql_hosts as $value) {
|
||||||
$i++;
|
$i++;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -426,7 +426,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="step-left">
|
<td class="step-left">
|
||||||
<input type="text" size="20" class="vst-input" name="v_pgsql_host" value="<?php echo $key; ?>" disabled>
|
<input type="text" size="20" class="vst-input" name="v_pgsql_host" value="<?=$value['HOST']?>" disabled>
|
||||||
<br><br>
|
<br><br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue