mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
add state users and domains as options getter to be used with selects
This commit is contained in:
parent
f7e47e620c
commit
84374cdd53
2 changed files with 20 additions and 3 deletions
|
@ -143,6 +143,19 @@ export default {
|
|||
},
|
||||
|
||||
getters: {
|
||||
usersAsOptions: state => {
|
||||
const choices = Object.values(state.users).map(({ username, fullname, mail }) => {
|
||||
return { text: `${fullname} (${mail})`, value: username }
|
||||
})
|
||||
return { choices, value: choices[0].value }
|
||||
},
|
||||
|
||||
domainsAsOptions: state => {
|
||||
const mainDomain = state.main_domain
|
||||
const choices = state.domains.map(domain => {
|
||||
return { value: domain, text: domain === mainDomain ? domain + ' ★' : domain }
|
||||
})
|
||||
return { choices, value: mainDomain }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,10 +188,10 @@ export default {
|
|||
],
|
||||
apps: undefined,
|
||||
// Set by user inputs
|
||||
category: 'office',
|
||||
category: null,
|
||||
subtag: 'all',
|
||||
search: '',
|
||||
quality: 'all',
|
||||
quality: 'isDecentQuality',
|
||||
selectedApp: {
|
||||
// Set some basic values to avoid modal errors
|
||||
state: 'lowquality',
|
||||
|
@ -345,7 +345,11 @@ export default {
|
|||
},
|
||||
|
||||
goToCustomAppInstallForm () {
|
||||
this.$router.push({ name: 'app-install-custom', params: { id: this.form.url } })
|
||||
const url = this.form.url
|
||||
this.$router.push({
|
||||
name: 'app-install-custom',
|
||||
params: { id: url.endsWith('/') ? url : url + '/' }
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue