From f82d5de9d298c2a549065a1321fa02161d23f246 Mon Sep 17 00:00:00 2001 From: Darren Satkunas Date: Thu, 8 Dec 2022 07:09:57 -0800 Subject: [PATCH] add monit system service in monit configuration --- .../monit/_components/AlertServices.vue | 42 +++++++++++++++++++ .../monit/_components/TheForm.vue | 4 -- .../monit/_components/TheView.js | 30 ++++++++++--- .../Configuration/monit/_components/index.js | 4 +- 4 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 html/pfappserver/root/src/views/Configuration/monit/_components/AlertServices.vue diff --git a/html/pfappserver/root/src/views/Configuration/monit/_components/AlertServices.vue b/html/pfappserver/root/src/views/Configuration/monit/_components/AlertServices.vue new file mode 100644 index 000000000000..3a5d701e4113 --- /dev/null +++ b/html/pfappserver/root/src/views/Configuration/monit/_components/AlertServices.vue @@ -0,0 +1,42 @@ + + + diff --git a/html/pfappserver/root/src/views/Configuration/monit/_components/TheForm.vue b/html/pfappserver/root/src/views/Configuration/monit/_components/TheForm.vue index 94e6a0020ece..750a42d8a877 100644 --- a/html/pfappserver/root/src/views/Configuration/monit/_components/TheForm.vue +++ b/html/pfappserver/root/src/views/Configuration/monit/_components/TheForm.vue @@ -5,10 +5,6 @@ :schema="schema" :isLoading="isLoading" > -
{{ $t('Modifying this configuration requires to restart monit using the following command: `systemctl restart monit`') }}
- useViewResource(resource, props, context) + +const setup = (props, context) => { + + const viewResource = useViewResource(resource, props, context) + const { + isLoading, + isModified + } = viewResource + + const scopedSlotProps = computed(() => ({ ...props, isLoading: isLoading.value, isModified: isModified.value })) + + return { + ...viewResource, + scopedSlotProps + } +} + +const render = renderHOCWithScopedSlots(BaseView, { components, props, setup }, { + buttonsPrepend: AlertServices +}) // @vue/component export default { name: 'the-view', extends: BaseView, inheritAttrs: false, - components, props, - setup + render } - diff --git a/html/pfappserver/root/src/views/Configuration/monit/_components/index.js b/html/pfappserver/root/src/views/Configuration/monit/_components/index.js index a6eef0cbf351..0c769e1b0281 100644 --- a/html/pfappserver/root/src/views/Configuration/monit/_components/index.js +++ b/html/pfappserver/root/src/views/Configuration/monit/_components/index.js @@ -5,6 +5,7 @@ import { BaseFormGroupTextarea, BaseFormGroupToggleDisabledEnabled } from '@/components/new/' +import AlertServices from './AlertServices' import TheForm from './TheForm' import TheView from './TheView' @@ -18,7 +19,8 @@ export { BaseFormGroupToggleDisabledEnabled as FormGroupStatus, BaseFormGroupInput as FormGroupSubjectPrefix, - BaseViewResource as BaseView, + BaseViewResource as BaseView, + AlertServices, TheForm, TheView }