fix: require_arg for --hdd-path, explicit event in stackAction, title separator, nextPruneLabel Sunday edge case
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -246,8 +246,12 @@ func (s *Server) templateFuncMap() template.FuncMap {
|
|||||||
next = now.Add(24 * time.Hour)
|
next = now.Add(24 * time.Hour)
|
||||||
default: // weekly/sunday
|
default: // weekly/sunday
|
||||||
daysUntilSunday := (7 - int(now.Weekday())) % 7
|
daysUntilSunday := (7 - int(now.Weekday())) % 7
|
||||||
if daysUntilSunday == 0 && now.Hour() >= 4 {
|
if daysUntilSunday == 0 {
|
||||||
daysUntilSunday = 7
|
if now.Hour() >= 4 {
|
||||||
|
daysUntilSunday = 7 // Already ran today, next week
|
||||||
|
} else {
|
||||||
|
return "ma" // Today (Sunday), hasn't run yet
|
||||||
|
}
|
||||||
}
|
}
|
||||||
next = now.AddDate(0, 0, daysUntilSunday)
|
next = now.AddDate(0, 0, daysUntilSunday)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,16 +140,16 @@
|
|||||||
{{if .Protected}}
|
{{if .Protected}}
|
||||||
<span class="badge badge-protected">Védett</span>
|
<span class="badge badge-protected">Védett</span>
|
||||||
{{if isOperational .State}}
|
{{if isOperational .State}}
|
||||||
<button class="btn btn-sm btn-warning" onclick="stackAction('{{.Name}}', 'restart')">↻</button>
|
<button class="btn btn-sm btn-warning" onclick="stackAction(event, '{{.Name}}', 'restart')">↻</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else if not .Deployed}}
|
{{else if not .Deployed}}
|
||||||
<a href="/stacks/{{.Name}}/deploy" class="btn btn-sm btn-primary" onclick="return checkBeforeDeploy(event, '{{.Name}}')">Telepítés</a>
|
<a href="/stacks/{{.Name}}/deploy" class="btn btn-sm btn-primary" onclick="return checkBeforeDeploy(event, '{{.Name}}')">Telepítés</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{if isOperational .State}}
|
{{if isOperational .State}}
|
||||||
<button class="btn btn-sm btn-warning" onclick="stackAction('{{.Name}}', 'restart')">↻</button>
|
<button class="btn btn-sm btn-warning" onclick="stackAction(event, '{{.Name}}', 'restart')">↻</button>
|
||||||
<button class="btn btn-sm btn-danger" onclick="stackAction('{{.Name}}', 'stop')">■</button>
|
<button class="btn btn-sm btn-danger" onclick="stackAction(event, '{{.Name}}', 'stop')">■</button>
|
||||||
{{else}}
|
{{else}}
|
||||||
<button class="btn btn-sm btn-success" onclick="stackAction('{{.Name}}', 'start')">▶</button>
|
<button class="btn btn-sm btn-success" onclick="stackAction(event, '{{.Name}}', 'start')">▶</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
<a href="/stacks/{{.Name}}/logs" class="btn btn-sm btn-outline">Napló</a>
|
<a href="/stacks/{{.Name}}/logs" class="btn btn-sm btn-outline">Napló</a>
|
||||||
{{if .Orphaned}}<button class="btn btn-sm btn-danger" onclick="deleteOrphanStack('{{.Name}}')">Törlés</button>{{end}}
|
{{if .Orphaned}}<button class="btn btn-sm btn-danger" onclick="deleteOrphanStack('{{.Name}}')">Törlés</button>{{end}}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>{{.Title}}Felhom.eu</title>
|
<title>{{.Title}} — Felhom.eu</title>
|
||||||
<link rel="stylesheet" href="/static/style.css">
|
<link rel="stylesheet" href="/static/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
btn.disabled = false;
|
btn.disabled = false;
|
||||||
btn.classList.remove('loading');
|
btn.classList.remove('loading');
|
||||||
}
|
}
|
||||||
async function stackAction(name, action) {
|
async function stackAction(event, name, action) {
|
||||||
const btn = event.currentTarget;
|
const btn = event.currentTarget;
|
||||||
const origText = btn.textContent;
|
const origText = btn.textContent;
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
{{if .Protected}}
|
{{if .Protected}}
|
||||||
<span class="badge badge-protected">Védett rendszerkomponens</span>
|
<span class="badge badge-protected">Védett rendszerkomponens</span>
|
||||||
{{if isOperational .State}}
|
{{if isOperational .State}}
|
||||||
<button class="btn btn-warning" onclick="stackAction('{{.Name}}', 'restart')">Újraindítás</button>
|
<button class="btn btn-warning" onclick="stackAction(event, '{{.Name}}', 'restart')">Újraindítás</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .Meta.Slug}}
|
{{if .Meta.Slug}}
|
||||||
<a href="/apps/{{.Meta.Slug}}" class="btn btn-outline">Részletek</a>
|
<a href="/apps/{{.Meta.Slug}}" class="btn btn-outline">Részletek</a>
|
||||||
@@ -70,11 +70,11 @@
|
|||||||
<a href="{{appPageURL .Meta.Slug}}" class="btn btn-outline">Részletek</a>
|
<a href="{{appPageURL .Meta.Slug}}" class="btn btn-outline">Részletek</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{if isOperational .State}}
|
{{if isOperational .State}}
|
||||||
{{if not .Orphaned}}<button class="btn btn-success" onclick="stackAction('{{.Name}}', 'update')">Frissítés</button>{{end}}
|
{{if not .Orphaned}}<button class="btn btn-success" onclick="stackAction(event, '{{.Name}}', 'update')">Frissítés</button>{{end}}
|
||||||
<button class="btn btn-warning" onclick="stackAction('{{.Name}}', 'restart')">Újraindítás</button>
|
<button class="btn btn-warning" onclick="stackAction(event, '{{.Name}}', 'restart')">Újraindítás</button>
|
||||||
<button class="btn btn-danger" onclick="stackAction('{{.Name}}', 'stop')">Leállítás</button>
|
<button class="btn btn-danger" onclick="stackAction(event, '{{.Name}}', 'stop')">Leállítás</button>
|
||||||
{{else}}
|
{{else}}
|
||||||
<button class="btn btn-success" onclick="stackAction('{{.Name}}', 'start')">Indítás</button>
|
<button class="btn btn-success" onclick="stackAction(event, '{{.Name}}', 'start')">Indítás</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
<a href="/stacks/{{.Name}}/logs" class="btn btn-outline">Naplók</a>
|
<a href="/stacks/{{.Name}}/logs" class="btn btn-outline">Naplók</a>
|
||||||
{{if not .Orphaned}}<a href="{{appPageURL .Meta.Slug}}" class="btn btn-outline">Részletek</a>{{end}}
|
{{if not .Orphaned}}<a href="{{appPageURL .Meta.Slug}}" class="btn btn-outline">Részletek</a>{{end}}
|
||||||
|
|||||||
@@ -312,7 +312,9 @@ parse_args() {
|
|||||||
CUSTOMER_ID="$2"; shift 2 ;;
|
CUSTOMER_ID="$2"; shift 2 ;;
|
||||||
--self-signed-cert) SELF_SIGNED_CERT=true; shift ;;
|
--self-signed-cert) SELF_SIGNED_CERT=true; shift ;;
|
||||||
--skip-filebrowser) SKIP_FILEBROWSER=true; shift ;;
|
--skip-filebrowser) SKIP_FILEBROWSER=true; shift ;;
|
||||||
--hdd-path) HDD_PATH="$2"; shift 2 ;;
|
--hdd-path)
|
||||||
|
require_arg "$1" "${2:-}"
|
||||||
|
HDD_PATH="$2"; shift 2 ;;
|
||||||
--dry-run) DRY_RUN=true; shift ;;
|
--dry-run) DRY_RUN=true; shift ;;
|
||||||
--debug) DEBUG_MODE=true; shift ;;
|
--debug) DEBUG_MODE=true; shift ;;
|
||||||
-h|--help) print_help; exit 0 ;;
|
-h|--help) print_help; exit 0 ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user