@ibiz-template/runtime 0.7.41-alpha.141 → 0.7.41-alpha.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +40 -11
- package/dist/index.system.min.js +1 -1
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +47 -11
- package/out/types.d.ts +6 -0
- package/out/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/app-hub.ts +51 -11
- package/src/types.ts +7 -0
package/dist/index.esm.js
CHANGED
|
@@ -88834,6 +88834,7 @@ var AppHub = class {
|
|
|
88834
88834
|
}
|
|
88835
88835
|
if (pluginListLength === 0)
|
|
88836
88836
|
return;
|
|
88837
|
+
ibiz.__TEMPAPPID__ = ibiz.env.appId.split("__")[1];
|
|
88837
88838
|
const pluginTasks = Array.from({ length: pluginListLength }, (_, i) => {
|
|
88838
88839
|
const index = i + 1;
|
|
88839
88840
|
const suffix = index === 1 ? "" : "".concat(index);
|
|
@@ -88863,6 +88864,7 @@ var AppHub = class {
|
|
|
88863
88864
|
})
|
|
88864
88865
|
);
|
|
88865
88866
|
}
|
|
88867
|
+
ibiz.__TEMPAPPID__ = "";
|
|
88866
88868
|
}
|
|
88867
88869
|
/**
|
|
88868
88870
|
* @description 加载指定子应用扩展插件
|
|
@@ -88871,24 +88873,52 @@ var AppHub = class {
|
|
|
88871
88873
|
* @memberof AppHub
|
|
88872
88874
|
*/
|
|
88873
88875
|
async loadSubExtensionPlugin(appId2) {
|
|
88874
|
-
|
|
88876
|
+
var _a3;
|
|
88877
|
+
const { enableExternalPlugin, concurrentPluginCount } = ibiz.appUtil.getRuntimeDevToolConfig();
|
|
88875
88878
|
if (!enableExternalPlugin) {
|
|
88876
88879
|
return;
|
|
88877
88880
|
}
|
|
88878
|
-
|
|
88879
|
-
|
|
88880
|
-
|
|
88881
|
-
|
|
88882
|
-
|
|
88883
|
-
|
|
88884
|
-
|
|
88885
|
-
}
|
|
88881
|
+
let pluginListLength = 0;
|
|
88882
|
+
const res = await ibiz.net.axios({
|
|
88883
|
+
method: "get",
|
|
88884
|
+
url: "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.remoteModelUrl, "/subapps/").concat(appId2, "/extension")
|
|
88885
|
+
});
|
|
88886
|
+
if (res.status === 200 && res.data) {
|
|
88887
|
+
pluginListLength = Number(res.data);
|
|
88888
|
+
}
|
|
88889
|
+
if (pluginListLength === 0)
|
|
88890
|
+
return;
|
|
88891
|
+
ibiz.__TEMPAPPID__ = appId2.split("__")[2];
|
|
88892
|
+
const pluginTasks = Array.from({ length: pluginListLength }, (_, i) => {
|
|
88893
|
+
const index = i + 1;
|
|
88894
|
+
const suffix = index === 1 ? "" : "".concat(index);
|
|
88895
|
+
const targetUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.remoteModelUrl, "/subapps/").concat(appId2, "/ext").concat(suffix);
|
|
88896
|
+
return async () => {
|
|
88897
|
+
try {
|
|
88898
|
+
await ibiz.plugin.loadPlugin({
|
|
88899
|
+
runtimeObject: true,
|
|
88900
|
+
rtobjectName: "".concat(appId2, "_ExtensionPlugin").concat(suffix),
|
|
88901
|
+
rtobjectRepo: targetUrl
|
|
88902
|
+
});
|
|
88903
|
+
return { ok: true, data: { index, targetUrl } };
|
|
88904
|
+
} catch (error) {
|
|
88905
|
+
return { ok: false, data: { index, targetUrl, error } };
|
|
88906
|
+
}
|
|
88907
|
+
};
|
|
88908
|
+
});
|
|
88909
|
+
const results = await runWithConcurrency(
|
|
88910
|
+
pluginTasks,
|
|
88911
|
+
concurrentPluginCount || 1
|
|
88912
|
+
);
|
|
88913
|
+
const errorResults = results.filter((result) => !(result == null ? void 0 : result.ok));
|
|
88914
|
+
if (errorResults && errorResults.length > 0) {
|
|
88886
88915
|
ibiz.log.warn(
|
|
88887
88916
|
ibiz.i18n.t("runtime.hub.noExtensionPlugin", {
|
|
88888
|
-
targetUrl
|
|
88917
|
+
targetUrl: ((_a3 = errorResults[0].data) == null ? void 0 : _a3.targetUrl) || "Unknown"
|
|
88889
88918
|
})
|
|
88890
88919
|
);
|
|
88891
88920
|
}
|
|
88921
|
+
ibiz.__TEMPAPPID__ = "";
|
|
88892
88922
|
}
|
|
88893
88923
|
/**
|
|
88894
88924
|
* 新建 hub 应用
|
|
@@ -88906,7 +88936,6 @@ var AppHub = class {
|
|
|
88906
88936
|
throw new RuntimeError78(ibiz.i18n.t("runtime.utils.firstregister"));
|
|
88907
88937
|
}
|
|
88908
88938
|
if (id !== ibiz.env.appId) {
|
|
88909
|
-
await this.loadSubExtensionPlugin(id);
|
|
88910
88939
|
}
|
|
88911
88940
|
const appModel = await this.modelLoaderProvider.getApp(id);
|
|
88912
88941
|
const subAppRef = await this.modelLoaderProvider.getSubAppRef(id);
|