Files
TA-ProxMenu/inc/notifications.inc
David Schroeder 6f4c95e0f2 menu update
2026-09-24 19:22:04 -05:00

46 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# Interactive entry points; backend operations run only after selection.
TAPM_NOTIFICATION_ACTION() {
python3 /opt/idssys/ta-proxmenu/inc/notifications.py "$@"
local result=$?
ENTER2CONTINUE
return "$result"
}
TAPM_UPDATE_NOTIFICATION_MENU() {
local -a labels=(
"All available package updates"
"Proxmox VE version updates only"
"Disable update notifications"
)
local -a values=(all version disabled)
while true; do
SELECT_MENU "Update Notification Policy" labels values
case "$MENU_SELECTION" in
all|version|disabled) TAPM_NOTIFICATION_ACTION apply "$MENU_SELECTION" ;;
back) return ;;
quit) EXIT1; exit 0 ;;
esac
done
}
TAPM_NOTIFICATIONS_MENU() {
local -a labels=(
"Update notification policy"
"Review notification settings and destinations"
"Send a test notification"
)
local -a values=(policy delivery test)
while true; do
SELECT_MENU "Proxmox Notifications" labels values
case "$MENU_SELECTION" in
policy) TAPM_UPDATE_NOTIFICATION_MENU ;;
delivery) TAPM_NOTIFICATION_ACTION delivery ;;
test) TAPM_NOTIFICATION_ACTION test ;;
back) return ;;
quit) EXIT1; exit 0 ;;
esac
done
}