diff --git a/package-lock.json b/package-lock.json index a53afd05..34e83778 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "echarts": "^5.2.2", "element-plus": "^2.0.2", "lodash": "^4.17.21", + "monaco-editor": "^0.33.0", "pinia": "^2.0.5", "vue": "^3.0.0", "vue-grid-layout": "^3.0.0-beta1", @@ -18234,6 +18235,11 @@ "node": "*" } }, + "node_modules/monaco-editor": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.33.0.tgz", + "integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw==" + }, "node_modules/move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -43271,6 +43277,11 @@ "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", "dev": true }, + "monaco-editor": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.33.0.tgz", + "integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw==" + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", diff --git a/package.json b/package.json index ece16b3a..679606f2 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "echarts": "^5.2.2", "element-plus": "^2.0.2", "lodash": "^4.17.21", + "monaco-editor": "^0.33.0", "pinia": "^2.0.5", "vue": "^3.0.0", "vue-grid-layout": "^3.0.0-beta1", diff --git a/src/store/modules/demand-log.ts b/src/store/modules/demand-log.ts index af8d8c29..3c2bce46 100644 --- a/src/store/modules/demand-log.ts +++ b/src/store/modules/demand-log.ts @@ -35,21 +35,21 @@ interface DemandLogState { export const demandLogStore = defineStore({ id: "demandLog", state: (): DemandLogState => ({ - containers: [{ value: "0", label: "" }], - instances: [{ value: "0", label: "" }], + containers: [{ label: "Detail", value: "Detail" }], + instances: [{ value: "", label: "" }], conditions: { container: "", serviceId: "", serviceInstanceId: "", queryDuration: useAppStoreWithOut().durationTime, - paging: { pageNum: 1, pageSize: 15 }, + paging: { pageNum: 1, pageSize: -1 }, }, selectorStore: useSelectorStore(), logs: [], loadLogs: false, }), actions: { - setLogCondition(data: any) { + setLogCondition(data: Conditions) { this.conditions = { ...this.conditions, ...data }; }, async getInstances(id: string) { @@ -86,9 +86,10 @@ export const demandLogStore = defineStore({ if (res.data.errors) { return res.data; } - this.containers = res.data.data.containers.containers.map((d: string) => { - return { label: d, value: d }; - }) || [{ label: "Detail", value: "Detail" }]; + this.containers = + res.data.data.containers.containers.map((d: string) => { + return { label: d, value: d }; + }) || []; return res.data; }, async getDemandLogs() { diff --git a/src/types/monaco-editor.ts b/src/types/monaco-editor.ts new file mode 100644 index 00000000..c5005680 --- /dev/null +++ b/src/types/monaco-editor.ts @@ -0,0 +1,17 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +declare module "monaco-editor/esm/vs/editor/editor.main.js"; diff --git a/src/views/dashboard/controls/DemandLog.vue b/src/views/dashboard/controls/DemandLog.vue index b46f057e..f60426e1 100644 --- a/src/views/dashboard/controls/DemandLog.vue +++ b/src/views/dashboard/controls/DemandLog.vue @@ -32,7 +32,7 @@ limitations under the License. -->