fix
This commit is contained in:
parent
f3c4e3c60b
commit
ef325f31da
3 changed files with 20 additions and 4 deletions
File diff suppressed because one or more lines are too long
2
cmd/telesrv-admin/web/dist/index.html
vendored
2
cmd/telesrv-admin/web/dist/index.html
vendored
|
|
@ -23,7 +23,7 @@
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="module" crossorigin src="/assets/index-CgFYD-Jw.js"></script>
|
<script type="module" crossorigin src="/assets/index-C5uszvXY.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-hA2EpjuH.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-hA2EpjuH.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,22 @@ export function Shell({
|
||||||
// sections are granted independently, so one entry can be visible without the other.
|
// sections are granted independently, so one entry can be visible without the other.
|
||||||
const canReviewBotVerification = useCan(permissionBotVerificationReview);
|
const canReviewBotVerification = useCan(permissionBotVerificationReview);
|
||||||
const canManageServer = useCan(permissionServerManage);
|
const canManageServer = useCan(permissionServerManage);
|
||||||
|
// Server identity (name/icon) is admin-editable per Server Settings ->
|
||||||
|
// Server identity, and takes over the sidebar branding when set -- the
|
||||||
|
// operator's own server should look like their server, not like the
|
||||||
|
// "OwpenGram" reference build, once they've bothered to configure it.
|
||||||
|
// Only fetched for sessions that can even see Server Settings; a session
|
||||||
|
// without that permission just gets the default branding.
|
||||||
|
const [identity, setIdentity] = useState<{ name: string; iconExt?: string } | null>(null);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!canManageServer) return;
|
||||||
|
api.serverIdentity()
|
||||||
|
.then((info) => setIdentity({ name: info.name, iconExt: info.icon_ext }))
|
||||||
|
.catch(() => undefined);
|
||||||
|
}, [canManageServer]);
|
||||||
|
const [brandIconFailed, setBrandIconFailed] = useState(false);
|
||||||
|
const brandName = identity?.name?.trim() || "OwpenGram";
|
||||||
|
const brandIconSrc = identity?.iconExt && !brandIconFailed ? api.serverIconURL() : "/logo.png";
|
||||||
// Third-party verification is additionally hidden by default (not fully
|
// Third-party verification is additionally hidden by default (not fully
|
||||||
// finished) regardless of what the session was granted -- see permissions.tsx.
|
// finished) regardless of what the session was granted -- see permissions.tsx.
|
||||||
const thirdPartyVerificationHidden = useThirdPartyVerificationHidden();
|
const thirdPartyVerificationHidden = useThirdPartyVerificationHidden();
|
||||||
|
|
@ -82,9 +98,9 @@ export function Shell({
|
||||||
<div className="shell">
|
<div className="shell">
|
||||||
<aside className="sidebar">
|
<aside className="sidebar">
|
||||||
<AppLink className="brand" href="/" navigate={navigate}>
|
<AppLink className="brand" href="/" navigate={navigate}>
|
||||||
<span className="brand-mark"><img src="/logo.png" alt="OwpenGram" /></span>
|
<span className="brand-mark"><img src={brandIconSrc} alt={brandName} onError={() => setBrandIconFailed(true)} /></span>
|
||||||
<span>
|
<span>
|
||||||
<strong>OwpenGram</strong>
|
<strong>{brandName}</strong>
|
||||||
<small>{"Admin Console"}</small>
|
<small>{"Admin Console"}</small>
|
||||||
</span>
|
</span>
|
||||||
</AppLink>
|
</AppLink>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue