|
|
@ -1,17 +1,19 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<q-tabs no-pane-border inverted>
|
|
|
|
<q-tabs v-model="tab" no-pane-border inverted class="sourceset-tabs">
|
|
|
|
<q-tab v-for="(sourceset, index) in destinations" :default="index === 0"
|
|
|
|
<q-tab v-for="(sourceset, index) in destinations" :default="index === 0"
|
|
|
|
:count="destinationsCount(sourceset.destinationGroups)"
|
|
|
|
:count="destinationsCount(sourceset.destinationGroups)"
|
|
|
|
:key="sourceset.sourcesetId || 0" slot="title"
|
|
|
|
:key="sourceset.sourcesetId || 0" slot="title"
|
|
|
|
:name="sourceset.sourcesetName || 'Everybody'" icon="people"
|
|
|
|
:name="sourceset.sourcesetName || 'Everybody'" icon="people"
|
|
|
|
:label="sourceset.sourcesetName || 'Everybody'" />
|
|
|
|
:label="sourceset.sourcesetName || 'Everybody'" />
|
|
|
|
|
|
|
|
<q-tab slot="title" label="Add new" name="addnew" icon="fa-plus" />
|
|
|
|
<q-tab-pane v-for="sourceset in destinations"
|
|
|
|
<q-tab-pane v-for="sourceset in destinations"
|
|
|
|
:key="sourceset.sourcesetId || 0"
|
|
|
|
:key="sourceset.sourcesetId || 0"
|
|
|
|
:name="sourceset.sourcesetName || 'Everybody'">
|
|
|
|
:name="sourceset.sourcesetName || 'Everybody'" class="sourceset-pane">
|
|
|
|
<div class="sources-section" v-if="sourceset.sourcesetId">
|
|
|
|
<div class="sources-section" v-if="sourceset.sourcesetId">
|
|
|
|
<div class="sources-title">
|
|
|
|
<div class="sources-title">
|
|
|
|
<q-icon name="contact_phone" class="sources-icon" />
|
|
|
|
<q-icon name="contact_phone" class="sources-icon" />
|
|
|
|
{{ $t('pages.callForward.titles.sources') }}
|
|
|
|
{{ $t('pages.callForward.sources.sourcesTitleMode',
|
|
|
|
|
|
|
|
{ mode: capitalizedMode(sourceset.sourcesetMode) }) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<q-list no-border>
|
|
|
|
<q-list no-border>
|
|
|
|
<q-item highlight separator
|
|
|
|
<q-item highlight separator
|
|
|
@ -26,11 +28,52 @@
|
|
|
|
:timeset="timesetName"
|
|
|
|
:timeset="timesetName"
|
|
|
|
:destinations="sourceset.destinationGroups" />
|
|
|
|
:destinations="sourceset.destinationGroups" />
|
|
|
|
</q-tab-pane>
|
|
|
|
</q-tab-pane>
|
|
|
|
|
|
|
|
<q-tab-pane name="addnew">
|
|
|
|
|
|
|
|
<q-list no-border>
|
|
|
|
|
|
|
|
<q-item>
|
|
|
|
|
|
|
|
<q-item-main>
|
|
|
|
|
|
|
|
<q-item-tile class="row no-wrap">
|
|
|
|
|
|
|
|
<q-input
|
|
|
|
|
|
|
|
autofocus
|
|
|
|
|
|
|
|
class="col"
|
|
|
|
|
|
|
|
v-model="sourcesetName"
|
|
|
|
|
|
|
|
:float-label="$t('pages.callForward.sources.sourceset')"
|
|
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
|
|
@keyup.enter="addSourceset()" />
|
|
|
|
|
|
|
|
<q-input
|
|
|
|
|
|
|
|
class="col"
|
|
|
|
|
|
|
|
v-model="source"
|
|
|
|
|
|
|
|
:float-label="$t('pages.callForward.sources.source')"
|
|
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
|
|
@keyup.enter="addSourceset()" />
|
|
|
|
|
|
|
|
<q-select
|
|
|
|
|
|
|
|
v-model="mode"
|
|
|
|
|
|
|
|
:options="modes"
|
|
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
|
|
class="col"
|
|
|
|
|
|
|
|
align="right" />
|
|
|
|
|
|
|
|
</q-item-tile>
|
|
|
|
|
|
|
|
<q-item-tile>
|
|
|
|
|
|
|
|
<q-btn
|
|
|
|
|
|
|
|
flat
|
|
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
|
|
icon-right="fa-save"
|
|
|
|
|
|
|
|
@click="addSourceset()"
|
|
|
|
|
|
|
|
:disable="!isValid"
|
|
|
|
|
|
|
|
class="sourceset-add-button">
|
|
|
|
|
|
|
|
{{ $t('buttons.save') }}
|
|
|
|
|
|
|
|
</q-btn>
|
|
|
|
|
|
|
|
</q-item-tile>
|
|
|
|
|
|
|
|
</q-item-main>
|
|
|
|
|
|
|
|
</q-item>
|
|
|
|
|
|
|
|
</q-list>
|
|
|
|
|
|
|
|
</q-tab-pane>
|
|
|
|
</q-tabs>
|
|
|
|
</q-tabs>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import CscCallForwardDestinations from './CscCallForwardDestinations'
|
|
|
|
import CscCallForwardDestinations from './CscCallForwardDestinations'
|
|
|
|
|
|
|
|
import { showGlobalError } from '../../../helpers/ui'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
QTabs,
|
|
|
|
QTabs,
|
|
|
|
QTab,
|
|
|
|
QTab,
|
|
|
@ -38,7 +81,11 @@
|
|
|
|
QBtn,
|
|
|
|
QBtn,
|
|
|
|
QList,
|
|
|
|
QList,
|
|
|
|
QItem,
|
|
|
|
QItem,
|
|
|
|
QIcon
|
|
|
|
QItemMain,
|
|
|
|
|
|
|
|
QItemTile,
|
|
|
|
|
|
|
|
QInput,
|
|
|
|
|
|
|
|
QIcon,
|
|
|
|
|
|
|
|
QSelect
|
|
|
|
} from 'quasar-framework'
|
|
|
|
} from 'quasar-framework'
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'csc-sourcesets',
|
|
|
|
name: 'csc-sourcesets',
|
|
|
@ -47,6 +94,24 @@
|
|
|
|
'sourcesets',
|
|
|
|
'sourcesets',
|
|
|
|
'timesetName'
|
|
|
|
'timesetName'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
sourcesetName: '',
|
|
|
|
|
|
|
|
source: '',
|
|
|
|
|
|
|
|
mode: 'whitelist',
|
|
|
|
|
|
|
|
modes: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: 'Whitelist',
|
|
|
|
|
|
|
|
value: 'whitelist'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: 'Blacklist',
|
|
|
|
|
|
|
|
value: 'blacklist'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
tab: 'Everybody'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
CscCallForwardDestinations,
|
|
|
|
CscCallForwardDestinations,
|
|
|
|
QTabs,
|
|
|
|
QTabs,
|
|
|
@ -55,9 +120,27 @@
|
|
|
|
QBtn,
|
|
|
|
QBtn,
|
|
|
|
QList,
|
|
|
|
QList,
|
|
|
|
QItem,
|
|
|
|
QItem,
|
|
|
|
QIcon
|
|
|
|
QItemMain,
|
|
|
|
|
|
|
|
QItemTile,
|
|
|
|
|
|
|
|
QInput,
|
|
|
|
|
|
|
|
QIcon,
|
|
|
|
|
|
|
|
QSelect
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
isValid() {
|
|
|
|
|
|
|
|
return this.source.length > 0 && this.sourcesetName.length > 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
capitalizedMode(mode) {
|
|
|
|
|
|
|
|
return `${mode.charAt(0).toUpperCase()}${mode.slice(1)}`;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
resetForm() {
|
|
|
|
|
|
|
|
this.source = '';
|
|
|
|
|
|
|
|
this.sourcesetName = '';
|
|
|
|
|
|
|
|
this.mode = 'whitelist';
|
|
|
|
|
|
|
|
this.tab = 'Everybody';
|
|
|
|
|
|
|
|
},
|
|
|
|
sourcesetSources(id) {
|
|
|
|
sourcesetSources(id) {
|
|
|
|
return this.sourcesets.filter((sourceset) => {
|
|
|
|
return this.sourcesets.filter((sourceset) => {
|
|
|
|
return sourceset.id === id;
|
|
|
|
return sourceset.id === id;
|
|
|
@ -85,6 +168,18 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tabName(name) {
|
|
|
|
tabName(name) {
|
|
|
|
return name === null ? 'Everybody' : name;
|
|
|
|
return name === null ? 'Everybody' : name;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
addSourceset() {
|
|
|
|
|
|
|
|
if (this.isValid) {
|
|
|
|
|
|
|
|
this.$store.dispatch('callForward/createSourcesetWithSource', {
|
|
|
|
|
|
|
|
sourcesetName: this.sourcesetName,
|
|
|
|
|
|
|
|
source: this.source,
|
|
|
|
|
|
|
|
mode: this.mode
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
showGlobalError(this.$t('pages.callForward.sources.fieldMissing'));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -99,6 +194,17 @@
|
|
|
|
.q-item.source-item
|
|
|
|
.q-item.source-item
|
|
|
|
padding 0
|
|
|
|
padding 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.sourceset-tabs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.q-tab-pane
|
|
|
|
|
|
|
|
padding 12px 0 0 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.q-item
|
|
|
|
|
|
|
|
padding 8px 0 0 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.sourceset-add-button
|
|
|
|
|
|
|
|
margin-top 8px
|
|
|
|
|
|
|
|
|
|
|
|
.sources-section
|
|
|
|
.sources-section
|
|
|
|
padding 30px 0 20px 0
|
|
|
|
padding 30px 0 20px 0
|
|
|
|
|
|
|
|
|
|
|
@ -106,6 +212,4 @@
|
|
|
|
color $secondary
|
|
|
|
color $secondary
|
|
|
|
font-size 16px
|
|
|
|
font-size 16px
|
|
|
|
|
|
|
|
|
|
|
|
.sources-icon
|
|
|
|
|
|
|
|
margin-right 5px
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|