summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/LogModuleEntry.vue
diff options
context:
space:
mode:
authorUdo Walter2019-03-22 05:36:03 +0100
committerUdo Walter2019-03-22 05:36:03 +0100
commite6c97c4913e5d24a908c65cc7592d9332df24057 (patch)
tree80662936f9dcb8622a743726fac5fcfccd6bddd2 /webapp/src/components/LogModuleEntry.vue
parent[server/registration/backends] Rework addClient and updateClient to receive json (diff)
downloadbas-e6c97c4913e5d24a908c65cc7592d9332df24057.tar.gz
bas-e6c97c4913e5d24a908c65cc7592d9332df24057.tar.xz
bas-e6c97c4913e5d24a908c65cc7592d9332df24057.zip
[webapp] add back to top button + log improvements
Diffstat (limited to 'webapp/src/components/LogModuleEntry.vue')
-rw-r--r--webapp/src/components/LogModuleEntry.vue121
1 files changed, 121 insertions, 0 deletions
diff --git a/webapp/src/components/LogModuleEntry.vue b/webapp/src/components/LogModuleEntry.vue
new file mode 100644
index 0000000..3aaa5f2
--- /dev/null
+++ b/webapp/src/components/LogModuleEntry.vue
@@ -0,0 +1,121 @@
+<i18n>
+{
+ "en": {
+ },
+ "de": {
+ }
+}
+</i18n>
+
+<template>
+ <div style="display: flex; align-items: center;">
+ <template v-if="item.client">
+ <v-menu v-model="menus.client" :close-on-content-click="false" offset-y>
+ <template #activator="{ on }">
+ <v-btn v-on="on" outline small class="description-button" :class="{ 'error--text': item.client.deleted }">
+ <v-icon small class="mr-1">computer</v-icon>{{ item.client.name }}
+ </v-btn>
+ </template>
+ <template #default>
+ <v-card style="user-select: text;"><v-card-text>{{ item.clientSnapshot }}</v-card-text></v-card>
+ </template>
+ </v-menu>
+ </template>
+
+ <template v-if="item.group">
+ <v-menu v-model="menus.group" :close-on-content-click="false" offset-y>
+ <template #activator="{ on }">
+ <v-btn v-on="on" outline small class="description-button" :class="{ 'error--text': item.group.deleted }">
+ <v-icon small class="mr-1">category</v-icon>{{ item.group.name }}
+ </v-btn>
+ </template>
+ <template #default>
+ <v-card style="user-select: text;"><v-card-text>{{ item.groupSnapshot }}</v-card-text></v-card>
+ </template>
+ </v-menu>
+ </template>
+
+ <template v-if="item.user">
+ <v-menu v-model="menus.user" :close-on-content-click="false" offset-y>
+ <template #activator="{ on }">
+ <v-btn v-on="on" outline small class="description-button" :class="{ 'error--text': item.user.deleted }">
+ <v-icon small class="mr-1">person</v-icon>{{ item.user.name }}
+ </v-btn>
+ </template>
+ <template #default>
+ <v-card style="user-select: text;"><v-card-text>{{ item.userSnapshot }}</v-card-text></v-card>
+ </template>
+ </v-menu>
+ </template>
+
+ <v-menu
+ v-if="item.multilineDescription"
+ v-model="menus.description"
+ :close-on-content-click="false"
+ nudge-top="12"
+ nudge-left="16"
+ >
+ <template #activator="{ on }">
+ <v-btn v-if="item.multilineDescription" v-on="on" small icon style="margin: 0 2px 0 0; overflow: hidden;">
+ <v-icon :style="menus.description ? 'transform: rotate(180deg)' : ''">arrow_drop_down</v-icon>
+ </v-btn>
+ </template>
+ <template #default>
+ <v-card style="display: flex; padding: 16px">
+ <v-btn small icon style="margin: -4px 2px 0 0; overflow: hidden;" @click="menus.description = false">
+ <v-icon :style="menus.description ? 'transform: rotate(180deg)' : ''">arrow_drop_down</v-icon>
+ </v-btn>
+ <div style="user-select: text; white-space: pre;">{{ item.multilineDescription }}</div>
+ </v-card>
+ </template>
+ </v-menu>
+ <div style="user-select: text;" @click="menus.description = true">{{ item.description }}</div>
+ </div>
+</template>
+
+<script>
+
+export default {
+ name: 'LogModuleEntry',
+ props: {
+ item: {
+ type: Object,
+ default: () => ({})
+ }
+ },
+ data () {
+ return {
+ menus: { description: false, client: false, group: false, user: false }
+ }
+ },
+ watch: {
+ item () {
+ this.menus = { description: false, client: false, group: false, user: false }
+ },
+ menus: {
+ deep: true,
+ handler (menus) {
+ if (menus.description || menus.client || menus.group || menus.user) this.$emit('menu-translate', this.$el.offsetParent.style.transform)
+ }
+ }
+ },
+ methods: {
+ }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+.description-button {
+ min-width: 10px;
+ margin: 0 10px 0 0;
+}
+
+.description-button >>> .v-btn__content {
+ max-width: 180px;
+ overflow: hidden;
+ display: block;
+ text-overflow: ellipsis;
+ text-transform: none;
+}
+</style>