diff --git a/app/dashboard/applications/Applications.tsx b/app/dashboard/applications/Applications.tsx index eba0ef1..a8377d5 100644 --- a/app/dashboard/applications/Applications.tsx +++ b/app/dashboard/applications/Applications.tsx @@ -27,6 +27,7 @@ import { Zap, ViewIcon, Grid3X3, + HelpCircle, } from "lucide-react"; import { Card, @@ -95,6 +96,7 @@ interface Application { server?: string; online: boolean; serverId: number; + uptimecheckUrl?: string; } interface Server { @@ -116,6 +118,8 @@ export default function Dashboard() { const [publicURL, setPublicURL] = useState(""); const [localURL, setLocalURL] = useState(""); const [serverId, setServerId] = useState(null); + const [customUptimeCheck, setCustomUptimeCheck] = useState(false); + const [uptimecheckUrl, setUptimecheckUrl] = useState(""); const [editName, setEditName] = useState(""); const [editDescription, setEditDescription] = useState(""); @@ -124,6 +128,8 @@ export default function Dashboard() { const [editLocalURL, setEditLocalURL] = useState(""); const [editId, setEditId] = useState(null); const [editServerId, setEditServerId] = useState(null); + const [editCustomUptimeCheck, setEditCustomUptimeCheck] = useState(false); + const [editUptimecheckUrl, setEditUptimecheckUrl] = useState(""); const [currentPage, setCurrentPage] = useState(1); const [maxPage, setMaxPage] = useState(1); @@ -212,6 +218,7 @@ export default function Dashboard() { publicURL, localURL, serverId, + uptimecheckUrl: customUptimeCheck ? uptimecheckUrl : "", }); getApplications(); toast.success("Application added successfully"); @@ -273,6 +280,14 @@ export default function Dashboard() { setEditIcon(app.icon || ""); setEditLocalURL(app.localURL || ""); setEditPublicURL(app.publicURL || ""); + + if (app.uptimecheckUrl) { + setEditCustomUptimeCheck(true); + setEditUptimecheckUrl(app.uptimecheckUrl); + } else { + setEditCustomUptimeCheck(false); + setEditUptimecheckUrl(""); + } }; const edit = async () => { @@ -287,6 +302,7 @@ export default function Dashboard() { icon: editIcon, publicURL: editPublicURL, localURL: editLocalURL, + uptimecheckUrl: editCustomUptimeCheck ? editUptimecheckUrl : "", }); getApplications(); setEditId(null); @@ -567,6 +583,36 @@ export default function Dashboard() { onChange={(e) => setLocalURL(e.target.value)} /> +
+ setCustomUptimeCheck(e.target.checked)} + className="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" + /> + + + + + + + + When enabled, this URL replaces the Public URL for uptime monitoring checks + + + +
+ {customUptimeCheck && ( +
+ + setUptimecheckUrl(e.target.value)} + /> +
+ )} @@ -820,6 +866,36 @@ export default function Dashboard() { } /> +
+ setEditCustomUptimeCheck(e.target.checked)} + className="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" + /> + + + + + + + + When enabled, this URL replaces the Public URL for uptime monitoring checks + + + +
+ {editCustomUptimeCheck && ( +
+ + setEditUptimecheckUrl(e.target.value)} + /> +
+ )} @@ -990,6 +1066,36 @@ export default function Dashboard() { } /> +
+ setEditCustomUptimeCheck(e.target.checked)} + className="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" + /> + + + + + + + + When enabled, this URL replaces the Public URL for uptime monitoring checks + + + +
+ {editCustomUptimeCheck && ( +
+ + setEditUptimecheckUrl(e.target.value)} + /> +
+ )}