mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 14:25:07 +00:00
fix: update config
This commit is contained in:
parent
5b95557905
commit
a5f8cc2900
@ -43,9 +43,6 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!chartRef.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setOptions(props.option);
|
setOptions(props.option);
|
||||||
addResizeListener(unref(chartRef), resize);
|
addResizeListener(unref(chartRef), resize);
|
||||||
});
|
});
|
||||||
@ -58,9 +55,6 @@ watch(
|
|||||||
);
|
);
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
if (!chartRef.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
removeResizeListener(unref(chartRef), resize);
|
removeResizeListener(unref(chartRef), resize);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -27,7 +27,7 @@ export const NewControl = {
|
|||||||
graph: {},
|
graph: {},
|
||||||
standard: {},
|
standard: {},
|
||||||
};
|
};
|
||||||
export const ConfigData = {
|
export const ConfigData: any = {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
w: 8,
|
w: 8,
|
||||||
@ -41,8 +41,6 @@ export const ConfigData = {
|
|||||||
tips: "Tooltip",
|
tips: "Tooltip",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
showBackground: true,
|
|
||||||
barWidth: 30,
|
|
||||||
type: "Line",
|
type: "Line",
|
||||||
},
|
},
|
||||||
standard: {
|
standard: {
|
||||||
|
@ -144,6 +144,7 @@ export const dashboardStore = defineStore({
|
|||||||
...this.layout[index],
|
...this.layout[index],
|
||||||
...param,
|
...param,
|
||||||
};
|
};
|
||||||
|
this.selectedGrid = this.layout[index];
|
||||||
},
|
},
|
||||||
async fetchMetricType(item: string) {
|
async fetchMetricType(item: string) {
|
||||||
const res: AxiosResponse = await graph
|
const res: AxiosResponse = await graph
|
||||||
|
@ -20,9 +20,9 @@ export interface LayoutConfig {
|
|||||||
w: number;
|
w: number;
|
||||||
h: number;
|
h: number;
|
||||||
i: string;
|
i: string;
|
||||||
widget: WidgetConfig;
|
widget?: WidgetConfig;
|
||||||
graph: GraphConfig;
|
graph?: GraphConfig;
|
||||||
standard: StandardConfig;
|
standard?: StandardConfig;
|
||||||
metrics?: string[];
|
metrics?: string[];
|
||||||
type?: string;
|
type?: string;
|
||||||
queryMetricType?: string;
|
queryMetricType?: string;
|
||||||
@ -30,8 +30,8 @@ export interface LayoutConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface WidgetConfig {
|
export interface WidgetConfig {
|
||||||
title: string;
|
title?: string;
|
||||||
tips: string;
|
tips?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StandardConfig {
|
export interface StandardConfig {
|
||||||
@ -39,19 +39,18 @@ export interface StandardConfig {
|
|||||||
unit?: string;
|
unit?: string;
|
||||||
max?: string;
|
max?: string;
|
||||||
min?: string;
|
min?: string;
|
||||||
plus: string;
|
plus?: string;
|
||||||
minus: string;
|
minus?: string;
|
||||||
multiply: string;
|
multiply?: string;
|
||||||
divide: string;
|
divide?: string;
|
||||||
milliseconds: string;
|
milliseconds?: string;
|
||||||
seconds: string;
|
seconds?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GraphConfig = BarConfig | LineConfig;
|
export type GraphConfig = BarConfig | LineConfig;
|
||||||
export interface BarConfig {
|
export interface BarConfig {
|
||||||
type?: string;
|
type?: string;
|
||||||
showBackground?: boolean;
|
showBackground?: boolean;
|
||||||
barWidth?: number;
|
|
||||||
}
|
}
|
||||||
export interface LineConfig extends AreaConfig {
|
export interface LineConfig extends AreaConfig {
|
||||||
type?: string;
|
type?: string;
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License. -->
|
|||||||
<div class="graph">
|
<div class="graph">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<span>{{ states.widget.title }}</span>
|
<span>{{ states.widget.title }}</span>
|
||||||
<div class="tips">
|
<div class="tips" v-show="states.widget.tips">
|
||||||
<el-tooltip :content="states.widget.tips">
|
<el-tooltip :content="states.widget.tips">
|
||||||
<Icon iconName="info_outline" size="sm" />
|
<Icon iconName="info_outline" size="sm" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
@ -13,16 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
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. -->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
|
||||||
<span class="label">Bar Width</span>
|
|
||||||
<el-slider
|
|
||||||
class="bar-width"
|
|
||||||
v-model="barWidth"
|
|
||||||
show-input
|
|
||||||
input-size="small"
|
|
||||||
@change="changeConfig({ barWidth })"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<span class="label">Show Background</span>
|
<span class="label">Show Background</span>
|
||||||
<el-switch
|
<el-switch
|
||||||
@ -45,7 +35,6 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const emits = defineEmits(["update"]);
|
const emits = defineEmits(["update"]);
|
||||||
const barWidth = ref(props.config.barWidth || 30);
|
|
||||||
const showBackground = ref(props.config.showBackground || false);
|
const showBackground = ref(props.config.showBackground || false);
|
||||||
|
|
||||||
function changeConfig(param: { [key: string]: unknown }) {
|
function changeConfig(param: { [key: string]: unknown }) {
|
||||||
|
@ -49,7 +49,7 @@ import { LineConfig } from "@/types/dashboard";
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
config: {
|
config: {
|
||||||
type: Object as PropType<LineConfig>,
|
type: Object as PropType<LineConfig>,
|
||||||
default: () => ({ showBackground: true, barWidth: 30 }),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const emits = defineEmits(["update"]);
|
const emits = defineEmits(["update"]);
|
||||||
|
@ -15,10 +15,15 @@ limitations under the License. -->
|
|||||||
<template>
|
<template>
|
||||||
<div class="widget">
|
<div class="widget">
|
||||||
<div class="header flex-h">
|
<div class="header flex-h">
|
||||||
<div>{{ data.widget.title || "" }}</div>
|
<div>{{ data.widget?.title || "" }}</div>
|
||||||
<div>
|
<div>
|
||||||
<el-tooltip :content="data.widget.tips">
|
<el-tooltip :content="data.widget?.tips">
|
||||||
<Icon iconName="info_outline" size="sm" class="operation" />
|
<Icon
|
||||||
|
iconName="info_outline"
|
||||||
|
size="sm"
|
||||||
|
class="operation"
|
||||||
|
v-show="data.widget?.tips"
|
||||||
|
/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
@ -37,11 +42,12 @@ limitations under the License. -->
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="body" v-if="data.graph.type" v-loading="loading">
|
<div class="body" v-if="data.graph?.type" v-loading="loading">
|
||||||
<component
|
<component
|
||||||
:is="data.graph.type"
|
:is="data.graph.type"
|
||||||
:intervalTime="appStoreWithOut.intervalTime"
|
:intervalTime="appStoreWithOut.intervalTime"
|
||||||
:data="state.source"
|
:data="state.source"
|
||||||
|
:config="data.graph"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="no-data">{{ t("noData") }}</div>
|
<div v-else class="no-data">{{ t("noData") }}</div>
|
||||||
@ -108,6 +114,12 @@ export default defineComponent({
|
|||||||
dashboardStore.setConfigPanel(true);
|
dashboardStore.setConfigPanel(true);
|
||||||
dashboardStore.selectWidget(props.data);
|
dashboardStore.selectWidget(props.data);
|
||||||
}
|
}
|
||||||
|
// watch(
|
||||||
|
// () => data.value,
|
||||||
|
// (data) => {
|
||||||
|
// console.log(data);
|
||||||
|
// }
|
||||||
|
// );
|
||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
appStoreWithOut,
|
appStoreWithOut,
|
||||||
|
@ -30,7 +30,6 @@ export const DefaultGraphConfig: { [key: string]: any } = {
|
|||||||
Bar: {
|
Bar: {
|
||||||
type: "Bar",
|
type: "Bar",
|
||||||
showBackground: true,
|
showBackground: true,
|
||||||
barWidth: 30,
|
|
||||||
},
|
},
|
||||||
Line: {
|
Line: {
|
||||||
type: "Line",
|
type: "Line",
|
||||||
|
@ -75,7 +75,6 @@ function getOption() {
|
|||||||
name: i,
|
name: i,
|
||||||
type: "bar",
|
type: "bar",
|
||||||
symbol: "none",
|
symbol: "none",
|
||||||
barWidth: props.config.barWidth,
|
|
||||||
stack: "sum",
|
stack: "sum",
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
width: 1.5,
|
width: 1.5,
|
||||||
|
Loading…
Reference in New Issue
Block a user