From 21aa57a51b32db41a3c48aa3b17c2b612fe4efc6 Mon Sep 17 00:00:00 2001 From: Fotis Paraskevopoulos Date: Thu, 25 Apr 2024 13:39:07 +0300 Subject: [PATCH] Initial release Change-Id: If51199c8e3e9655001b2ba0f4ef7d762029d5764 --- gui/Dockerfile | 2 +- gui/package.json | 3 + gui/src/Master.vue | 4 + .../MonacoEditor/MonacoEditor.vue | 2 +- .../MonacoEditor/math-syntax.ts | 1 + .../MultiStepsProvider/index.vue | 12 +- .../Application/ExpressionEditor.vue | 1 + .../Application/Metrics/Metrics.vue | 16 +- .../Application/Metrics/MetricsComposable.ts | 49 ++--- .../Metrics/MetricsTemplateDesktop.vue | 105 +++++----- .../Metrics/MetricsTemplateMobile.vue | 46 +---- .../components/Application/Metrics/index.vue | 4 +- gui/src/components/Application/Resources.vue | 8 +- gui/src/components/Application/index.vue | 2 + gui/src/components/DebugInfo/DebugInfo.vue | 40 ++++ gui/src/components/Header/Header.vue | 95 +-------- gui/src/components/Modal/ResourceCreation.vue | 108 ++++------- gui/src/components/Modal/ResourceEditing.vue | 71 +------ gui/src/components/Modal/ResourceForm.vue | 182 ++++++++++++++++++ gui/src/components/Modal/index.vue | 2 +- gui/src/constants/index.ts | 4 +- gui/src/constants/metricsOptions.ts | 4 +- .../Applications/Overview/index.vue | 6 +- .../Applications/PolicyEditor/index.vue | 32 +++ .../Applications/Resources/index.vue | 73 +++++-- .../Applications/applications-route.ts | 8 + gui/src/containers/Login/index.vue | 14 +- gui/src/interfaces/metrics.interface.ts | 9 +- gui/src/interfaces/platform.interface.ts | 1 - gui/src/interfaces/resources.interface.ts | 40 +++- .../interfaces/utilityFunctions.interface.ts | 2 +- .../store/api-services/application.service.ts | 16 +- .../store/api-services/resources.service.ts | 9 +- gui/src/store/modules/navigation.ts | 6 + gui/src/store/modules/policies.ts | 24 +++ gui/src/store/modules/resources.ts | 12 +- gui/src/store/modules/ui.ts | 1 + gui/src/types/metrics.ts | 2 +- gui/src/types/resource.ts | 3 +- gui/src/types/responses.ts | 1 + gui/src/utils/colors.ts | 3 + 41 files changed, 614 insertions(+), 409 deletions(-) create mode 100644 gui/src/components/DebugInfo/DebugInfo.vue create mode 100644 gui/src/components/Modal/ResourceForm.vue create mode 100644 gui/src/containers/Applications/PolicyEditor/index.vue create mode 100644 gui/src/store/modules/policies.ts diff --git a/gui/Dockerfile b/gui/Dockerfile index 6112b01..b0365c2 100644 --- a/gui/Dockerfile +++ b/gui/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/node:20.11.0-bookworm +FROM docker.io/library/node:21.4.0-bookworm COPY . /app WORKDIR /app RUN corepack enable pnpm && pnpm install && npx vue-tsc diff --git a/gui/package.json b/gui/package.json index 5f851f4..14435b1 100644 --- a/gui/package.json +++ b/gui/package.json @@ -2,6 +2,9 @@ "name": "enigma-nebulous", "private": true, "version": "0.0.0", + "engines": { + "node": "v21.4.0" + }, "scripts": { "serve": "vite", "build": "vue-tsc && vite build", diff --git a/gui/src/Master.vue b/gui/src/Master.vue index 4dd0c93..6714f88 100644 --- a/gui/src/Master.vue +++ b/gui/src/Master.vue @@ -3,6 +3,7 @@
+
@@ -30,6 +31,7 @@ import SideMenu from "@/components/SideMenu" import MobileMenu from "@/components/MobileMenu" import Modal from "@/components/Modal" import Snackbar from "@/components/Snackbar" +import Footer from "@/base-components/Headless/Menu/Footer.vue"; const route: RouteLocationNormalizedLoaded = useRoute() @@ -44,4 +46,6 @@ watch( }, { deep: true } ) + + diff --git a/gui/src/base-components/MonacoEditor/MonacoEditor.vue b/gui/src/base-components/MonacoEditor/MonacoEditor.vue index 24c791e..7e444ed 100644 --- a/gui/src/base-components/MonacoEditor/MonacoEditor.vue +++ b/gui/src/base-components/MonacoEditor/MonacoEditor.vue @@ -19,7 +19,7 @@ import ICodeEditor = editor.ICodeEditor interface IEditorProps { modelValue: string - language: "yaml" | "math" + language: "yaml" | "math" | "json" | "casbin" theme?: string fontSize?: number destroyDelay?: number diff --git a/gui/src/base-components/MonacoEditor/math-syntax.ts b/gui/src/base-components/MonacoEditor/math-syntax.ts index cda0dfe..6ca2e5a 100644 --- a/gui/src/base-components/MonacoEditor/math-syntax.ts +++ b/gui/src/base-components/MonacoEditor/math-syntax.ts @@ -8,6 +8,7 @@ export const keywords = [ "POW", "LOG", "LOG10", + "MEAN", "LN2", "LN10", "LOG10E", diff --git a/gui/src/base-components/MultiStepsProvider/index.vue b/gui/src/base-components/MultiStepsProvider/index.vue index fc81e3b..f3a8b72 100644 --- a/gui/src/base-components/MultiStepsProvider/index.vue +++ b/gui/src/base-components/MultiStepsProvider/index.vue @@ -17,7 +17,11 @@ - +
+
+ +
@@ -126,6 +132,7 @@ const router = useRouter() interface MultiStepsProviderProps { stages: Record + saveEnabled: boolean entrypointComponent: string returnRouteName: string responseErrorMessages: Array @@ -165,6 +172,7 @@ watch(currentStageName, () => { const clientErrorMessages = ref>([]) +const saveEnabled = computed(() => props.saveEnabled) const currentStage = computed(() => props.stages[currentStageName.value]) const visibleStagesHeads = computed(() => Object.values(props.stages).filter(({ isInvisible }) => !isInvisible)) const lastStageNumber = computed(() => Math.max(...Object.values(props.stages).map(({ stage }) => stage))) diff --git a/gui/src/components/Application/ExpressionEditor.vue b/gui/src/components/Application/ExpressionEditor.vue index 16afa58..2a68c06 100644 --- a/gui/src/components/Application/ExpressionEditor.vue +++ b/gui/src/components/Application/ExpressionEditor.vue @@ -66,6 +66,7 @@ }" > + diff --git a/gui/src/components/Application/Metrics/Metrics.vue b/gui/src/components/Application/Metrics/Metrics.vue index 718c928..370beb1 100644 --- a/gui/src/components/Application/Metrics/Metrics.vue +++ b/gui/src/components/Application/Metrics/Metrics.vue @@ -8,12 +8,14 @@