diff --git a/priv/frontend/package-lock.json b/priv/frontend/package-lock.json index dcc0126..f0fb0f4 100644 --- a/priv/frontend/package-lock.json +++ b/priv/frontend/package-lock.json @@ -9014,6 +9014,14 @@ } } }, + "react-placeholder": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/react-placeholder/-/react-placeholder-3.0.1.tgz", + "integrity": "sha512-FMTAMBDn5ozWWBeS//QmGenaAy2qYeCytlC7s6DG+NL/TYOu5C33CkrysXgqv4LZ18dgKKspo0BekeACkWfV/w==", + "requires": { + "prop-types": "^15.6.0" + } + }, "react-scripts": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-1.1.4.tgz", diff --git a/priv/frontend/package.json b/priv/frontend/package.json index 94e410d..d35c34a 100644 --- a/priv/frontend/package.json +++ b/priv/frontend/package.json @@ -7,6 +7,7 @@ "ms": "^2.1.1", "react": "^16.4.0", "react-dom": "^16.4.0", + "react-placeholder": "^3.0.1", "react-scripts": "1.1.4" }, "scripts": { diff --git a/priv/frontend/src/App.js b/priv/frontend/src/App.js index a0ae5c7..eac917a 100644 --- a/priv/frontend/src/App.js +++ b/priv/frontend/src/App.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import Service from './Service.js'; +import ServicePlaceholder from './ServicePlaceholder.js'; import './App.css'; - import OP from './ws/op.js'; const log = (...args) => { @@ -131,11 +131,16 @@ export default class App extends Component { ); + return (

elstatus

{this.state.loading ? ( -
Loading metrics...
+ + + + + ) : null} {this.state.error ? (
Error: {this.state.error}
diff --git a/priv/frontend/src/ServicePlaceholder.css b/priv/frontend/src/ServicePlaceholder.css new file mode 100644 index 0000000..a68a699 --- /dev/null +++ b/priv/frontend/src/ServicePlaceholder.css @@ -0,0 +1,9 @@ +.service-placeholder { + margin-bottom: 2rem; +} + +.service-placeholder .title { + display: grid; + grid-template-columns: 3rem 1fr; + grid-gap: 1rem; +} diff --git a/priv/frontend/src/ServicePlaceholder.js b/priv/frontend/src/ServicePlaceholder.js new file mode 100644 index 0000000..cea7638 --- /dev/null +++ b/priv/frontend/src/ServicePlaceholder.js @@ -0,0 +1,49 @@ +import React from 'react'; + +import ReactPlaceholder from 'react-placeholder'; +import 'react-placeholder/lib/reactPlaceholder.css'; + +import './ServicePlaceholder.css'; + +const ServicePlaceholder = () => ( +
+
+ + {' '} + + + {' '} + +
+ + {' '} + + + {' '} + +
+); + +export default ServicePlaceholder;