diff --git a/src/components/Selector.vue b/src/components/Selector.vue
index 37920ca6..46aa408b 100644
--- a/src/components/Selector.vue
+++ b/src/components/Selector.vue
@@ -35,7 +35,6 @@ limitations under the License. -->
+
diff --git a/src/views/components/LogTable/LogBrowser.vue b/src/views/components/LogTable/LogBrowser.vue
new file mode 100644
index 00000000..20fbb7d8
--- /dev/null
+++ b/src/views/components/LogTable/LogBrowser.vue
@@ -0,0 +1,107 @@
+
+
+
+
+
+ {{ dateFormat(data.time) }}
+ {{ data.pagePath }}
+ {{
+ data[item.label] || "-"
+ }}
+
+
+
+
+
diff --git a/src/views/components/LogTable/LogService.vue b/src/views/components/LogTable/LogService.vue
new file mode 100644
index 00000000..59943d47
--- /dev/null
+++ b/src/views/components/LogTable/LogService.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+ {{ dateFormat(data.timestamp) }}
+
+
+ {{ tags }}
+
+
+ {{ data[item.label] }}
+
+ {{ data[item.label] }}
+
+
+
+
+
diff --git a/src/views/components/LogTable/data.ts b/src/views/components/LogTable/data.ts
new file mode 100644
index 00000000..9765e019
--- /dev/null
+++ b/src/views/components/LogTable/data.ts
@@ -0,0 +1,120 @@
+/**
+ * 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.
+ */
+
+export const ServiceLogConstants = [
+ {
+ label: "serviceName",
+ value: "service",
+ },
+ {
+ label: "serviceInstanceName",
+ value: "instance",
+ },
+ {
+ label: "timestamp",
+ value: "time",
+ },
+ {
+ label: "contentType",
+ value: "contentType",
+ },
+ {
+ label: "tags",
+ value: "tags",
+ },
+ {
+ label: "content",
+ value: "content",
+ },
+ {
+ label: "traceId",
+ value: "traceID",
+ },
+];
+export const ServiceLogDetail = [
+ {
+ label: "serviceName",
+ value: "currentService",
+ },
+ {
+ label: "serviceInstanceName",
+ value: "currentInstance",
+ },
+ {
+ 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: 'pagePath',
+ // value: 'Page Path',
+ // },
+ {
+ label: "category",
+ value: "category",
+ },
+ {
+ label: "grade",
+ value: "grade",
+ },
+];
diff --git a/src/views/dashboard/related/trace/Detail.vue b/src/views/dashboard/related/trace/Detail.vue
index 4aadb25b..71e8ac9f 100644
--- a/src/views/dashboard/related/trace/Detail.vue
+++ b/src/views/dashboard/related/trace/Detail.vue
@@ -23,9 +23,36 @@ limitations under the License. -->
class="red mr-5 sm"
/>
{{ traceStore.currentTrace.endpointNames[0] }}
-
+
+
+ {{ t("viewLogs") }}
+
+
+
+
+
+
+
+ {{ t("noData") }}
+
+
+
+
("");
const displayMode = ref("List");
+ const pageNum = ref(1);
+ const pageSize = 10;
const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
dayjs(date).format(pattern);
+ const showTraceLogs = ref(false);
+
function handleClick(ids: string[]) {
let copyValue = null;
if (ids.length === 1) {
@@ -138,22 +172,33 @@ export default defineComponent({
copy(copyValue);
}
- function changeTraceId(opt: Option[]) {
+ async function changeTraceId(opt: Option[]) {
traceId.value = opt[0].value;
- traceStore.getTraceSpans({ traceId: opt[0].value });
+ const res = await traceStore.getTraceSpans({ traceId: opt[0].value });
+ if (res.errors) {
+ ElMessage.error(res.errors);
+ }
}
- // function searchTraceLogs() {
- // this.showTraceLogs = true;
- // this.GET_TRACE_SPAN_LOGS({
- // condition: {
- // relatedTrace: {
- // traceId: this.traceId || traceStore.current.traceIds[0],
- // },
- // paging: { pageNum: this.pageNum, pageSize: this.pageSize, needTotal: true },
- // },
- // });
- // }
+ async function searchTraceLogs() {
+ showTraceLogs.value = true;
+ const res = await traceStore.getSpanLogs({
+ condition: {
+ relatedTrace: {
+ traceId: traceId.value || traceStore.currentTrace.traceIds[0],
+ },
+ paging: { pageNum: pageNum.value, pageSize, needTotal: true },
+ },
+ });
+ if (res.errors) {
+ ElMessage.error(res.errors);
+ }
+ }
+
+ function turnLogsPage(page: number) {
+ pageNum.value = page;
+ searchTraceLogs();
+ }
return {
traceStore,
displayMode,
@@ -161,6 +206,10 @@ export default defineComponent({
changeTraceId,
handleClick,
t,
+ searchTraceLogs,
+ showTraceLogs,
+ turnLogsPage,
+ pageSize,
};
},
});
@@ -205,16 +254,7 @@ export default defineComponent({
}
.trace-log-btn {
- padding: 3px 9px;
- background-color: #484b55;
- border-radius: 4px;
- color: #eee;
- font-weight: normal;
- cursor: pointer;
-
- &.bg-blue {
- background-color: #448dfe;
- }
+ float: right;
}
.tag {
diff --git a/src/views/dashboard/related/trace/TraceList.vue b/src/views/dashboard/related/trace/TraceList.vue
index a5d7a90d..22641781 100644
--- a/src/views/dashboard/related/trace/TraceList.vue
+++ b/src/views/dashboard/related/trace/TraceList.vue
@@ -96,7 +96,7 @@ function searchTrace() {
function updatePage(p: number) {
traceStore.setCondition({
- paging: { pageNum: p, pageSize: 15, needTotal: true },
+ paging: { pageNum: p, pageSize: pageSize.value, needTotal: true },
});
searchTrace();
}
@@ -104,7 +104,7 @@ function updatePage(p: number) {
function changeSort(opt: Option[]) {
traceStore.setCondition({
queryOrder: opt[0].value,
- paging: { pageNum: 1, pageSize: 15, needTotal: true },
+ paging: { pageNum: 1, pageSize: pageSize.value, needTotal: true },
});
searchTrace();
}
diff --git a/src/views/dashboard/related/trace/components/table/Index.vue b/src/views/dashboard/related/trace/components/table/Index.vue
index de1ae041..ae375f86 100644
--- a/src/views/dashboard/related/trace/components/table/Index.vue
+++ b/src/views/dashboard/related/trace/components/table/Index.vue
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. -->