community: store versionsUrl in the database

This commit is contained in:
Girish Ramakrishnan
2026-02-05 17:29:00 +01:00
parent 91b8f1a457
commit d6eb6d3e3e
13 changed files with 249 additions and 118 deletions
+1 -1
View File
@@ -31,7 +31,6 @@ async function onAckChecklistItem(item, key) {
hasOldChecklist.value = true;
}
// Notes
async function onSubmit() {
busy.value = true;
@@ -81,6 +80,7 @@ onMounted(() => {
<div class="info-row">
<div class="info-label">{{ $t('app.updates.info.description') }}</div>
<div class="info-value" v-if="app.appStoreId">{{ app.manifest.title }} {{ app.manifest.upstreamVersion }}</div>
<div class="info-value" v-if="app.versionsUrl">{{ app.versionsUrl }} {{ app.manifest.upstreamVersion }}</div>
<div class="info-value" v-else>{{ app.manifest.dockerImage }}</div>
</div>
+11 -7
View File
@@ -66,7 +66,11 @@ async function onUpdate() {
busyUpdate.value = true;
updateError.value = '';
const [error, result] = await appsModel.update(props.app.id, props.app.updateInfo.manifest, skipBackup.value);
let appData = '';
if (props.app.appStoreId) appData = { appStoreId: `${props.app.appStoreId}@${props.app.updateInfo.manifest.version}` };
if (props.app.versionsUrl) appData = { versionsUrl: `${props.app.versionsUrl}@${props.app.updateInfo.manifest.version}` };
const [error, result] = await appsModel.update(props.app.id, appData, skipBackup.value);
if (error) {
busyUpdate.value = false;
if (error.status === 400) updateError.value = error.body ? error.body.message : 'Internal error';
@@ -118,20 +122,20 @@ onMounted(async () => {
<SettingsItem>
<div>
<label>{{ $t('app.updates.auto.title') }}</label>
<div v-if="!app.appStoreId">{{ $t('app.updates.info.customAppUpdateInfo') }}</div>
<div v-else v-html="$t('app.updates.auto.description')"></div>
</div>
<Switch v-if="app.appStoreId" v-model="autoUpdatesEnabled" :disabled="autoUpdatesEnabledBusy" @change="onAutoUpdatesEnabledChange"/>
<div v-if="app.appStoreId || app.versionsUrl" v-html="$t('app.updates.auto.description')"></div>
<div v-else>{{ $t('app.updates.info.customAppUpdateInfo') }}</div>
</div>
<Switch v-if="app.appStoreId || app.versionsUrl" v-model="autoUpdatesEnabled" :disabled="autoUpdatesEnabledBusy" @change="onAutoUpdatesEnabledChange"/>
</SettingsItem>
<hr style="margin-top: 20px"/>
<div v-if="app.appStoreId">
<div v-if="app.appStoreId || app.versionsUrl">
<label>{{ $t('app.updatesTabTitle') }}</label>
<div v-html="$t('app.updates.updates.description', { appStoreLink: 'https://www.cloudron.io/store/index.html' })"></div>
</div>
<br/>
<Button v-if="app.appStoreId" @click="onCheck()" :disabled="busyCheck" :loading="busyCheck">{{ $t('settings.updates.checkForUpdatesAction') }}</Button>
<Button v-if="app.appStoreId || app.versionsUrl" @click="onCheck()" :disabled="busyCheck" :loading="busyCheck">{{ $t('settings.updates.checkForUpdatesAction') }}</Button>
<hr v-if="app.updateInfo" style="margin-top: 20px"/>