Mercurial > gemma
annotate client/src/components/Logs.vue @ 5348:45b03e8ca47e extented-report
Toggles in user overview and in details section as well established
This commit introduces toggles to change the state for administrative
users to be able to receive the DQL Report.
For quick access there is the possibility to change via overview.
If you want to edit this in the details or if you change the role
of the user to a non administrative, there is the possibility to change
the flag in a fast way.
When the user looses administrative privilege the option is not available
and the according flag is set to "false".
Aside: Changed user.go to resolve inconsitencies in frontend where the
key "reports" was missing due to "omitempty" in marshalling the go objects.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 21 Jun 2021 16:41:39 +0200 |
parents | 6b054b91d9b2 |
children | 7768f14f6535 |
rev | line source |
---|---|
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
2 <div class="main d-flex flex-column"> |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
3 <div class="d-flex flex-row"> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2916
diff
changeset
|
4 <Spacer /> |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
5 <div class="card logs shadow-xs mt-2 mr-2"> |
2387
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
1669
diff
changeset
|
6 <UIBoxHeader icon="book" title="Logs" /> |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
7 <div class="logoutput text-left bg-white"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
8 <pre id="code" v-highlightjs="logs"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
9 <code class="bash hljs hljs-string"></code> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
10 </pre> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 </div> |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
12 <div class="logmenu"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
13 <div class="d-flex align-self-center"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
14 <ul class="nav nav-pills"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
15 <li class="nav-item"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
16 <a |
2931
f90f2fd94fbc
added regression test for protocols
Thomas Junk <thomas.junk@intevation.de>
parents:
2930
diff
changeset
|
17 id="accesslog" |
1490 | 18 :class="accesslogStyle" |
2930
1019f4d0e18f
protocol: fixed links and layout
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
19 @click.prevent=" |
1019f4d0e18f
protocol: fixed links and layout
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
20 fetch('system/log/apache2/access.log', 'accesslog') |
1019f4d0e18f
protocol: fixed links and layout
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
21 " |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
22 href="#" |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
23 > |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
24 <translate>Accesslog</translate> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
25 </a> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
26 </li> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
27 <li class="nav-item"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
28 <a |
2931
f90f2fd94fbc
added regression test for protocols
Thomas Junk <thomas.junk@intevation.de>
parents:
2930
diff
changeset
|
29 id="errorlog" |
1490 | 30 :class="errorlogStyle" |
2930
1019f4d0e18f
protocol: fixed links and layout
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
31 @click.prevent=" |
1019f4d0e18f
protocol: fixed links and layout
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
32 fetch('system/log/apache2/error.log', 'errorlog') |
1019f4d0e18f
protocol: fixed links and layout
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
33 " |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
34 href="#" |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
35 > |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
36 <translate>Errorlog</translate> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
37 </a> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
38 </li> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
39 </ul> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
40 </div> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
41 <div class="statuscontainer d-flex flex-row mb-3"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
42 <div class="statusline align-self-center"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
43 <h3><translate>Last refresh:</translate> {{ refreshed }}</h3> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
44 </div> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
45 <div class="refresh"> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
46 <button |
1490 | 47 @click="fetch(currentFile, currentLog)" |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
48 class="btn btn-dark" |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
49 > |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
50 <translate>Refresh</translate> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
51 </button> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
52 </div> |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
53 </div> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
55 </div> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
57 </div> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 </template> |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 |
1449 | 60 <style lang="scss" scoped> |
61 .statuscontainer { | |
62 width: 87%; | |
63 position: relative; | |
64 } | |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
65 |
1449 | 66 .logmenu { |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
67 position: relative; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
68 margin-left: $offset; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
69 margin-top: $offset; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
70 } |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
71 |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
72 .logs { |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
73 height: 85vh; |
2930
1019f4d0e18f
protocol: fixed links and layout
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
74 width: 100vw; |
1449 | 75 } |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
76 |
1449 | 77 #code { |
78 overflow: auto; | |
79 } | |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
80 |
1449 | 81 .refresh { |
82 position: absolute; | |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
83 right: $offset; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
84 bottom: 0; |
1449 | 85 } |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
86 |
1449 | 87 .logoutput { |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
88 margin-left: $offset; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
89 margin-right: $offset; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
90 margin-top: $offset; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
91 height: 90%; |
1449 | 92 overflow: auto; |
93 transition: $transition-fast; | |
94 } | |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
95 |
1449 | 96 .statusline { |
97 position: absolute; | |
98 right: 0; | |
1500
811497a8092f
layout issues due to translations
Thomas Junk <thomas.junk@intevation.de>
parents:
1490
diff
changeset
|
99 margin-right: 9rem; |
1482
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
100 bottom: -0.5rem; |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
101 } |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
102 |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
103 .statuscontainer { |
46636f863742
refac: logs in card-design
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
104 width: 100%; |
1449 | 105 } |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
106 </style> |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
108 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
109 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 * without warranty, see README.md and license for details. |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
111 * |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 * SPDX-License-Identifier: AGPL-3.0-or-later |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
113 * License-Filename: LICENSES/AGPL-3.0.txt |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
114 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
115 * Copyright (C) 2018 by via donau |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 * – Österreichische Wasserstraßen-Gesellschaft mbH |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 * Software engineering by Intevation GmbH |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
118 * |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
119 * Author(s): |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 * Thomas Junk <thomas.junk@intevation.de> |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 */ |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 import { mapState } from "vuex"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2931
diff
changeset
|
123 import { HTTP } from "@/lib/http"; |
1558
0ded4c56978e
refac: component filestructure. remove admin/map hierarchy
Thomas Junk <thomas.junk@intevation.de>
parents:
1517
diff
changeset
|
124 import "../../node_modules/highlight.js/styles/paraiso-dark.css"; |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 import Vue from "vue"; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 import VueHighlightJS from "vue-highlightjs"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2931
diff
changeset
|
127 import { displayError } from "@/lib/errors"; |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
128 Vue.use(VueHighlightJS); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
129 |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 const ACCESSLOG = "accesslog"; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 const ERRORLOG = "errorlog"; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
132 |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
133 export default { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 name: "logs", |
1605
ef5cc5f1c757
refac: extracted spacer component
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
135 components: { |
1669
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
136 Spacer: () => import("./Spacer") |
1605
ef5cc5f1c757
refac: extracted spacer component
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
137 }, |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
138 mounted() { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
139 this.fetch("system/log/apache2/access.log", ACCESSLOG); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
140 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 data() { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
142 return { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
143 logs: null, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
144 currentLog: null, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
145 currentFile: null, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
146 refreshed: null |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
147 }; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
148 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
149 methods: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
150 fetch(file, type) { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
151 HTTP.get(file, { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
152 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
153 }) |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
154 .then(response => { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
155 this.logs = response.data.content; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
156 this.currentLog = type; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
157 this.refreshed = new Date().toLocaleString(); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
158 this.currentFile = file; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 }) |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
160 .catch(error => { |
4869
6b054b91d9b2
backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
4868
diff
changeset
|
161 let message = "Backend not reachable"; |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
162 if (error.response) { |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
163 const { status, data } = error.response; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
164 message = `${status}: ${data.message || data}`; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
165 } |
2916
ea54e63deb40
client:logs:add catch method
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
166 displayError({ |
ea54e63deb40
client:logs:add catch method
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
167 title: this.$gettext("Backend Error"), |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
168 message: message |
2916
ea54e63deb40
client:logs:add catch method
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
169 }); |
ea54e63deb40
client:logs:add catch method
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
170 }); |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
171 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
172 disallow(e) { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
173 e.target.blur(); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
174 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
175 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
176 computed: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 ...mapState("application", ["showSidebar"]), |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 accesslogStyle() { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 return { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 active: this.currentLog == ACCESSLOG, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
181 "nav-link": true |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
182 }; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
183 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
184 errorlogStyle() { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
185 return { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 active: this.currentLog == ERRORLOG, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 "nav-link": true |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
188 }; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
191 }; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
192 </script> |