mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
feat: update config
This commit is contained in:
@@ -14,6 +14,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export const NewControl = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 24,
|
||||
h: 12,
|
||||
i: "0",
|
||||
type: "Widget",
|
||||
widget: {
|
||||
title: "Title",
|
||||
},
|
||||
graph: {},
|
||||
standard: {},
|
||||
};
|
||||
export const ConfigData = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
@@ -24,8 +37,8 @@ export const ConfigData = {
|
||||
queryMetricType: "readMetricsValues",
|
||||
type: "Widget",
|
||||
widget: {
|
||||
title: "Title123",
|
||||
tips: "Tooltip123",
|
||||
title: "Title",
|
||||
tips: "Tooltip",
|
||||
},
|
||||
graph: {
|
||||
showBackground: true,
|
||||
@@ -34,7 +47,7 @@ export const ConfigData = {
|
||||
},
|
||||
standard: {
|
||||
sortOrder: "DEC",
|
||||
unit: "s",
|
||||
unit: "min",
|
||||
},
|
||||
children: [],
|
||||
};
|
@@ -19,8 +19,9 @@ import { store } from "@/store";
|
||||
import { LayoutConfig } from "@/types/dashboard";
|
||||
import graph from "@/graph";
|
||||
import { AxiosResponse } from "axios";
|
||||
import { ConfigData } from "./data";
|
||||
import { ConfigData } from "../data";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
import { NewControl } from "../data";
|
||||
interface DashboardState {
|
||||
showConfig: boolean;
|
||||
layout: LayoutConfig[];
|
||||
@@ -29,19 +30,7 @@ interface DashboardState {
|
||||
layerId: string;
|
||||
activedGridItem: string;
|
||||
}
|
||||
const newControl: LayoutConfig = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 24,
|
||||
h: 12,
|
||||
i: "0",
|
||||
type: "Widget",
|
||||
widget: {
|
||||
title: "Title",
|
||||
},
|
||||
graph: {},
|
||||
standard: {},
|
||||
};
|
||||
|
||||
export const dashboardStore = defineStore({
|
||||
id: "dashboard",
|
||||
state: (): DashboardState => ({
|
||||
@@ -58,7 +47,7 @@ export const dashboardStore = defineStore({
|
||||
},
|
||||
addControl(type: string) {
|
||||
const newWidget: LayoutConfig = {
|
||||
...newControl,
|
||||
...NewControl,
|
||||
i: String(this.layout.length),
|
||||
type,
|
||||
};
|
||||
|
Reference in New Issue
Block a user