From 35367df3712e682c664d4be7f53176f364916e60 Mon Sep 17 00:00:00 2001 From: Peter Olu Date: Fri, 20 May 2022 23:24:58 +0100 Subject: [PATCH] relplaced the position of logColumn contants to store/modules/data.ts --- src/store/data.ts | 112 ++++++++++++++++++++++++++++++++++++++ src/store/modules/log.ts | 5 ++ src/types/log-column.d.ts | 7 ++- 3 files changed, 123 insertions(+), 1 deletion(-) diff --git a/src/store/data.ts b/src/store/data.ts index d6d3e01e..aed7e072 100644 --- a/src/store/data.ts +++ b/src/store/data.ts @@ -29,3 +29,115 @@ export const TextConfig = { fontSize: 14, textAlign: "left", }; + +export const ServiceLogConstants = [ + { + label: "serviceName", + value: "service", + isVisible: true + }, + { + label: "serviceInstanceName", + value: "instance", + isVisible: true + }, + { + label: "endpointName", + value: "endpoint", + isVisible: false + }, + { + label: "timestamp", + value: "time", + isVisible: true + }, + { + label: "contentType", + value: "contentType", + isVisible: true + }, + { + label: "tags", + value: "tags", + isVisible: false + }, + { + label: "content", + value: "content", + isVisible: true + }, + { + label: "traceId", + value: "traceID", + isVisible: false + }, +]; +export const ServiceLogDetail = [ + { + label: "serviceName", + value: "service", + }, + { + label: "serviceInstanceName", + value: "instance", + }, + { + label: "timestamp", + value: "time", + }, + { + label: "contentType", + value: "contentType", + }, + { + label: "traceId", + value: "traceID", + }, + { + label: "tags", + value: "tags", + }, + { + label: "content", + value: "content", + }, +]; +// The order of columns should be time, service, error, stack, version, url, catalog, and grade. +export const BrowserLogConstants = [ + { + label: "service", + value: "service", + }, + { + label: "serviceVersion", + value: "serviceVersion", + }, + { + label: "errorUrl", + value: "errorPage", + }, + { + label: "time", + value: "time", + }, + { + label: "message", + value: "message", + // drag: true, + method: 350, + }, + { + label: "stack", + value: "stack", + // drag: true, + method: 350, + }, + { + label: "category", + value: "category", + }, + { + label: "grade", + value: "grade", + }, +]; \ No newline at end of file diff --git a/src/store/modules/log.ts b/src/store/modules/log.ts index b9934976..785c29f4 100644 --- a/src/store/modules/log.ts +++ b/src/store/modules/log.ts @@ -17,6 +17,7 @@ import { defineStore } from "pinia"; import { Duration } from "@/types/app"; import { Instance, Endpoint, Service } from "@/types/selector"; +import { ServiceLogColumn, BrowserLogColumn } from '@/types/log-column' import { store } from "@/store"; import graphql from "@/graphql"; import { AxiosResponse } from "axios"; @@ -28,6 +29,8 @@ interface LogState { services: Service[]; instances: Instance[]; endpoints: Endpoint[]; + serviceLogColumn: ServiceLogColumn[]; + browserLogColumn: BrowserLogColumn[]; conditions: any; durationTime: Duration; selectorStore: any; @@ -47,6 +50,8 @@ export const logStore = defineStore({ queryDuration: useAppStoreWithOut().durationTime, paging: { pageNum: 1, pageSize: 15, needTotal: true }, }, + serviceLogColumn: [], + browserLogColumn: [], supportQueryLogsByKeywords: true, durationTime: useAppStoreWithOut().durationTime, selectorStore: useSelectorStore(), diff --git a/src/types/log-column.d.ts b/src/types/log-column.d.ts index 564adef9..26cda88b 100644 --- a/src/types/log-column.d.ts +++ b/src/types/log-column.d.ts @@ -14,7 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export interface logColumn { +export interface BrowserLogColumn { + lable: string; + value: string; + isVisible?: boolean; +} +export interface ServiceLogColumn { lable: string; value: string; isVisible?: boolean;