summaryrefslogtreecommitdiff
path: root/src/env/components/Dumps/DumpsForm.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/DumpsForm.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/DumpsForm.vue')
-rw-r--r--src/env/components/Dumps/DumpsForm.vue38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/env/components/Dumps/DumpsForm.vue b/src/env/components/Dumps/DumpsForm.vue
index ed81b3a8..9dc8bcb1 100644
--- a/src/env/components/Dumps/DumpsForm.vue
+++ b/src/env/components/Dumps/DumpsForm.vue
@@ -21,20 +21,28 @@
{{ $t('global.form.required') }}
</b-form-invalid-feedback>
</b-form-group>
+ <alert variant="info" class="mb-3" :show="selectedDumpType === 'system'">
+ {{ $t('pageDumps.form.systemDumpInfo') }}
+ </alert>
<b-button variant="primary" type="submit" form="form-new-dump">
- {{ $t('pageDumps.form.createNewDump') }}
+ {{ $t('pageDumps.form.initiateDump') }}
</b-button>
</b-form>
+ <modal-confirmation @ok="createSystemDump" />
</div>
</template>
<script>
import { required } from 'vuelidate/lib/validators';
+import ModalConfirmation from './DumpsModalConfirmation';
+import Alert from '@/components/Global/Alert';
+
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js';
export default {
+ components: { Alert, ModalConfirmation },
mixins: [BVToastMixin, VuelidateMixin],
data() {
return {
@@ -54,7 +62,33 @@ export default {
handleSubmit() {
this.$v.$touch();
if (this.$v.$invalid) return;
- this.successToast(this.$t('pageDumps.toast.successStartDump'));
+ if (this.selectedDumpType === 'system') {
+ this.showConfirmationModal();
+ } else {
+ this.$store
+ .dispatch('dumps/createBmcDump')
+ .then(() =>
+ this.infoToast(
+ this.$t('pageDumps.toast.successStartBmcDump'),
+ this.$t('pageDumps.toast.successStartBmcDumpTitle')
+ )
+ )
+ .catch(({ message }) => this.errorToast(message));
+ }
+ },
+ showConfirmationModal() {
+ this.$bvModal.show('modal-confirmation');
+ },
+ createSystemDump() {
+ this.$store
+ .dispatch('dumps/createSystemDump')
+ .then(() =>
+ this.infoToast(
+ this.$t('pageDumps.toast.successStartSystemDump'),
+ this.$t('pageDumps.toast.successStartSystemDumpTitle')
+ )
+ )
+ .catch(({ message }) => this.errorToast(message));
},
},
};