2025-03-12 14:28:01 +01:00
|
|
|
import? "/etc/self-host-playbook/tiers/core.just"
|
|
|
|
import? "/etc/self-host-playbook/tiers/starter.just"
|
|
|
|
import? "/etc/self-host-playbook/tiers/premium.just"
|
|
|
|
|
|
|
|
@default:
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Function to show the header
|
|
|
|
show_header() {
|
|
|
|
gum style \
|
|
|
|
--foreground 212 --border double --border-foreground 212 \
|
|
|
|
--align center --width 50 --margin "1 2" --padding "1 2" \
|
2025-03-13 13:42:25 +01:00
|
|
|
"🚀 Self-Hosting Playbook Command Center 🚀"
|
2025-03-12 14:28:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Function to create menu items with icons and descriptions
|
|
|
|
create_menu() {
|
|
|
|
echo "📊 Status - Show running docker containers"
|
|
|
|
echo "📝 Logs - View container logs"
|
|
|
|
echo "💾 Disk Usage - Show docker disk usage"
|
|
|
|
echo "🔄 Restart - Restart a specific container"
|
|
|
|
echo "🐳 Update Docker - Update Docker containers"
|
2025-03-13 13:42:25 +01:00
|
|
|
echo "🌐 Add custom service"
|
2025-03-12 14:28:01 +01:00
|
|
|
echo "❌ Exit"
|
|
|
|
}
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
clear
|
|
|
|
show_header
|
|
|
|
|
|
|
|
# Show menu and get selection
|
|
|
|
choice=$(create_menu | gum choose --cursor.foreground 212 --selected.foreground 212 --header "Select an action:" --cursor "➜ ")
|
|
|
|
|
|
|
|
# Exit if no selection
|
|
|
|
if [ -z "$choice" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Process selection
|
|
|
|
case $choice in
|
|
|
|
"📊 Status"*)
|
|
|
|
just status
|
|
|
|
;;
|
|
|
|
"📝 Logs"*)
|
|
|
|
just logs
|
|
|
|
;;
|
|
|
|
"🛑 Stop All"*)
|
|
|
|
just docker-stop-all
|
|
|
|
;;
|
|
|
|
"🗑️ Prune"*)
|
|
|
|
just docker-prune
|
|
|
|
;;
|
|
|
|
"💾 Disk Usage"*)
|
|
|
|
just docker-disk
|
|
|
|
;;
|
|
|
|
"🔄 Restart"*)
|
|
|
|
just docker-restart
|
|
|
|
;;
|
|
|
|
"🐳 Update Docker"*)
|
|
|
|
just update-containers
|
|
|
|
;;
|
2025-03-13 13:42:25 +01:00
|
|
|
"🌐 Add custom"*)
|
|
|
|
just add-custom-service
|
|
|
|
;; "❌ Exit")
|
2025-03-12 14:28:01 +01:00
|
|
|
echo "Goodbye! 👋" | gum style --foreground 212
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Pause after command execution
|
|
|
|
gum confirm "Press Enter to continue..." --default=true --affirmative "Continue" --negative "Exit" || exit 0
|
|
|
|
done
|