修复中控
This commit is contained in:
@@ -29,18 +29,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function delegateInstanceToParent(url, title, exchangeId, nextPath) {
|
/** 在 LocalNav 等父页 iframe 内:直接替换本 iframe 地址,避免 postMessage / 三层嵌套 */
|
||||||
|
function openInstanceInParentFrame(url) {
|
||||||
try {
|
try {
|
||||||
window.parent.postMessage(
|
window.location.assign(url);
|
||||||
{
|
|
||||||
type: "hub:open-instance",
|
|
||||||
url,
|
|
||||||
title: title || "实例",
|
|
||||||
exchangeId: String(exchangeId),
|
|
||||||
nextPath: nextPath || "/",
|
|
||||||
},
|
|
||||||
"*"
|
|
||||||
);
|
|
||||||
return true;
|
return true;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return false;
|
return false;
|
||||||
@@ -71,8 +63,8 @@
|
|||||||
const row = lastMonitorRows.find((x) => String(x.id) === String(exchangeId));
|
const row = lastMonitorRows.find((x) => String(x.id) === String(exchangeId));
|
||||||
const title = row ? row.name : exchangeId;
|
const title = row ? row.name : exchangeId;
|
||||||
instanceFrameCtx = { exchangeId: String(exchangeId), nextPath: next, title };
|
instanceFrameCtx = { exchangeId: String(exchangeId), nextPath: next, title };
|
||||||
if (isHubEmbedded() && delegateInstanceToParent(url, title, exchangeId, next)) {
|
if (isHubEmbedded()) {
|
||||||
return;
|
if (openInstanceInParentFrame(url)) return;
|
||||||
}
|
}
|
||||||
openInstanceFrame(url, title);
|
openInstanceFrame(url, title);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -120,6 +120,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="toast"></div>
|
<div id="toast"></div>
|
||||||
<script src="/assets/app.js?v=20260530-hub-nav-delegate"></script>
|
<script src="/assets/app.js?v=20260530-hub-embed-nav"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user