Browse Source

Quick workaround for the hiram.services change

Kirk Trombley 5 years ago
parent
commit
b57b1b896a

+ 2 - 2
src/components/tiles/CommaFeed.jsx

@@ -7,8 +7,8 @@ import useHealthPolling from "../../hooks/useHealthPolling";
 const ms = 1000 * 60 * 20;
 const fetchOptions = { credentials: "same-origin" };
 const apiOptions = { ms, fetchOptions };
-const homepage = "https://kirkleon.ddns.net/commafeed/";
-const unreadLookup = "https://kirkleon.ddns.net/commafeed/rest/category/entries?id=all&limit=20&offset=0&order=desc&readType=unread";
+const homepage = `https://${window.location.hostname}/commafeed/`;
+const unreadLookup = `https://${window.location.hostname}/commafeed/rest/category/entries?id=all&limit=20&offset=0&order=desc&readType=unread`;
 
 export default () => {
   const health = useHealthPolling(homepage, { ms });

+ 1 - 1
src/components/tiles/Gogs.jsx

@@ -2,7 +2,7 @@ import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
-const gogsUrl = "https://kirkleon.ddns.net/gogs/";
+const gogsUrl = `https://${window.location.hostname}/gogs/`;
 const update = 1000 * 60 * 20;
 
 export default () => {

+ 2 - 2
src/components/tiles/Minecraft.jsx

@@ -7,7 +7,7 @@ const trimLen = 20;
 const ms = 1000 * 60;
 
 export default () => {
-  const [rawHealth, rawData] = useApi("https://kirkleon.ddns.net/minecraft/", { ms });
+  const [rawHealth, rawData] = useApi(`https://${window.location.hostname}/minecraft/`, { ms });
 
   let health = BAD;
   let message = null;
@@ -34,7 +34,7 @@ export default () => {
   }
 
   return <Tile
-    link="https://kirkleon.ddns.net/minecraft/map/"
+    link={`https://${window.location.hostname}/minecraft/map/`}
     title="Minecraft Server"
     health={health}
     data={message}

+ 2 - 2
src/components/tiles/Rollbot.jsx

@@ -2,14 +2,14 @@ import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
-const rollbotHealth = "https://kirkleon.ddns.net/rollbot/health";
+const rollbotHealth = `https://${window.location.hostname}/rollbot/health`;
 const update = 1000 * 60 * 20;
 
 export default () => {
   const health = useHealthPolling(rollbotHealth, { ms: update })
 
   return <Tile
-    link="https://kirkleon.ddns.net/gogs/kirkleon/rollbot3"
+    link={`https://${window.location.hostname}/gogs/kirkleon/rollbot3`}
     title="Rollbot"
     health={health}
   />

+ 2 - 2
src/components/tiles/Teamspeak.jsx

@@ -4,10 +4,10 @@ import Tile from "../shared/Tile";
 import useApi from "../../hooks/useApi";
 
 export default () => {
-  const [health, data] = useApi("https://kirkleon.ddns.net/teamspeak/api");
+  const [health, data] = useApi(`https://${window.location.hostname}/teamspeak/api`);
 
   return <Tile
-    link="https://kirkleon.ddns.net/teamspeak/"
+    link={`https://${window.location.hostname}/teamspeak/`}
     title="Teamspeak Server"
     health={health}
     data={health === OK ? `${data.users.length} user(s) online` : null}

+ 1 - 1
src/components/tiles/TerrAssumptions.jsx

@@ -2,7 +2,7 @@ import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
-const taUrl = "https://kirkleon.ddns.net/terrassumptions/";
+const taUrl = `https://${window.location.hostname}/terrassumptions/`;
 const update = 1000 * 60 * 20;
 
 export default () => {

+ 2 - 2
src/components/tiles/VacationPlanner.jsx

@@ -2,14 +2,14 @@ import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
-const plannerHealth = "https://kirkleon.ddns.net/vacation-planner/api/";
+const plannerHealth = `https://${window.location.hostname}/vacation-planner/api/`;
 const update = 1000 * 60 * 20;
 
 export default () => {
   const health = useHealthPolling(plannerHealth, { ms: update })
 
   return <Tile
-    link="https://kirkleon.ddns.net/vacation-planner/"
+    link={`https://${window.location.hostname}/vacation-planner/`}
     title="Vacation Planner"
     health={health}
   />