mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
feat: create global actions for setting page title and auto refresh pages (#13)
* fix: update heat map * feat: update servicelist * fix: update list * feat: update page with changing times * feat: set auto fresh * feat: set page titles
This commit is contained in:
@@ -101,3 +101,24 @@ export const ConfigData2: any = {
|
||||
},
|
||||
children: [],
|
||||
};
|
||||
export const ConfigData3: any = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 8,
|
||||
h: 12,
|
||||
i: "0",
|
||||
metrics: ["all_heatmap"],
|
||||
metricTypes: ["readHeatMap"],
|
||||
type: "Widget",
|
||||
widget: {
|
||||
title: "all_heatmap",
|
||||
tips: "Tooltip",
|
||||
},
|
||||
graph: {
|
||||
type: "HeatMap",
|
||||
},
|
||||
standard: {
|
||||
unit: "min",
|
||||
},
|
||||
children: [],
|
||||
};
|
||||
|
@@ -28,6 +28,8 @@ interface AppState {
|
||||
utcMin: number;
|
||||
eventStack: (() => unknown)[];
|
||||
timer: Nullable<any>;
|
||||
autoRefresh: boolean;
|
||||
pageTitle: string;
|
||||
}
|
||||
|
||||
export const appStore = defineStore({
|
||||
@@ -39,6 +41,8 @@ export const appStore = defineStore({
|
||||
utcMin: 0,
|
||||
eventStack: [],
|
||||
timer: null,
|
||||
autoRefresh: false,
|
||||
pageTitle: "",
|
||||
}),
|
||||
getters: {
|
||||
duration(): Duration {
|
||||
@@ -117,6 +121,12 @@ export const appStore = defineStore({
|
||||
setEventStack(funcs: (() => void)[]): void {
|
||||
this.eventStack = funcs;
|
||||
},
|
||||
setAutoRefresh(auto: boolean) {
|
||||
this.autoRefresh = auto;
|
||||
},
|
||||
setPageTitle(title: string) {
|
||||
this.pageTitle = title;
|
||||
},
|
||||
runEventStack() {
|
||||
if (this.timer) {
|
||||
clearTimeout(this.timer);
|
||||
|
@@ -18,7 +18,7 @@ import { defineStore } from "pinia";
|
||||
import { store } from "@/store";
|
||||
import { LayoutConfig } from "@/types/dashboard";
|
||||
import graph from "@/graph";
|
||||
import { ConfigData, ConfigData1, ConfigData2 } from "../data";
|
||||
import { ConfigData, ConfigData1, ConfigData2, ConfigData3 } from "../data";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
import { useSelectorStore } from "@/store/modules/selectors";
|
||||
import { NewControl } from "../data";
|
||||
@@ -146,12 +146,19 @@ export const dashboardStore = defineStore({
|
||||
},
|
||||
setEntity(type: string) {
|
||||
this.entity = type;
|
||||
// todo
|
||||
if (type === "ServiceInstance") {
|
||||
this.layout = [ConfigData1];
|
||||
}
|
||||
if (type === "Endpoint") {
|
||||
this.layout = [ConfigData2];
|
||||
}
|
||||
if (type == "All") {
|
||||
this.layout = [ConfigData3];
|
||||
}
|
||||
if (type == "Service") {
|
||||
this.layout = [ConfigData];
|
||||
}
|
||||
},
|
||||
setConfigs(param: { [key: string]: unknown }) {
|
||||
const actived = this.activedGridItem.split("-");
|
||||
|
Reference in New Issue
Block a user