(props.rules)
const $externalResults = reactive({})
diff --git a/gui/src/components/Modal/index.vue b/gui/src/components/Modal/index.vue
index ee92863..77109e9 100644
--- a/gui/src/components/Modal/index.vue
+++ b/gui/src/components/Modal/index.vue
@@ -9,7 +9,7 @@
{{ openedModalWindow.title }}
-
+
View instructions
@@ -52,6 +52,12 @@ const components: Record = {
const openedModalWindow = computed(() => uiStore.openedModalWindow)
+const showInstructionsLink = computed(() => {
+ return (
+ openedModalWindow.value?.name === MODAL_WINDOW_NAMES.RESOURCE_CREATION ||
+ openedModalWindow.value?.name === MODAL_WINDOW_NAMES.RESOURCE_EDITING
+ )
+})
/* const closeModal = () => {
uiStore.setModalWindowState()
} */
diff --git a/gui/src/interfaces/resources.interface.ts b/gui/src/interfaces/resources.interface.ts
index 2ef1260..12fa7a9 100644
--- a/gui/src/interfaces/resources.interface.ts
+++ b/gui/src/interfaces/resources.interface.ts
@@ -19,6 +19,7 @@ export interface IResource {
uuid: string
title: string
regions: string | Array
+ excludedInstanceTypes: string | Array
securityGroup: string
subnet: string
endpoint: string
@@ -54,8 +55,14 @@ export interface IRegions {
[key: string]: Array
}
+export interface IType {
+ instanceType: string
+}
+export interface ITypes {
+ [key: string]: Array
+}
export interface INodeCandidate {
diff --git a/gui/src/store/modules/application.ts b/gui/src/store/modules/application.ts
index 6d81715..217e118 100644
--- a/gui/src/store/modules/application.ts
+++ b/gui/src/store/modules/application.ts
@@ -7,12 +7,17 @@ import { SNACKBAR_MESSAGE_TYPES } from "@/constants";
interface ApplicationState {
applications: IPagination
pollingTimerId?: number;
+ pollingAttempts: number;
+ pollingStartTime?: number;
}
export const useApplicationStore = defineStore("application", {
state: (): ApplicationState => ({
applications: { pages: 0, currentPage: 0, results: [] },
pollingTimerId: undefined,
+ pollingAttempts: 0,
+ pollingStartTime: undefined,
+
}),
actions: {
async validateApplication(payload: Partial): Promise {
@@ -106,9 +111,10 @@ export const useApplicationStore = defineStore("application", {
console.log("Polling started...");
const batchSize = 100;
- let interval = 10000; //10 sec
- //const maxInterval = 60000;
-
+ const interval = 10000; // 10 seconds
+ const maxPollingTime = 20000; // 20 seconds
+ const maxPollingAttempts = 4;
+
const pollStatus = async () => {
const deployingApps = this.applications.results.filter(
(app) => app.status === "deploying" || app.status === "undeploying"
@@ -120,7 +126,19 @@ export const useApplicationStore = defineStore("application", {
}
console.log(`Polling for ${deployingApps.length} deploying/undeploying applications.`);
+
+ if (this.pollingAttempts >= maxPollingAttempts) {
+ console.log("Max polling attempts reached. Stopping polling.");
+ this.stopPolling();
+ return;
+ }
+ if (Date.now() - (this.pollingStartTime || 0) > maxPollingTime) {
+ console.log("Max polling time reached. Stopping polling.");
+ this.stopPolling();
+ return;
+ }
+
for (let i = 0; i < deployingApps.length; i += batchSize) {
const batch = deployingApps.slice(i, i + batchSize);
await this.checkApplicationStatus(batch.map((app) => app.uuid));
@@ -132,6 +150,9 @@ export const useApplicationStore = defineStore("application", {
if (stillDeploying) {
console.log(`Some applications are still deploying. Polling again.`);
+
+ this.pollingAttempts++;
+
this.pollingTimerId = window.setTimeout(pollStatus, interval);
} else {
console.log("All applications have completed. Stopping polling.");
@@ -139,6 +160,9 @@ export const useApplicationStore = defineStore("application", {
}
};
+ this.pollingStartTime = Date.now(); // Set the polling start time
+ this.pollingAttempts = 0; // Reset the polling attempts
+
pollStatus();
},
@@ -146,6 +170,9 @@ export const useApplicationStore = defineStore("application", {
if (this.pollingTimerId) {
clearTimeout(this.pollingTimerId);
this.pollingTimerId = undefined;
+ this.pollingStartTime = undefined; // Reset polling start time
+ this.pollingAttempts = 0;
+
console.log("Polling stopped.");
}
},