Add repair app configure view

This commit is contained in:
Johannes Zellner
2025-02-22 18:31:21 +01:00
parent 3e2177b402
commit c593b4180a
5 changed files with 105 additions and 21 deletions
+8 -9
View File
@@ -171,29 +171,28 @@ function create() {
return [null, result.body];
},
async restart(id) {
let error, result;
let result;
try {
result = await fetcher.post(`${origin}/api/v1/apps/${id}/restart`, null, { access_token: accessToken });
} catch (e) {
error = e;
return [e];
}
if (error || result.status !== 202) {
console.error(`Failed to restart app ${this.id}`, error || result.status);
return;
}
if (result.status !== 202) return [result];
while(true) {
let result;
try {
result = await fetcher.get(`${origin}/api/v1/apps/${id}`, { access_token: accessToken });
} catch (e) {
console.error(e);
return [e];
}
if (result && result.status === 200 && result.body.installationState === ISTATES.INSTALLED) break;
if (result.status !== 200) return [result];
await sleep(2000);
// are we done here?
if (result.body.installationState !== ISTATES.INSTALLED) await sleep(2000);
else return [null];
}
},
async start(id) {