mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
Update menu VM
This commit is contained in:
parent
1e98059760
commit
305b2823b7
@ -78,7 +78,7 @@ function start_vm_configuration() {
|
|||||||
while true; do
|
while true; do
|
||||||
OS_TYPE=$(dialog --backtitle "ProxMenux" \
|
OS_TYPE=$(dialog --backtitle "ProxMenux" \
|
||||||
--title "$(translate "Select System Type")" \
|
--title "$(translate "Select System Type")" \
|
||||||
--menu "$(translate "Choose the type of virtual system to install:")" 18 70 8 \
|
--menu "\n$(translate "Choose the type of virtual system to install:")" 18 70 8 \
|
||||||
1 "$(translate "Create") VM System NAS" \
|
1 "$(translate "Create") VM System NAS" \
|
||||||
2 "$(translate "Create") VM System Windows" \
|
2 "$(translate "Create") VM System Windows" \
|
||||||
3 "$(translate "Create") VM System Linux" \
|
3 "$(translate "Create") VM System Linux" \
|
||||||
|
@ -41,13 +41,13 @@ function select_virtual_disk() {
|
|||||||
|
|
||||||
VIRTUAL_DISKS=()
|
VIRTUAL_DISKS=()
|
||||||
|
|
||||||
# Loop to add multiple disks
|
|
||||||
local add_more_disks=true
|
local add_more_disks=true
|
||||||
while $add_more_disks; do
|
while $add_more_disks; do
|
||||||
|
|
||||||
msg_info "Detecting available storage volumes..."
|
msg_info "Detecting available storage volumes..."
|
||||||
|
|
||||||
# Get list of available storage
|
|
||||||
STORAGE_MENU=()
|
STORAGE_MENU=()
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
TAG=$(echo $line | awk '{print $1}')
|
TAG=$(echo $line | awk '{print $1}')
|
||||||
@ -57,7 +57,7 @@ function select_virtual_disk() {
|
|||||||
STORAGE_MENU+=("$TAG" "$ITEM" "OFF")
|
STORAGE_MENU+=("$TAG" "$ITEM" "OFF")
|
||||||
done < <(pvesm status -content images | awk 'NR>1')
|
done < <(pvesm status -content images | awk 'NR>1')
|
||||||
|
|
||||||
# Check that storage is available
|
|
||||||
VALID=$(pvesm status -content images | awk 'NR>1')
|
VALID=$(pvesm status -content images | awk 'NR>1')
|
||||||
if [ -z "$VALID" ]; then
|
if [ -z "$VALID" ]; then
|
||||||
msg_error "Unable to detect a valid storage location."
|
msg_error "Unable to detect a valid storage location."
|
||||||
@ -66,7 +66,7 @@ function select_virtual_disk() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Select storage
|
|
||||||
if [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then
|
if [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then
|
||||||
STORAGE=${STORAGE_MENU[0]}
|
STORAGE=${STORAGE_MENU[0]}
|
||||||
msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location."
|
msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location."
|
||||||
@ -90,7 +90,7 @@ function select_virtual_disk() {
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Request disk size
|
|
||||||
DISK_SIZE=$(whiptail --backtitle "ProxMenuX" --inputbox "$(translate "System Disk Size (GB)")" 8 58 32 --title "VIRTUAL DISK" --cancel-button Cancel 3>&1 1>&2 2>&3)
|
DISK_SIZE=$(whiptail --backtitle "ProxMenuX" --inputbox "$(translate "System Disk Size (GB)")" 8 58 32 --title "VIRTUAL DISK" --cancel-button Cancel 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@ -109,18 +109,18 @@ function select_virtual_disk() {
|
|||||||
DISK_SIZE="32"
|
DISK_SIZE="32"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Store the configuration in the disk list
|
|
||||||
VIRTUAL_DISKS+=("${STORAGE}:${DISK_SIZE}")
|
VIRTUAL_DISKS+=("${STORAGE}:${DISK_SIZE}")
|
||||||
|
|
||||||
|
|
||||||
# Ask if you want to create another disk
|
|
||||||
if ! whiptail --backtitle "ProxMenuX" --title "$(translate "Add Another Disk")" \
|
if ! whiptail --backtitle "ProxMenuX" --title "$(translate "Add Another Disk")" \
|
||||||
--yesno "$(translate "Do you want to add another virtual disk?")" 8 58; then
|
--yesno "$(translate "Do you want to add another virtual disk?")" 8 58; then
|
||||||
add_more_disks=false
|
add_more_disks=false
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Show summary of the created disks
|
|
||||||
if [ ${#VIRTUAL_DISKS[@]} -gt 0 ]; then
|
if [ ${#VIRTUAL_DISKS[@]} -gt 0 ]; then
|
||||||
|
|
||||||
msg_ok "Virtual Disks Created:"
|
msg_ok "Virtual Disks Created:"
|
||||||
|
@ -33,7 +33,7 @@ function select_linux_iso() {
|
|||||||
while [[ "$EXIT_FLAG" != "yes" ]]; do
|
while [[ "$EXIT_FLAG" != "yes" ]]; do
|
||||||
|
|
||||||
if [[ "$LANGUAGE" == "es" ]]; then
|
if [[ "$LANGUAGE" == "es" ]]; then
|
||||||
# Menú en español formateado manualmente
|
|
||||||
CHOICE=$(dialog --clear \
|
CHOICE=$(dialog --clear \
|
||||||
--backtitle "ProxMenux" \
|
--backtitle "ProxMenux" \
|
||||||
--title "Opciones de instalación de Linux" \
|
--title "Opciones de instalación de Linux" \
|
||||||
@ -45,7 +45,7 @@ function select_linux_iso() {
|
|||||||
4 "Volver al menú principal" \
|
4 "Volver al menú principal" \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
else
|
else
|
||||||
# Menú multilingüe con traducción
|
|
||||||
local desc1 desc2 desc3 back
|
local desc1 desc2 desc3 back
|
||||||
desc1="$(translate "Install with traditional method")"
|
desc1="$(translate "Install with traditional method")"
|
||||||
desc2="$(translate "Install with Cloud-Init script")"
|
desc2="$(translate "Install with Cloud-Init script")"
|
||||||
@ -240,7 +240,7 @@ function select_linux_other_scripts() {
|
|||||||
2)
|
2)
|
||||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/vm/docker-vm.sh)"
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/vm/docker-vm.sh)"
|
||||||
|
|
||||||
# Mostrar credenciales
|
|
||||||
whiptail --title "Docker VM Info" \
|
whiptail --title "Docker VM Info" \
|
||||||
--msgbox "$(translate "Default Login Credentials:\n\nUsername: root\nPassword: docker")" 12 50
|
--msgbox "$(translate "Default Login Credentials:\n\nUsername: root\nPassword: docker")" 12 50
|
||||||
;;
|
;;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# ProxMenux - NAS ISO Selector (Dialog Edition)
|
# ProxMenux - NAS ISO Selector (Dialog Edition)
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
|
|
||||||
# Configuración Base
|
|
||||||
BASE_DIR="/usr/local/share/proxmenux"
|
BASE_DIR="/usr/local/share/proxmenux"
|
||||||
UTILS_FILE="$BASE_DIR/utils.sh"
|
UTILS_FILE="$BASE_DIR/utils.sh"
|
||||||
VENV_PATH="/opt/googletrans-env"
|
VENV_PATH="/opt/googletrans-env"
|
||||||
@ -35,7 +35,7 @@ function select_nas_iso() {
|
|||||||
--menu "\n$(translate "Select the NAS system to install:")" 18 70 10 \
|
--menu "\n$(translate "Select the NAS system to install:")" 18 70 10 \
|
||||||
"${NAS_OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
"${NAS_OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
# Si se pulsa ESC o Cancelar
|
|
||||||
[[ $? -ne 0 ]] && return 1
|
[[ $? -ne 0 ]] && return 1
|
||||||
|
|
||||||
case "$NAS_TYPE" in
|
case "$NAS_TYPE" in
|
||||||
|
@ -84,7 +84,7 @@ if [[ ! -f "$CONVERTER/convert.sh" ]]; then
|
|||||||
cd "$TMP_DIR" || exit 1
|
cd "$TMP_DIR" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Crear script de descarga uup_download_linux.sh
|
|
||||||
cat > uup_download_linux.sh <<EOF
|
cat > uup_download_linux.sh <<EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
mkdir -p files
|
mkdir -p files
|
||||||
|
@ -110,7 +110,7 @@ function apply_default_vm_config() {
|
|||||||
function configure_vm_advanced() {
|
function configure_vm_advanced() {
|
||||||
header_info
|
header_info
|
||||||
|
|
||||||
# Obtener el siguiente ID libre
|
|
||||||
NEXTID=$(pvesh get /cluster/nextid 2>/dev/null || echo "100")
|
NEXTID=$(pvesh get /cluster/nextid 2>/dev/null || echo "100")
|
||||||
[[ -z "$MAC" ]] && MAC=$(generate_mac)
|
[[ -z "$MAC" ]] && MAC=$(generate_mac)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user