diff --git a/src/components/index.ts b/src/components/index.ts index d807304a..57da373f 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -20,6 +20,7 @@ import Selector from "./Selector.vue"; import Graph from "./Graph.vue"; import type { App } from "vue"; import VueGridLayout from "vue-grid-layout"; +import { ElLoading } from "element-plus"; const components: { [key: string]: any } = { Icon, @@ -27,6 +28,7 @@ const components: { [key: string]: any } = { VueGridLayout, Selector, Graph, + ElLoading, }; const componentsName: string[] = Object.keys(components); diff --git a/src/hooks/useEcharts.ts b/src/hooks/useEcharts.ts index e219094c..052b751e 100644 --- a/src/hooks/useEcharts.ts +++ b/src/hooks/useEcharts.ts @@ -116,7 +116,6 @@ export function useECharts( } function resize() { - console.log("resize"); chartInstance?.resize(); } diff --git a/src/main.ts b/src/main.ts index 142000f1..8e4f5c15 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,9 +23,11 @@ import i18n from "./locales"; import "element-plus/dist/index.css"; import "./styles/lib.scss"; import "./styles/reset.scss"; +import ElementPlus from "element-plus"; const app = createApp(App); +app.use(ElementPlus); app.use(components); app.use(i18n); app.use(store); diff --git a/src/utils/event.ts b/src/utils/event.ts index 7309c586..4e5bf674 100644 --- a/src/utils/event.ts +++ b/src/utils/event.ts @@ -1,3 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ const isServer = typeof window === "undefined"; function resizeHandler(entries: any[]): void { diff --git a/src/utils/loading.ts b/src/utils/loading.ts deleted file mode 100644 index 8cdfa071..00000000 --- a/src/utils/loading.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ElLoading } from "element-plus"; - -type Props = { text?: string; fullscreen?: boolean }; - -export default function (): { - loading: (props: Props) => any; -} { - const loading = (props: Props) => { - const loadingInstance = ElLoading.service(props); - return loadingInstance; - }; - - return { - loading, - }; -} diff --git a/src/views/dashboard/configuration/ConfigEdit.vue b/src/views/dashboard/configuration/ConfigEdit.vue index 723d99ef..cc4f12b0 100644 --- a/src/views/dashboard/configuration/ConfigEdit.vue +++ b/src/views/dashboard/configuration/ConfigEdit.vue @@ -49,6 +49,7 @@ limitations under the License. --> placeholder="Select a metric" @change="changeValueType" class="selectors" + v-loading="loading" /> @@ -89,14 +90,13 @@ limitations under the License. -->