mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 17:05:10 +00:00
connect to ide when portal
This commit is contained in:
parent
7a640495a5
commit
3b21cc35a6
1337
package-lock.json
generated
1337
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/jquery": "^3.5.14",
|
"@types/jquery": "^3.5.14",
|
||||||
|
"@types/sockjs-client": "^1.5.1",
|
||||||
|
"@types/vertx3-eventbus-client": "^3.5.1",
|
||||||
|
"@vertx/eventbus-bridge-client.js": "^1.0.0-3-SNAPSHOT",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"d3": "^7.3.0",
|
"d3": "^7.3.0",
|
||||||
"d3-flame-graph": "^4.1.3",
|
"d3-flame-graph": "^4.1.3",
|
||||||
@ -20,6 +23,9 @@
|
|||||||
"jquery": "^3.6.0",
|
"jquery": "^3.6.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pinia": "^2.0.5",
|
"pinia": "^2.0.5",
|
||||||
|
"sockjs": "^0.3.24",
|
||||||
|
"sockjs-client": "^1.6.0",
|
||||||
|
"vertx3-eventbus-client": "^3.9.4",
|
||||||
"vis-timeline": "^7.5.1",
|
"vis-timeline": "^7.5.1",
|
||||||
"vue": "^3.0.0",
|
"vue": "^3.0.0",
|
||||||
"vue-grid-layout": "^3.0.0-beta1",
|
"vue-grid-layout": "^3.0.0-beta1",
|
||||||
|
@ -38,6 +38,7 @@ import { useDashboardStore } from "@/store/modules/dashboard";
|
|||||||
import Configuration from "../views/dashboard/configuration";
|
import Configuration from "../views/dashboard/configuration";
|
||||||
import controls from "../views/dashboard/controls/index";
|
import controls from "../views/dashboard/controls/index";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
import connect from "../hooks/useIDE";
|
||||||
|
|
||||||
let isScrolling = false;
|
let isScrolling = false;
|
||||||
function scrollStop(callback: { (): void; (): void }, refresh = 66) {
|
function scrollStop(callback: { (): void; (): void }, refresh = 66) {
|
||||||
@ -160,6 +161,10 @@ export default defineComponent({
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
observeItems();
|
observeItems();
|
||||||
initScroller();
|
initScroller();
|
||||||
|
|
||||||
|
if (query["portal"] === "true") {
|
||||||
|
connect();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
scrollWrapRef?.value?.removeEventListener("wheel", wheelGraphScroll);
|
scrollWrapRef?.value?.removeEventListener("wheel", wheelGraphScroll);
|
||||||
|
27
src/hooks/useIDE.ts
Normal file
27
src/hooks/useIDE.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import * as EventBus from "vertx3-eventbus-client";
|
||||||
|
import router from "@/router";
|
||||||
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
|
||||||
|
const appStore = useAppStoreWithOut();
|
||||||
|
|
||||||
|
export default function connect(idePort = 8080) {
|
||||||
|
console.log("Connecting to IDE...");
|
||||||
|
|
||||||
|
const eb = new EventBus(`http://localhost:${idePort}/eventbus`);
|
||||||
|
eb.onopen = () => {
|
||||||
|
console.log("EventBus connected");
|
||||||
|
appStore.setAutoRefresh(true);
|
||||||
|
|
||||||
|
eb.registerHandler(
|
||||||
|
"portal.SetCurrentPage",
|
||||||
|
(error: Error, message: any) => {
|
||||||
|
console.log("Setting current page:" + JSON.stringify(message));
|
||||||
|
router.push(message.body.page);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
eb.registerHandler("portal.SetSettings", (error: Error, message: any) => {
|
||||||
|
console.log("Setting config:" + JSON.stringify(message));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
1
src/types/sockjs.d.ts
vendored
Normal file
1
src/types/sockjs.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
declare module "sockjs-client";
|
1
src/types/vertx-eventbus.d.ts
vendored
Normal file
1
src/types/vertx-eventbus.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
declare module "vertx3-eventbus-client";
|
Loading…
Reference in New Issue
Block a user