Skip to content

Commit

Permalink
Ota finish up
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Jan 19, 2024
1 parent e25ffbc commit 9fd37d5
Show file tree
Hide file tree
Showing 12 changed files with 324 additions and 33 deletions.
41 changes: 39 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"material-design-icons-iconfont": "^6.7.0",
"mitt": "^3.0.1",
"normalize.css": "^8.0.1",
"relative-time-vue-component": "^5.0.2",
"toastr": "^2.1.4",
"vue": "^3.3.7",
"vue-cropperjs": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/globals/config/config.development.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
name: "ShockLink Dev",
webUiUrl: "https://dev.shocklink.net/#/",
apiUrl: "https://dev-api.shocklink.net/",
webUiUrl: "https://staging.shocklink.net/#/",
apiUrl: "https://staging-api.shocklink.net/",
shortUrl: "https://shockl.ink/",
}

Expand Down
28 changes: 28 additions & 0 deletions src/js/UserHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,34 @@ export default class ws {
});
});

this.connection.on("DeviceUpdate", (deviceId, type) => {
emitter.emit('deviceUpdate', { deviceId, type });
});


// OTA

this.connection.on("OtaInstallStarted", (deviceId, updateId, version) => {
emitter.emit('otaInstallStarted', { deviceId, updateId, version });
});

this.connection.on("OtaInstallProgress", (deviceId, updateId, task, progress) => {
emitter.emit('otaInstallProgress', { deviceId, updateId, task, progress });
});

this.connection.on("OtaInstallFailed", (deviceId, updateId, fatal, message) => {
emitter.emit('otaInstallFailed', { deviceId, updateId, fatal, message });
});

this.connection.on("OtaRollback", (deviceId, updateId) => {
emitter.emit('otaRollback', { deviceId, updateId });
});

this.connection.on("OtaInstallSucceeded", (deviceId, updateId) => {
emitter.emit('otaInstallSucceeded', { deviceId, updateId });
});


this.interval = setInterval(() => {
if(storeF.state.userHubState != this.connection._connectionState) {
storeF.commit('setUserHubState', this.connection._connectionState);
Expand Down
4 changes: 2 additions & 2 deletions src/views/dashboard/Navigation/NavRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export default {
}
}
@media (min-width: 992px) {
@media (min-width: 1283px) {
.first-level {
flex-flow: row nowrap;
justify-content: flex-start;
Expand All @@ -299,7 +299,7 @@ export default {
}
@media (max-width: 991px) {
@media (max-width: 1282px) {
.first-level {
.navbar-logo img {
Expand Down
2 changes: 1 addition & 1 deletion src/views/dashboard/devices/DevicesRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export default {
ws.captive(deviceId, enabled);
},
getFirmwareVersionString(version) {
if(version === null) return "Older than 7.1.0.0, please upgrade.";
if(version === null) return "Older than 0.8.0, please upgrade.";
return version;
},
ellipsis(e, item) {
Expand Down
Loading

0 comments on commit 9fd37d5

Please sign in to comment.