Mercurial > gemma
annotate client/src/components/Systemconfiguration.vue @ 2037:11cb57f85c60 unify_imports
Merged default into branch.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 25 Jan 2019 11:53:28 +0100 |
parents | 16fb9667ddf8 |
children |
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="d-flex flex-row"> |
1606
a4d8f284db93
spacer in admin interface added
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
3 <Spacer></Spacer> |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
4 <div class="card sysconfig mt-3 shadow-xs"> |
1480 | 5 <h6 |
6 class="mb-0 py-2 px-3 border-bottom d-flex text-info align-items-center" | |
7 > | |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
8 <font-awesome-icon icon="wrench" class="mr-2"></font-awesome-icon> |
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
9 <translate class="headline">Systemconfiguration</translate> |
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
10 </h6> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
11 <div class="card-body config"> |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
12 <section class="configsection"> |
1449 | 13 <h4 class="card-title"> |
14 <translate>Bottleneck Areas stroke-color</translate> | |
15 </h4> | |
1480 | 16 <compact-picker v-model="strokeColor" /> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
17 </section> |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
18 <section> |
1449 | 19 <h4 class="card-title"> |
20 <translate>Bottleneck Areas fill-color</translate> | |
21 </h4> | |
1480 | 22 <chrome-picker v-model="fillColor" /> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
23 </section> |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
24 <div class="sendbutton"> |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
25 <a @click.prevent="submit" class="btn btn-info text-white"> |
1449 | 26 <translate>Send</translate> |
27 </a> | |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
29 </div> |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
30 <!-- card-body --> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
32 </div> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 </template> |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 |
1449 | 35 <style scoped lang="scss"> |
36 .config { | |
37 text-align: left; | |
38 } | |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
39 |
1449 | 40 .configsection { |
41 margin-bottom: $large-offset; | |
42 } | |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
43 |
1449 | 44 .sendbutton { |
45 position: absolute; | |
46 right: $offset; | |
47 bottom: $offset; | |
48 } | |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
49 |
1449 | 50 .inputs { |
51 margin-left: auto; | |
52 margin-right: auto; | |
53 } | |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
54 |
1449 | 55 .sysconfig { |
1530 | 56 margin-right: $offset; |
57 width: 100%; | |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
58 height: 100%; |
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
59 } |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 </style> |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
63 /* 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
|
64 * 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
|
65 * |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
66 * SPDX-License-Identifier: AGPL-3.0-or-later |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
67 * 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
|
68 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
69 * Copyright (C) 2018 by via donau |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
70 * – Österreichische Wasserstraßen-Gesellschaft mbH |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
71 * 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
|
72 * |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
73 * Author(s): |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
74 * Thomas Junk <thomas.junk@intevation.de> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1276
diff
changeset
|
75 * Bernhard Reiter <bernhard@intevation.de> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
76 */ |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
77 import { Chrome } from "vue-color"; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
78 import { Compact } from "vue-color"; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
79 |
1613
f2d24dceecc7
refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents:
1606
diff
changeset
|
80 import { HTTP } from "@/lib/http"; |
f2d24dceecc7
refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents:
1606
diff
changeset
|
81 import { displayError } from "@/lib/errors.js"; |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
82 import { mapState } from "vuex"; |
1606
a4d8f284db93
spacer in admin interface added
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
83 |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 export default { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 name: "systemconfiguration", |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 data() { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
87 return { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
88 sent: false, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
89 strokeColor: { r: 0, g: 0, b: 0, a: 1.0 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
90 fillColor: { r: 0, g: 0, b: 0, a: 1.0 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
91 currentConfig: null |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
92 }; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
93 }, |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
94 components: { |
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
95 "chrome-picker": Chrome, |
1606
a4d8f284db93
spacer in admin interface added
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
96 "compact-picker": Compact, |
1669
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
97 Spacer: () => import("./Spacer") |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
98 }, |
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
99 computed: { |
1606
a4d8f284db93
spacer in admin interface added
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
100 ...mapState("application", ["showSidebar"]) |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
101 }, |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 methods: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 submit() { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
104 HTTP.put("/system/style/Bottlenecks/stroke", this.strokeColor.rgba, { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 headers: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
106 "X-Gemma-Auth": localStorage.getItem("token"), |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 "Content-type": "application/json" |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
108 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 }) |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 .then() |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 .catch(error => { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 const { status, data } = error.response; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
113 displayError({ |
1460 | 114 title: this.$gettext("Backend Error"), |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 message: `${status}: ${data.message || data}` |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 }); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 }); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
119 HTTP.put("/system/style/Bottlenecks/fill", this.fillColor.rgba, { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 headers: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 "X-Gemma-Auth": localStorage.getItem("token"), |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 "Content-type": "application/json" |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 }) |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 .then() |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 .catch(error => { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
127 const { status, data } = error.response; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
128 displayError({ |
1460 | 129 title: this.$gettext("Backend Error"), |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 message: `${status}: ${data.message || data}` |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 }); |
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 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 }, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 mounted() { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
136 HTTP.get("/system/style/Bottlenecks/stroke", { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
137 headers: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
138 "X-Gemma-Auth": localStorage.getItem("token"), |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
139 "Content-type": "application/json" |
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 }) |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
142 .then(response => { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
143 this.strokeColor = response.data.colour; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
144 }) |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
145 .catch(error => { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
146 const { status, data } = error.response; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
147 displayError({ |
1460 | 148 title: this.$gettext("Backend Error"), |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
149 message: `${status}: ${data.message || data}` |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
150 }); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
151 }); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
152 |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
153 HTTP.get("/system/style/Bottlenecks/fill", { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
154 headers: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
155 "X-Gemma-Auth": localStorage.getItem("token"), |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
156 "Content-type": "application/json" |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
157 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
158 }) |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 .then(response => { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
160 this.fillColor = response.data.colour; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
161 }) |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
162 .catch(error => { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
163 const { status, data } = error.response; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
164 displayError({ |
1460 | 165 title: this.$gettext("Backend Error"), |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
166 message: `${status}: ${data.message || data}` |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
167 }); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
168 }); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
169 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
170 }; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
171 </script> |