mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-01 18:43:40 +00:00
feat: add axiosCancel
This commit is contained in:
parent
1b30216545
commit
b0f6194f0c
@ -43,4 +43,16 @@ const router = createRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
(window as any).axiosCancel = [];
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const token = window.localStorage.getItem("skywalking-authority");
|
||||
if ((window as any).axiosCancel.length !== 0) {
|
||||
for (const func of (window as any).axiosCancel) {
|
||||
setTimeout(func(), 0);
|
||||
}
|
||||
(window as any).axiosCancel = [];
|
||||
}
|
||||
next();
|
||||
});
|
||||
export default router;
|
||||
|
8
src/shims-vue.d.ts
vendored
8
src/shims-vue.d.ts
vendored
@ -19,3 +19,11 @@ declare module "*.vue" {
|
||||
const Component: ReturnType<typeof defineComponent>;
|
||||
export default Component;
|
||||
}
|
||||
declare global {
|
||||
namespace JSX {}
|
||||
interface Window {
|
||||
Promise: any;
|
||||
moment: any;
|
||||
axiosCancel: any;
|
||||
}
|
||||
}
|
||||
|
@ -149,10 +149,10 @@ import {
|
||||
ElInput,
|
||||
ElButton,
|
||||
} from "element-plus";
|
||||
// import { useSelectorStore } from "@/store/modules/selectors";
|
||||
import { useSelectorStore } from "@/store/modules/selectors";
|
||||
import { EntityType, SelectOpt, Options } from "./data";
|
||||
|
||||
// const selectorStore = useSelectorStore();
|
||||
const selectorStore = useSelectorStore();
|
||||
const props = {
|
||||
expandTrigger: "hover",
|
||||
};
|
||||
@ -173,24 +173,22 @@ const handleChange = (value: any) => {
|
||||
const onCreate = () => {
|
||||
console.log(state);
|
||||
};
|
||||
// selectorStore.fetchServices("general");
|
||||
selectorStore.fetchServices("general");
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.new-dashboard {
|
||||
width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.item {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.selectors {
|
||||
width: 600px;
|
||||
}
|
||||
.new-dashboard,
|
||||
.selectors,
|
||||
.el-cascader-menu {
|
||||
width: 600px;
|
||||
}
|
||||
.create {
|
||||
width: 160px;
|
||||
width: 600px;
|
||||
}
|
||||
.btn {
|
||||
margin-top: 40px;
|
||||
|
Loading…
Reference in New Issue
Block a user