mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: add widget type
This commit is contained in:
parent
7bb719d9b6
commit
569c4f6301
@ -53,6 +53,7 @@ limitations under the License. -->
|
|||||||
import { addResizeListener, removeResizeListener } from "@/utils/event";
|
import { addResizeListener, removeResizeListener } from "@/utils/event";
|
||||||
import Trace from "@/views/dashboard/related/trace/Index.vue";
|
import Trace from "@/views/dashboard/related/trace/Index.vue";
|
||||||
import associateProcessor from "@/hooks/useAssociateProcessor";
|
import associateProcessor from "@/hooks/useAssociateProcessor";
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
/*global Nullable, defineProps, defineEmits, Indexable*/
|
/*global Nullable, defineProps, defineEmits, Indexable*/
|
||||||
const emits = defineEmits(["select"]);
|
const emits = defineEmits(["select"]);
|
||||||
@ -63,7 +64,7 @@ limitations under the License. -->
|
|||||||
const currentParams = ref<Nullable<EventParams>>(null);
|
const currentParams = ref<Nullable<EventParams>>(null);
|
||||||
const showTrace = ref<boolean>(false);
|
const showTrace = ref<boolean>(false);
|
||||||
const traceOptions = ref<{ type: string; filters?: unknown }>({
|
const traceOptions = ref<{ type: string; filters?: unknown }>({
|
||||||
type: "Trace",
|
type: WidgetType.Trace,
|
||||||
});
|
});
|
||||||
const menuPos = reactive<{ x: number; y: number }>({ x: NaN, y: NaN });
|
const menuPos = reactive<{ x: number; y: number }>({ x: NaN, y: NaN });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -14,13 +14,15 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
export const NewControl = {
|
export const NewControl = {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
w: 24,
|
w: 24,
|
||||||
h: 12,
|
h: 12,
|
||||||
i: "0",
|
i: "0",
|
||||||
type: "Widget",
|
type: WidgetType.Widget,
|
||||||
};
|
};
|
||||||
export const TextConfig = {
|
export const TextConfig = {
|
||||||
fontColor: "white",
|
fontColor: "white",
|
||||||
@ -39,15 +41,15 @@ export const TimeRangeConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ControlsTypes = [
|
export const ControlsTypes = [
|
||||||
"Trace",
|
WidgetType.Trace,
|
||||||
"Profile",
|
WidgetType.Profile,
|
||||||
"Log",
|
WidgetType.Log,
|
||||||
"DemandLog",
|
WidgetType.DemandLog,
|
||||||
"Ebpf",
|
WidgetType.Ebpf,
|
||||||
"NetworkProfiling",
|
WidgetType.NetworkProfiling,
|
||||||
"ThirdPartyApp",
|
WidgetType.ThirdPartyApp,
|
||||||
"ContinuousProfiling",
|
WidgetType.ContinuousProfiling,
|
||||||
"TaskTimeline",
|
WidgetType.TaskTimeline,
|
||||||
];
|
];
|
||||||
export enum EBPFProfilingTriggerType {
|
export enum EBPFProfilingTriggerType {
|
||||||
FIXED_TIME = "FIXED_TIME",
|
FIXED_TIME = "FIXED_TIME",
|
||||||
|
@ -25,7 +25,7 @@ import { NewControl, TextConfig, TimeRangeConfig, ControlsTypes } from "../data"
|
|||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { EntityType, MetricModes } from "@/views/dashboard/data";
|
import { EntityType, MetricModes, WidgetType } from "@/views/dashboard/data";
|
||||||
interface DashboardState {
|
interface DashboardState {
|
||||||
showConfig: boolean;
|
showConfig: boolean;
|
||||||
layout: LayoutConfig[];
|
layout: LayoutConfig[];
|
||||||
@ -78,7 +78,7 @@ export const dashboardStore = defineStore({
|
|||||||
setCurrentDashboard(item: DashboardItem) {
|
setCurrentDashboard(item: DashboardItem) {
|
||||||
this.currentDashboard = item;
|
this.currentDashboard = item;
|
||||||
},
|
},
|
||||||
addControl(type: string) {
|
addControl(type: WidgetType) {
|
||||||
const arr = this.layout.map((d: Recordable) => Number(d.i));
|
const arr = this.layout.map((d: Recordable) => Number(d.i));
|
||||||
let index = String(Math.max(...arr) + 1);
|
let index = String(Math.max(...arr) + 1);
|
||||||
if (!this.layout.length) {
|
if (!this.layout.length) {
|
||||||
@ -93,10 +93,10 @@ export const dashboardStore = defineStore({
|
|||||||
metrics: [""],
|
metrics: [""],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type === "Widget") {
|
if (type === WidgetType.Widget) {
|
||||||
newItem.metricMode = MetricModes.Expression;
|
newItem.metricMode = MetricModes.Expression;
|
||||||
}
|
}
|
||||||
if (type === "Tab") {
|
if (type === WidgetType.Tab) {
|
||||||
newItem.h = 36;
|
newItem.h = 36;
|
||||||
newItem.activedTabIndex = 0;
|
newItem.activedTabIndex = 0;
|
||||||
newItem.children = [
|
newItem.children = [
|
||||||
@ -110,7 +110,7 @@ export const dashboardStore = defineStore({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (type === "Topology") {
|
if (type === WidgetType.Topology) {
|
||||||
newItem.h = 36;
|
newItem.h = 36;
|
||||||
newItem.graph = {
|
newItem.graph = {
|
||||||
showDepth: true,
|
showDepth: true,
|
||||||
@ -120,11 +120,11 @@ export const dashboardStore = defineStore({
|
|||||||
if (ControlsTypes.includes(type)) {
|
if (ControlsTypes.includes(type)) {
|
||||||
newItem.h = 36;
|
newItem.h = 36;
|
||||||
}
|
}
|
||||||
if (type === "Text") {
|
if (type === WidgetType.Text) {
|
||||||
newItem.h = 6;
|
newItem.h = 6;
|
||||||
newItem.graph = TextConfig;
|
newItem.graph = TextConfig;
|
||||||
}
|
}
|
||||||
if (type === "TimeRange") {
|
if (type === WidgetType.TimeRange) {
|
||||||
newItem.w = 8;
|
newItem.w = 8;
|
||||||
newItem.h = 6;
|
newItem.h = 6;
|
||||||
newItem.graph = TimeRangeConfig;
|
newItem.graph = TimeRangeConfig;
|
||||||
@ -149,7 +149,7 @@ export const dashboardStore = defineStore({
|
|||||||
};
|
};
|
||||||
this.layout[idx].children?.push(i);
|
this.layout[idx].children?.push(i);
|
||||||
},
|
},
|
||||||
addTabControls(type: string) {
|
addTabControls(type: WidgetType) {
|
||||||
const activedGridItem = this.activedGridItem.split("-")[0];
|
const activedGridItem = this.activedGridItem.split("-")[0];
|
||||||
const idx = this.layout.findIndex((d: LayoutConfig) => d.i === activedGridItem);
|
const idx = this.layout.findIndex((d: LayoutConfig) => d.i === activedGridItem);
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
@ -171,10 +171,10 @@ export const dashboardStore = defineStore({
|
|||||||
metricTypes: [""],
|
metricTypes: [""],
|
||||||
metrics: [""],
|
metrics: [""],
|
||||||
};
|
};
|
||||||
if (type === "Widget") {
|
if (type === WidgetType.Widget) {
|
||||||
newItem.metricMode = MetricModes.Expression;
|
newItem.metricMode = MetricModes.Expression;
|
||||||
}
|
}
|
||||||
if (type === "Topology") {
|
if (type === WidgetType.Topology) {
|
||||||
newItem.h = 32;
|
newItem.h = 32;
|
||||||
newItem.graph = {
|
newItem.graph = {
|
||||||
showDepth: true,
|
showDepth: true,
|
||||||
@ -184,11 +184,11 @@ export const dashboardStore = defineStore({
|
|||||||
if (ControlsTypes.includes(type)) {
|
if (ControlsTypes.includes(type)) {
|
||||||
newItem.h = 32;
|
newItem.h = 32;
|
||||||
}
|
}
|
||||||
if (type === "Text") {
|
if (type === WidgetType.Text) {
|
||||||
newItem.h = 6;
|
newItem.h = 6;
|
||||||
newItem.graph = TextConfig;
|
newItem.graph = TextConfig;
|
||||||
}
|
}
|
||||||
if (type === "TimeRange") {
|
if (type === WidgetType.TimeRange) {
|
||||||
newItem.w = 8;
|
newItem.w = 8;
|
||||||
newItem.h = 6;
|
newItem.h = 6;
|
||||||
newItem.graph = TextConfig;
|
newItem.graph = TextConfig;
|
||||||
@ -292,7 +292,7 @@ export const dashboardStore = defineStore({
|
|||||||
},
|
},
|
||||||
setWidget(param: LayoutConfig) {
|
setWidget(param: LayoutConfig) {
|
||||||
for (let i = 0; i < this.layout.length; i++) {
|
for (let i = 0; i < this.layout.length; i++) {
|
||||||
if (this.layout[i].type === "Tab") {
|
if (this.layout[i].type === WidgetType.Tab) {
|
||||||
if ((this.layout[i].children || []).length) {
|
if ((this.layout[i].children || []).length) {
|
||||||
for (const child of this.layout[i].children || []) {
|
for (const child of this.layout[i].children || []) {
|
||||||
if (child.children && child.children.length) {
|
if (child.children && child.children.length) {
|
||||||
|
@ -139,6 +139,7 @@ limitations under the License. -->
|
|||||||
import { saveFile, readFile } from "@/utils/file";
|
import { saveFile, readFile } from "@/utils/file";
|
||||||
import { EntityType } from "./data";
|
import { EntityType } from "./data";
|
||||||
import { isEmptyObject } from "@/utils/is";
|
import { isEmptyObject } from "@/utils/is";
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
/*global Nullable*/
|
/*global Nullable*/
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -271,12 +272,23 @@ limitations under the License. -->
|
|||||||
if (!(child.metricConfig && child.metricConfig.length)) {
|
if (!(child.metricConfig && child.metricConfig.length)) {
|
||||||
delete child.metricConfig;
|
delete child.metricConfig;
|
||||||
}
|
}
|
||||||
if (child.type === "Tab") {
|
if (child.type === WidgetType.Tab) {
|
||||||
for (const item of child.children || []) {
|
for (const item of child.children || []) {
|
||||||
optimizeTemplate(item.children);
|
optimizeTemplate(item.children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (["Trace", "Topology", "Tab", "Profile", "Ebpf", "Log"].includes(child.type)) {
|
if (
|
||||||
|
(
|
||||||
|
[
|
||||||
|
WidgetType.Trace,
|
||||||
|
WidgetType.Topology,
|
||||||
|
WidgetType.Tab,
|
||||||
|
WidgetType.Profile,
|
||||||
|
WidgetType.Ebpf,
|
||||||
|
WidgetType.Log,
|
||||||
|
] as string[]
|
||||||
|
).includes(child.type)
|
||||||
|
) {
|
||||||
delete child.widget;
|
delete child.widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,15 +29,21 @@ limitations under the License. -->
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { reactive } from "vue";
|
import { reactive, computed } from "vue";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const originConfig = dashboardStore.selectedGrid;
|
const originConfig = dashboardStore.selectedGrid;
|
||||||
const expressions = reactive<{ [key: string]: string }>({});
|
const expressions = reactive<{ [key: string]: string }>({});
|
||||||
|
const widgetTabs = computed(() =>
|
||||||
|
dashboardStore.selectedGrid.children.filter((child: any[]) =>
|
||||||
|
child.find((item: any) => item.type === WidgetType.Widget),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
console.log(widgetTabs.value);
|
||||||
for (const child of originConfig.children || []) {
|
for (const child of originConfig.children || []) {
|
||||||
expressions[child.name] = child.expression || "";
|
expressions[child.name] = child.expression || "";
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ limitations under the License. -->
|
|||||||
if (params.source[child.expression || ""]) {
|
if (params.source[child.expression || ""]) {
|
||||||
child.enable = !!Number(params.source[child.expression || ""]);
|
child.enable = !!Number(params.source[child.expression || ""]);
|
||||||
} else {
|
} else {
|
||||||
child.enable = false;
|
child.enable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dashboardStore.setConfigs(tabsProps);
|
dashboardStore.setConfigs(tabsProps);
|
||||||
|
@ -349,3 +349,21 @@ export enum CallTypes {
|
|||||||
Server = "SERVER",
|
Server = "SERVER",
|
||||||
Client = "CLIENT",
|
Client = "CLIENT",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum WidgetType {
|
||||||
|
Widget = "Widget",
|
||||||
|
Topology = "Topology",
|
||||||
|
Tab = "Tab",
|
||||||
|
Text = "Text",
|
||||||
|
TimeRange = "TimeRange",
|
||||||
|
Trace = "Trace",
|
||||||
|
Log = "Log",
|
||||||
|
Profile = "Profile",
|
||||||
|
Ebpf = "Ebpf",
|
||||||
|
DemandLog = "DemandLog",
|
||||||
|
Event = "Event",
|
||||||
|
NetworkProfiling = "NetworkProfiling",
|
||||||
|
ContinuousProfiling = "ContinuousProfiling",
|
||||||
|
ThirdPartyApp = "ThirdPartyApp",
|
||||||
|
TaskTimeline = "TaskTimeline",
|
||||||
|
}
|
||||||
|
@ -65,6 +65,7 @@ limitations under the License. -->
|
|||||||
import { TextColors } from "@/views/dashboard/data";
|
import { TextColors } from "@/views/dashboard/data";
|
||||||
import Trace from "@/views/dashboard/related/trace/Index.vue";
|
import Trace from "@/views/dashboard/related/trace/Index.vue";
|
||||||
import { QueryOrders, Status, RefIdTypes, ProtocolTypes, ExpressionResultType } from "../data";
|
import { QueryOrders, Status, RefIdTypes, ProtocolTypes, ExpressionResultType } from "../data";
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
/*global defineProps */
|
/*global defineProps */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -90,7 +91,7 @@ limitations under the License. -->
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const showTrace = ref<boolean>(false);
|
const showTrace = ref<boolean>(false);
|
||||||
const traceOptions = ref<{ type: string; filters?: unknown }>({
|
const traceOptions = ref<{ type: string; filters?: unknown }>({
|
||||||
type: "Trace",
|
type: WidgetType.Trace,
|
||||||
});
|
});
|
||||||
const refIdType = computed(
|
const refIdType = computed(
|
||||||
() => (props.config.relatedTrace && props.config.relatedTrace.refIdType) || RefIdTypes[0].value,
|
() => (props.config.relatedTrace && props.config.relatedTrace.refIdType) || RefIdTypes[0].value,
|
||||||
|
@ -143,7 +143,8 @@ limitations under the License. -->
|
|||||||
ServiceRelationTools,
|
ServiceRelationTools,
|
||||||
ProcessTools,
|
ProcessTools,
|
||||||
ProcessRelationTools,
|
ProcessRelationTools,
|
||||||
} from "../data";
|
WidgetType,
|
||||||
|
} from "@/views/dashboard/data";
|
||||||
import { useSelectorStore } from "@/store/modules/selectors";
|
import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import type { Option } from "@/types/app";
|
import type { Option } from "@/types/app";
|
||||||
@ -412,46 +413,46 @@ limitations under the License. -->
|
|||||||
function setTabControls(id: string) {
|
function setTabControls(id: string) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case "addWidget":
|
case "addWidget":
|
||||||
dashboardStore.addTabControls("Widget");
|
dashboardStore.addTabControls(WidgetType.Widget);
|
||||||
break;
|
break;
|
||||||
case "addTrace":
|
case "addTrace":
|
||||||
dashboardStore.addTabControls("Trace");
|
dashboardStore.addTabControls(WidgetType.Trace);
|
||||||
break;
|
break;
|
||||||
case "addLog":
|
case "addLog":
|
||||||
dashboardStore.addTabControls("Log");
|
dashboardStore.addTabControls(WidgetType.Log);
|
||||||
break;
|
break;
|
||||||
case "addProfile":
|
case "addProfile":
|
||||||
dashboardStore.addTabControls("Profile");
|
dashboardStore.addTabControls(WidgetType.Profile);
|
||||||
break;
|
break;
|
||||||
case "addEbpf":
|
case "addEbpf":
|
||||||
dashboardStore.addTabControls("Ebpf");
|
dashboardStore.addTabControls(WidgetType.Ebpf);
|
||||||
break;
|
break;
|
||||||
case "addTopology":
|
case "addTopology":
|
||||||
dashboardStore.addTabControls("Topology");
|
dashboardStore.addTabControls(WidgetType.Topology);
|
||||||
break;
|
break;
|
||||||
case "addText":
|
case "addText":
|
||||||
dashboardStore.addTabControls("Text");
|
dashboardStore.addTabControls(WidgetType.Text);
|
||||||
break;
|
break;
|
||||||
case "addDemandLog":
|
case "addDemandLog":
|
||||||
dashboardStore.addTabControls("DemandLog");
|
dashboardStore.addTabControls(WidgetType.DemandLog);
|
||||||
break;
|
break;
|
||||||
case "addEvent":
|
case "addEvent":
|
||||||
dashboardStore.addTabControls("Event");
|
dashboardStore.addTabControls(WidgetType.Event);
|
||||||
break;
|
break;
|
||||||
case "addNetworkProfiling":
|
case "addNetworkProfiling":
|
||||||
dashboardStore.addTabControls("NetworkProfiling");
|
dashboardStore.addTabControls(WidgetType.NetworkProfiling);
|
||||||
break;
|
break;
|
||||||
case "addContinuousProfiling":
|
case "addContinuousProfiling":
|
||||||
dashboardStore.addTabControls("ContinuousProfiling");
|
dashboardStore.addTabControls(WidgetType.ContinuousProfiling);
|
||||||
break;
|
break;
|
||||||
case "addTimeRange":
|
case "addTimeRange":
|
||||||
dashboardStore.addTabControls("TimeRange");
|
dashboardStore.addTabControls(WidgetType.TimeRange);
|
||||||
break;
|
break;
|
||||||
case "addIframe":
|
case "addIframe":
|
||||||
dashboardStore.addTabControls("ThirdPartyApp");
|
dashboardStore.addTabControls(WidgetType.ThirdPartyApp);
|
||||||
break;
|
break;
|
||||||
case "addTaskTimeline":
|
case "addTaskTimeline":
|
||||||
dashboardStore.addTabControls("TaskTimeline");
|
dashboardStore.addTabControls(WidgetType.TaskTimeline);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ElMessage.info("Don't support this control");
|
ElMessage.info("Don't support this control");
|
||||||
@ -462,52 +463,52 @@ limitations under the License. -->
|
|||||||
function setControls(id: string) {
|
function setControls(id: string) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case "addWidget":
|
case "addWidget":
|
||||||
dashboardStore.addControl("Widget");
|
dashboardStore.addControl(WidgetType.Widget);
|
||||||
break;
|
break;
|
||||||
case "addTab":
|
case "addTab":
|
||||||
dashboardStore.addControl("Tab");
|
dashboardStore.addControl(WidgetType.Tab);
|
||||||
break;
|
break;
|
||||||
case "addTrace":
|
case "addTrace":
|
||||||
dashboardStore.addControl("Trace");
|
dashboardStore.addControl(WidgetType.Trace);
|
||||||
break;
|
break;
|
||||||
case "addProfile":
|
case "addProfile":
|
||||||
dashboardStore.addControl("Profile");
|
dashboardStore.addControl(WidgetType.Profile);
|
||||||
break;
|
break;
|
||||||
case "addEbpf":
|
case "addEbpf":
|
||||||
dashboardStore.addControl("Ebpf");
|
dashboardStore.addControl(WidgetType.Ebpf);
|
||||||
break;
|
break;
|
||||||
case "addLog":
|
case "addLog":
|
||||||
dashboardStore.addControl("Log");
|
dashboardStore.addControl(WidgetType.Log);
|
||||||
break;
|
break;
|
||||||
case "addTopology":
|
case "addTopology":
|
||||||
dashboardStore.addControl("Topology");
|
dashboardStore.addControl(WidgetType.Topology);
|
||||||
break;
|
break;
|
||||||
case "addText":
|
case "addText":
|
||||||
dashboardStore.addControl("Text");
|
dashboardStore.addControl(WidgetType.Text);
|
||||||
break;
|
break;
|
||||||
case "addDemandLog":
|
case "addDemandLog":
|
||||||
dashboardStore.addControl("DemandLog");
|
dashboardStore.addControl(WidgetType.DemandLog);
|
||||||
break;
|
break;
|
||||||
case "addEvent":
|
case "addEvent":
|
||||||
dashboardStore.addControl("Event");
|
dashboardStore.addControl(WidgetType.Event);
|
||||||
break;
|
break;
|
||||||
case "addNetworkProfiling":
|
case "addNetworkProfiling":
|
||||||
dashboardStore.addControl("NetworkProfiling");
|
dashboardStore.addControl(WidgetType.NetworkProfiling);
|
||||||
break;
|
break;
|
||||||
case "addContinuousProfiling":
|
case "addContinuousProfiling":
|
||||||
dashboardStore.addControl("ContinuousProfiling");
|
dashboardStore.addControl(WidgetType.ContinuousProfiling);
|
||||||
break;
|
break;
|
||||||
case "addTimeRange":
|
case "addTimeRange":
|
||||||
dashboardStore.addControl("TimeRange");
|
dashboardStore.addControl(WidgetType.TimeRange);
|
||||||
break;
|
break;
|
||||||
case "addIframe":
|
case "addIframe":
|
||||||
dashboardStore.addControl("ThirdPartyApp");
|
dashboardStore.addControl(WidgetType.ThirdPartyApp);
|
||||||
break;
|
break;
|
||||||
case "addTaskTimeline":
|
case "addTaskTimeline":
|
||||||
dashboardStore.addControl("TaskTimeline");
|
dashboardStore.addControl(WidgetType.TaskTimeline);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dashboardStore.addControl("Widget");
|
dashboardStore.addControl(WidgetType.Widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ limitations under the License. -->
|
|||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
import dateFormatStep, { dateFormatTime } from "@/utils/dateFormat";
|
import dateFormatStep, { dateFormatTime } from "@/utils/dateFormat";
|
||||||
import getLocalTime from "@/utils/localtime";
|
import getLocalTime from "@/utils/localtime";
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
const eventStore = useEventStore();
|
const eventStore = useEventStore();
|
||||||
/*global defineProps, Nullable */
|
/*global defineProps, Nullable */
|
||||||
@ -122,7 +123,9 @@ limitations under the License. -->
|
|||||||
}[],
|
}[],
|
||||||
dashboard: LayoutConfig[],
|
dashboard: LayoutConfig[],
|
||||||
) {
|
) {
|
||||||
const widgets = dashboard.filter((d: { type: string }) => ["Trace", "Log"].includes(d.type));
|
const widgets = dashboard.filter((d: { type: string }) =>
|
||||||
|
([WidgetType.Trace, WidgetType.Log] as string[]).includes(d.type),
|
||||||
|
);
|
||||||
const index = items[0];
|
const index = items[0];
|
||||||
const i = events[index - 1 || 0];
|
const i = events[index - 1 || 0];
|
||||||
for (const widget of widgets) {
|
for (const widget of widgets) {
|
||||||
|
@ -41,6 +41,7 @@ limitations under the License. -->
|
|||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import type { LayoutConfig } from "@/types/dashboard";
|
import type { LayoutConfig } from "@/types/dashboard";
|
||||||
import { dateFormat } from "@/utils/dateFormat";
|
import { dateFormat } from "@/utils/dateFormat";
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
/*global defineProps, defineEmits, Recordable */
|
/*global defineProps, defineEmits, Recordable */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -78,7 +79,7 @@ limitations under the License. -->
|
|||||||
traceId: id,
|
traceId: id,
|
||||||
id: props.data.serviceId || "",
|
id: props.data.serviceId || "",
|
||||||
},
|
},
|
||||||
"Trace",
|
WidgetType.Trace,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -101,6 +101,7 @@ limitations under the License. -->
|
|||||||
import type { LayoutConfig } from "@/types/dashboard";
|
import type { LayoutConfig } from "@/types/dashboard";
|
||||||
import { dateFormat } from "@/utils/dateFormat";
|
import { dateFormat } from "@/utils/dateFormat";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
serviceId: { type: String, default: "" },
|
serviceId: { type: String, default: "" },
|
||||||
@ -145,7 +146,7 @@ limitations under the License. -->
|
|||||||
traceId: traceId.value || traceStore.currentTrace.traceIds[0].value,
|
traceId: traceId.value || traceStore.currentTrace.traceIds[0].value,
|
||||||
id: props.serviceId || undefined,
|
id: props.serviceId || undefined,
|
||||||
},
|
},
|
||||||
"Log",
|
WidgetType.Log,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user