diff --git a/machinery/src/cloud/Cloud.go b/machinery/src/cloud/Cloud.go index afcf1f4..eafe453 100644 --- a/machinery/src/cloud/Cloud.go +++ b/machinery/src/cloud/Cloud.go @@ -54,6 +54,9 @@ func HandleUpload(configuration *models.Configuration, communication *models.Com log.Log.Debug("HandleUpload: stopping as Offline is enabled.") } else { + // Half a second delay between two uploads + delay := 500 * time.Millisecond + loop: for { // This will check if we need to stop the thread, @@ -69,6 +72,7 @@ func HandleUpload(configuration *models.Configuration, communication *models.Com log.Log.Error("HandleUpload: " + err.Error()) } else { for _, f := range ff { + // This will check if we need to stop the thread, // because of a reconfiguration. select { @@ -89,6 +93,7 @@ func HandleUpload(configuration *models.Configuration, communication *models.Com // Check if the file is uploaded, if so, remove it. if uploaded { + delay = 500 * time.Millisecond // reset err := os.Remove(watchDirectory + fileName) if err != nil { log.Log.Error("HandleUpload: " + err.Error()) @@ -107,8 +112,12 @@ func HandleUpload(configuration *models.Configuration, communication *models.Com if err != nil { log.Log.Error("HandleUpload: " + err.Error()) } + } else { + delay = 5 * time.Second // slow down + log.Log.Error("HandleUpload: " + err.Error()) } + time.Sleep(delay) } } } diff --git a/machinery/src/computervision/main.go b/machinery/src/computervision/main.go index d02686c..251de55 100644 --- a/machinery/src/computervision/main.go +++ b/machinery/src/computervision/main.go @@ -164,8 +164,12 @@ func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Confi // If offline mode is disabled, send a message to the hub if config.Offline == "false" { - if mqttClient != nil && key != "" { - mqttClient.Publish("kerberos/"+key+"/device/"+config.Key+"/motion", 2, false, "motion") + if mqttClient != nil { + if key != "" { + mqttClient.Publish("kerberos/"+key+"/device/"+config.Key+"/motion", 2, false, "motion") + } else { + mqttClient.Publish("kerberos/device/"+config.Key+"/motion", 2, false, "motion") + } } } diff --git a/ui/package.json b/ui/package.json index dbd467b..50bc3d2 100644 --- a/ui/package.json +++ b/ui/package.json @@ -4,7 +4,7 @@ "private": false, "dependencies": { "@giantmachines/redux-websocket": "^1.5.1", - "@kerberos-io/ui": "^1.71.0", + "@kerberos-io/ui": "^1.72.0", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@testing-library/jest-dom": "^5.16.5", diff --git a/ui/src/App.scss b/ui/src/App.scss index f72af9b..1881186 100644 --- a/ui/src/App.scss +++ b/ui/src/App.scss @@ -1,5 +1,16 @@ @import "./app.variables"; +.grid-container { + row-gap: size(2); +} + +.main { + padding-top: size(7); + + @media (min-width: 800px) { + padding-top: 0; + } +} .offline-mode, .cloud-not-installed { background: var(--upper-gradient); diff --git a/ui/src/api/authentication.js b/ui/src/api/authentication.js index 0fa2099..e37fe80 100644 --- a/ui/src/api/authentication.js +++ b/ui/src/api/authentication.js @@ -46,11 +46,3 @@ export function doCheckIfInstalled(onSuccess, onError) { } }); } - -/* export function doAuth(onSuccess, onError) { - -} - -export function doRefreshToken(onSuccess, onError) { - -} */ diff --git a/ui/src/pages/Dashboard/Dashboard.jsx b/ui/src/pages/Dashboard/Dashboard.jsx index 7af3985..abf36fd 100644 --- a/ui/src/pages/Dashboard/Dashboard.jsx +++ b/ui/src/pages/Dashboard/Dashboard.jsx @@ -220,14 +220,21 @@ class Dashboard extends React.Component { id="cells1" bodycells={[ <> -
{event.time}
this.openModal(
`${config.URL}/file/${event.key}`
diff --git a/ui/src/pages/Dashboard/Dashboard.scss b/ui/src/pages/Dashboard/Dashboard.scss
index 6ae572d..833ae50 100644
--- a/ui/src/pages/Dashboard/Dashboard.scss
+++ b/ui/src/pages/Dashboard/Dashboard.scss
@@ -1,3 +1,5 @@
+@import "../../app.variables";
+
#dashboard {
hr {
@@ -15,6 +17,13 @@
video {
width: 100%;
}
+
+ p.event-description {
+ display: none;
+ @media (min-width: 800px) {
+ display: block;
+ }
+ }
a {
display: flex;
diff --git a/ui/src/pages/Media/Media.jsx b/ui/src/pages/Media/Media.jsx
index aea1fc1..e32ae64 100644
--- a/ui/src/pages/Media/Media.jsx
+++ b/ui/src/pages/Media/Media.jsx
@@ -3,11 +3,8 @@ import PropTypes from 'prop-types';
import { withTranslation } from 'react-i18next';
import {
Breadcrumb,
- VideoContainer,
VideoCard,
- ControlBar,
Button,
- Input,
Modal,
ModalHeader,
ModalBody,
@@ -105,17 +102,7 @@ class Media extends React.Component {
-