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