migrate admin settings

This commit is contained in:
Simon Vieille
2025-04-10 19:54:03 +02:00
parent 8c5c43dafa
commit f9c3f96919
25 changed files with 1024 additions and 108 deletions
@@ -0,0 +1,82 @@
<template>
<NcButton
aria-label="t('side_menu', 'Select apps')"
@click="openModal"
variant="primary"
>
{{ t('side_menu', 'Select apps') }} ({{ model.length }})
</NcButton>
<NcModal
v-if="modal"
@close="closeModal"
>
<div class="modal__content">
<NcCheckboxRadioSwitch
v-for="(item, key) in apps"
v-model="model"
name="value"
:value="item.id"
:key="key"
>
<img
:src="item.icon"
:alt="item.name"
/>
{{ item.name }}
</NcCheckboxRadioSwitch>
<div class="modal__footer">
<NcButton
@click="closeModal"
variant="primary"
>
{{ t('side_menu', 'Close') }}
</NcButton>
</div>
</div>
</NcModal>
</template>
<style scoped>
.modal__content {
padding: 20px;
}
.modal__footer {
margin-top: 20px;
text-align: right;
}
.modal__footer button {
display: inline-block;
}
img {
width: 15px;
height: 15px;
}
</style>
<script setup>
import { NcButton, NcModal, NcCheckboxRadioSwitch } from '@nextcloud/vue'
import { useNavStore } from '../../../store/nav.js'
import { ref, onMounted } from 'vue'
const model = defineModel()
const navStore = useNavStore()
const modal = ref(false)
const apps = ref([])
const openModal = () => {
modal.value = true
}
const closeModal = () => {
modal.value = false
}
onMounted(async () => {
apps.value = await navStore.getApps()
})
</script>