Add pause resume and abort controls
This commit is contained in:
@@ -1 +0,0 @@
|
||||
e956ec19eb199b15938ab4e85c766f31614fc47e42233e3d807eb59e5c0b0e39 backupper-2026.06.14.9.11-x86_64-1.txz
|
||||
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
33d2cf963aeee0b1b53ee785a506562f3f8d317d9ffd2004b0f4fa44ec0484f5 backupper-2026.06.14.9.12-x86_64-1.txz
|
||||
Vendored
+5
-2
@@ -2,13 +2,16 @@
|
||||
<!DOCTYPE PLUGIN [
|
||||
<!ENTITY name "backupper">
|
||||
<!ENTITY author "Michael Roll">
|
||||
<!ENTITY version "2026.06.14.9.11">
|
||||
<!ENTITY version "2026.06.14.9.12">
|
||||
<!ENTITY pluginURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper.plg">
|
||||
<!ENTITY packageURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper-&version;-x86_64-1.txz">
|
||||
<!ENTITY packageSHA256 "e956ec19eb199b15938ab4e85c766f31614fc47e42233e3d807eb59e5c0b0e39">
|
||||
<!ENTITY packageSHA256 "33d2cf963aeee0b1b53ee785a506562f3f8d317d9ffd2004b0f4fa44ec0484f5">
|
||||
]>
|
||||
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/BackUpper/issues" icon="backupper.png">
|
||||
<CHANGES>
|
||||
### 2026.06.14.9.12
|
||||
- Add Pause, Resume, and Abort controls for active Restic operations using Linux process-group signals.
|
||||
|
||||
### 2026.06.14.9.11
|
||||
- Add a global setting to show live run logs in Activity, disabled by default.
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ func New(socket string, svc *service.Service, log *slog.Logger) *Server {
|
||||
mux.HandleFunc("GET /v1/workloads/{kind}", s.workloads)
|
||||
mux.HandleFunc("POST /v1/jobs/{id}/run", s.runJob)
|
||||
mux.HandleFunc("POST /v1/runs/{id}/cancel", s.cancelRun)
|
||||
mux.HandleFunc("POST /v1/runs/{id}/pause", s.pauseRun)
|
||||
mux.HandleFunc("POST /v1/runs/{id}/resume", s.resumeRun)
|
||||
mux.HandleFunc("POST /v1/repositories/{id}/test", s.testRepository)
|
||||
mux.HandleFunc("POST /v1/repositories/{id}/init", s.initRepository)
|
||||
mux.HandleFunc("POST /v1/repositories/{id}/{action}", s.maintenance)
|
||||
@@ -157,6 +159,22 @@ func (s *Server) cancelRun(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(204)
|
||||
}
|
||||
|
||||
func (s *Server) pauseRun(w http.ResponseWriter, r *http.Request) {
|
||||
if err := s.service.Pause(r.PathValue("id")); err != nil {
|
||||
writeError(w, err)
|
||||
return
|
||||
}
|
||||
w.WriteHeader(204)
|
||||
}
|
||||
|
||||
func (s *Server) resumeRun(w http.ResponseWriter, r *http.Request) {
|
||||
if err := s.service.Resume(r.PathValue("id")); err != nil {
|
||||
writeError(w, err)
|
||||
return
|
||||
}
|
||||
w.WriteHeader(204)
|
||||
}
|
||||
|
||||
func (s *Server) testRepository(w http.ResponseWriter, r *http.Request) {
|
||||
s.repositoryAction(w, r, false)
|
||||
}
|
||||
|
||||
+20
-1
@@ -37,7 +37,7 @@ func (q *Queue) RestoreHistory(runs []model.Run) {
|
||||
q.mu.Lock()
|
||||
defer q.mu.Unlock()
|
||||
for _, run := range runs {
|
||||
if run.Status == "queued" || run.Status == "running" {
|
||||
if run.Status == "queued" || run.Status == "running" || run.Status == "paused" {
|
||||
run.Status = "failed"
|
||||
run.ErrorCode = "environment"
|
||||
run.Message = "daemon restarted while task was active"
|
||||
@@ -125,6 +125,25 @@ func (q *Queue) Cancel(id string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (q *Queue) SetPaused(id string, paused bool) bool {
|
||||
q.mu.Lock()
|
||||
defer q.mu.Unlock()
|
||||
if q.active == nil || q.active.ID != id {
|
||||
return false
|
||||
}
|
||||
expected := "running"
|
||||
next := "paused"
|
||||
if !paused {
|
||||
expected, next = "paused", "running"
|
||||
}
|
||||
if q.active.Status != expected {
|
||||
return false
|
||||
}
|
||||
q.active.Status = next
|
||||
q.emitLocked()
|
||||
return true
|
||||
}
|
||||
|
||||
func (q *Queue) Stop() {
|
||||
q.mu.Lock()
|
||||
q.stopping = true
|
||||
|
||||
@@ -59,3 +59,34 @@ func TestClearHistoryKeepsActiveAndPendingRuns(t *testing.T) {
|
||||
q.Stop()
|
||||
close(release)
|
||||
}
|
||||
|
||||
func TestPauseAndResumeActiveRun(t *testing.T) {
|
||||
started := make(chan struct{})
|
||||
release := make(chan struct{})
|
||||
q := New(func(_ context.Context, run model.Run) model.Run {
|
||||
close(started)
|
||||
<-release
|
||||
run.Status = "success"
|
||||
return run
|
||||
}, nil)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
go q.Run(ctx)
|
||||
if err := q.Enqueue(model.Run{ID: "run", JobID: "job"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
<-started
|
||||
if !q.SetPaused("run", true) {
|
||||
t.Fatal("active run could not be paused")
|
||||
}
|
||||
if runs := q.Snapshot(); len(runs) != 1 || runs[0].Status != "paused" {
|
||||
t.Fatalf("paused runs = %#v", runs)
|
||||
}
|
||||
if !q.SetPaused("run", false) {
|
||||
t.Fatal("paused run could not be resumed")
|
||||
}
|
||||
if runs := q.Snapshot(); len(runs) != 1 || runs[0].Status != "running" {
|
||||
t.Fatalf("resumed runs = %#v", runs)
|
||||
}
|
||||
close(release)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/backupper-unraid/backupper/internal/model"
|
||||
)
|
||||
@@ -23,6 +25,47 @@ type Runner struct {
|
||||
RuntimeDir string
|
||||
Secrets SecretGetter
|
||||
Log *slog.Logger
|
||||
mu sync.Mutex
|
||||
processes map[string]*os.Process
|
||||
}
|
||||
|
||||
type runIDKey struct{}
|
||||
|
||||
func WithRunID(ctx context.Context, runID string) context.Context {
|
||||
return context.WithValue(ctx, runIDKey{}, runID)
|
||||
}
|
||||
|
||||
func (r *Runner) Pause(runID string) error { return r.signal(runID, syscall.SIGSTOP) }
|
||||
func (r *Runner) Resume(runID string) error { return r.signal(runID, syscall.SIGCONT) }
|
||||
|
||||
func (r *Runner) signal(runID string, signal syscall.Signal) error {
|
||||
r.mu.Lock()
|
||||
process := r.processes[runID]
|
||||
r.mu.Unlock()
|
||||
if process == nil {
|
||||
return errors.New("restic process is not active yet")
|
||||
}
|
||||
if err := syscall.Kill(-process.Pid, signal); err != nil {
|
||||
return fmt.Errorf("signal restic process group: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Runner) registerProcess(runID string, process *os.Process) func() {
|
||||
if runID == "" {
|
||||
return func() {}
|
||||
}
|
||||
r.mu.Lock()
|
||||
if r.processes == nil {
|
||||
r.processes = make(map[string]*os.Process)
|
||||
}
|
||||
r.processes[runID] = process
|
||||
r.mu.Unlock()
|
||||
return func() {
|
||||
r.mu.Lock()
|
||||
delete(r.processes, runID)
|
||||
r.mu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
type Summary struct {
|
||||
@@ -203,6 +246,19 @@ func (r *Runner) run(ctx context.Context, repo model.Repository, args []string,
|
||||
}
|
||||
fullArgs := append(globalArgs, args...)
|
||||
cmd := exec.CommandContext(ctx, r.Binary, fullArgs...)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
cmd.Cancel = func() error {
|
||||
if cmd.Process == nil {
|
||||
return os.ErrProcessDone
|
||||
}
|
||||
if err := syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL); err != nil {
|
||||
if errors.Is(err, syscall.ESRCH) {
|
||||
return os.ErrProcessDone
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
cmd.Env = []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "HOME=/root", "RESTIC_PASSWORD_FILE=" + passwordPath}
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
@@ -215,6 +271,9 @@ func (r *Runner) run(ctx context.Context, repo model.Repository, args []string,
|
||||
if err := cmd.Start(); err != nil {
|
||||
return classify(err)
|
||||
}
|
||||
runID, _ := ctx.Value(runIDKey{}).(string)
|
||||
unregister := r.registerProcess(runID, cmd.Process)
|
||||
defer unregister()
|
||||
var captured []byte
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/backupper-unraid/backupper/internal/model"
|
||||
)
|
||||
@@ -88,3 +89,60 @@ func TestResticErrorExplainsCiphertextVerification(t *testing.T) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunnerPausesResumesAndCancelsProcessGroup(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
ticksPath := filepath.Join(dir, "ticks")
|
||||
script := filepath.Join(dir, "restic")
|
||||
body := fmt.Sprintf("#!/bin/sh\nwhile :; do printf x >> '%s'; sleep 0.05; done\n", ticksPath)
|
||||
if err := os.WriteFile(script, []byte(body), 0700); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
runner := &Runner{Binary: script, RuntimeDir: dir, Secrets: fakeSecrets{"password": "secret"}}
|
||||
repo := model.Repository{Type: model.RepositoryLocal, Location: "/repo", PasswordRef: "password"}
|
||||
ctx, cancel := context.WithCancel(WithRunID(context.Background(), "run"))
|
||||
done := make(chan error, 1)
|
||||
go func() { done <- runner.run(ctx, repo, []string{"backup"}, nil, nil) }()
|
||||
|
||||
waitForSize := func(minimum int64) int64 {
|
||||
deadline := time.Now().Add(2 * time.Second)
|
||||
for time.Now().Before(deadline) {
|
||||
if info, err := os.Stat(ticksPath); err == nil && info.Size() >= minimum {
|
||||
return info.Size()
|
||||
}
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
}
|
||||
t.Fatalf("tick file did not reach %d bytes", minimum)
|
||||
return 0
|
||||
}
|
||||
waitForSize(2)
|
||||
if err := runner.Pause("run"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
pausedSize := waitForSize(1)
|
||||
time.Sleep(150 * time.Millisecond)
|
||||
info, err := os.Stat(ticksPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if info.Size() != pausedSize {
|
||||
t.Fatalf("process continued while paused: size=%d, expected=%d", info.Size(), pausedSize)
|
||||
}
|
||||
if err := runner.Resume("run"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
waitForSize(pausedSize + 2)
|
||||
if err := runner.Pause("run"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cancel()
|
||||
select {
|
||||
case err := <-done:
|
||||
if err == nil || !strings.Contains(err.Error(), "cancelled") {
|
||||
t.Fatalf("cancel result = %v", err)
|
||||
}
|
||||
case <-time.After(2 * time.Second):
|
||||
t.Fatal("paused process group was not cancelled")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,27 @@ func (s *Service) EnqueueRestore(task model.RestoreTask) (model.Run, error) {
|
||||
func (s *Service) Cancel(runID string) bool { return s.queue.Cancel(runID) }
|
||||
func (s *Service) ClearRunHistory() int { return s.queue.ClearHistory() }
|
||||
|
||||
func (s *Service) Pause(runID string) error {
|
||||
if err := s.restic.Pause(runID); err != nil {
|
||||
return fmt.Errorf("pause: %w", err)
|
||||
}
|
||||
if !s.queue.SetPaused(runID, true) {
|
||||
_ = s.restic.Resume(runID)
|
||||
return errors.New("pause: run is not currently running")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) Resume(runID string) error {
|
||||
if err := s.restic.Resume(runID); err != nil {
|
||||
return fmt.Errorf("resume: %w", err)
|
||||
}
|
||||
if !s.queue.SetPaused(runID, false) {
|
||||
return errors.New("resume: run is not currently paused")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) Snapshots(ctx context.Context, repoID string) ([]model.Snapshot, error) {
|
||||
repo, ok := s.repository(repoID)
|
||||
if !ok {
|
||||
@@ -212,6 +233,7 @@ func (s *Service) TestRepository(ctx context.Context, repoID string, initialize
|
||||
}
|
||||
|
||||
func (s *Service) execute(ctx context.Context, run model.Run) model.Run {
|
||||
ctx = restic.WithRunID(ctx, run.ID)
|
||||
if run.TaskType == "backup" {
|
||||
return s.executeBackup(ctx, run)
|
||||
}
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
<!DOCTYPE PLUGIN [
|
||||
<!ENTITY name "backupper">
|
||||
<!ENTITY author "Michael Roll">
|
||||
<!ENTITY version "2026.06.14.9.11">
|
||||
<!ENTITY version "2026.06.14.9.12">
|
||||
<!ENTITY pluginURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper.plg">
|
||||
<!ENTITY packageURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper-&version;-x86_64-1.txz">
|
||||
<!ENTITY packageSHA256 "REPLACE_DURING_RELEASE">
|
||||
]>
|
||||
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/BackUpper/issues" icon="backupper.png">
|
||||
<CHANGES>
|
||||
### 2026.06.14.9.12
|
||||
- Add Pause, Resume, and Abort controls for active Restic operations using Linux process-group signals.
|
||||
|
||||
### 2026.06.14.9.11
|
||||
- Add a global setting to show live run logs in Activity, disabled by default.
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
.bu-status { border: 1px solid currentColor; border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; text-transform: uppercase; }
|
||||
.bu-status.success { background: rgba(8,122,85,.10); color: var(--bu-good); }
|
||||
.bu-status.failed, .bu-status.cancelled { background: rgba(180,35,47,.10); color: var(--bu-bad); }
|
||||
.bu-status.running, .bu-status.queued, .bu-status.warning { background: rgba(232,93,36,.10); color: var(--bu-accent); }
|
||||
.bu-status.running, .bu-status.queued, .bu-status.paused, .bu-status.warning { background: rgba(232,93,36,.10); color: var(--bu-accent); }
|
||||
|
||||
.bu-form { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(220px, 1fr)); }
|
||||
#backupper-app .bu-form label { color: var(--bu-text) !important; display: grid; font-size: 14px; font-weight: 600; gap: 7px; }
|
||||
|
||||
@@ -112,11 +112,13 @@
|
||||
'open-dir': 'Öffnet dieses Verzeichnis innerhalb des schreibgeschützten Snapshots.',
|
||||
'open-source-dir': 'Öffnet diesen Ordner, um darin weitere Unterordner auszuwählen.',
|
||||
'open-repository-dir': 'Öffnet diesen lokalen Ordner, um ihn oder einen Unterordner als Repository-Ziel auszuwählen.',
|
||||
'cancel-run': 'Bricht die laufende oder wartende Aufgabe ab. Cleanup und Neustart gestoppter Workloads werden trotzdem versucht.',
|
||||
'cancel-run': 'Bricht die laufende oder wartende Aufgabe ab. Cleanup und Neustart gestoppter Workloads werden trotzdem versucht.',
|
||||
'pause-run': 'Hält den aktiven Restic-Prozess und seine Unterprozesse an. Mounts sowie gestoppte Container oder VMs bleiben bis zum Fortsetzen oder Abbrechen bestehen.',
|
||||
'resume-run': 'Setzt einen zuvor pausierten Restic-Vorgang an derselben Stelle fort.',
|
||||
};
|
||||
return dynamic[name] || `${label} ausführen.`;
|
||||
};
|
||||
const status = (value) => `<span class="bu-status ${esc(value)}" tabindex="0"${tipAttr(`Status dieses Vorgangs. Beispiel: success = erfolgreich, warning = mit Warnung, failed = fehlgeschlagen, running = läuft.`)}>${esc(value)}</span>`;
|
||||
const status = (value) => `<span class="bu-status ${esc(value)}" tabindex="0"${tipAttr(`Status dieses Vorgangs. Beispiel: success = erfolgreich, warning = mit Warnung, failed = fehlgeschlagen, running = läuft, paused = pausiert.`)}>${esc(value)}</span>`;
|
||||
const button = (label, action, kind = '') => `<button class="bu-button ${kind}" type="button" data-action="${esc(action)}"${tipAttr(actionTooltip(action, label))}>${esc(label)}</button>`;
|
||||
const disabledButton = (label, help) => `<button class="bu-button" type="button" disabled${tipAttr(help)}>${esc(label)}</button>`;
|
||||
const actionGroup = (buttons) => `<div class="bu-actions bu-table-actions">${buttons}</div>`;
|
||||
@@ -270,7 +272,7 @@
|
||||
}
|
||||
|
||||
function renderDashboard() {
|
||||
const active = state.runs.filter(r => ['queued','running'].includes(r.status)).length;
|
||||
const active = state.runs.filter(r => ['queued','running','paused'].includes(r.status)).length;
|
||||
const failures = state.runs.filter(r => r.status === 'failed').slice(-5);
|
||||
const last = [...state.runs].reverse().slice(0, 8);
|
||||
const backups = state.runs.filter(r=>r.taskType==='backup' && ['success','warning'].includes(r.status)).slice(-20);
|
||||
@@ -469,7 +471,7 @@
|
||||
if(run.progressFileTotal) details.push(`${Number(run.progressFiles||0).toLocaleString()} / ${Number(run.progressFileTotal).toLocaleString()} files`);
|
||||
if(run.bytesPerSecond) details.push(`${formatBytes(run.bytesPerSecond)}/s`);
|
||||
if(run.secondsRemaining>0) details.push(`ETA ${formatEta(run.secondsRemaining)}`);
|
||||
return `<div class="bu-progress-wrap"><div class="bu-progress-label"><strong>${scanning?'Scanning…':`${percent.toFixed(1)}%`}</strong><span>${esc(details.join(' · '))}</span></div><div class="bu-progress ${scanning?'indeterminate':''}"><span style="width:${scanning?30:percent}%"></span></div>${run.currentFile?`<div class="bu-current-file" title="${esc(run.currentFile)}">${esc(run.currentFile)}</div>`:''}</div>`;
|
||||
return `<div class="bu-progress-wrap"><div class="bu-progress-label"><strong>${run.status==='paused'?'Pausiert':scanning?'Scanning…':`${percent.toFixed(1)}%`}</strong><span>${esc(details.join(' · '))}</span></div><div class="bu-progress ${scanning?'indeterminate':''}"><span style="width:${scanning?30:percent}%"></span></div>${run.currentFile?`<div class="bu-current-file" title="${esc(run.currentFile)}">${esc(run.currentFile)}</div>`:''}</div>`;
|
||||
}
|
||||
function liveLogView(run) {
|
||||
if(!(run.liveLog||[]).length) return '';
|
||||
@@ -479,7 +481,7 @@
|
||||
function runsTable(runs) {
|
||||
if(!runs.length) return '<div class="bu-empty">No activity recorded.</div>';
|
||||
const showLiveLog=state.config?.settings?.showLiveLog===true;
|
||||
return `<table class="bu-table bu-runs-table"><thead><tr><th>Task</th><th>Status</th><th>Created</th><th>Progress</th><th>Message</th><th></th></tr></thead><tbody>${runs.map(r=>`<tr><td>${esc(r.taskType)} ${esc(r.jobId||'')}</td><td>${status(r.status)}</td><td>${esc(new Date(r.createdAt).toLocaleString())}</td><td>${progressView(r)}</td><td>${esc(r.message||'')}</td><td>${['queued','running'].includes(r.status)?button('Cancel',`cancel-run:${r.id}`,'danger'):''}</td></tr>${showLiveLog&&(r.liveLog||[]).length?`<tr class="bu-log-row"><td colspan="6">${liveLogView(r)}</td></tr>`:''}`).join('')}</tbody></table>`;
|
||||
return `<table class="bu-table bu-runs-table"><thead><tr><th>Task</th><th>Status</th><th>Created</th><th>Progress</th><th>Message</th><th></th></tr></thead><tbody>${runs.map(r=>{const controls=r.status==='running'?button('Pause',`pause-run:${r.id}`)+button('Abbrechen',`cancel-run:${r.id}`,'danger'):r.status==='paused'?button('Fortsetzen',`resume-run:${r.id}`,'primary')+button('Abbrechen',`cancel-run:${r.id}`,'danger'):r.status==='queued'?button('Abbrechen',`cancel-run:${r.id}`,'danger'):'';return `<tr><td>${esc(r.taskType)} ${esc(r.jobId||'')}</td><td>${status(r.status)}</td><td>${esc(new Date(r.createdAt).toLocaleString())}</td><td>${progressView(r)}</td><td>${esc(r.message||'')}</td><td>${actionGroup(controls)}</td></tr>${showLiveLog&&(r.liveLog||[]).length?`<tr class="bu-log-row"><td colspan="6">${liveLogView(r)}</td></tr>`:''}`;}).join('')}</tbody></table>`;
|
||||
}
|
||||
|
||||
function renderSettings() {
|
||||
@@ -510,6 +512,8 @@
|
||||
if (name === 'refresh') return load();
|
||||
if (name === 'run-job') { await api(`/v1/jobs/${a}/run`,{method:'POST'}); notify('Backup queued'); return load(); }
|
||||
if (name === 'cancel-run') { await api(`/v1/runs/${a}/cancel`,{method:'POST'}); return load(); }
|
||||
if (name === 'pause-run') { await api(`/v1/runs/${a}/pause`,{method:'POST'}); notify('Vorgang pausiert'); return load(); }
|
||||
if (name === 'resume-run') { await api(`/v1/runs/${a}/resume`,{method:'POST'}); notify('Vorgang wird fortgesetzt'); return load(); }
|
||||
if (name === 'clear-activity') { if(confirm('Alle abgeschlossenen Aktivitäten und deren gespeicherte Laufprotokolle löschen?\n\nLaufende und wartende Aufgaben bleiben erhalten.')) { const result=await api('/v1/runs',{method:'DELETE'}); notify(result.cleared?`${result.cleared} abgeschlossene Aktivitäten gelöscht`:'Keine abgeschlossenen Aktivitäten vorhanden'); return load(); } return; }
|
||||
if (name === 'test-repo') { await api(`/v1/repositories/${a}/test`,{method:'POST'}); return notify('Repository connection succeeded'); }
|
||||
if (name === 'init-repo') { if(confirm('Create a NEW Restic repository here?\n\nOnly continue if this destination does not already contain a Restic repository. For an existing repository, enter its original password under Edit and use Test.')) { await api(`/v1/repositories/${a}/init`,{method:'POST'}); notify('Repository initialized successfully'); } return; }
|
||||
|
||||
Reference in New Issue
Block a user