Skip to content

Commit

Permalink
Fixed DWC version display on Settings page
Browse files Browse the repository at this point in the history
Changed version table layout a bit as well
Incompatible versions are now dumped to the JS console
  • Loading branch information
chrishamm committed Apr 14, 2023
1 parent 735cefe commit 1ea461b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
13 changes: 8 additions & 5 deletions src/components/dialogs/IncompatibleVersionsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,22 @@ export default Vue.extend({
if (mainboardVersion) {
// Check expansion board firmware versions
for (const board of store.state.machine.model.boards) {
if (board.canAddress && semver.compare(mainboardVersion, board.firmwareVersion) !== 0) {
if (board.canAddress && board.firmwareVersion && semver.compare(mainboardVersion, board.firmwareVersion) !== 0) {
console.warn(`Expansion board #${board.canAddress} version mismatch (MB ${mainboardVersion} != EXP ${board.firmwareVersion}`);
versionMismatch = true;
}
}
// Check DSF version
if (!versionMismatch && store.state.machine.model.state.dsfVersion !== null) {
versionMismatch = semver.compare(mainboardVersion, store.state.machine.model.state.dsfVersion) !== 0;
if (!versionMismatch && store.state.machine.model.state.dsfVersion !== null && semver.compare(mainboardVersion, store.state.machine.model.state.dsfVersion) !== 0) {
console.warn(`DSF version mismatch (MB ${mainboardVersion} != DSF ${store.state.machine.model.state.dsfVersion}`);
versionMismatch = true;
}
// Check DWC version
if (!versionMismatch) {
versionMismatch = semver.compare(mainboardVersion, packageInfo.version) !== 0;
if (!versionMismatch && semver.compare(mainboardVersion, packageInfo.version) !== 0) {
console.warn(`DWC version mismatch (MB ${mainboardVersion} != DWC ${packageInfo.version}`);
versionMismatch = true;
}
}
Expand Down
17 changes: 11 additions & 6 deletions src/components/panels/SettingsElectronicsPanel.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<style scoped>
th {
padding: 0 16px;
text-align: left;
}
</style>

<template>
<v-card outlined>
<v-card-title>
Expand Down Expand Up @@ -43,7 +50,7 @@
Duet WiFi Server
</td>
<td>
<!-- n/a -->
{{ $t("generic.noValue") }}
</td>
<td>
{{ wifiVersion }}
Expand Down Expand Up @@ -72,18 +79,16 @@
DWC
</td>
<td :title="$t('panel.settingsAbout.buildDateTime', [buildDateTime])">
{{ dsfVersion }}
{{ dwcVersion }}
</td>
</tr>
</tbody>
<tfoot>
<upload-btn v-if="!isRestConnector || !isDuetFirmware" target="update" color="primary"
class="mt-3 d-flex justify-center" />
</tfoot>
</v-simple-table>
<v-card-text v-else>
{{ $t("panel.settingsElectronics.notConnected") }}
</v-card-text>

<upload-btn v-if="!isRestConnector || !isDuetFirmware" class="my-3 d-flex justify-center" target="update" color="primary" />
</v-card>
</template>

Expand Down

0 comments on commit 1ea461b

Please sign in to comment.