mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: update
This commit is contained in:
parent
15a7ffa241
commit
b8cf8fea4b
@ -28,12 +28,18 @@ limitations under the License. -->
|
|||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const originConfig = dashboardStore.selectedGrid;
|
const originConfig = dashboardStore.selectedGrid;
|
||||||
const expressions = ref<string>(originConfig.expressions);
|
const expressions = ref<string>(originConfig.expressions);
|
||||||
|
|
||||||
function changeConfig() {
|
function changeConfig() {
|
||||||
|
if (!expressions.value.includes("is_present")) {
|
||||||
|
ElMessage.error("Only support the is_present function");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { selectedGrid } = dashboardStore;
|
const { selectedGrid } = dashboardStore;
|
||||||
|
|
||||||
dashboardStore.selectWidget({ ...selectedGrid, expressions: expressions.value });
|
dashboardStore.selectWidget({ ...selectedGrid, expressions: expressions.value });
|
||||||
|
@ -117,6 +117,7 @@ limitations under the License. -->
|
|||||||
import controls from "./tab";
|
import controls from "./tab";
|
||||||
import { dragIgnoreFrom } from "../data";
|
import { dragIgnoreFrom } from "../data";
|
||||||
import copy from "@/utils/copy";
|
import copy from "@/utils/copy";
|
||||||
|
import { useExpressionsQueryProcessor } from "@/hooks/useExpressionsProcessor";
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
data: {
|
data: {
|
||||||
@ -124,6 +125,7 @@ limitations under the License. -->
|
|||||||
default: () => ({ children: [] }),
|
default: () => ({ children: [] }),
|
||||||
},
|
},
|
||||||
active: { type: Boolean, default: false },
|
active: { type: Boolean, default: false },
|
||||||
|
needQuery: { type: Boolean, default: false },
|
||||||
};
|
};
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "Tab",
|
name: "Tab",
|
||||||
@ -148,6 +150,10 @@ limitations under the License. -->
|
|||||||
dashboardStore.setActiveTabIndex(activeTabIndex.value, props.data.i);
|
dashboardStore.setActiveTabIndex(activeTabIndex.value, props.data.i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (props.needQuery || !dashboardStore.currentDashboard.id) {
|
||||||
|
// queryExpressions();
|
||||||
|
// }
|
||||||
|
|
||||||
function clickTabs(e: Event, idx: number) {
|
function clickTabs(e: Event, idx: number) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
activeTabIndex.value = idx;
|
activeTabIndex.value = idx;
|
||||||
@ -232,6 +238,18 @@ limitations under the License. -->
|
|||||||
dashboardStore.setConfigPanel(true);
|
dashboardStore.setConfigPanel(true);
|
||||||
dashboardStore.selectWidget(props.data);
|
dashboardStore.selectWidget(props.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function queryExpressions() {
|
||||||
|
const params = (await useExpressionsQueryProcessor({ metrics: [props.data.expressions] })) || {};
|
||||||
|
console.log(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.data.expressions,
|
||||||
|
() => {
|
||||||
|
queryExpressions();
|
||||||
|
},
|
||||||
|
);
|
||||||
watch(
|
watch(
|
||||||
() => dashboardStore.activedGridItem,
|
() => dashboardStore.activedGridItem,
|
||||||
(data) => {
|
(data) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user