\n \n );\n};\n\nexport default Queue;\n","import React from \"react\";\nimport styled from \"styled-components/macro\";\nimport { StatsElement } from \"./StatsElement\";\n\nconst StyledQueue = styled(StatsElement)`\n width: auto;\n min-width: 45px;\n .used {\n flex: 2;\n font-weight: 300;\n font-size: 2em;\n\n .small {\n font-size: 0.5em;\n padding-left: 3px;\n }\n }\n`;\n\nconst Used = ({ used, pending, total }) => {\n const perc = total > 0 ? (((used + pending) / total) * 100).toFixed() : \"?\";\n\n return (\n \n
USED
\n
\n {perc}\n %\n
\n \n );\n};\n\nexport default Used;\n","import styled from \"styled-components/macro\";\n\nconst Separator = styled.div`\n height: 60px;\n border-left: 1px dashed #555f6a;\n`;\n\nexport default Separator;\n","import React, { useRef, useState } from \"react\";\nimport { HashRouter as Router, Link, Route } from \"react-router-dom\";\nimport { merge, Observable, of, timer } from \"rxjs\";\nimport { catchError, delayWhen, flatMap, map, pluck, retryWhen, tap } from \"rxjs/operators\";\nimport { ajax } from \"rxjs/ajax\";\n\nimport AutosizeInput from \"react-input-autosize\";\n\nimport { useObservable } from \"rxjs-hooks\";\n\nimport styled from \"styled-components/macro\";\nimport { GlobalStyle, StyledTopBar, StyledViewport } from \"./styles.css\";\n\nimport \"event-source-polyfill\";\n\nimport Navigation from \"../../components/Navigation\";\nimport Stats from \"../../containers/Stats\";\nimport Capabilities from \"../../containers/Capabilities\";\nimport Status from \"../../components/Stats/Status\";\nimport Sessions from \"../../components/Sessions\";\nimport Session from \"../../components/Session\";\nimport Videos from \"../../components/Videos\";\nimport Quota from \"../../components/Stats/Quota\";\nimport Queue from \"../../components/Stats/Queue\";\nimport Used from \"../../components/Stats/Used\";\nimport Separator from \"../../components/Stats/Separator\";\n\nconst links = videos => {\n return [\n { href: \"/\", title: \"STATS\", exact: true },\n { href: \"/capabilities/\", title: \"CAPABILITIES\", exact: true },\n ...(videos ? [{ href: \"/videos\", title: \"VIDEOS\", exact: true }] : []),\n ];\n};\n\nconst Viewport = () => {\n const [{ status, sse }, onStatus] = useState({\n status: \"unknown\",\n sse: \"unknown\",\n });\n\n const [query, onQuery] = useState(\"\");\n\n const select = useRef(null);\n\n // can be checked offline with simple\n // const {origin, sse, status, state, browsers = {}, sessions = {}} = require(\"../../sse-example.json\");\n\n const { origin, state = {}, browsers = {}, sessions = {}, version = \"unknown\" } = useObservable(\n in$ => {\n return in$.pipe(\n flatMap(([pushStatus]) =>\n merge(\n ajax(\"/status\").pipe(\n pluck(\"response\"),\n tap(() => pushStatus({ status: \"ok\" })),\n catchError(e => {\n pushStatus({ status: \"error\" });\n return of();\n })\n ),\n\n new Observable(observer => {\n const sse = new EventSource(\"/events\");\n\n sse.onmessage = x => observer.next(x.data);\n sse.onerror = x => observer.error(x);\n sse.onopen = () => pushStatus({ sse: \"ok\" });\n\n return () => {\n sse.close();\n };\n }).pipe(\n map(event => JSON.parse(event)),\n map(event => {\n if (!event) {\n pushStatus({ status: \"error\" });\n return {};\n }\n\n if (event.errors && event.errors.length) {\n pushStatus({ status: \"error\", sse: \"ok\" });\n return event;\n }\n\n if (event.state) {\n pushStatus({ status: \"ok\", sse: \"ok\" });\n return event;\n } else {\n console.error(\"Wrong data from backend\", event);\n pushStatus({ status: \"error\" });\n return {\n ...event,\n errors: [],\n };\n }\n }),\n retryWhen(errs =>\n errs.pipe(\n tap(err => {\n console.error(\"Error connecting to SSE\", err.target ? err.target.url : err);\n pushStatus({\n sse: \"error\",\n status: \"unknown\",\n });\n }),\n delayWhen(() => timer(3000))\n )\n )\n )\n )\n )\n );\n },\n {\n state: {},\n },\n [onStatus]\n );\n\n return (\n <>\n \n \n \n \n \n \n\n \n\n \n \n\n \n\n \n \n \n \n \n \n \n \n \n \n\n {\n if (query) {\n return null;\n }\n return (\n \n );\n }}\n />\n\n } />\n\n }\n />\n\n }\n />\n\n (\n \n )}\n />\n \n \n >\n );\n};\n\nconst PanelFilter = ({ select, query, onQuery }) => (\n {\n if (select.current) {\n select.current.focus();\n }\n }}\n >\n \n onQuery(\"\")}\n />\n \n);\n\nconst StyledPanelFilter = styled.div`\n flex: 1;\n display: flex;\n box-sizing: border-box;\n min-width: 190px;\n height: 100%;\n align-items: center;\n color: #fff;\n`;\n\nexport default Viewport;\n\nconst aerokubeColor = \"#4195d3\";\nconst aerokubeColorBright = \"#00c6f4\";\nconst statsBgColor = \"#272727\";\n\nconst StatsBar = styled.div`\n height: 80px;\n background-color: ${statsBgColor};\n box-shadow: inset 0 -5px 5px 0 rgba(0, 0, 0, 0.1);\n display: flex;\n align-items: center;\n overflow: auto;\n`;\n\nconst Logo = styled.div`\n line-height: 30px;\n transition: color 0.5s ease-out 0s;\n color: ${aerokubeColorBright};\n margin-left: 55px;\n position: relative;\n font-weight: 400;\n font-size: 16px;\n min-width: 40px;\n\n &:before {\n content: \"\";\n width: 20px;\n height: 20px;\n position: absolute;\n border-radius: 1px;\n left: -30px;\n top: 0;\n box-shadow: 0 0 10px 5px ${aerokubeColor};\n border: 5px solid #272727;\n background-color: ${aerokubeColorBright};\n }\n`;\n","import React from \"react\";\n\nimport Viewport from \"./containers/Viewport\";\n\nconst App = () => {\n return ;\n};\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === \"localhost\" ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === \"[::1]\" ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === \"production\" && \"serviceWorker\" in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener(\"load\", () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n \"This web app is being served cache-first by a service \" +\n \"worker. To learn more, visit http://bit.ly/CRA-PWA\"\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === \"installed\") {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n \"New content is available and will be used when all \" +\n \"tabs for this page are closed. See http://bit.ly/CRA-PWA.\"\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log(\"Content is cached for offline use.\");\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error(\"Error during service worker registration:\", error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get(\"content-type\");\n if (response.status === 404 || (contentType != null && contentType.indexOf(\"javascript\") === -1)) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\"No internet connection found. App is running in offline mode.\");\n });\n}\n\nexport function unregister() {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./static/dripicons.css\";\nimport App from \"./App\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nconst render = Component => {\n return ReactDOM.render(, document.getElementById(\"root\"));\n};\n\nrender(App);\n\nif (module.hot) {\n module.hot.accept(\"./App\", () => {\n const NextApp = require(\"./App\").default;\n render(NextApp);\n });\n}\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}