summaryrefslogtreecommitdiff
path: root/src/env/components/Dumps/DumpsModalConfirmation.vue
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2020-12-08 00:04:11 +0300
committerDerick Montague <derick.montague@ibm.com>2021-01-05 22:54:01 +0300
commitf415a0898b6f1f5cee8aa43259e8aedf07d395aa (patch)
treec4cb17fba51d9d4c6caa266081f07b95778abf9d /src/env/components/Dumps/DumpsModalConfirmation.vue
parent22d4d527af48d87ca70a8766bacc5b1ec0cfe9b7 (diff)
downloadwebui-vue-f415a0898b6f1f5cee8aa43259e8aedf07d395aa.tar.xz
Add DumpsStore API calls
Ties in API requests to the Dumps page and adds ability to: - Create new System or BMC dump - Delete single or multiple BMC dumps. Uses ClearLog service to delete all and DELETE request for single dump deletion Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: Iae928fa3b8fab00e549c33c0ab914a4b04de0f40
Diffstat (limited to 'src/env/components/Dumps/DumpsModalConfirmation.vue')
-rw-r--r--src/env/components/Dumps/DumpsModalConfirmation.vue75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/env/components/Dumps/DumpsModalConfirmation.vue b/src/env/components/Dumps/DumpsModalConfirmation.vue
new file mode 100644
index 00000000..f8e20cfd
--- /dev/null
+++ b/src/env/components/Dumps/DumpsModalConfirmation.vue
@@ -0,0 +1,75 @@
+<template>
+ <b-modal
+ id="modal-confirmation"
+ ref="modal"
+ :title="$t('pageDumps.modal.initiateSystemDump')"
+ @hidden="resetForm"
+ >
+ <p>
+ <strong>
+ {{ $t('pageDumps.modal.initiateSystemDumpMessage1') }}
+ </strong>
+ </p>
+ <p>
+ {{ $t('pageDumps.modal.initiateSystemDumpMessage2') }}
+ </p>
+ <p>
+ <status-icon status="danger" />
+ {{ $t('pageDumps.modal.initiateSystemDumpMessage3') }}
+ </p>
+ <b-form-checkbox v-model="confirmed" @input="$v.confirmed.$touch()">
+ {{ $t('pageDumps.modal.initiateSystemDumpMessage4') }}
+ </b-form-checkbox>
+ <b-form-invalid-feedback
+ :state="getValidationState($v.confirmed)"
+ role="alert"
+ >
+ {{ $t('global.form.required') }}
+ </b-form-invalid-feedback>
+ <template #modal-footer="{ cancel }">
+ <b-button variant="secondary" @click="cancel()">
+ {{ $t('global.action.cancel') }}
+ </b-button>
+ <b-button variant="danger" @click="handleSubmit">
+ {{ $t('pageDumps.form.initiateDump') }}
+ </b-button>
+ </template>
+ </b-modal>
+</template>
+
+<script>
+import StatusIcon from '@/components/Global/StatusIcon';
+import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js';
+
+export default {
+ components: { StatusIcon },
+ mixins: [VuelidateMixin],
+ data() {
+ return {
+ confirmed: false,
+ };
+ },
+ validations: {
+ confirmed: {
+ mustBeTrue: (value) => value === true,
+ },
+ },
+ methods: {
+ closeModal() {
+ this.$nextTick(() => {
+ this.$refs.modal.hide();
+ });
+ },
+ handleSubmit() {
+ this.$v.$touch();
+ if (this.$v.$invalid) return;
+ this.$emit('ok');
+ this.closeModal();
+ },
+ resetForm() {
+ this.confirmed = false;
+ this.$v.$reset();
+ },
+ },
+};
+</script>