summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorUdo Walter2019-04-14 15:18:10 +0200
committerUdo Walter2019-04-14 15:18:10 +0200
commit0a80c3383b1289c2b1e6adf4d206fc86f0a612e9 (patch)
treeaf8b13894cdde19112a06bc21b5446f047cde656 /webapp
parent[webapp/groups] same as last commit but better (diff)
downloadbas-0a80c3383b1289c2b1e6adf4d206fc86f0a612e9.tar.gz
bas-0a80c3383b1289c2b1e6adf4d206fc86f0a612e9.tar.xz
bas-0a80c3383b1289c2b1e6adf4d206fc86f0a612e9.zip
[webapp/systemlog] add copy button to table
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/DataTable.vue3
-rw-r--r--webapp/src/components/LogModule.vue5
-rw-r--r--webapp/src/components/LogModuleEntry.vue8
3 files changed, 8 insertions, 8 deletions
diff --git a/webapp/src/components/DataTable.vue b/webapp/src/components/DataTable.vue
index 36b44f3..93eb674 100644
--- a/webapp/src/components/DataTable.vue
+++ b/webapp/src/components/DataTable.vue
@@ -462,7 +462,8 @@ export default {
let rowString = ''
for (let i in keys) {
let value = row.data[keys[i]]
- if (typeof value === 'string' && (value.indexOf(',') !== -1 || value.indexOf('"') !== -1)) value = JSON.stringify(value)
+ if (typeof value === 'string' &&
+ (value.indexOf(',') !== -1 || value.indexOf('"') !== -1 || value.indexOf('\n') !== -1)) value = JSON.stringify(value)
else if (typeof value === 'object') value = JSON.stringify(JSON.stringify(value))
if (value) rowString += value
if (i < topIndex) rowString += ','
diff --git a/webapp/src/components/LogModule.vue b/webapp/src/components/LogModule.vue
index a381fb2..6c9ba43 100644
--- a/webapp/src/components/LogModule.vue
+++ b/webapp/src/components/LogModule.vue
@@ -188,7 +188,7 @@
</v-card>
<v-subheader>{{ $t('log') }}</v-subheader>
<v-card>
- <data-table :loading="loading" :headers="headers" :items="log" min-width="900px" no-select no-sort :row-count="-1">
+ <data-table :loading="loading" :headers="headers" :items="log" min-width="900px" no-select no-sort :row-count="-1" copy-button>
<template #category="{ item }">
<span
style="user-select: text"
@@ -304,8 +304,7 @@ export default {
if (item.description) {
item.searchString += item.description + '\n'
const desc = item.description.split('\n')
- if (desc.length > 1) item.multilineDescription = item.description
- item.description = desc[0]
+ if (desc.length > 1) item.descriptionHeader = desc[0]
}
// Add client/group/user info to the search string
if (item.client) for (let key in item.client) item.searchString += item.client[key] + '\n'
diff --git a/webapp/src/components/LogModuleEntry.vue b/webapp/src/components/LogModuleEntry.vue
index e6ccead..d633a47 100644
--- a/webapp/src/components/LogModuleEntry.vue
+++ b/webapp/src/components/LogModuleEntry.vue
@@ -95,7 +95,7 @@
</template>
<v-menu
- v-if="item.multilineDescription"
+ v-if="item.descriptionHeader"
v-model="menus.description"
:close-on-content-click="false"
nudge-top="12"
@@ -103,7 +103,7 @@
content-class="log-entry-menu-conent"
>
<template #activator="{ on }">
- <v-btn v-if="item.multilineDescription" v-on="on" small icon style="margin: 0 2px 0 0; overflow: hidden;">
+ <v-btn 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>
@@ -112,11 +112,11 @@
<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>
+ <div style="user-select: text; white-space: pre;">{{ item.description }}</div>
</v-card>
</template>
</v-menu>
- <div style="user-select: text;" @click="menus.description = true">{{ item.description }}</div>
+ <div style="user-select: text;" @click="menus.description = true">{{ item.descriptionHeader || item.description }}</div>
</div>
</template>