Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/User/Info.vue
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | <div class="container"> | ||||
<label for="greylist_enabled" class="col-sm-4 col-form-label">{{ $t('user.greylisting') }}</label> | <label for="greylist_enabled" class="col-sm-4 col-form-label">{{ $t('user.greylisting') }}</label> | ||||
<div class="col-sm-8 pt-2"> | <div class="col-sm-8 pt-2"> | ||||
<input type="checkbox" id="greylist_enabled" name="greylist_enabled" value="1" class="form-check-input d-block mb-2" :checked="user.config.greylist_enabled"> | <input type="checkbox" id="greylist_enabled" name="greylist_enabled" value="1" class="form-check-input d-block mb-2" :checked="user.config.greylist_enabled"> | ||||
<small id="greylisting-hint" class="text-muted"> | <small id="greylisting-hint" class="text-muted"> | ||||
{{ $t('user.greylisting-text') }} | {{ $t('user.greylisting-text') }} | ||||
</small> | </small> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div v-if="$root.hasPermission('beta')" class="row checkbox mb-3"> | |||||
<label for="guam_enabled" class="col-sm-4 col-form-label"> | |||||
{{ $t('user.imapproxy') }} | |||||
<sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup> | |||||
</label> | |||||
<div class="col-sm-8 pt-2"> | |||||
<input type="checkbox" id="guam_enabled" name="guam_enabled" value="1" class="form-check-input d-block mb-2" :checked="user.config.guam_enabled"> | |||||
<small id="guam-hint" class="text-muted"> | |||||
{{ $t('user.imapproxy-text') }} | |||||
</small> | |||||
</div> | |||||
</div> | |||||
<div v-if="$root.hasPermission('beta')" class="row mb-3"> | <div v-if="$root.hasPermission('beta')" class="row mb-3"> | ||||
<label for="limit_geo" class="col-sm-4 col-form-label"> | <label for="limit_geo" class="col-sm-4 col-form-label"> | ||||
{{ $t('user.geolimit') }} | {{ $t('user.geolimit') }} | ||||
<sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup> | <sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup> | ||||
</label> | </label> | ||||
<div class="col-sm-8 pt-2"> | <div class="col-sm-8 pt-2"> | ||||
<country-select id="limit_geo" v-model="user.config.limit_geo"></country-select> | <country-select id="limit_geo" v-model="user.config.limit_geo"></country-select> | ||||
<small id="geolimit-hint" class="text-muted"> | <small id="geolimit-hint" class="text-muted"> | ||||
▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | export default { | ||||
this.$router.push({ name: 'users' }) | this.$router.push({ name: 'users' }) | ||||
}) | }) | ||||
}, | }, | ||||
submitSettings() { | submitSettings() { | ||||
this.$root.clearFormValidation($('#settings form')) | this.$root.clearFormValidation($('#settings form')) | ||||
let post = this.$root.pick(this.user.config, ['limit_geo']) | let post = this.$root.pick(this.user.config, ['limit_geo']) | ||||
post.greylist_enabled = $('#greylist_enabled').prop('checked') ? 1 : 0 | const checklist = ['greylist_enabled', 'guam_enabled'] | ||||
checklist.forEach(name => { | |||||
if ($('#' + name).length) { | |||||
post[name] = $('#' + name).prop('checked') ? 1 : 0 | |||||
} | |||||
}) | |||||
axios.post('/api/v4/users/' + this.user_id + '/config', post) | axios.post('/api/v4/users/' + this.user_id + '/config', post) | ||||
.then(response => { | .then(response => { | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
}) | }) | ||||
}, | }, | ||||
statusUpdate(user) { | statusUpdate(user) { | ||||
this.user = Object.assign({}, this.user, user) | this.user = Object.assign({}, this.user, user) | ||||
Show All 23 Lines |