Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Resource/Info.vue
Show All 34 Lines | <div class="container"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div v-if="resource.email" class="row mb-3"> | <div v-if="resource.email" class="row mb-3"> | ||||
<label for="email" class="col-sm-4 col-form-label">{{ $t('form.email') }}</label> | <label for="email" class="col-sm-4 col-form-label">{{ $t('form.email') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<input type="text" class="form-control" id="email" disabled v-model="resource.email"> | <input type="text" class="form-control" id="email" disabled v-model="resource.email"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div v-if="resource_id === 'new' || resource.id" id="resource-skus" class="row mb-3"> | |||||
<label class="col-sm-4 col-form-label">{{ $t('form.subscriptions') }}</label> | |||||
<subscription-select class="col-sm-8 pt-sm-1" ref="skus" :object="resource" type="resource" :readonly="true"></subscription-select> | |||||
</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 class="tab-pane" id="settings" role="tabpanel" aria-labelledby="tab-settings"> | <div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="tab-settings"> | ||||
<form @submit.prevent="submitSettings" class="card-body"> | <form @submit.prevent="submitSettings" class="card-body"> | ||||
<div class="row mb-3"> | <div class="row mb-3"> | ||||
<label for="invitation_policy" class="col-sm-4 col-form-label">{{ $t('resource.invitation-policy') }}</label> | <label for="invitation_policy" class="col-sm-4 col-form-label">{{ $t('resource.invitation-policy') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
Show All 17 Lines | <div class="container"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import StatusComponent from '../Widgets/Status' | import StatusComponent from '../Widgets/Status' | ||||
import SubscriptionSelect from '../Widgets/SubscriptionSelect' | |||||
export default { | export default { | ||||
components: { | components: { | ||||
StatusComponent | StatusComponent, | ||||
SubscriptionSelect | |||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
domains: [], | domains: [], | ||||
resource_id: null, | resource_id: null, | ||||
resource: { config: {} }, | resource: { config: {} }, | ||||
status: {} | status: {} | ||||
} | } | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | export default { | ||||
statusUpdate(resource) { | statusUpdate(resource) { | ||||
this.resource = Object.assign({}, this.resource, resource) | this.resource = Object.assign({}, this.resource, resource) | ||||
}, | }, | ||||
submit() { | submit() { | ||||
this.$root.clearFormValidation($('#resource-info form')) | this.$root.clearFormValidation($('#resource-info form')) | ||||
let method = 'post' | let method = 'post' | ||||
let location = '/api/v4/resources' | let location = '/api/v4/resources' | ||||
let post = this.$root.pick(this.resource, ['id', 'name', 'domain']) | |||||
if (this.resource_id !== 'new') { | if (this.resource_id !== 'new') { | ||||
method = 'put' | method = 'put' | ||||
location += '/' + this.resource_id | location += '/' + this.resource_id | ||||
} | } | ||||
const post = this.$root.pick(this.resource, ['id', 'name', 'domain']) | // post.skus = this.$refs.skus.getSkus() | ||||
axios[method](location, post) | axios[method](location, post) | ||||
.then(response => { | .then(response => { | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'resources' }) | this.$router.push({ name: 'resources' }) | ||||
}) | }) | ||||
}, | }, | ||||
submitSettings() { | submitSettings() { | ||||
Show All 18 Lines |