add iconUrl to manifest
This commit is contained in:
@@ -29,6 +29,9 @@ const dashboardDomain = inject('dashboardDomain');
|
||||
// reactive
|
||||
const busy = ref(false);
|
||||
const formError = ref({});
|
||||
|
||||
// community { iconUrl, versionsUrl, manifest, publishState, creationDate, ts }
|
||||
// appstore { id, iconUrl, appStoreId, manifest, creationDate, publishState }
|
||||
const packageData = ref({});
|
||||
const manifest = ref({});
|
||||
const step = ref(STEP.DETAILS);
|
||||
@@ -272,12 +275,12 @@ defineExpose({
|
||||
<div v-else class="app-install-dialog-body" :class="{ 'step-detail': step === STEP.DETAILS, 'step-install': step === STEP.INSTALL }">
|
||||
<div class="app-install-header">
|
||||
<div class="summary" v-if="packageData.manifest">
|
||||
<div class="title"><img class="icon pankow-no-desktop" style="width: 32px; height: 32px; margin-right: 10px" :src="packageData.iconUrl" />{{ manifest.title }}</div>
|
||||
<div class="title"><img class="icon pankow-no-desktop" style="width: 32px; height: 32px; margin-right: 10px" :src="packageData.iconUrl || '/img/appicon_fallback.png'"/>{{ manifest.title }}</div>
|
||||
<div><a :href="manifest.website" target="_blank">{{ manifest.title }}</a> {{ packageData.manifest.upstreamVersion }} - {{ $t('app.updates.info.packageVersion') }} {{ packageData.manifest.version }}</div>
|
||||
<div>{{ $t('appstore.installDialog.lastUpdated', { date: prettyDate(packageData.creationDate) }) }}</div>
|
||||
<div>{{ $t('appstore.installDialog.memoryRequirement', { size: prettyBinarySize(manifest.memoryLimit || (256 * 1024 * 1024)) }) }}</div>
|
||||
</div>
|
||||
<img class="icon pankow-no-mobile" :src="packageData.iconUrl" />
|
||||
<img class="icon pankow-no-mobile" :src="packageData.iconUrl || '/img/appicon_fallback.png'"/>
|
||||
</div>
|
||||
<Transition name="slide-left" mode="out-in">
|
||||
<div v-if="step === STEP.DETAILS">
|
||||
|
||||
@@ -34,7 +34,11 @@ async function onSubmit() {
|
||||
return console.error(error);
|
||||
}
|
||||
|
||||
const packageData = { ...result, versionsUrl: `${url}@${version || 'latest'}` };
|
||||
const packageData = {
|
||||
...result, // { manifest, publishState, creationDate, ts }
|
||||
versionsUrl: `${url}@${version || 'latest'}`,
|
||||
iconUrl: result.manifest.iconUrl // compat with app store format
|
||||
};
|
||||
|
||||
emit('success', packageData);
|
||||
|
||||
|
||||
@@ -165,7 +165,10 @@ async function onHashChange() {
|
||||
});
|
||||
}
|
||||
|
||||
const packageData = { ...result, appStoreId: `${appId}@${version}` };
|
||||
const packageData = {
|
||||
...result, // { id, creationDate, publishState, manifest, iconUrl }
|
||||
appStoreId: `${appId}@${version}`
|
||||
};
|
||||
appInstallDialog.value.open(packageData, installedApps.value.length >= features.value.appMaxCount, domains.value);
|
||||
}
|
||||
}
|
||||
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -12,7 +12,7 @@
|
||||
"@aws-sdk/client-s3": "^3.974.0",
|
||||
"@aws-sdk/lib-storage": "^3.974.0",
|
||||
"@cloudron/connect-lastmile": "^2.3.0",
|
||||
"@cloudron/manifest-format": "^5.32.1",
|
||||
"@cloudron/manifest-format": "^5.32.2",
|
||||
"@cloudron/pipework": "^1.2.0",
|
||||
"@cloudron/superagent": "^1.0.1",
|
||||
"@google-cloud/dns": "^5.3.1",
|
||||
@@ -1291,9 +1291,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@cloudron/manifest-format": {
|
||||
"version": "5.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@cloudron/manifest-format/-/manifest-format-5.32.1.tgz",
|
||||
"integrity": "sha512-dq54lx/YMO1TOoFfdZTArgU3UH+WOz57z8Tcafc09d82iKB40grZSVsT1AWuY+yw5aXbo8V0r5P9nDx/qzMejw==",
|
||||
"version": "5.32.2",
|
||||
"resolved": "https://registry.npmjs.org/@cloudron/manifest-format/-/manifest-format-5.32.2.tgz",
|
||||
"integrity": "sha512-VzkJG2LwwDsxa9iaeh2VvUYrgxzgkUUHAo2bjr9C0eRqMCSYaMyKMWjO7529x+xRreFHJZ+kOjoQ6PpIkxOudg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^8.17.1",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"@aws-sdk/client-s3": "^3.974.0",
|
||||
"@aws-sdk/lib-storage": "^3.974.0",
|
||||
"@cloudron/connect-lastmile": "^2.3.0",
|
||||
"@cloudron/manifest-format": "^5.32.1",
|
||||
"@cloudron/manifest-format": "^5.32.2",
|
||||
"@cloudron/pipework": "^1.2.0",
|
||||
"@cloudron/superagent": "^1.0.1",
|
||||
"@google-cloud/dns": "^5.3.1",
|
||||
|
||||
@@ -396,7 +396,7 @@ async function getAppVersion(appId, version) {
|
||||
if (response.status === 404) throw new BoxError(BoxError.NOT_FOUND, `Could not find app ${appId}`);
|
||||
if (response.status !== 200) throw new BoxError(BoxError.EXTERNAL_ERROR, `App fetch failed. ${response.status} ${JSON.stringify(response.body)}`);
|
||||
|
||||
return response.body;
|
||||
return response.body; // { id, creationDate, publishState, manifest, iconUrl }
|
||||
}
|
||||
|
||||
async function getApp(appId) {
|
||||
|
||||
@@ -36,11 +36,7 @@ async function getAppVersion(url, version) {
|
||||
const manifestError = manifestFormat.checkVersionsRequirements(versionData.manifest);
|
||||
if (manifestError) throw new BoxError(BoxError.BAD_FIELD, `Invalid manifest: ${manifestError.message}`);
|
||||
|
||||
return {
|
||||
id: versionData.manifest.id,
|
||||
iconUrl: versionData.manifest.iconUrl,
|
||||
...versionData // { manifest, publishState, creationDate, ts }
|
||||
};
|
||||
return versionData; // { manifest, publishState, creationDate, ts }
|
||||
}
|
||||
|
||||
async function downloadManifest(versionsUrl) {
|
||||
@@ -98,8 +94,6 @@ async function getAppUpdate(app, options) {
|
||||
|
||||
return {
|
||||
id: app.manifest.id,
|
||||
creationDate: nextVersion.creationDate,
|
||||
manifest: nextVersion.manifest,
|
||||
unstable: nextVersion.publishState === 'approved'
|
||||
...nextVersion // { manifest, publishState, creationDate, ts }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ async function getAppVersion(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.appstoreId, 'string');
|
||||
assert.strictEqual(typeof req.params.versionId, 'string');
|
||||
|
||||
const [error, manifest] = await safe(appstore.getAppVersion(req.params.appstoreId, req.params.versionId));
|
||||
const [error, result] = await safe(appstore.getAppVersion(req.params.appstoreId, req.params.versionId));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, manifest));
|
||||
next(new HttpSuccess(200, result)); // { id, creationDate, publishState, manifest, iconUrl }
|
||||
}
|
||||
|
||||
async function unlinkAccount(req, res, next) {
|
||||
|
||||
@@ -17,5 +17,5 @@ async function getAppVersion(req, res, next) {
|
||||
const [error, result] = await safe(community.getAppVersion(req.query.url, req.query.version));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, result));
|
||||
next(new HttpSuccess(200, result)); // { manifest, publishState, creationDate, ts }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user