Canvas: Implement worker to manager communication
Register workers on manager side.
Let user force reload service workers.
Change-Id: I2635a04167e7c853151d8a1f5c3511646181a063
diff --git a/apps/canvas/front/src/lib/config.ts b/apps/canvas/front/src/lib/config.ts
index 187f51c..a3784c1 100644
--- a/apps/canvas/front/src/lib/config.ts
+++ b/apps/canvas/front/src/lib/config.ts
@@ -78,14 +78,21 @@
};
export type Config = {
+ input: {
+ appId: string;
+ managerAddr: string;
+ };
service?: Service[];
volume?: Volume[];
postgresql?: PostgreSQL[];
mongodb?: MongoDB[];
};
-export function generateDodoConfig(nodes: AppNode[], env: Env): Config | null {
+export function generateDodoConfig(appId: string | undefined, nodes: AppNode[], env: Env): Config | null {
try {
+ if (appId == null || env.managerAddr == null) {
+ return null;
+ }
const networkMap = new Map(env.networks.map((n) => [n.domain, n.name]));
const ingressNodes = nodes.filter((n) => n.type === "gateway-https").filter((n) => n.data.https !== undefined);
const tcpNodes = nodes.filter((n) => n.type === "gateway-tcp").filter((n) => n.data.exposed !== undefined);
@@ -105,6 +112,10 @@
});
};
return {
+ input: {
+ appId: appId,
+ managerAddr: env.managerAddr,
+ },
service: nodes
.filter((n) => n.type === "app")
.map((n): Service => {