Move applink creation into appearance view
This commit is contained in:
@@ -1,24 +1,17 @@
|
||||
<script setup>
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
|
||||
import { ref, computed, useTemplateRef, onMounted, onUnmounted } from 'vue';
|
||||
import { Button, ButtonGroup, SingleSelect, Icon, TableView, TextInput } from 'pankow';
|
||||
import { API_ORIGIN, APP_TYPES, HSTATES, ISTATES, RSTATES, PROXY_APP_ID } from '../constants.js';
|
||||
import { API_ORIGIN, APP_TYPES, HSTATES, ISTATES, RSTATES } from '../constants.js';
|
||||
import AppsModel from '../models/AppsModel.js';
|
||||
import AppstoreModel from '../models/AppstoreModel.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 AppInstallDialog from '../components/AppInstallDialog.vue';
|
||||
import ApplinkDialog from '../components/ApplinkDialog.vue';
|
||||
import PostInstallDialog from '../components/PostInstallDialog.vue';
|
||||
|
||||
const appsModel = AppsModel.create();
|
||||
const appstoreModel = AppstoreModel.create();
|
||||
const domainsModel = DomainsModel.create();
|
||||
const applinksModel = ApplinksModel.create();
|
||||
const profileModel = ProfileModel.create();
|
||||
@@ -132,28 +125,6 @@ const updateInfo = ref({});
|
||||
|
||||
const applinkDialog = useTemplateRef('applinkDialog');
|
||||
const postInstallDialog = useTemplateRef('postInstallDialog');
|
||||
const appInstallDialog = useTemplateRef('appInstallDialog');
|
||||
|
||||
const newAppMenu = [{
|
||||
icon: 'fa fa-cloud-download-alt',
|
||||
label: t('appstore.title'),
|
||||
href: '/#/appstore',
|
||||
}, {
|
||||
separator: true
|
||||
}, {
|
||||
icon: 'fas fa-exchange-alt',
|
||||
label: t('apps.addAppproxyAction'),
|
||||
action: async () => {
|
||||
const [error, result] = await appstoreModel.get(PROXY_APP_ID);
|
||||
if (error) return console.error(error);
|
||||
|
||||
appInstallDialog.value.open(result);
|
||||
},
|
||||
}, {
|
||||
icon: 'fas fa-link',
|
||||
label: t('apps.addApplinkAction'),
|
||||
action: () => { applinkDialog.value.open(); },
|
||||
}];
|
||||
|
||||
// hook for applinks otherwise it is a link
|
||||
function openAppEdit(app, event) {
|
||||
@@ -270,7 +241,6 @@ onUnmounted(() => {
|
||||
<div class="content">
|
||||
<ApplinkDialog ref="applinkDialog" @success="refreshApps"/>
|
||||
<PostInstallDialog ref="postInstallDialog"/>
|
||||
<AppInstallDialog ref="appInstallDialog" @close="refreshApps"/>
|
||||
|
||||
<h1 class="view-header">
|
||||
{{ $t('apps.title') }}
|
||||
@@ -280,7 +250,6 @@ onUnmounted(() => {
|
||||
<SingleSelect class="pankow-no-mobile" v-if="profile.isAtLeastAdmin" :options="stateFilterOptions" option-key="id" v-model="stateFilter" />
|
||||
<SingleSelect class="pankow-no-mobile" v-if="profile.isAtLeastAdmin" :options="domainFilterOptions" option-key="id" option-label="domain" v-model="domainFilter" />
|
||||
<Button tool outline secondary @click="toggleView()" :icon="viewType === VIEW_TYPE.GRID ? 'fas fa-list' : 'fas fa-grip'"></Button>
|
||||
<Button tool :menu="newAppMenu" icon="fa-solid fa-plus" v-if="profile.isAtLeastAdmin" />
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user