Prechádzať zdrojové kódy

Adding tile for drone that doesn't work yet

Kirk Trombley 5 rokov pred
rodič
commit
aac7012837
2 zmenil súbory, kde vykonal 18 pridanie a 0 odobranie
  1. 2 0
      src/App.js
  2. 16 0
      src/components/tiles/DroneCI.jsx

+ 2 - 0
src/App.js

@@ -7,6 +7,7 @@ import Gogs from './components/tiles/Gogs';
 import Minecraft from './components/tiles/Minecraft';
 import Rollbot from './components/tiles/Rollbot';
 import VacationPlanner from './components/tiles/VacationPlanner';
+import DroneCI from './components/tiles/DroneCI';
 
 export default () => (
   <div className="App">
@@ -17,5 +18,6 @@ export default () => (
     <Minecraft/>
     <Rollbot/>
     <VacationPlanner/>
+    <DroneCI/>
   </div>
 );

+ 16 - 0
src/components/tiles/DroneCI.jsx

@@ -0,0 +1,16 @@
+import React from "react";
+import Tile from "../shared/Tile";
+import useHealthPolling from "../../hooks/useHealthPolling";
+
+const droneUrl = `https://drone.hiram.services/`;
+const update = 1000 * 60 * 20;
+
+export default () => {
+  const health = useHealthPolling(droneUrl, { ms: update })
+
+  return <Tile
+    link={droneUrl}
+    title="Drone CI"
+    health={health}
+  />
+}