diff --git a/src/assets/icons/library_books.svg b/src/assets/icons/library_books.svg new file mode 100644 index 00000000..1fac0f64 --- /dev/null +++ b/src/assets/icons/library_books.svg @@ -0,0 +1,17 @@ + + + + diff --git a/src/components/DateCalendar.vue b/src/components/DateCalendar.vue index 91e56751..3e3a150f 100755 --- a/src/components/DateCalendar.vue +++ b/src/components/DateCalendar.vue @@ -553,6 +553,9 @@ const ok = (info: any) => { if (props.right && _time.getTime() / 100000 > start.value) { emit("setDates", _time, "right"); } + if (!(props.left && props.right)) { + emit("setDates", _time); + } emit("ok", info === "h"); }; onMounted(() => { diff --git a/src/components/Radio.vue b/src/components/Radio.vue new file mode 100644 index 00000000..f5aee030 --- /dev/null +++ b/src/components/Radio.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/components/Selector.vue b/src/components/Selector.vue index 46aa408b..5fbfdb60 100644 --- a/src/components/Selector.vue +++ b/src/components/Selector.vue @@ -76,42 +76,6 @@ watch( ); diff --git a/src/views/dashboard/controls/Trace.vue b/src/views/dashboard/controls/Trace.vue index 9f05fb8a..4a466a57 100644 --- a/src/views/dashboard/controls/Trace.vue +++ b/src/views/dashboard/controls/Trace.vue @@ -20,8 +20,8 @@ limitations under the License. --> -
- {{ t("delete") }} +
+ {{ t("delete") }}
diff --git a/src/views/dashboard/controls/index.ts b/src/views/dashboard/controls/index.ts index d4f2656c..4f2ee20e 100644 --- a/src/views/dashboard/controls/index.ts +++ b/src/views/dashboard/controls/index.ts @@ -18,5 +18,6 @@ import Topology from "./Topology.vue"; import Tab from "./Tab.vue"; import Widget from "./Widget.vue"; import Trace from "./Trace.vue"; +import Profile from "./Profile.vue"; -export default { Tab, Widget, Trace, Topology }; +export default { Tab, Widget, Trace, Topology, Profile }; diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index 97a079e3..17a186f3 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -167,6 +167,7 @@ export const ToolIcons = [ { name: "all_inbox", content: "Add Tab", id: "addTab" }, { name: "device_hub", content: "Add Topology", id: "topology" }, { name: "merge", content: "Add Trace", id: "trace" }, + { name: "timeline", content: "Add Profile", id: "profile" }, // { name: "save_alt", content: "Export", id: "export" }, // { name: "folder_open", content: "Import", id: "import" }, // { name: "settings", content: "Settings", id: "settings" }, @@ -209,7 +210,7 @@ export const Status = [ { label: "Error", value: "ERROR" }, ]; export const QueryOrders = [ - { label: "startTime", value: "BY_START_TIME" }, - { label: "duration", value: "BY_DURATION" }, + { label: "Start Time", value: "BY_START_TIME" }, + { label: "Duration", value: "BY_DURATION" }, ]; export const TraceEntitys = ["All", "Service", "ServiceInstance", "Endpoint"]; diff --git a/src/views/dashboard/panel/Layout.vue b/src/views/dashboard/panel/Layout.vue index a437f6ee..72c95881 100644 --- a/src/views/dashboard/panel/Layout.vue +++ b/src/views/dashboard/panel/Layout.vue @@ -31,7 +31,7 @@ limitations under the License. --> :key="item.i" @click="clickGrid(item)" :class="{ active: dashboardStore.activedGridItem === item.i }" - drag-ignore-from="svg.d3-trace-tree" + drag-ignore-from="svg.d3-trace-tree, .dragger" > diff --git a/src/views/dashboard/panel/Tool.vue b/src/views/dashboard/panel/Tool.vue index 287ca3d0..7e5774a8 100644 --- a/src/views/dashboard/panel/Tool.vue +++ b/src/views/dashboard/panel/Tool.vue @@ -84,10 +84,13 @@ limitations under the License. --> size="sm" :iconName="t.name" v-if=" - !['topology', 'trace'].includes(t.id) || + !['topology', 'trace', 'profile'].includes(t.id) || (t.id === 'topology' && hasTopology.includes(dashboardStore.entity)) || - (t.id === 'trace' && TraceEntitys.includes(dashboardStore.entity)) + (t.id === 'trace' && + TraceEntitys.includes(dashboardStore.entity)) || + (t.id === 'profile' && + dashboardStore.entity === EntityType[0].value) " /> @@ -295,6 +298,9 @@ function clickIcons(t: { id: string; content: string; name: string }) { case "trace": dashboardStore.addControl("Trace"); break; + case "profile": + dashboardStore.addControl("Profile"); + break; case "topology": dashboardStore.addControl("Topology"); break; diff --git a/src/views/dashboard/related/profile/Content.vue b/src/views/dashboard/related/profile/Content.vue new file mode 100644 index 00000000..4679ba67 --- /dev/null +++ b/src/views/dashboard/related/profile/Content.vue @@ -0,0 +1,83 @@ + + + + diff --git a/src/views/dashboard/related/profile/Header.vue b/src/views/dashboard/related/profile/Header.vue new file mode 100644 index 00000000..e0ab1a2e --- /dev/null +++ b/src/views/dashboard/related/profile/Header.vue @@ -0,0 +1,117 @@ + + + + diff --git a/src/views/dashboard/related/profile/components/NewTask.vue b/src/views/dashboard/related/profile/components/NewTask.vue new file mode 100644 index 00000000..81ad9091 --- /dev/null +++ b/src/views/dashboard/related/profile/components/NewTask.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/src/views/dashboard/related/profile/components/SegmentList.vue b/src/views/dashboard/related/profile/components/SegmentList.vue new file mode 100644 index 00000000..dac0942e --- /dev/null +++ b/src/views/dashboard/related/profile/components/SegmentList.vue @@ -0,0 +1,156 @@ + + + + diff --git a/src/views/dashboard/related/profile/components/SpanTree.vue b/src/views/dashboard/related/profile/components/SpanTree.vue new file mode 100644 index 00000000..63df51d9 --- /dev/null +++ b/src/views/dashboard/related/profile/components/SpanTree.vue @@ -0,0 +1,173 @@ + + + + diff --git a/src/views/dashboard/related/profile/components/Stack/Container.vue b/src/views/dashboard/related/profile/components/Stack/Container.vue new file mode 100644 index 00000000..d127943a --- /dev/null +++ b/src/views/dashboard/related/profile/components/Stack/Container.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/views/dashboard/related/profile/components/Stack/Index.vue b/src/views/dashboard/related/profile/components/Stack/Index.vue new file mode 100644 index 00000000..a22e4496 --- /dev/null +++ b/src/views/dashboard/related/profile/components/Stack/Index.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/views/dashboard/related/profile/components/Stack/Item.vue b/src/views/dashboard/related/profile/components/Stack/Item.vue new file mode 100644 index 00000000..731beab0 --- /dev/null +++ b/src/views/dashboard/related/profile/components/Stack/Item.vue @@ -0,0 +1,153 @@ + + + + diff --git a/src/views/dashboard/related/profile/components/Stack/profile.scss b/src/views/dashboard/related/profile/components/Stack/profile.scss new file mode 100644 index 00000000..fbfdbb99 --- /dev/null +++ b/src/views/dashboard/related/profile/components/Stack/profile.scss @@ -0,0 +1,28 @@ +/** + * 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. + */ +.dump-count { + width: 100px; +} + +.exec-ms { + width: 200px; + position: relative; +} + +.self { + width: 100px; +} diff --git a/src/views/dashboard/related/profile/components/TaskList.vue b/src/views/dashboard/related/profile/components/TaskList.vue new file mode 100644 index 00000000..ca14705a --- /dev/null +++ b/src/views/dashboard/related/profile/components/TaskList.vue @@ -0,0 +1,246 @@ + + + + diff --git a/src/views/dashboard/related/profile/components/data.ts b/src/views/dashboard/related/profile/components/data.ts new file mode 100644 index 00000000..a382e5a9 --- /dev/null +++ b/src/views/dashboard/related/profile/components/data.ts @@ -0,0 +1,63 @@ +/** + * 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 ProfileMode: any[] = [ + { label: "Include Children", value: "include" }, + { label: "Exclude Children", value: "exclude" }, +]; +export const NewTaskField = { + service: { key: "", label: "None" }, + monitorTime: { key: "0", label: "monitor now" }, + monitorDuration: { key: 5, label: "5 min" }, + minThreshold: 0, + dumpPeriod: { key: 10, label: "10ms" }, + endpointName: "", + maxSamplingCount: { key: 5, label: "5" }, +}; + +export const InitTaskField = { + serviceSource: [{ key: "", label: "None" }], + monitorTimeEn: [ + { value: "0", label: "monitor now" }, + { value: "1", label: "set start time" }, + ], + monitorTimeCn: [ + { value: "0", label: "此刻" }, + { value: "1", label: "设置时间" }, + ], + monitorDuration: [ + { value: "5", label: "5 min" }, + { value: "10", label: "10 min" }, + { value: "15", label: "15 min" }, + ], + dumpPeriod: [ + { value: "10", label: "10 ms" }, + { value: "20", label: "20 ms" }, + { value: "50", label: "50 ms" }, + { value: "100", label: "100 ms" }, + ], + maxSamplingCount: [ + { value: "1", label: "1" }, + { value: "2", label: "2" }, + { value: "3", label: "3" }, + { value: "4", label: "4" }, + { value: "5", label: "5" }, + { value: "6", label: "6" }, + { value: "7", label: "7" }, + { value: "8", label: "8" }, + { value: "9", label: "9" }, + ], +}; diff --git a/src/views/dashboard/related/trace/Detail.vue b/src/views/dashboard/related/trace/Detail.vue index ae44f0e1..ade0f74e 100644 --- a/src/views/dashboard/related/trace/Detail.vue +++ b/src/views/dashboard/related/trace/Detail.vue @@ -123,14 +123,16 @@ limitations under the License. -->
{{ t("noData") }}
- +
+ +
- diff --git a/src/views/dashboard/related/trace/components/List.vue b/src/views/dashboard/related/trace/components/List.vue index c9a48d52..e8d4cd07 100644 --- a/src/views/dashboard/related/trace/components/List.vue +++ b/src/views/dashboard/related/trace/components/List.vue @@ -88,7 +88,7 @@ function downloadTrace() { .charts { overflow: auto; padding: 10px; - height: calc(100% - 95px); + height: 100%; width: 100%; } diff --git a/src/views/dashboard/related/trace/components/Table/Index.vue b/src/views/dashboard/related/trace/components/Table/Index.vue index 07bc73e2..eb177fc6 100644 --- a/src/views/dashboard/related/trace/components/Table/Index.vue +++ b/src/views/dashboard/related/trace/components/Table/Index.vue @@ -20,7 +20,8 @@ limitations under the License. -->
{{ $t("noData") }}
@@ -31,27 +32,26 @@ import { ref, watch, onMounted } from "vue"; import type { PropType } from "vue"; import TableContainer from "./TableContainer.vue"; import traceTable from "../../utils/trace-table"; +import { Span } from "@/types/trace"; /* global defineProps, defineEmits */ const props = defineProps({ data: { type: Array as PropType, default: () => [] }, traceId: { type: String, default: "" }, showBtnDetail: { type: Boolean, default: false }, - HeaderType: { type: String, default: "" }, + headerType: { type: String, default: "" }, }); const emit = defineEmits(["select", "view", "load"]); const loading = ref(true); const tableData = ref([]); const showDetail = ref(false); -const currentSpan = ref([]); +const currentSpan = ref({}); onMounted(() => { tableData.value = formatData( traceTable.changeTree(props.data, props.traceId) ); loading.value = false; - emit("select", handleSelectSpan); - emit("view", handleViewSpan); emit("load", () => { loading.value = true; }); @@ -69,7 +69,7 @@ function formatData(arr: any[], level = 1, totalExec?: number) { return arr; } -function handleSelectSpan(data: any[]) { +function handleSelectSpan(data: Span) { currentSpan.value = data; if (!props.showBtnDetail) { showDetail.value = true; @@ -77,10 +77,6 @@ function handleSelectSpan(data: any[]) { emit("select", data); } -function handleViewSpan() { - showDetail.value = true; -} - watch( () => props.data, () => { @@ -109,8 +105,7 @@ watch( } .trace-table { - padding: 10px; - height: calc(100% - 95px); + height: 100%; width: 100%; } diff --git a/src/views/dashboard/related/trace/components/Table/TableContainer.vue b/src/views/dashboard/related/trace/components/Table/TableContainer.vue index d8f02824..277a877c 100644 --- a/src/views/dashboard/related/trace/components/Table/TableContainer.vue +++ b/src/views/dashboard/related/trace/components/Table/TableContainer.vue @@ -30,7 +30,7 @@ limitations under the License. -->
- + {{ headerData[0].value }} @@ -43,12 +43,14 @@ limitations under the License. --> {{ item.value }}
- @@ -56,21 +58,24 @@ limitations under the License. -->