mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 00:08:56 +00:00
feat: update paths
This commit is contained in:
parent
722982922d
commit
b73eca349a
@ -62,13 +62,11 @@ limitations under the License. -->
|
|||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const pageName = ref<string>("");
|
|
||||||
const pathNames = ref<any[]>([]);
|
const pathNames = ref<any[]>([]);
|
||||||
const timeRange = ref<number>(0);
|
const timeRange = ref<number>(0);
|
||||||
|
|
||||||
resetDuration();
|
resetDuration();
|
||||||
getVersion();
|
getVersion();
|
||||||
// getPathNames();
|
|
||||||
|
|
||||||
function handleReload() {
|
function handleReload() {
|
||||||
const gap = appStore.duration.end.getTime() - appStore.duration.start.getTime();
|
const gap = appStore.duration.end.getTime() - appStore.duration.start.getTime();
|
||||||
@ -84,10 +82,6 @@ limitations under the License. -->
|
|||||||
appStore.setDuration(timeFormat(val));
|
appStore.setDuration(timeFormat(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
function setConfig(value: string) {
|
|
||||||
pageName.value = value || "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPathNames() {
|
function getPathNames() {
|
||||||
const dashboard = dashboardStore.currentDashboard;
|
const dashboard = dashboardStore.currentDashboard;
|
||||||
pathNames.value = [];
|
pathNames.value = [];
|
||||||
@ -107,17 +101,35 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pathNames.value.push(root);
|
pathNames.value.push(root);
|
||||||
if (dashboard.entity !== MetricCatalog.ALL) {
|
if (dashboard.entity === MetricCatalog.ALL) {
|
||||||
const d = dashboardStore.dashboards.filter(
|
return;
|
||||||
(d: DashboardItem) => dashboard.entity === d.entity && dashboard.layer === d.layer,
|
|
||||||
)[0];
|
|
||||||
const id = route.params.id;
|
|
||||||
const path = `/dashboard/${dashboard.layer}/${dashboard.entity}/${id}/${dashboard.name}`;
|
|
||||||
pathNames.value.push({
|
|
||||||
...d,
|
|
||||||
path,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
if (dashboard.entity === MetricCatalog.SERVICE) {
|
||||||
|
pathNames.value.push({
|
||||||
|
name: dashboard.name,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const serviceDashboard = dashboardStore.dashboards.filter(
|
||||||
|
(d: DashboardItem) => MetricCatalog.SERVICE === d.entity && dashboard.layer === d.layer,
|
||||||
|
)[0];
|
||||||
|
if (!serviceDashboard) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const serviceId = route.params.serviceId;
|
||||||
|
let path = `/dashboard/${serviceDashboard.layer}/${serviceDashboard.entity}/${serviceDashboard.name}`;
|
||||||
|
if (serviceId) {
|
||||||
|
path = `/dashboard/${serviceDashboard.layer}/${serviceDashboard.entity}/${serviceId}/${serviceDashboard.name}`;
|
||||||
|
}
|
||||||
|
pathNames.value.push(
|
||||||
|
{
|
||||||
|
...serviceDashboard,
|
||||||
|
path,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: dashboard.name,
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getVersion() {
|
async function getVersion() {
|
||||||
|
Loading…
Reference in New Issue
Block a user