summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorUdo Walter2019-04-13 02:10:34 +0200
committerUdo Walter2019-04-13 02:10:34 +0200
commitc0496b3ff021ac1ff5939479ed19a4a6dac7793a (patch)
tree240693f63a0249fdd3e1dbfc8b475978cde346bc /webapp
parent[webapp/groups] very small fix (diff)
downloadbas-c0496b3ff021ac1ff5939479ed19a4a6dac7793a.tar.gz
bas-c0496b3ff021ac1ff5939479ed19a4a6dac7793a.tar.xz
bas-c0496b3ff021ac1ff5939479ed19a4a6dac7793a.zip
[webapp/groups] yet another small redesign
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/GroupModuleClientList.vue20
-rw-r--r--webapp/src/components/GroupModuleGroupList.vue18
-rw-r--r--webapp/src/components/GroupModuleGroupView.vue300
-rw-r--r--webapp/src/main.js19
4 files changed, 149 insertions, 208 deletions
diff --git a/webapp/src/components/GroupModuleClientList.vue b/webapp/src/components/GroupModuleClientList.vue
index ef01ee3..e3ab36a 100644
--- a/webapp/src/components/GroupModuleClientList.vue
+++ b/webapp/src/components/GroupModuleClientList.vue
@@ -29,11 +29,13 @@
<template>
<div>
- <data-table class="client-table" v-model="selected" :headers="headers" :items="clients" :loading="loading" @dblclick="loadClient($event)" min-width="1300px">
+ <v-divider></v-divider>
+ <data-table v-model="selected" :headers="headers" :items="clients" :loading="loading" @dblclick="loadClient($event)" min-width="1300px">
<div slot="actions" slot-scope="row" style="text-align: right">
<v-btn icon @click.stop @mousedown="loadClient(row.item)" style="margin: 0"><v-icon>keyboard_arrow_right</v-icon></v-btn>
</div>
</data-table>
+ <v-divider></v-divider>
<div class="text-xs-right">
<v-btn flat color="primary" @click="wake" :disabled="selected.length === 0">
<v-icon left>notifications_active</v-icon>{{ $tc('wakeClients', selected.length, [selected.length]) }}
@@ -119,20 +121,4 @@ export default {
margin-left: 20px;
margin-right: -10px;
}
-
-.client-table {
- position: relative;
-}
-
-.client-table::before {
- pointer-events: none;
- z-index: 3;
- box-shadow: inset 0px 0px 6px rgba(0,0,0,0.5);
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- content: "";
-}
</style>
diff --git a/webapp/src/components/GroupModuleGroupList.vue b/webapp/src/components/GroupModuleGroupList.vue
index dff666d..7fbc070 100644
--- a/webapp/src/components/GroupModuleGroupList.vue
+++ b/webapp/src/components/GroupModuleGroupList.vue
@@ -24,7 +24,7 @@
<template>
<div>
<v-divider></v-divider>
- <data-table class="group-table" v-model="selected" :headers="headers" :items="groups" :loading="loading" @dblclick="loadGroup($event)">
+ <data-table v-model="selected" :headers="headers" :items="groups" :loading="loading" @dblclick="loadGroup($event)">
<div slot="actions" slot-scope="row" style="text-align: right">
<v-btn icon @click.stop @mousedown="loadGroup(row.item)" style="margin: 0"><v-icon>keyboard_arrow_right</v-icon></v-btn>
</div>
@@ -101,20 +101,4 @@ export default {
margin-left: 20px;
margin-right: -10px;
}
-
-.group-table {
- position: relative;
-}
-
-.group-table::before {
- pointer-events: none;
- z-index: 3;
- box-shadow: inset 0px 0px 6px rgba(0,0,0,0.5);
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- content: "";
-}
</style>
diff --git a/webapp/src/components/GroupModuleGroupView.vue b/webapp/src/components/GroupModuleGroupView.vue
index 37f1c02..6706e0a 100644
--- a/webapp/src/components/GroupModuleGroupView.vue
+++ b/webapp/src/components/GroupModuleGroupView.vue
@@ -36,163 +36,157 @@
</i18n>
<template>
- <v-expansion-panel style="margin-top: 24px" v-model="section">
- <v-expansion-panel-content v-if="group.id !== 0" class="non-selectable">
- <template #header>
- <div class="panel-header primary--text">Info</div>
- </template>
- <v-divider></v-divider>
- <v-layout wrap style="padding: 16px" class="selectable">
- <v-flex lg4 sm6 xs12 order-lg1 order-xs2>
- <v-layout column>
- <v-flex>
+ <v-card style="margin-top: 24px">
+ <v-tabs v-model="activeTab" grow hide-slider>
+ <v-tab v-if="group.id !== 0" class="groupview-tab" :class="(group.id !== 0 && activeTab === 0) ? 'primary--text' : ''">
+ <v-icon :color="(group.id !== 0 && activeTab === 0) ? 'primary' : ''">list_alt</v-icon>
+ <span class="hidden-xs-only ml-2">Info</span>
+ </v-tab>
+ <v-tab v-if="group.id !== 'create'" class="groupview-tab" :class="activeTab === (group.id === 0 ? 0 : 1) ? 'primary--text' : ''">
+ <v-icon class="mr-2" :color="activeTab === (group.id === 0 ? 0 : 1) ? 'primary' : ''">category</v-icon>
+ {{ group.subgroups ? group.subgroups.length : 0 }}
+ <span class="hidden-xs-only ml-1">{{ group.id > 0 ? $t('subgroups') : $t('groups') }}</span>
+ </v-tab>
+ <v-tab v-if="group.id !== 'create'" class="groupview-tab" :class="activeTab === (group.id === 0 ? 1 : 2) ? 'primary--text' : ''">
+ <v-icon class="mr-2" :color="activeTab === (group.id === 0 ? 1 : 2) ? 'primary' : ''">computer</v-icon>
+ {{ group.clients ? group.clients.length : 0 }}
+ <span class="hidden-xs-only ml-1">{{ $t('clients') }}</span>
+ </v-tab>
+
+ <v-switch
+ v-if="group.id !== 'create'"
+ :input-value="group.tabShowAll"
+ @change="setShowAll"
+ class="show-toggle"
+ :label="$t('showall')"
+ hide-details
+ color="primary"
+ ></v-switch>
+
+ <v-tab-item v-if="group.id !== 0" :transition="false" :reverse-transition="false">
+ <v-divider></v-divider>
+ <v-card-text>
+ <v-layout wrap>
+ <v-flex lg4 sm6 xs12 order-lg1 order-xs2>
+ <v-layout column>
+ <v-flex>
+ <div class="info-box">
+ <div class="body-2 info-heading"><v-icon>label</v-icon><span>{{ $t('name') }}</span></div>
+ <div class="info-text">
+ <v-text-field v-if="editMode" class="info-input" color="primary" v-model="info.name" hide-details tabindex="1"></v-text-field>
+ <div v-else>{{ group.name || '-' }}</div>
+ </div>
+ </div>
+ </v-flex>
+ <v-flex>
+ <div class="info-box">
+ <div class="body-2 info-heading"><v-icon>device_hub</v-icon><span>{{ $t('parents') }}</span></div>
+ <div class="info-text">
+ <select-box v-if="editMode" v-model="parents" :items="groupList" class="info-input" hide-details></select-box>
+ <div v-else class="chip-container non-selectable">
+ <v-tooltip v-for="parent in firstParents" :key="parent.id" top open-delay="800">
+ <template #activator="{ on }">
+ <v-chip v-on="on" small label style="width: calc(50% - 8px)" @click="openParent(parent)">
+ <span class="chip-text">{{ parent.name || parent.id }}</span>
+ </v-chip>
+ </template>
+ <span>{{ parent.name || parent.id }}</span>
+ </v-tooltip>
+ <span v-if="group.parents && group.parents.length > 5" class="and-more">+ {{ group.parents.length - 5 }} {{ $t('more') }}</span>
+ <span v-else-if="group.parents === undefined || group.parents.length === 0">-</span>
+ </div>
+ </div>
+ </div>
+ </v-flex>
+ <v-flex>
+ <div class="info-box">
+ <div class="body-2 info-heading"><v-icon>list</v-icon><span>{{ $t('config') }}</span></div>
+ <div class="info-text">
+ <v-select v-if="editMode"
+ class="info-input"
+ clearable
+ item-text="name"
+ item-value="id"
+ :menu-props="{ offsetY: '' }"
+ hide-details
+ color="primary"
+ v-model="info.configId"
+ :items="configList"
+ ></v-select>
+ <div v-else>{{ configName || '-' }}</div>
+ </div>
+ </div>
+ </v-flex>
+ </v-layout>
+ </v-flex>
+ <v-flex lg4 sm6 xs12 order-lg2 order-xs3>
<div class="info-box">
- <div class="body-2 info-heading"><v-icon>label</v-icon><span>{{ $t('name') }}</span></div>
+ <div class="body-2 info-heading"><v-icon>description</v-icon><span>{{ $t('description') }}</span></div>
<div class="info-text">
- <v-text-field v-if="editMode" class="info-input" color="primary" v-model="info.name" hide-details tabindex="1"></v-text-field>
- <div v-else>{{ group.name || '-' }}</div>
+ <v-textarea v-if="editMode" class="info-input" rows="1" auto-grow hide-details color="primary" v-model="info.description" tabindex="2"></v-textarea>
+ <div v-else style="white-space: pre-wrap;">{{ group.description || '-' }}</div>
</div>
</div>
- </v-flex>
- <v-flex>
+
<div class="info-box">
- <div class="body-2 info-heading"><v-icon>device_hub</v-icon><span>{{ $t('parents') }}</span></div>
+ <div class="body-2 info-heading"><v-icon>settings_ethernet</v-icon><span>{{ $t('ipranges') }}</span></div>
<div class="info-text">
- <select-box v-if="editMode" v-model="parents" :items="groupList" class="info-input" hide-details></select-box>
- <div v-else class="chip-container non-selectable">
- <v-tooltip v-for="parent in firstParents" :key="parent.id" top open-delay="800">
- <template #activator="{ on }">
- <v-chip v-on="on" small label style="width: calc(50% - 8px)" @click="openParent(parent)">
- <span class="chip-text">{{ parent.name || parent.id }}</span>
- </v-chip>
- </template>
- <span>{{ parent.name || parent.id }}</span>
- </v-tooltip>
- <span v-if="group.parents && group.parents.length > 5" class="and-more">+ {{ group.parents.length - 5 }} {{ $t('more') }}</span>
- <span v-else-if="group.parents === undefined || group.parents.length === 0">-</span>
+ <div v-if="editMode">
+ <div v-for="(iprange, index) in ipranges" :key="index">
+ <div class="iprange">
+ <v-btn class="iprange-button" small icon @click="removeIprange(index)"><v-icon>remove</v-icon></v-btn>
+ <v-text-field solo flat hide-details :label="$t('startIp')" color="primary" v-model="iprange.startIp" single-line></v-text-field>
+ <span class="ip-seperator">-</span>
+ <v-text-field solo flat hide-details :label="$t('endIp')" color="primary" v-model="iprange.endIp" single-line></v-text-field>
+ </div>
+ <v-divider></v-divider>
+ </div>
+ <div class="iprange-add-wrapper">
+ <v-btn class="iprange-button" small icon @click="addIprange"><v-icon>add</v-icon></v-btn>
+ </div>
+ </div>
+ <div v-else>
+ <table>
+ <tr v-for="(iprange, index) in group.ipranges" :key="index">
+ <td class="text-xs-right">{{ iprange.startIp }}</td>
+ <td class="ip-seperator">-</td>
+ <td>{{ iprange.endIp }}</td>
+ </tr>
+ </table>
+ <div v-if="group.ipranges && group.ipranges.length === 0">-</div>
</div>
</div>
</div>
</v-flex>
- <v-flex>
+ <v-flex lg4 xs12 order-lg3 order-xs1 class="text-xs-right">
<div class="info-box">
- <div class="body-2 info-heading"><v-icon>list</v-icon><span>{{ $t('config') }}</span></div>
- <div class="info-text">
- <v-select v-if="editMode"
- class="info-input"
- clearable
- item-text="name"
- item-value="id"
- :menu-props="{ offsetY: '' }"
- hide-details
- color="primary"
- v-model="info.configId"
- :items="configList"
- ></v-select>
- <div v-else>{{ configName || '-' }}</div>
+ <div v-if="!editMode">
+ <v-btn color="error" flat @click="deleteGroup" class="info-buttons">
+ <v-icon left>delete</v-icon>{{ $t('delete') }}
+ </v-btn>
+ <v-btn color="primary" flat @click="editInfo" class="info-buttons">
+ <v-icon left>create</v-icon>{{ $t('edit') }}
+ </v-btn>
+ </div>
+ <div v-else>
+ <v-btn color="primary" flat @click="cancelEdit" class="info-buttons">{{ $t('cancel') }}</v-btn>
+ <v-btn color="primary" @click="saveData" class="info-buttons" tabindex="3">
+ <v-icon left>save</v-icon>{{ $t('save') }}
+ </v-btn>
</div>
</div>
</v-flex>
</v-layout>
- </v-flex>
- <v-flex lg4 sm6 xs12 order-lg2 order-xs3>
- <div class="info-box">
- <div class="body-2 info-heading"><v-icon>description</v-icon><span>{{ $t('description') }}</span></div>
- <div class="info-text">
- <v-textarea v-if="editMode" class="info-input" rows="1" auto-grow hide-details color="primary" v-model="info.description" tabindex="2"></v-textarea>
- <div v-else style="white-space: pre-wrap;">{{ group.description || '-' }}</div>
- </div>
- </div>
-
- <div class="info-box">
- <div class="body-2 info-heading"><v-icon>settings_ethernet</v-icon><span>{{ $t('ipranges') }}</span></div>
- <div class="info-text">
- <div v-if="editMode">
- <div v-for="(iprange, index) in ipranges" :key="index">
- <div class="iprange">
- <v-btn class="iprange-button" small icon @click="removeIprange(index)"><v-icon>remove</v-icon></v-btn>
- <v-text-field solo flat hide-details :label="$t('startIp')" color="primary" v-model="iprange.startIp" single-line></v-text-field>
- <span class="ip-seperator">-</span>
- <v-text-field solo flat hide-details :label="$t('endIp')" color="primary" v-model="iprange.endIp" single-line></v-text-field>
- </div>
- <v-divider></v-divider>
- </div>
- <div class="iprange-add-wrapper">
- <v-btn class="iprange-button" small icon @click="addIprange"><v-icon>add</v-icon></v-btn>
- </div>
- </div>
- <div v-else>
- <table>
- <tr v-for="(iprange, index) in group.ipranges" :key="index">
- <td class="text-xs-right">{{ iprange.startIp }}</td>
- <td class="ip-seperator">-</td>
- <td>{{ iprange.endIp }}</td>
- </tr>
- </table>
- <div v-if="group.ipranges && group.ipranges.length === 0">-</div>
- </div>
- </div>
- </div>
- </v-flex>
- <v-flex lg4 xs12 order-lg3 order-xs1 class="text-xs-right">
- <div class="info-box">
- <div v-if="!editMode">
- <v-btn color="error" flat @click="deleteGroup" class="info-buttons">
- <v-icon left>delete</v-icon>{{ $t('delete') }}
- </v-btn>
- <v-btn color="primary" flat @click="editInfo" class="info-buttons">
- <v-icon left>create</v-icon>{{ $t('edit') }}
- </v-btn>
- </div>
- <div v-else>
- <v-btn color="primary" flat @click="cancelEdit" class="info-buttons">{{ $t('cancel') }}</v-btn>
- <v-btn color="primary" @click="saveData" class="info-buttons" tabindex="3">
- <v-icon left>save</v-icon>{{ $t('save') }}
- </v-btn>
- </div>
- </div>
- </v-flex>
- </v-layout>
- </v-expansion-panel-content>
- <v-expansion-panel-content v-if="group.id !== 'create'" class="non-selectable">
- <template #header>
- <div class="panel-header primary--text">
- <span>{{ group.subgroups ? group.subgroups.length : 0 }} {{ group.id > 0 ? $t('subgroups') : $t('groups') }}</span>
- <v-switch
- v-if="section === (group.id !== 0 ? 1 : 0)"
- @click.native.stop
- :input-value="group.tabShowAll"
- @change="setShowAll"
- class="show-toggle"
- :label="$t('showall')"
- hide-details
- color="primary"
- ></v-switch>
- </div>
- </template>
- <group-module-group-list v-if="loadTables || group.id === 0" class="selectable" :tabIndex="tabIndex" :groupId="group.id" :groups="group.subgroups || []" />
- <div v-else></div>
- </v-expansion-panel-content>
- <v-expansion-panel-content v-if="group.id !== 'create'" class="non-selectable">
- <template #header>
- <div class="panel-header primary--text">
- <span>{{ group.clients ? group.clients.length : 0 }} {{ $t('clients') }}</span>
- <v-switch
- v-if="section === (group.id !== 0 ? 2 : 1)"
- @click.native.stop
- :input-value="group.tabShowAll"
- @change="setShowAll"
- class="show-toggle"
- :label="$t('showall')"
- hide-details
- color="primary"
- ></v-switch>
- </div>
- </template>
- <group-module-client-list v-if="loadTables" class="selectable" :tabIndex="tabIndex" :groupId="group.id" :clients="group.clients || []" />
- <div v-else></div>
- </v-expansion-panel-content>
- </v-expansion-panel>
+ </v-card-text>
+ </v-tab-item>
+ <v-tab-item v-if="group.id !== 'create'" lazy :transition="false" :reverse-transition="false">
+ <group-module-group-list :tabIndex="tabIndex" :groupId="group.id" :groups="group.subgroups || []" />
+ </v-tab-item>
+ <v-tab-item v-if="group.id !== 'create'" lazy :transition="false" :reverse-transition="false">
+ <group-module-client-list :tabIndex="tabIndex" :groupId="group.id" :clients="group.clients || []" />
+ </v-tab-item>
+ </v-tabs>
+ </v-card>
</template>
<script>
@@ -219,8 +213,7 @@ export default {
},
data () {
return {
- section: 0,
- loadTables: false,
+ activeTab: 0,
editMode: false,
info: {
name: '',
@@ -249,10 +242,8 @@ export default {
group (newValue, oldValue) {
if (newValue.id === 'create') {
this.editInfo()
- this.section = 0
} else if (newValue.id !== oldValue.id) {
this.editMode = false
- this.section = 0
}
}
},
@@ -311,28 +302,23 @@ export default {
},
created () {
if (this.group.id === 'create') this.editInfo()
- },
- mounted () {
- // Load tables later to speed up initial load/render time
- setTimeout(() => {
- this.loadTables = true
- }, 10)
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
-.panel-header {
+.groupview-tab {
+ text-transform: none;
font-weight: bold;
- display: flex;
- justify-content: space-between;
}
.show-toggle {
- padding: 0;
- margin: -2px 16px -2px 0;
+ padding: 0 16px;
+ margin: 0;
flex: initial;
+ display: flex;
+ align-items: center;
}
.info-buttons {
diff --git a/webapp/src/main.js b/webapp/src/main.js
index bd7d9ec..e62029f 100644
--- a/webapp/src/main.js
+++ b/webapp/src/main.js
@@ -136,25 +136,10 @@ new Vue({
router,
i18n,
computed: {
- locale: () => store.state.settings.locale,
- noAnimations: () => store.state.settings.noAnimations
+ locale: () => store.state.settings.locale
},
watch: {
- locale: v => { i18n.locale = v },
- noAnimations: {
- immediate: true,
- handler (value) {
- if (value) {
- Vue.component('transition', {
- render () {
- return this.$slots.default
- }
- })
- } else {
- delete Vue.options.components['transition']
- }
- }
- }
+ locale: v => { i18n.locale = v }
},
template: '<router-view/>'
}).$mount('#app')