annotate client/src/main.js @ 713:badbc0207418

feat: systeminformation feature added Under systeminformation there is a component to display textual data. Currently there is a stub log from my console displayed.
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 21 Sep 2018 13:18:30 +0200
parents 4bc27eea4f09
children aa2acb942e55
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 import Vue from "vue";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 import App from "./App.vue";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 import router from "./router";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 import store from "./store";
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
5 import GetTextPlugin from "vue-gettext";
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
6 import translations from "./translations.json";
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
7 import locale2 from "locale2";
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
8 import CxltToastr from "cxlt-vue2-toastr";
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
9 import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
10 import "../node_modules/font-awesome/css/font-awesome.min.css";
428
d7a06b9fffc9 feat: Usability for usermanagement improved.
Thomas Junk <thomas.junk@intevation.de>
parents: 375
diff changeset
11 import "../node_modules/animate.css/animate.min.css";
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
12 import "../node_modules/ol/ol.css";
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
13 import "../node_modules/cxlt-vue2-toastr/dist/css/cxlt-vue2-toastr.css";
713
badbc0207418 feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents: 565
diff changeset
14 import "../node_modules/highlight.js/styles/paraiso-dark.css";
565
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
15 import VTooltip from "v-tooltip";
713
badbc0207418 feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents: 565
diff changeset
16 import VueHighlightJS from "vue-highlightjs";
badbc0207418 feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents: 565
diff changeset
17 Vue.use(VueHighlightJS);
565
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
18
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
19 Vue.use(VTooltip);
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
20
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
21 var toastrConfigs = {
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
22 position: "bottom center",
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
23 showDuration: 2000,
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
24 timeOut: 8000,
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
25 closeButton: true
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
26 };
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
27
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
28 Vue.use(CxltToastr, toastrConfigs);
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
29
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
30 let browserLanguage = locale2;
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
31
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
32 // planned also SK, HU, HR, RS, BiH, BG, RO, UA
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
33 const supportedLanguages = {
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
34 en_GB: "British English",
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
35 de_AT: "Deutsch"
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
36 };
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
37
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
38 if (browserLanguage === "de-DE") {
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
39 browserLanguage = "de-AT"; // map german to austrian variant for now
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
40 }
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
41
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
42 const language = browserLanguage.replace("-", "_");
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
43 const isLanguageAvailable = supportedLanguages[language];
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
44 let defaultLanguage = isLanguageAvailable ? language : "en_GB";
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
45
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
46 Vue.use(GetTextPlugin, {
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
47 translations: translations,
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
48 availableLanguages: supportedLanguages,
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
49 defaultLanguage: defaultLanguage
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
50 });
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
51
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
52 Vue.config.productionTip = false;
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
53
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
54 const app = new Vue({
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
55 router,
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
56 store,
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
57 render: h => h(App)
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
58 }).$mount("#app");
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
59
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
60 export default app;