diff --git a/package-lock.json b/package-lock.json
index c38329c..ffd1b31 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,6 +10,7 @@
"dependencies": {
"pinia": "^2.3.0",
"vue": "^3.4.38",
+ "vue-toast-notification": "^3.1.3",
"vue3-markdown-it": "^1.0.10",
"vue3-toastify": "^0.2.8"
},
@@ -2737,6 +2738,18 @@
}
}
},
+ "node_modules/vue-toast-notification": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/vue-toast-notification/-/vue-toast-notification-3.1.3.tgz",
+ "integrity": "sha512-XNyWqwLIGBFfX5G9sK+clq3N3IPlhDjzNdbZaXkEElcotPlWs0wWZailk1vqhdtLYT/93Y4FHAVuzyatLmPZRA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.15.0"
+ },
+ "peerDependencies": {
+ "vue": "^3.0"
+ }
+ },
"node_modules/vue-tsc": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.2.0.tgz",
diff --git a/package.json b/package.json
index d790549..4834611 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
"dependencies": {
"pinia": "^2.3.0",
"vue": "^3.4.38",
+ "vue-toast-notification": "^3.1.3",
"vue3-markdown-it": "^1.0.10",
"vue3-toastify": "^0.2.8"
},
diff --git a/src/components/ActionSection.vue b/src/components/ActionSection.vue
index f9951fd..4397347 100644
--- a/src/components/ActionSection.vue
+++ b/src/components/ActionSection.vue
@@ -1,4 +1,7 @@
diff --git a/src/main.ts b/src/main.ts
index e5c5f99..3c65ef9 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,10 +1,10 @@
-import './style.css'
-//import "vue3-toastify/dist/index.css";
-
import { createApp } from 'vue'
import { createPinia } from 'pinia'
+
import App from './App.vue'
+import './style.css'
+
const pinia = createPinia()
const app = createApp(App)
diff --git a/src/stores/iterate.ts b/src/stores/iterate.ts
index 23fb4e0..681ac14 100644
--- a/src/stores/iterate.ts
+++ b/src/stores/iterate.ts
@@ -1,17 +1,10 @@
-//import { toast, ToastOptions } from "vue3-toastify";
import { defineStore } from 'pinia'
type State = 'Pending' | 'Running' | 'Completed' | 'Failed' | 'Terminated'
-const URL_BASE = 'https://03600f7f7081.ngrok.app' //import.meta.env.VITE_API_URL
+const URL_BASE = import.meta.env.VITE_API_URL
const API_CODE = import.meta.env.VITE_API_CODE
-// const TOAST_ERROR_CONFIG = {
-// "theme": "auto",
-// "type": "error",
-// "transition": "slide"
-// } as ToastOptions;
-
export const useIterateStore = defineStore('iterate', {
state: () => {
return {
@@ -101,7 +94,7 @@ export const useIterateStore = defineStore('iterate', {
});
},
start() {
- fetch(`${URL_BASE}/api/Iterator_Start`, {
+ return fetch(`${URL_BASE}/api/Iterator_Start`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -121,31 +114,10 @@ export const useIterateStore = defineStore('iterate', {
this.id = Id
this.interval = setInterval(() => this.next(), 1000)
this.next()
- })
- .catch(error => {
- this.id = ''
-
- let message = '';
- switch (error.status) {
- case 401:
- message = 'Unauthorized: Access denied.';
- break;
- case 429:
- message = 'Timeout: Try again in 1 hour.';
- break;
- case 500:
- message = 'Error: We messed up.';
- break;
- default:
- message = 'Error: Something Unexpected.';
- break;
- }
- console.error('Error:', message)
- //toast(message, TOAST_ERROR_CONFIG)
});
},
stop() {
- fetch(`${URL_BASE}/runtime/webhooks/durabletask/instances/${this.id}/terminate?reason=Canceled&code=${API_CODE}`, {
+ return fetch(`${URL_BASE}/runtime/webhooks/durabletask/instances/${this.id}/terminate?reason=Canceled&code=${API_CODE}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' }
})