Move new app link and app proxy to apps view

This commit is contained in:
Johannes Zellner
2025-05-21 17:10:43 +02:00
parent 08294f5f39
commit c231184c28
2 changed files with 34 additions and 20 deletions

View File

@@ -6,19 +6,16 @@ const t = i18n.t;
import moment from 'moment';
import { ref, computed, useTemplateRef, onMounted, inject, watch } from 'vue';
import { Button, TextInput, Spinner, InputDialog, SingleSelect } from 'pankow';
import { TextInput, Spinner, InputDialog, SingleSelect } from 'pankow';
import AppsModel from '../models/AppsModel.js';
import AppstoreModel from '../models/AppstoreModel.js';
import AppInstallDialog from '../components/AppInstallDialog.vue';
import ApplinkDialog from '../components/ApplinkDialog.vue';
import AppStoreItem from '../components/AppStoreItem.vue';
import { PROXY_APP_ID } from '../constants.js';
const appsModel = AppsModel.create();
const appstoreModel = AppstoreModel.create();
const ready = ref(false);
const proxyApp = ref();
const apps = ref([]);
const search = ref('');
@@ -71,7 +68,6 @@ const filteredPopularApps = computed(() => {
});
const appInstallDialog = useTemplateRef('appInstallDialog');
const searchInput = useTemplateRef('searchInput');
const applinkDialog = useTemplateRef('applinkDialog');
const inputDialog = useTemplateRef('inputDialog');
const features = inject('features');
const installedApps = ref([]);
@@ -110,14 +106,6 @@ function onAppInstallDialogClose() {
window.location.href = '#/appstore';
}
function onApplinkDialogOpen() {
applinkDialog.value.open();
}
function onApplinkDialogSuccess() {
window.location.href = '#/apps';
}
function onInstall(app) {
window.location.href = `#/appstore/${app.manifest.id}?version=${app.manifest.version}`;
appInstallDialog.value.open(app, installedApps.value.length >= features.value.appMaxCount);
@@ -176,8 +164,6 @@ onMounted(async () => {
} catch(e) {;}
}, 100);
}
proxyApp.value = await getApp(PROXY_APP_ID);
});
</script>
@@ -186,13 +172,10 @@ onMounted(async () => {
<div class="content" style="width: 100%;">
<InputDialog ref="inputDialog"/>
<AppInstallDialog ref="appInstallDialog" @close="onAppInstallDialogClose"/>
<ApplinkDialog ref="applinkDialog" @success="onApplinkDialogSuccess()"/>
<div class="filter-bar" :disabled="!ready" :style="{ 'pointer-events': ready ? null : 'none' }">
<SingleSelect @select="onCategory" v-model="category" :options="categories" option-key="id" option-label="label"/>
<TextInput ref="searchInput" @keydown.esc="search = ''" v-model="search" :placeholder="$t('appstore.searchPlaceholder')" style="flex-grow: 1;"/>
<Button secondary plain icon="fas fa-exchange-alt" @click="onInstall(proxyApp)">{{ $t('apps.addAppproxyAction') }}</Button>
<Button secondary plain icon="fas fa-link" @click="onApplinkDialogOpen()">{{ $t('apps.addApplinkAction') }}</Button>
</div>
<div v-if="!ready" style="width: 100%; text-align: center;">