From b2c0b1b42fe724a03983ae051c4bff167997557e Mon Sep 17 00:00:00 2001 From: Tai Sakuma Date: Wed, 15 Jun 2022 10:45:11 -0400 Subject: [PATCH] add an interrupt button --- src/components/MainCtrl.vue | 12 ++++++++++++ src/graphql/mutations/Interrupt.gql | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 src/graphql/mutations/Interrupt.gql diff --git a/src/components/MainCtrl.vue b/src/components/MainCtrl.vue index 57f5a1e..f1f4f94 100644 --- a/src/components/MainCtrl.vue +++ b/src/components/MainCtrl.vue @@ -30,6 +30,7 @@ import { useStore } from "@/stores/index"; import RESET from "@/graphql/mutations/Reset.gql"; import EXEC from "@/graphql/mutations/Exec.gql"; +import INTERRUPT from "@/graphql/mutations/Interrupt.gql"; import SUBSCRIBE_STATE from "@/graphql/subscriptions/State.gql"; import SUBSCRIBE_TRACE_IDS from "@/graphql/subscriptions/TraceIds.gql"; @@ -52,6 +53,12 @@ export default { icon: "mdi-restore", states: ["initialized", "finished", "closed"], }, + { + text: "Interrupt", + method: "interrupt", + icon: "mdi-close", + states: ["running"], + }, ], chipConfig: { default: { color: null }, @@ -102,6 +109,11 @@ export default { mutation: RESET, }); }, + async interrupt() { + const data = await this.$apollo.mutate({ + mutation: INTERRUPT, + }); + }, }, }; diff --git a/src/graphql/mutations/Interrupt.gql b/src/graphql/mutations/Interrupt.gql new file mode 100644 index 0000000..405c106 --- /dev/null +++ b/src/graphql/mutations/Interrupt.gql @@ -0,0 +1,3 @@ +mutation Interrupt { + interrupt +}