mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 11:21:29 +00:00
feat: implement the Dark Theme (#334)
This commit is contained in:
@@ -23,6 +23,7 @@ import type { AxiosResponse } from "axios";
|
||||
import dateFormatStep, { dateFormatTime } from "@/utils/dateFormat";
|
||||
import { TimeType } from "@/constants/data";
|
||||
import type { MenuOptions, SubItem } from "@/types/app";
|
||||
import { Themes } from "@/constants/data";
|
||||
/*global Nullable*/
|
||||
interface AppState {
|
||||
durationRow: Recordable;
|
||||
@@ -36,6 +37,7 @@ interface AppState {
|
||||
isMobile: boolean;
|
||||
reloadTimer: Nullable<IntervalHandle>;
|
||||
allMenus: MenuOptions[];
|
||||
theme: string;
|
||||
}
|
||||
|
||||
export const appStore = defineStore({
|
||||
@@ -56,6 +58,7 @@ export const appStore = defineStore({
|
||||
isMobile: false,
|
||||
reloadTimer: null,
|
||||
allMenus: [],
|
||||
theme: Themes.Dark,
|
||||
}),
|
||||
getters: {
|
||||
duration(): Duration {
|
||||
@@ -126,6 +129,9 @@ export const appStore = defineStore({
|
||||
updateDurationRow(data: Duration) {
|
||||
this.durationRow = data;
|
||||
},
|
||||
setTheme(data: string) {
|
||||
this.theme = data;
|
||||
},
|
||||
setUTC(utcHour: number, utcMin: number): void {
|
||||
this.runEventStack();
|
||||
this.utcMin = utcMin;
|
||||
|
@@ -163,7 +163,7 @@ export const profileStore = defineStore({
|
||||
return res.data;
|
||||
},
|
||||
async getSegmentSpans(params: { segmentId: string }) {
|
||||
if (!params.segmentId) {
|
||||
if (!(params && params.segmentId)) {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
}
|
||||
const res: AxiosResponse = await graphql.query("queryProfileSegment").params(params);
|
||||
|
Reference in New Issue
Block a user