app configure: refresh app when a task is started

This commit is contained in:
Girish Ramakrishnan
2026-03-30 10:25:26 +02:00
parent 4a02e988c1
commit 8d0160a3e7
7 changed files with 34 additions and 31 deletions
+8 -11
View File
@@ -10,7 +10,7 @@ import SystemModel from '../../models/SystemModel.js';
const appsModel = AppsModel.create();
const systemModel = SystemModel.create();
const props = defineProps([ 'app' ]);
const props = defineProps([ 'app', 'refreshApp' ]);
const memoryLimitBusy = ref(false);
const memoryLimit = ref(0);
@@ -33,8 +33,8 @@ async function onSubmitMemoryLimit() {
const [error] = await appsModel.configure(props.app.id, 'memory_limit', { memoryLimit: limit });
if (error) return console.error(error);
// give polling some time
setTimeout(() => memoryLimitBusy.value = false, 4000);
await props.refreshApp();
memoryLimitBusy.value = false;
}
async function onSubmitCpuQuota() {
@@ -44,9 +44,8 @@ async function onSubmitCpuQuota() {
if (error) return console.error(error);
currentCpuQuota.value = parseInt(cpuQuota.value);
// give polling some time
setTimeout(() => cpuQuotaBusy.value = false, 4000);
await props.refreshApp();
cpuQuotaBusy.value = false;
}
async function onSubmitDevices() {
@@ -70,11 +69,9 @@ async function onSubmitDevices() {
return;
}
// give polling some time
setTimeout(() => {
devicesBusy.value = false;
currentDevices.value = Object.keys(devs);
}, 4000);
currentDevices.value = Object.keys(devs);
await props.refreshApp();
devicesBusy.value = false;
}
const devicesChanged = computed(() => {