mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-25 11:04:25 +01:00
Improved pre-commit and linters config
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<span class="text-h4">{{ $gettext('Edit account') }}</span>
|
||||
<div class="mt-4" />
|
||||
<AccountEditForm />
|
||||
<span class="text-h4">{{ $gettext('Edit account') }}</span>
|
||||
<div class="mt-4" />
|
||||
<AccountEditForm />
|
||||
</template>
|
||||
|
||||
<script setup lang="js">
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
<template>
|
||||
<v-toolbar flat>
|
||||
<v-toolbar-title>
|
||||
{{ $gettext('Account') }} {{ account.username }}
|
||||
<v-btn
|
||||
color="primary"
|
||||
icon="mdi-circle-edit-outline"
|
||||
:to="{ name: 'AccountEdit', params: { id: account.pk } }"
|
||||
/>
|
||||
<v-btn color="primary" icon="mdi-reload" @click="refreshAccount" />
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
<AccountSummary :account="account" />
|
||||
<DomainAdminDomains
|
||||
v-if="account.role === 'DomainAdmins'"
|
||||
class="mt-2"
|
||||
:account="account"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="6">
|
||||
<ResourcesView
|
||||
v-if="
|
||||
limitsConfig.params &&
|
||||
limitsConfig.params.enable_admin_limits &&
|
||||
account.role !== 'SimpleUsers' &&
|
||||
account.role !== 'SuperAdmins'
|
||||
"
|
||||
:resources="account.resources"
|
||||
/>
|
||||
<AccountAliases v-if="account.aliases" class="mt-2" :account="account" />
|
||||
<AccountSenderAddresses
|
||||
v-if="account.mailbox"
|
||||
class="mt-2"
|
||||
:account="account"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-toolbar flat>
|
||||
<v-toolbar-title>
|
||||
{{ $gettext('Account') }} {{ account.username }}
|
||||
<v-btn
|
||||
color="primary"
|
||||
icon="mdi-circle-edit-outline"
|
||||
:to="{ name: 'AccountEdit', params: { id: account.pk } }"
|
||||
/>
|
||||
<v-btn color="primary" icon="mdi-reload" @click="refreshAccount" />
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
<AccountSummary :account="account" />
|
||||
<DomainAdminDomains
|
||||
v-if="account.role === 'DomainAdmins'"
|
||||
class="mt-2"
|
||||
:account="account"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="6">
|
||||
<ResourcesView
|
||||
v-if="
|
||||
limitsConfig.params &&
|
||||
limitsConfig.params.enable_admin_limits &&
|
||||
account.role !== 'SimpleUsers' &&
|
||||
account.role !== 'SuperAdmins'
|
||||
"
|
||||
:resources="account.resources"
|
||||
/>
|
||||
<AccountAliases
|
||||
v-if="account.aliases"
|
||||
class="mt-2"
|
||||
:account="account"
|
||||
/>
|
||||
<AccountSenderAddresses
|
||||
v-if="account.mailbox"
|
||||
class="mt-2"
|
||||
:account="account"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script setup lang="js">
|
||||
@@ -54,25 +58,25 @@ const route = useRoute()
|
||||
const accountsStore = useAccountsStore()
|
||||
|
||||
const account = computed(() => {
|
||||
if (accountsStore.accounts[route.params.id] !== undefined) {
|
||||
return accountsStore.accounts[route.params.id]
|
||||
}
|
||||
refreshAccount()
|
||||
return { pk: route.params.id }
|
||||
if (accountsStore.accounts[route.params.id] !== undefined) {
|
||||
return accountsStore.accounts[route.params.id]
|
||||
}
|
||||
refreshAccount()
|
||||
return { pk: route.params.id }
|
||||
})
|
||||
const limitsConfig = ref({})
|
||||
|
||||
parametersApi.getApplication('limits').then((resp) => {
|
||||
limitsConfig.value = resp.data
|
||||
limitsConfig.value = resp.data
|
||||
})
|
||||
|
||||
function refreshAccount() {
|
||||
accountsStore.getAccount(route.params.id)
|
||||
accountsStore.getAccount(route.params.id)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.v-toolbar {
|
||||
background-color: #f7f8fa !important;
|
||||
background-color: #f7f8fa !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<span class="text-h4">{{ $gettext('Edit alias') }}</span>
|
||||
<div class="mt-4" />
|
||||
<AliasEditForm :alias="alias" />
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-h4">{{ $gettext('Edit alias') }}</span>
|
||||
<div class="mt-4" />
|
||||
<AliasEditForm :alias="alias" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="js">
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar flat>
|
||||
<v-toolbar-title>
|
||||
{{ $gettext('Alias') }} {{ alias.address }}
|
||||
<v-btn
|
||||
color="primary"
|
||||
icon="mdi-circle-edit-outline"
|
||||
:to="{ name: 'AliasEdit', params: { id: alias.pk } }"
|
||||
/>
|
||||
<v-btn color="primary" icon="mdi-reload" @click="refreshAlias()" />
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
<AliasSummary :alias="alias" />
|
||||
<AliasRecipientsSummary :alias="alias" class="mt-2" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div>
|
||||
<v-toolbar flat>
|
||||
<v-toolbar-title>
|
||||
{{ $gettext('Alias') }} {{ alias.address }}
|
||||
<v-btn
|
||||
color="primary"
|
||||
icon="mdi-circle-edit-outline"
|
||||
:to="{ name: 'AliasEdit', params: { id: alias.pk } }"
|
||||
/>
|
||||
<v-btn
|
||||
color="primary"
|
||||
icon="mdi-reload"
|
||||
@click="refreshAlias()"
|
||||
/>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
<AliasSummary :alias="alias" />
|
||||
<AliasRecipientsSummary :alias="alias" class="mt-2" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="js">
|
||||
@@ -33,20 +37,20 @@ const aliasesStore = useAliasesStore()
|
||||
const route = useRoute()
|
||||
|
||||
const alias = computed(() => {
|
||||
if (aliasesStore.aliases[route.params.id] !== undefined) {
|
||||
return aliasesStore.aliases[route.params.id]
|
||||
}
|
||||
refreshAlias()
|
||||
return { pk: route.params.id }
|
||||
if (aliasesStore.aliases[route.params.id] !== undefined) {
|
||||
return aliasesStore.aliases[route.params.id]
|
||||
}
|
||||
refreshAlias()
|
||||
return { pk: route.params.id }
|
||||
})
|
||||
|
||||
function refreshAlias() {
|
||||
aliasesStore.getAlias(route.params.id)
|
||||
aliasesStore.getAlias(route.params.id)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.v-toolbar {
|
||||
background-color: #f7f8fa !important;
|
||||
background-color: #f7f8fa !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,97 +1,108 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar flat>
|
||||
<v-toolbar-title>{{ $gettext('Identities') }}</v-toolbar-title>
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
class="mr-2"
|
||||
:title="$gettext('Import accounts and aliases from CSV file')"
|
||||
variant="elevated"
|
||||
icon="mdi-file-import-outline"
|
||||
@click="showImportForm = true"
|
||||
></v-btn>
|
||||
<v-btn
|
||||
class="mr-2"
|
||||
:title="$gettext('Export accounts and aliases to CSV')"
|
||||
icon="mdi-file-export-outline"
|
||||
variant="elevated"
|
||||
@click="exportIdentities"
|
||||
></v-btn>
|
||||
<v-menu offset-y>
|
||||
<template #activator="{ props }">
|
||||
<v-btn
|
||||
color="primary"
|
||||
variant="flat"
|
||||
v-bind="props"
|
||||
prepend-icon="mdi-plus"
|
||||
>
|
||||
{{ $gettext('New') }}
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list density="compact">
|
||||
<v-list-item @click="showCreationWizard = true">
|
||||
<v-list-item-title>{{ $gettext('Account') }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="showAliasCreationWizard = true">
|
||||
<v-list-item-title>{{ $gettext('Alias') }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
<div>
|
||||
<v-toolbar flat>
|
||||
<v-toolbar-title>{{ $gettext('Identities') }}</v-toolbar-title>
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
class="mr-2"
|
||||
:title="$gettext('Import accounts and aliases from CSV file')"
|
||||
variant="elevated"
|
||||
icon="mdi-file-import-outline"
|
||||
@click="showImportForm = true"
|
||||
></v-btn>
|
||||
<v-btn
|
||||
class="mr-2"
|
||||
:title="$gettext('Export accounts and aliases to CSV')"
|
||||
icon="mdi-file-export-outline"
|
||||
variant="elevated"
|
||||
@click="exportIdentities"
|
||||
></v-btn>
|
||||
<v-menu offset-y>
|
||||
<template #activator="{ props }">
|
||||
<v-btn
|
||||
color="primary"
|
||||
variant="flat"
|
||||
v-bind="props"
|
||||
prepend-icon="mdi-plus"
|
||||
>
|
||||
{{ $gettext('New') }}
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list density="compact">
|
||||
<v-list-item @click="showCreationWizard = true">
|
||||
<v-list-item-title>{{
|
||||
$gettext('Account')
|
||||
}}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="showAliasCreationWizard = true">
|
||||
<v-list-item-title>{{
|
||||
$gettext('Alias')
|
||||
}}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
|
||||
<IdentityList />
|
||||
<v-dialog
|
||||
v-model="showAliasCreationWizard"
|
||||
fullscreen
|
||||
scrollable
|
||||
z-index="10"
|
||||
>
|
||||
<AliasCreationForm @close="showAliasCreationWizard = false" />
|
||||
</v-dialog>
|
||||
<IdentityList />
|
||||
<v-dialog
|
||||
v-model="showAliasCreationWizard"
|
||||
fullscreen
|
||||
scrollable
|
||||
z-index="10"
|
||||
>
|
||||
<AliasCreationForm @close="showAliasCreationWizard = false" />
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="showCreationWizard" fullscreen scrollable z-index="10">
|
||||
<AccountCreationForm @close="showCreationWizard = false" />
|
||||
</v-dialog>
|
||||
<v-dialog
|
||||
v-model="showCreationWizard"
|
||||
fullscreen
|
||||
scrollable
|
||||
z-index="10"
|
||||
>
|
||||
<AccountCreationForm @close="showCreationWizard = false" />
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="showImportForm" persistent max-width="800px">
|
||||
<ImportForm
|
||||
ref="importForm"
|
||||
:title="$gettext('Import identities')"
|
||||
@submit="importIdentities"
|
||||
@close="showImportForm = false"
|
||||
>
|
||||
<template #help>
|
||||
<ul>
|
||||
<li>
|
||||
<em
|
||||
>account; loginname; password; first name; last name; enabled;
|
||||
group; address; quota; [, domain, ...]</em
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<em
|
||||
>alias; address; enabled; recipient; [more recipients; ...]</em
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
<template #extraFields="{ form }">
|
||||
<v-switch
|
||||
v-model="form.crypt_passwords"
|
||||
:label="$gettext('Crypt passwords')"
|
||||
color="primary"
|
||||
density="compact"
|
||||
:hint="
|
||||
$gettext(
|
||||
'Check this option if passwords contained in your file are not crypted'
|
||||
)
|
||||
"
|
||||
persistent-hint
|
||||
/>
|
||||
</template>
|
||||
</ImportForm>
|
||||
</v-dialog>
|
||||
</div>
|
||||
<v-dialog v-model="showImportForm" persistent max-width="800px">
|
||||
<ImportForm
|
||||
ref="importForm"
|
||||
:title="$gettext('Import identities')"
|
||||
@submit="importIdentities"
|
||||
@close="showImportForm = false"
|
||||
>
|
||||
<template #help>
|
||||
<ul>
|
||||
<li>
|
||||
<em
|
||||
>account; loginname; password; first name; last
|
||||
name; enabled; group; address; quota; [, domain,
|
||||
...]</em
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<em
|
||||
>alias; address; enabled; recipient; [more
|
||||
recipients; ...]</em
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
<template #extraFields="{ form }">
|
||||
<v-switch
|
||||
v-model="form.crypt_passwords"
|
||||
:label="$gettext('Crypt passwords')"
|
||||
color="primary"
|
||||
density="compact"
|
||||
:hint="
|
||||
$gettext(
|
||||
'Check this option if passwords contained in your file are not crypted'
|
||||
)
|
||||
"
|
||||
persistent-hint
|
||||
/>
|
||||
</template>
|
||||
</ImportForm>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="js">
|
||||
@@ -113,23 +124,23 @@ const showImportForm = ref(false)
|
||||
const importForm = ref()
|
||||
|
||||
function exportIdentities() {
|
||||
identitiesApi.exportAll().then((resp) => {
|
||||
exportContent(resp.data, 'identities', $gettext)
|
||||
})
|
||||
identitiesApi.exportAll().then((resp) => {
|
||||
exportContent(resp.data, 'identities', $gettext)
|
||||
})
|
||||
}
|
||||
|
||||
function importIdentities(data, form) {
|
||||
data.append('crypt_passwords', form.crypt_passwords)
|
||||
importContent(identitiesApi, data, importForm, $gettext)
|
||||
data.append('crypt_passwords', form.crypt_passwords)
|
||||
importContent(identitiesApi, data, importForm, $gettext)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.v-toolbar {
|
||||
background-color: #f7f8fa !important;
|
||||
background-color: #f7f8fa !important;
|
||||
}
|
||||
|
||||
.v-tabs-items {
|
||||
background-color: #f7f8fa !important;
|
||||
background-color: #f7f8fa !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user