mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
Add tag to deployment pages (#3624)
This commit is contained in:
parent
ec5de0d26f
commit
6c76bea3e8
1 changed files with 11 additions and 5 deletions
|
|
@ -1,10 +1,16 @@
|
||||||
// Load Unify intent tag on authentication pages only
|
// Load Unify intent tag on selected pages
|
||||||
(function () {
|
(function () {
|
||||||
if (typeof window === "undefined") return;
|
if (typeof window === "undefined") return;
|
||||||
|
|
||||||
function isAuthPage() {
|
function isTaggedPage() {
|
||||||
var path = window.location.pathname;
|
var path = window.location.pathname;
|
||||||
return path.includes("/servers/auth/") || path.includes("/clients/auth/");
|
return (
|
||||||
|
path.includes("/servers/auth/") ||
|
||||||
|
path.includes("/clients/auth/") ||
|
||||||
|
path.includes("/deployment/running-server") ||
|
||||||
|
path.includes("/deployment/http") ||
|
||||||
|
path.includes("/deployment/prefect-horizon")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadUnify() {
|
function loadUnify() {
|
||||||
|
|
@ -45,9 +51,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
if (isAuthPage() && !document.getElementById("unifytag")) {
|
if (isTaggedPage() && !document.getElementById("unifytag")) {
|
||||||
loadUnify();
|
loadUnify();
|
||||||
} else if (!isAuthPage() && document.getElementById("unifytag")) {
|
} else if (!isTaggedPage() && document.getElementById("unifytag")) {
|
||||||
document.getElementById("unifytag").remove();
|
document.getElementById("unifytag").remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue