mfe-index/app/abc-audit/audit-tree/index.html

47 lines
2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>abc-audit · audit-tree</title>
<link rel="icon" href="data:," />
<style>
html, body { margin: 0; height: 100%; background: #0b0f14; }
abc-audit-tree { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
</style>
</head>
<body>
<!--
Staging / in-shell "View" page for the ABC Audit MFE.
The app-shell library "View" action opens this page (the profile's `embed`).
It mounts <abc-audit-tree> and hands it the runtime embed config:
apiUrl — base of the sovereign ABC API for THIS deployment
tk — the app-shell-signed JWT (C1 wire: same HS256 secret abc-api verifies)
loader-injects-token — keep the token OUT of the built bundle. Priority:
?tk=<token> → window.__MFE_TOKEN__ → the baked profile-config.tk
The API base is set the same way via ?api= → window.__ABC_API_URL__ → cfg.apiUrl,
so ONE built bundle serves every deployment (dev sandbox, staging, prod) — the
host wires the URL + token, never a rebuild.
-->
<abc-audit-tree id="abc-mfe" profile-config='{"profile":"audit-tree","useFixtures":"0"}'></abc-audit-tree>
<script>
(function () {
var el = document.getElementById('abc-mfe');
var cfg = {};
try { cfg = JSON.parse(el.getAttribute('profile-config')) || {}; } catch (e) { cfg = {}; }
var q = new URLSearchParams(location.search);
// Token: ?tk → window.__MFE_TOKEN__ → baked cfg.tk
var tk = q.get('tk') || window.__MFE_TOKEN__ || cfg.tk || '';
if (tk) cfg.tk = tk;
// API base: ?api → window.__ABC_API_URL__ → baked cfg.apiUrl
var api = q.get('api') || window.__ABC_API_URL__ || cfg.apiUrl || '';
if (api) cfg.apiUrl = api;
el.setAttribute('profile-config', JSON.stringify(cfg));
})();
</script>
<script src="../abc-audit.iife.js"></script>
</body>
</html>