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 mb-3"> | |||||
<label for="limit_geo" class="col-sm-4 col-form-label"> | |||||
{{ $t('user.geolimit') }} | |||||
<sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup> | |||||
</label> | |||||
<div class="col-sm-8 pt-2"> | |||||
<country-select id="limit_geo" v-model="user.config.limit_geo"></country-select> | |||||
<small id="geolimit-hint" class="text-muted"> | |||||
{{ $t('user.geolimit-text') }} | |||||
</small> | |||||
</div> | |||||
</div> | |||||
<btn class="btn-primary" type="submit" icon="check">{{ $t('btn.submit') }}</btn> | <btn class="btn-primary" type="submit" icon="check">{{ $t('btn.submit') }}</btn> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<modal-dialog id="delete-warning" ref="deleteWarning" :buttons="['delete']" :cancel-focus="true" @click="deleteUser()" | <modal-dialog id="delete-warning" ref="deleteWarning" :buttons="['delete']" :cancel-focus="true" @click="deleteUser()" | ||||
:title="$t('user.delete-email', { email: user.email })" | :title="$t('user.delete-email', { email: user.email })" | ||||
> | > | ||||
<p>{{ $t('user.delete-text') }}</p> | <p>{{ $t('user.delete-text') }}</p> | ||||
</modal-dialog> | </modal-dialog> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import CountrySelect from '../Widgets/CountrySelect' | |||||
import ListInput from '../Widgets/ListInput' | import ListInput from '../Widgets/ListInput' | ||||
import ModalDialog from '../Widgets/ModalDialog' | import ModalDialog from '../Widgets/ModalDialog' | ||||
import PackageSelect from '../Widgets/PackageSelect' | import PackageSelect from '../Widgets/PackageSelect' | ||||
import PasswordInput from '../Widgets/PasswordInput' | import PasswordInput from '../Widgets/PasswordInput' | ||||
import StatusComponent from '../Widgets/Status' | import StatusComponent from '../Widgets/Status' | ||||
import SubscriptionSelect from '../Widgets/SubscriptionSelect' | import SubscriptionSelect from '../Widgets/SubscriptionSelect' | ||||
import { library } from '@fortawesome/fontawesome-svg-core' | import { library } from '@fortawesome/fontawesome-svg-core' | ||||
library.add( | library.add( | ||||
require('@fortawesome/free-regular-svg-icons/faClipboard').definition, | require('@fortawesome/free-regular-svg-icons/faClipboard').definition, | ||||
) | ) | ||||
export default { | export default { | ||||
components: { | components: { | ||||
CountrySelect, | |||||
ListInput, | ListInput, | ||||
ModalDialog, | ModalDialog, | ||||
PackageSelect, | PackageSelect, | ||||
PasswordInput, | PasswordInput, | ||||
StatusComponent, | StatusComponent, | ||||
SubscriptionSelect | SubscriptionSelect | ||||
}, | }, | ||||
data() { | data() { | ||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | export default { | ||||
} | } | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'users' }) | this.$router.push({ name: 'users' }) | ||||
}) | }) | ||||
}, | }, | ||||
submitSettings() { | submitSettings() { | ||||
this.$root.clearFormValidation($('#settings form')) | this.$root.clearFormValidation($('#settings form')) | ||||
let post = { greylist_enabled: $('#greylist_enabled').prop('checked') ? 1 : 0 } | |||||
let post = this.$root.pick(this.user.config, ['limit_geo']) | |||||
post.greylist_enabled = $('#greylist_enabled').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 |