diff --git a/public/i18n/en/translation.json b/public/i18n/en/translation.json
index 8a1d7d25f..79a4d63d9 100644
--- a/public/i18n/en/translation.json
+++ b/public/i18n/en/translation.json
@@ -685,7 +685,8 @@
"go_to_subscription": "Go to subscription",
"automatic_updates_enabled_message": "Automatic updates successfully enabled",
"automatic_updates_disabled_message": "Automatic updates successfully disabled",
- "schedule_update": "Schedule update"
+ "schedule_update": "Schedule update",
+ "no_updates_available": "No updates available"
},
"storage": {
"title": "Storage",
diff --git a/src/components/controller/units/ScheduleUpdateDrawer.vue b/src/components/controller/units/ScheduleUpdateDrawer.vue
index f8b5ddf27..0236a1051 100644
--- a/src/components/controller/units/ScheduleUpdateDrawer.vue
+++ b/src/components/controller/units/ScheduleUpdateDrawer.vue
@@ -55,9 +55,12 @@ watch(
fetchError.value = undefined
loading.value = true
checkUnitImageUpdate(_unit.value)
- .then((response) => {
+ .then(async (response) => {
versionToUpdate.value = response.data.lastVersion
- if (response.data.scheduledAt > 0) {
+ if (versionToUpdate.value == '') {
+ await unitsStore.getUnitInfo(_unit.value!.id)
+ await unitsStore.getUnits()
+ } else if (response.data.scheduledAt > 0) {
scheduledUpdate.value = new Date(response.data.scheduledAt * 1000)
updateMode.value = 'scheduled'
} else {
@@ -140,6 +143,13 @@ function close() {
{{ fetchError.toString() }}
+
+
+
+
+ {{ t('common.close') }}
+
+
emit('upgradeUnitPackages', unit),
- disabled: !unit.connected
+ disabled: !unit.connected || unitsStore.unitUpdatingPackages.find((id) => id == unit.id)
},
{
id: 'refreshUnitInfo',
@@ -452,48 +452,50 @@ function showRemoveUnitModal(unit: Unit) {
{{ item.info.version }}
-
-
-
-
-
-
-
- {{
- t('controller.units.scheduled_image_update_tooltip', {
- version: item.info.version_update,
- date: new Date(item.info.scheduled_update * 1000).toLocaleString()
- })
- }}
-
-
-
-
-
-
-
-
-
-
-
- {{
- t('controller.units.image_update_available_tooltip', {
- version: item.info.version_update
- })
- }}
-
-
-
+
+
+
+
+
+
+
+
+ {{
+ t('controller.units.scheduled_image_update_tooltip', {
+ version: item.info.version_update,
+ date: new Date(item.info.scheduled_update * 1000).toLocaleString()
+ })
+ }}
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ t('controller.units.image_update_available_tooltip', {
+ version: item.info.version_update
+ })
+ }}
+
+
+
+
diff --git a/src/components/controller/units/UpdateUnitsPackagesModal.vue b/src/components/controller/units/UpdateUnitsPackagesModal.vue
index 889d6822a..649bede4c 100644
--- a/src/components/controller/units/UpdateUnitsPackagesModal.vue
+++ b/src/components/controller/units/UpdateUnitsPackagesModal.vue
@@ -97,6 +97,7 @@ async function updateUnitPackages() {
name: _unit.value.info.unit_name
})
})
+ unitsStore.addUnitUpdating(_unit.value.id)
emit('close')
} catch (exception: any) {
error.value = exception
diff --git a/src/stores/controller/units.ts b/src/stores/controller/units.ts
index 56f3dbb24..156a42d64 100644
--- a/src/stores/controller/units.ts
+++ b/src/stores/controller/units.ts
@@ -59,6 +59,7 @@ export const useUnitsStore = defineStore('units', () => {
const loadingListUnits = ref(false)
const errorListUnits = ref('')
const errorListUnitsDetails = ref('')
+ const unitUpdatingPackages = ref([])
const getUnits = async () => {
loadingListUnits.value = true
@@ -212,6 +213,13 @@ export const useUnitsStore = defineStore('units', () => {
})
}
+ function addUnitUpdating(unitId: string) {
+ unitUpdatingPackages.value.push(unitId)
+ setTimeout(() => {
+ unitUpdatingPackages.value = unitUpdatingPackages.value.filter((unit) => unit !== unitId)
+ }, 10000)
+ }
+
return {
units,
getUnits,
@@ -224,6 +232,8 @@ export const useUnitsStore = defineStore('units', () => {
loadingListUnits,
errorListUnits,
errorListUnitsDetails,
- getUnitInfo
+ getUnitInfo,
+ unitUpdatingPackages,
+ addUnitUpdating
}
})