format code

This commit is contained in:
Simon Vieille
2025-04-13 20:33:03 +02:00
parent fdd8f8850d
commit b835bbb34d
7 changed files with 74 additions and 56 deletions
+15 -13
View File
@@ -10,18 +10,13 @@
<NcLoadingIcon v-else /> <NcLoadingIcon v-else />
</NcButton> </NcButton>
<div v-if="error" id="error"> <div
</div> v-if="error"
id="error"
></div>
</div> </div>
</template> </template>
<style scoped>
#error {
padding-top: 10px;
color: red;
}
</style>
<script setup> <script setup>
import { NcButton, NcLoadingIcon } from '@nextcloud/vue' import { NcButton, NcLoadingIcon } from '@nextcloud/vue'
import { ref } from 'vue' import { ref } from 'vue'
@@ -56,7 +51,7 @@ const save = async () => {
error.value = null error.value = null
const update = () => { const update = () => {
++counter; ++counter
if (counter === size) { if (counter === size) {
loading.value = false loading.value = false
@@ -70,9 +65,9 @@ const save = async () => {
for (let key in data) { for (let key in data) {
let value = data[key] let value = data[key]
if (Array.isArray(value) || typeof(value) === 'object') { if (Array.isArray(value) || typeof value === 'object') {
value = JSON.stringify(value) value = JSON.stringify(value)
} else if (typeof(value) === 'boolean') { } else if (typeof value === 'boolean') {
value = value ? 1 : 0 value = value ? 1 : 0
} }
@@ -83,8 +78,15 @@ const save = async () => {
error() { error() {
error.value = `Error while saving ${key}` error.value = `Error while saving ${key}`
update() update()
} },
}) })
} }
} }
</script> </script>
<style scoped>
#error {
padding-top: 10px;
color: red;
}
</style>
+7 -7
View File
@@ -23,18 +23,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
</template> </template>
<style scoped>
.disabled {
display: block;
}
</style>
<script setup> <script setup>
const { disabled } = defineProps({ const { disabled } = defineProps({
disabled: { disabled: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false, default: false,
} },
}) })
</script> </script>
<style scoped>
.disabled {
display: block;
}
</style>
+14 -12
View File
@@ -10,18 +10,13 @@
<NcLoadingIcon v-else /> <NcLoadingIcon v-else />
</NcButton> </NcButton>
<div v-if="error" id="error"> <div
</div> v-if="error"
id="error"
></div>
</div> </div>
</template> </template>
<style scoped>
#error {
padding-top: 10px;
color: red;
}
</style>
<script setup> <script setup>
import { NcButton, NcLoadingIcon } from '@nextcloud/vue' import { NcButton, NcLoadingIcon } from '@nextcloud/vue'
import { ref } from 'vue' import { ref } from 'vue'
@@ -56,7 +51,7 @@ const save = async () => {
error.value = null error.value = null
const update = () => { const update = () => {
++counter; ++counter
if (counter === size) { if (counter === size) {
loading.value = false loading.value = false
@@ -71,9 +66,9 @@ const save = async () => {
let value = data[key] let value = data[key]
let formData = [] let formData = []
if (Array.isArray(value) || typeof(value) === 'object') { if (Array.isArray(value) || typeof value === 'object') {
value = JSON.stringify(value) value = JSON.stringify(value)
} else if (typeof(value) === 'boolean') { } else if (typeof value === 'boolean') {
value = value ? 1 : 0 value = value ? 1 : 0
} }
@@ -95,3 +90,10 @@ const save = async () => {
} }
} }
</script> </script>
<style scoped>
#error {
padding-top: 10px;
color: red;
}
</style>
+4 -1
View File
@@ -35,7 +35,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
@end="update" @end="update"
> >
<template #item="{ element }"> <template #item="{ element }">
<div class="draggable" v-if="element.name !== ''"> <div
v-if="element.name !== ''"
class="draggable"
>
<span class="arrow">⇅</span> <span class="arrow">⇅</span>
{{ element.name }} {{ element.name }}
</div> </div>
+1 -1
View File
@@ -688,6 +688,6 @@ onMounted(async () => {
.save { .save {
display: block; display: block;
float: right float: right;
} }
</style> </style>
+18 -6
View File
@@ -19,12 +19,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
v-if="config" v-if="config"
app-name="side_menu" app-name="side_menu"
> >
<NcAppContent class="side-menu-setting-app" v-if="config['force']"> <NcAppContent
v-if="config['force']"
class="side-menu-setting-app"
>
<TableContainer> <TableContainer>
<TableLabel label="You do not have permission to change the settings." /> <TableLabel label="You do not have permission to change the settings." />
</TableContainer> </TableContainer>
</NcAppContent> </NcAppContent>
<NcAppContent v-else class="side-menu-setting-app side-menu-setting-app--user"> <NcAppContent
v-else
class="side-menu-setting-app side-menu-setting-app--user"
>
<TableContainer> <TableContainer>
<SectionTitle label="Menu" /> <SectionTitle label="Menu" />
@@ -64,11 +70,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
:middle="true" :middle="true"
/> />
<TableValue> <TableValue>
<FormSelect v-model="config['target-blank-mode']" :options="[ <FormSelect
v-model="config['target-blank-mode']"
:options="[
{ id: 1, label: 'Use the global setting' }, { id: 1, label: 'Use the global setting' },
{ id: 2, label: 'Use my selection' }, { id: 2, label: 'Use my selection' },
]" /> ]"
<FormAppPicker v-if="config['target-blank-mode'] === 2" v-model="config['target-blank-apps']" /> />
<FormAppPicker
v-if="config['target-blank-mode'] === 2"
v-model="config['target-blank-apps']"
/>
</TableValue> </TableValue>
</TableRow> </TableRow>
<TableRow> <TableRow>
@@ -166,6 +178,6 @@ onMounted(async () => {
.save { .save {
display: block; display: block;
float: right float: right;
} }
</style> </style>
-1
View File
@@ -16,7 +16,6 @@
*/ */
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { ref } from 'vue'
import axios from '@nextcloud/axios' import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router'