Mercurial > gemma
annotate client/src/logs/logs.vue @ 1240:9b0a7b3ea297
inport sounding results
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 20 Nov 2018 17:37:30 +0100 |
parents | ba8cd80d68b6 |
children |
rev | line source |
---|---|
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 <div class="main d-flex flex-column"> |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
3 <div class="d-flex flex-row"> |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 <div :class="spacer"></div> |
1217
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
5 <div class="logoutput text-left bg-white shadow mt-3 mx-3"> |
1069
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
6 <pre id="code" v-highlightjs="logs"><code class="bash hljs hljs-string"></code></pre> |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
7 </div> |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 </div> |
835 | 9 <div class="d-flex flex-row logmenu"> |
10 <div class="d-flex align-self-center"> | |
11 <ul class="nav nav-pills"> | |
12 <li class="nav-item"> | |
1069
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
13 <a |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
14 @click="fetch('system/log/apache2/access.log', 'accesslog')" |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
15 :class="accesslogStyle" |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
16 href="#" |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
17 >Accesslog</a> |
835 | 18 </li> |
19 <li class="nav-item"> | |
1069
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
20 <a |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
21 @click="fetch('system/log/apache2/error.log', 'errorlog')" |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
22 :class="errorlogStyle" |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
23 href="#" |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
1019
diff
changeset
|
24 >Errorlog</a> |
835 | 25 </li> |
26 </ul> | |
27 </div> | |
28 <div class="statuscontainer d-flex flex-row"> | |
1217
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
29 <div class="statusline ml-3 mt-1 align-self-center"> |
835 | 30 <h3>Last refresh: {{refreshed}}</h3> |
31 </div> | |
32 <div class="refresh"> | |
839 | 33 <button class="btn btn-dark" @click="fetch(currentFile, currentLog)">Refresh</button> |
835 | 34 </div> |
35 </div> | |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
36 </div> |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
37 </div> |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
38 </template> |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 |
1191
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
40 <style lang="sass" scoped> |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
41 .statuscontainer |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
42 width: 87% |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
43 position: relative |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
44 |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
45 .logmenu |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
46 margin-left: 5rem |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
47 min-width: 60vw |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
48 |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
49 #code |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
50 overflow: auto |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
51 |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
52 .refresh |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
53 position: absolute |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
54 right: 0 |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
55 |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
56 .logoutput |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
57 width: 95% |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
58 height: 85vh |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
59 overflow: auto |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
60 transition: $transition-fast |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
61 |
1191
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
62 .spacer |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
63 height: 90vh |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
64 |
1191
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
65 .spacer-collapsed |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
66 min-width: $icon-width + $offset |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
67 transition: $transition-fast |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
68 |
1191
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
69 .spacer-expanded |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
70 min-width: $sidebar-width + $offset |
835 | 71 |
1191
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
72 .statusline |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
73 position: absolute |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
74 right: 0 |
b23622905a3f
switched entirely to sass instead of scss
Markus Kottlaender <markus@intevation.de>
parents:
1123
diff
changeset
|
75 margin-right: 7rem |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
76 </style> |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
78 <script> |
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
79 /* |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
80 * This is Free Software under GNU Affero General Public License v >= 3.0 |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
81 * without warranty, see README.md and license for details. |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
82 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
83 * SPDX-License-Identifier: AGPL-3.0-or-later |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
84 * License-Filename: LICENSES/AGPL-3.0.txt |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
85 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
86 * Copyright (C) 2018 by via donau |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
87 * – Österreichische Wasserstraßen-Gesellschaft mbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
88 * Software engineering by Intevation GmbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
89 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
90 * Author(s): |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
91 * Thomas Junk <thomas.junk@intevation.de> |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
92 */ |
1123
d9e6a1f6f394
moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents:
1069
diff
changeset
|
93 import { mapState } from "vuex"; |
809 | 94 import { HTTP } from "../application/lib/http.js"; |
880
aa2acb942e55
refac: reduce bundlesize
Thomas Junk <thomas.junk@intevation.de>
parents:
853
diff
changeset
|
95 import "../../node_modules/highlight.js/styles/paraiso-dark.css"; |
aa2acb942e55
refac: reduce bundlesize
Thomas Junk <thomas.junk@intevation.de>
parents:
853
diff
changeset
|
96 import Vue from "vue"; |
aa2acb942e55
refac: reduce bundlesize
Thomas Junk <thomas.junk@intevation.de>
parents:
853
diff
changeset
|
97 import VueHighlightJS from "vue-highlightjs"; |
aa2acb942e55
refac: reduce bundlesize
Thomas Junk <thomas.junk@intevation.de>
parents:
853
diff
changeset
|
98 Vue.use(VueHighlightJS); |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
99 |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
100 const ACCESSLOG = "accesslog"; |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
101 const ERRORLOG = "errorlog"; |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
102 |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
103 export default { |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
104 name: "logs", |
809 | 105 mounted() { |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
106 this.fetch("system/log/apache2/access.log", ACCESSLOG); |
809 | 107 }, |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
108 data() { |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
109 return { |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
110 logs: null, |
835 | 111 currentLog: null, |
839 | 112 currentFile: null, |
835 | 113 refreshed: null |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
114 }; |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
115 }, |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
116 methods: { |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
117 fetch(file, type) { |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
118 HTTP.get(file, { |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
119 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
120 }) |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
121 .then(response => { |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
122 this.logs = response.data.content; |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
123 this.currentLog = type; |
835 | 124 this.refreshed = new Date().toLocaleString(); |
839 | 125 this.currentFile = file; |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
126 }) |
853 | 127 .catch(); |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
128 }, |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
129 disallow(e) { |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
130 e.target.blur(); |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
131 } |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
132 }, |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
133 computed: { |
1123
d9e6a1f6f394
moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents:
1069
diff
changeset
|
134 ...mapState("application", ["showSidebar"]), |
814
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
135 accesslogStyle() { |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
136 return { |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
137 active: this.currentLog == ACCESSLOG, |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
138 "nav-link": true |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
139 }; |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
140 }, |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
141 errorlogStyle() { |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
142 return { |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
143 active: this.currentLog == ERRORLOG, |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
144 "nav-link": true |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
145 }; |
d6888d1439e5
error log and access log selectable
Thomas Junk <thomas.junk@intevation.de>
parents:
809
diff
changeset
|
146 }, |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
147 spacer() { |
1217
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
148 return [ |
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
149 "spacer ml-3", |
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
150 { |
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
151 "spacer-expanded": this.showSidebar, |
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
152 "spacer-collapsed": !this.showSidebar |
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
153 } |
ba8cd80d68b6
made more use of bootstrap classes instead of custom css
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
154 ]; |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
155 } |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
156 } |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
157 }; |
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
158 </script> |