diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts
index 8a5e7391..84af4f57 100644
--- a/src/store/modules/dashboard.ts
+++ b/src/store/modules/dashboard.ts
@@ -150,7 +150,7 @@ export const dashboardStore = defineStore({
showDepth: true,
};
}
- if (type === "Trace" || type === "Profile") {
+ if (type === "Trace" || type === "Profile" || type === "Log") {
newItem.h = 24;
}
if (this.layout[idx].children) {
diff --git a/src/store/modules/log.ts b/src/store/modules/log.ts
index 6cc2882d..f7846d66 100644
--- a/src/store/modules/log.ts
+++ b/src/store/modules/log.ts
@@ -22,6 +22,7 @@ import graphql from "@/graphql";
import { AxiosResponse } from "axios";
import { useAppStoreWithOut } from "@/store/modules/app";
import { useSelectorStore } from "@/store/modules/selectors";
+import { useDashboardStore } from "@/store/modules/dashboard";
interface LogState {
services: Service[];
@@ -33,6 +34,7 @@ interface LogState {
supportQueryLogsByKeywords: boolean;
logs: any[];
logsTotal: number;
+ loadLogs: boolean;
}
export const logStore = defineStore({
@@ -50,6 +52,7 @@ export const logStore = defineStore({
selectorStore: useSelectorStore(),
logs: [],
logsTotal: 0,
+ loadLogs: false,
}),
actions: {
setLogCondition(data: any) {
@@ -111,22 +114,33 @@ export const logStore = defineStore({
return res.data;
},
async getLogs() {
+ const dashboardStore = useDashboardStore();
+ if (dashboardStore.layerId === "BROWSER") {
+ return this.getBrowserLogs();
+ }
+ return this.getServiceLogs();
+ },
+ async getServiceLogs() {
+ this.loadLogs = true;
const res: AxiosResponse = await graphql
.query("queryServiceLogs")
.params({ condition: this.conditions });
-
+ this.loadLogs = false;
if (res.data.errors) {
return res.data;
}
+
this.logs = res.data.data.queryLogs.logs;
this.logsTotal = res.data.data.queryLogs.total;
return res.data;
},
async getBrowserLogs() {
+ this.loadLogs = true;
const res: AxiosResponse = await graphql
.query("queryBrowserErrorLogs")
.params({ condition: this.conditions });
+ this.loadLogs = false;
if (res.data.errors) {
return res.data;
}
diff --git a/src/views/dashboard/controls/Log.vue b/src/views/dashboard/controls/Log.vue
index e3d8972e..d0a22405 100644
--- a/src/views/dashboard/controls/Log.vue
+++ b/src/views/dashboard/controls/Log.vue
@@ -33,7 +33,6 @@ limitations under the License. -->
diff --git a/src/views/dashboard/related/log/List.vue b/src/views/dashboard/related/log/List.vue
index be23c777..8cbcb501 100644
--- a/src/views/dashboard/related/log/List.vue
+++ b/src/views/dashboard/related/log/List.vue
@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. -->
-
-
+
+
{{ t("noData") }}
@@ -40,14 +40,9 @@ import { useLogStore } from "@/store/modules/log";
import { useDashboardStore } from "@/store/modules/dashboard";
import { ElMessage } from "element-plus";
-/* global defineProps*/
-defineProps({
- traceId: { type: String, default: "" },
-});
const { t } = useI18n();
const logStore = useLogStore();
const dashboardStore = useDashboardStore();
-const loading = ref(false);
const type = ref(
dashboardStore.layerId === "BROWSER" ? "browser" : "service"
);
@@ -59,12 +54,10 @@ function updatePage(p: number) {
queryLogs();
}
async function queryLogs() {
- loading.value = true;
const res = await logStore.getLogs();
if (res && res.errors) {
ElMessage.error(res.errors);
}
- loading.value = false;
}