Do not use cached service object in service edit dialog
This commit is contained in:
@@ -39,27 +39,27 @@ const columns = {
|
||||
|
||||
const actionMenuModel = ref([]);
|
||||
const actionMenuElement = useTemplateRef('actionMenuElement');
|
||||
function onActionMenu(service, event) {
|
||||
function onActionMenu(id, event) {
|
||||
actionMenuModel.value = [{
|
||||
icon: 'fa-solid fa-pencil-alt',
|
||||
label: t('main.action.configure'),
|
||||
disabled() { return refreshBusy.value; },
|
||||
visible: service.status !== 'disabled' && service.memoryLimit,
|
||||
action: onEdit.bind(null, service),
|
||||
visible: services[id].status !== 'disabled' && services[id].memoryLimit,
|
||||
action: onEdit.bind(null, id),
|
||||
}, {
|
||||
separator: true,
|
||||
visible: service.status !== 'disabled' && service.memoryLimit,
|
||||
visible: services[id].status !== 'disabled' && services[id].memoryLimit,
|
||||
}, {
|
||||
icon: 'fa-solid fa-sync-alt',
|
||||
label: t('services.restartActionTooltip'),
|
||||
visible: service.id !== 'box',
|
||||
disabled: (service.status === 'starting' && !service.config.recoveryMode),
|
||||
action: onRestart.bind(null, service.id),
|
||||
visible: id !== 'box',
|
||||
disabled: (services[id].status === 'starting' && !services[id].config.recoveryMode),
|
||||
action: onRestart.bind(null, id),
|
||||
}, {
|
||||
icon: 'fa-solid fa-fw fa-file-alt',
|
||||
label: t('logs.title'),
|
||||
target: '_blank',
|
||||
href: `/logs.html?id=${service.id}`,
|
||||
href: `/logs.html?id=${id}`,
|
||||
}];
|
||||
|
||||
actionMenuElement.value.open(event, event.currentTarget);
|
||||
@@ -147,10 +147,10 @@ const editRecoveryMode = ref(false);
|
||||
|
||||
let availableSystemMemory = 4 * 1024 * 1024 * 1024;
|
||||
|
||||
async function onEdit(service) {
|
||||
editService.value = service;
|
||||
editMemoryLimit.value = service.config.memoryLimit;
|
||||
editRecoveryMode.value = service.config.recoveryMode;
|
||||
async function onEdit(id) {
|
||||
editService.value = services[id];
|
||||
editMemoryLimit.value = services[id].config.memoryLimit;
|
||||
editRecoveryMode.value = services[id].config.recoveryMode;
|
||||
|
||||
editMemoryTicks.value = [];
|
||||
// we max system memory and current service memory for the case where the user configured the service on another server with more resources
|
||||
@@ -263,7 +263,7 @@ onMounted(async () => {
|
||||
</template>
|
||||
<template #actions="service">
|
||||
<div style="text-align: right;">
|
||||
<Button tool plain secondary @click.capture="onActionMenu(service, $event)" icon="fa-solid fa-ellipsis" />
|
||||
<Button tool plain secondary @click.capture="onActionMenu(service.id, $event)" icon="fa-solid fa-ellipsis" />
|
||||
</div>
|
||||
</template>
|
||||
</TableView>
|
||||
|
||||
Reference in New Issue
Block a user