app configure: refresh app when a task is started
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user