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 { ref } from "vue";
|
||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
const { t } = useI18n();
|
||||
const dashboardStore = useDashboardStore();
|
||||
const originConfig = dashboardStore.selectedGrid;
|
||||
const expressions = ref<string>(originConfig.expressions);
|
||||
|
||||
function changeConfig() {
|
||||
if (!expressions.value.includes("is_present")) {
|
||||
ElMessage.error("Only support the is_present function");
|
||||
return;
|
||||
}
|
||||
const { selectedGrid } = dashboardStore;
|
||||
|
||||
dashboardStore.selectWidget({ ...selectedGrid, expressions: expressions.value });
|
||||
|
@ -117,6 +117,7 @@ limitations under the License. -->
|
||||
import controls from "./tab";
|
||||
import { dragIgnoreFrom } from "../data";
|
||||
import copy from "@/utils/copy";
|
||||
import { useExpressionsQueryProcessor } from "@/hooks/useExpressionsProcessor";
|
||||
|
||||
const props = {
|
||||
data: {
|
||||
@ -124,6 +125,7 @@ limitations under the License. -->
|
||||
default: () => ({ children: [] }),
|
||||
},
|
||||
active: { type: Boolean, default: false },
|
||||
needQuery: { type: Boolean, default: false },
|
||||
};
|
||||
export default defineComponent({
|
||||
name: "Tab",
|
||||
@ -148,6 +150,10 @@ limitations under the License. -->
|
||||
dashboardStore.setActiveTabIndex(activeTabIndex.value, props.data.i);
|
||||
}
|
||||
|
||||
// if (props.needQuery || !dashboardStore.currentDashboard.id) {
|
||||
// queryExpressions();
|
||||
// }
|
||||
|
||||
function clickTabs(e: Event, idx: number) {
|
||||
e.stopPropagation();
|
||||
activeTabIndex.value = idx;
|
||||
@ -232,6 +238,18 @@ limitations under the License. -->
|
||||
dashboardStore.setConfigPanel(true);
|
||||
dashboardStore.selectWidget(props.data);
|
||||
}
|
||||
|
||||
async function queryExpressions() {
|
||||
const params = (await useExpressionsQueryProcessor({ metrics: [props.data.expressions] })) || {};
|
||||
console.log(params);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.data.expressions,
|
||||
() => {
|
||||
queryExpressions();
|
||||
},
|
||||
);
|
||||
watch(
|
||||
() => dashboardStore.activedGridItem,
|
||||
(data) => {
|
||||
|
Loading…
Reference in New Issue
Block a user