diff --git a/dashboard/public/translation/en.json b/dashboard/public/translation/en.json index fda6293f7..860e50925 100644 --- a/dashboard/public/translation/en.json +++ b/dashboard/public/translation/en.json @@ -1849,7 +1849,8 @@ "archiveDialog": { "title": "Archive {{app}}", "description": "This will uninstall the app and put the app's latest backup created at {{date}} in the App Archive." - } + }, + "updateAvailableTooltip": "Update available" }, "login": { "loginTo": "Login to", diff --git a/dashboard/public/translation/nl.json b/dashboard/public/translation/nl.json index efe965be2..0bb41127f 100644 --- a/dashboard/public/translation/nl.json +++ b/dashboard/public/translation/nl.json @@ -374,7 +374,7 @@ "label": "Beperk toegang" }, "enabled": "Ingeschakeld", - "title": "Directory Server", + "title": "LDAP aanbieder", "description": "Cloudron kan ingezet worden als gebruikers Directory Server voor externe applicaties.", "secret": { "label": "Koppel wachtwoord", @@ -2015,7 +2015,7 @@ "loginRedirectUri": "Login callback URLs (met komma gescheiden)", "logoutRedirectUri": "Logout callback URL (optioneel)" }, - "title": "OpenID Connect aanbieder", + "title": "OpenID aanbieder", "description": "Cloudron kan als een OpenID Connect aanbieder voor interne apps en externe diensten fungeren.", "editClientDialog": { "title": "Bewerk Client {{ client }}" diff --git a/dashboard/src/views/AppsView.vue b/dashboard/src/views/AppsView.vue index b3c2e031a..b11653335 100644 --- a/dashboard/src/views/AppsView.vue +++ b/dashboard/src/views/AppsView.vue @@ -7,12 +7,14 @@ import AppsModel from '../models/AppsModel.js'; import ApplinksModel from '../models/ApplinksModel.js'; import DomainsModel from '../models/DomainsModel.js'; import ProfileModel from '../models/ProfileModel.js'; +import UpdaterModel from '../models/UpdaterModel.js'; import ApplinkDialog from '../components/ApplinkDialog.vue'; const appsModel = AppsModel.create(); const domainsModel = DomainsModel.create(); const applinksModel = ApplinksModel.create(); const profileModel = ProfileModel.create(); +const updaterModel = UpdaterModel.create(); const VIEW_TYPE = { LIST: 'list', @@ -111,10 +113,7 @@ const filteredApps = computed(() => { if (stateFilter.value === 'running') return a.runState === RSTATES.RUNNING && a.health === HSTATES.HEALTHY && a.installationState === ISTATES.INSTALLED; if (stateFilter.value === 'stopped') return a.runState === RSTATES.STOPPED; - - // TODO implement this - // if (stateFilter.value === 'update_available') return !!(Client.getConfig().update[a.id] && Client.getConfig().update[a.id].manifest.version && Client.getConfig().update[a.id].manifest.version !== a.manifest.version); - if (stateFilter.value === 'update_available') return false; + if (stateFilter.value === 'update_available') return a.updateAvailable; return a.runState === RSTATES.RUNNING && (a.health !== HSTATES.HEALTHY || a.installationState !== ISTATES.INSTALLED); // not responding }); @@ -124,6 +123,8 @@ const installationStateLabel = AppsModel.installationStateLabel; const installationActive = AppsModel.installationActive; const appProgressMessage = AppsModel.appProgressMessage; +const updateInfo = ref({}); + const applinkDialog = useTemplateRef('applinkDialog'); // hook for applinks otherwise it is a link @@ -171,6 +172,11 @@ async function refreshApps() { const [error, result] = await appsModel.list(); if (error) return console.error(error); + // amend update info + result.forEach((a) => { + a.updateAvailable = !!(updateInfo.value[a.id] && updateInfo.value[a.id].manifest.version && updateInfo.value[a.id].manifest.version !== a.manifest.version); + }); + const [applinkError, applinks] = await applinksModel.list(); if (applinkError) return console.error(applinkError); @@ -201,7 +207,12 @@ function toggleView() { } onMounted(async () => { - let [error, result] = await profileModel.get(); + let [error, result] = await updaterModel.info(); + if (error) return console.error(error); + + updateInfo.value = result; + + [error, result] = await profileModel.get(); if (error) return console.error(error); profile.value = result; @@ -246,13 +257,14 @@ onUnmounted(() => {