Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Admin/Domain.vue
Show All 16 Lines | <div v-if="domain" class="container"> | ||||
<label for="first_name" class="col-sm-4 col-form-label">Status</label> | <label for="first_name" class="col-sm-4 col-form-label">Status</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<span class="form-control-plaintext" id="status"> | <span class="form-control-plaintext" id="status"> | ||||
<span :class="$root.domainStatusClass(domain)">{{ $root.domainStatusText(domain) }}</span> | <span :class="$root.domainStatusClass(domain)">{{ $root.domainStatusText(domain) }}</span> | ||||
</span> | </span> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</form> | </form> | ||||
<div class="mt-2"> | |||||
<button v-if="!domain.isSuspended" id="button-suspend" class="btn btn-warning" type="button" @click="suspendDomain">Suspend</button> | |||||
<button v-if="domain.isSuspended" id="button-unsuspend" class="btn btn-warning" type="button" @click="unsuspendDomain">Unsuspend</button> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<ul class="nav nav-tabs mt-3" role="tablist"> | <ul class="nav nav-tabs mt-3" role="tablist"> | ||||
<li class="nav-item"> | <li class="nav-item"> | ||||
<a class="nav-link active" id="tab-config" href="#domain-config" role="tab" aria-controls="domain-config" aria-selected="true"> | <a class="nav-link active" id="tab-config" href="#domain-config" role="tab" aria-controls="domain-config" aria-selected="true"> | ||||
Configuration | Configuration | ||||
</a> | </a> | ||||
Show All 26 Lines | export default { | ||||
axios.get('/api/v4/domains/' + domain_id) | axios.get('/api/v4/domains/' + domain_id) | ||||
.then(response => { | .then(response => { | ||||
this.domain = response.data | this.domain = response.data | ||||
}) | }) | ||||
.catch(this.$root.errorHandler) | .catch(this.$root.errorHandler) | ||||
}, | }, | ||||
methods: { | methods: { | ||||
suspendDomain() { | |||||
axios.post('/api/v4/domains/' + this.domain.id + '/suspend', {}) | |||||
.then(response => { | |||||
if (response.data.status == 'success') { | |||||
this.$toast.success(response.data.message) | |||||
this.domain = Object.assign({}, this.domain, { isSuspended: true }) | |||||
} | |||||
}) | |||||
}, | |||||
unsuspendDomain() { | |||||
axios.post('/api/v4/domains/' + this.domain.id + '/unsuspend', {}) | |||||
.then(response => { | |||||
if (response.data.status == 'success') { | |||||
this.$toast.success(response.data.message) | |||||
this.domain = Object.assign({}, this.domain, { isSuspended: false }) | |||||
} | |||||
}) | |||||
} | |||||
} | } | ||||
} | } | ||||
</script> | </script> |