Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Room/Info.vue
Show All 18 Lines | <div class="container"> | ||||
<form @submit.prevent="submit" class="card-body"> | <form @submit.prevent="submit" class="card-body"> | ||||
<div class="row mb-3"> | <div class="row mb-3"> | ||||
<label for="description" class="col-sm-4 col-form-label">{{ $t('form.description') }}</label> | <label for="description" class="col-sm-4 col-form-label">{{ $t('form.description') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<input type="text" class="form-control" id="description" v-model="room.description"> | <input type="text" class="form-control" id="description" v-model="room.description"> | ||||
<small class="form-text">{{ $t('room.description-hint') }}</small> | <small class="form-text">{{ $t('room.description-hint') }}</small> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div v-if="room.isOwner" id="room-skus" class="row mb-3"> | <div v-if="room_id === 'new' || room.isOwner" id="room-skus" class="row mb-3"> | ||||
<label class="col-sm-4 col-form-label">{{ $t('form.subscriptions') }}</label> | <label class="col-sm-4 col-form-label">{{ $t('form.subscriptions') }}</label> | ||||
<subscription-select class="col-sm-8 pt-sm-1" ref="skus" :object="room" type="room"></subscription-select> | <subscription-select class="col-sm-8 pt-sm-1" ref="skus" :object="room" type="room" :readonly="true"></subscription-select> | ||||
</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 v-if="room.canUpdate" :class="'tab-pane' + (!tabs.includes('form.general') ? ' show active' : '')" id="settings" role="tabpanel" aria-labelledby="tab-settings"> | <div v-if="room.canUpdate" :class="'tab-pane' + (!tabs.includes('form.general') ? ' show active' : '')" 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="password" class="col-sm-4 col-form-label">{{ $t('form.password') }}</label> | <label for="password" class="col-sm-4 col-form-label">{{ $t('form.password') }}</label> | ||||
Show All 40 Lines | <script> | ||||
export default { | export default { | ||||
components: { | components: { | ||||
AclInput, | AclInput, | ||||
SubscriptionSelect | SubscriptionSelect | ||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
href: '', | href: '', | ||||
room_id: null, | |||||
room: { config: { acl: [] } }, | room: { config: { acl: [] } }, | ||||
roomRoute: '' | roomRoute: '' | ||||
} | } | ||||
}, | }, | ||||
computed: { | computed: { | ||||
tabs() { | tabs() { | ||||
let tabs = [] | let tabs = [] | ||||
if (!this.room.id || this.room.isOwner) { | if (!this.room.id || this.room.isOwner) { | ||||
tabs.push('form.general') | tabs.push('form.general') | ||||
} | } | ||||
if (this.room.canUpdate) { | if (this.room.canUpdate) { | ||||
tabs.push('form.settings') | tabs.push('form.settings') | ||||
} | } | ||||
return tabs | return tabs | ||||
}, | }, | ||||
}, | }, | ||||
created() { | created() { | ||||
const room_id = this.$route.params.room | this.room_id = this.$route.params.room | ||||
if (room_id != 'new') { | if (this.room_id != 'new') { | ||||
axios.get('/api/v4/rooms/' + room_id, { loader: true }) | axios.get('/api/v4/rooms/' + this.room_id, { loader: true }) | ||||
.then(response => { | .then(response => { | ||||
this.room = response.data | this.room = response.data | ||||
this.roomRoute = '/meet/' + encodeURI(this.room.name) | this.roomRoute = '/meet/' + encodeURI(this.room.name) | ||||
this.href = window.config['app.url'] + this.roomRoute | this.href = window.config['app.url'] + this.roomRoute | ||||
}) | }) | ||||
.catch(this.$root.errorHandler) | .catch(this.$root.errorHandler) | ||||
} | } | ||||
}, | }, | ||||
Show All 15 Lines | export default { | ||||
let method = 'post' | let method = 'post' | ||||
let location = '/api/v4/rooms' | let location = '/api/v4/rooms' | ||||
let post = this.$root.pick(this.room, ['description']) | let post = this.$root.pick(this.room, ['description']) | ||||
if (this.room.id) { | if (this.room.id) { | ||||
method = 'put' | method = 'put' | ||||
location += '/' + this.room.id | location += '/' + this.room.id | ||||
post.skus = this.$refs.skus.getSkus() | |||||
} | } | ||||
// 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('/rooms') | this.$router.push('/rooms') | ||||
}) | }) | ||||
}, | }, | ||||
submitSettings() { | submitSettings() { | ||||
this.$root.clearFormValidation($('#settings form')) | this.$root.clearFormValidation($('#settings form')) | ||||
Show All 11 Lines |