trying nginx conf change-up

This commit is contained in:
Carter 2025-06-05 10:38:03 -06:00
parent 5545271322
commit 9c94585de0
2 changed files with 14 additions and 22 deletions

View file

@ -63,16 +63,23 @@ http {
expires $cache_expires;
location / {
try_files $uri /indexV2.html;
}
# Redirect old /index.html requests to new file
location = /index.html {
return 301 /indexV2.html;
}
# Serve indexV2.html directly without redirect loop
location = /indexV2.html {
root /usr/share/nginx/html;
}
# Fallback for SPA routing all unmatched routes go to indexV2.html
location / {
try_files $uri /indexV2.html;
}
}
# Healthcheck
server {
listen 8080;

View file

@ -151,18 +151,11 @@ export default function Devices() {
const groupID = useParams<{ groupID: string }>()?.groupID ?? "all";
// const [tab, setTab] = useState(groupID==="all" ? groupID : groupID);
const [tab, setTab] = useState(() => {
console.log("groupID: "+groupID)
if (groupID!=="all") return groupID
const stored = sessionStorage.getItem(location.pathname+"-groups-tab");
console.log("stored: "+stored)
return stored !== null ? stored : "all";
});
useEffect(() => {
console.log(tab)
sessionStorage.setItem(location.pathname+"-groups-tab", tab);
}, [tab]);
const [selectedGroup, setSelectedGroup] = useState<Group | undefined>(undefined);
const [groupSettingsMode, setGroupSettingsMode] = useState<
"add" | "update" | "remove" | undefined
@ -373,10 +366,6 @@ export default function Devices() {
return '/' + newSegments.join('/');
}
// useEffect(() => {
// console.log(devices)
// }, [devices])
const toDevice = (device: Device) => {
let url = getGroup() ? insertGroupContext(getGroup().id().toString(), device.id().toString()) : ""
if (url.length < 1) url = device.id().toString()
@ -724,10 +713,6 @@ export default function Devices() {
)
}
useEffect(() => {
console.log('Current tab value:', tab, typeof tab);
}, [tab]);
if (!groupsLoaded) return (
<LoadingScreen message="Loading groups" />
)