Skip to content

Commit debfbaa

Browse files
committed
Admin UI updated, internationalization added (partially).
1 parent 1b7ad05 commit debfbaa

File tree

8 files changed

+111
-120
lines changed

8 files changed

+111
-120
lines changed

src/htdocs-admin/src/components/AppNavigation.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<span>
3-
<v-navigation-drawer
3+
<v-navigation-drawer
44
app
55
v-model="drawer"
66
class="primary lighten-2"
@@ -18,31 +18,33 @@
1818
</template>
1919
</v-list>
2020
</v-navigation-drawer>
21-
<v-app-bar color="primary darken-4" dark>
21+
<v-app-bar color="primary darken-4" dark dense>
2222
<v-app-bar-nav-icon
2323
class="hidden-md-and-up"
2424
@click="drawer = !drawer"
2525
></v-app-bar-nav-icon>
2626
<v-spacer class="hidden-md-and-up"></v-spacer>
27-
<img alt="Vue logo" height="50px" src="../assets/json-scada.svg" />
27+
<img alt="{json-scada}" height="36px" src="../assets/json-scada.svg" />
2828
<v-spacer></v-spacer>
29-
<v-toolbar-title>{{ appTitle }}</v-toolbar-title>
29+
<v-toolbar-title>{{ msg.appTitle }}</v-toolbar-title>
3030
<v-spacer class="hidden-sm-and-down"></v-spacer>
3131
<v-btn text class="hidden-sm-and-down" @click="logout($event)"
32-
>LOGOUT <v-icon>mdi-logout</v-icon>
32+
>{{ msg.logout }} <v-icon>mdi-logout</v-icon>
3333
</v-btn>
3434
</v-app-bar>
3535
</span>
3636
</template>
3737

3838
<script>
39+
import i18n from "@/i18n/i18n-current";
40+
3941
export default {
4042
name: "AppNavigation",
4143
data() {
4244
return {
43-
appTitle: "Admin Management",
45+
msg: { ...i18n },
46+
items: [{ title: i18n.logout }],
4447
drawer: false,
45-
items: [{ title: "Logout" }],
4648
};
4749
},
4850
methods: {
@@ -62,7 +64,7 @@ export default {
6264
console.log("Error on a fetch operation: " + error.message);
6365
})
6466
.finally(() => {
65-
window.location="/login/login.html"
67+
window.location = "/login/login.html";
6668
});
6769
},
6870
},

src/htdocs-admin/src/components/ProtocolConnections.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<v-card>
33
<v-row class="pa-4" justify="space-between">
4-
<v-col cols="5">
4+
<v-col>
55
<v-treeview
66
style="max-height: 500px;min-width: 250px"
77
class="overflow-y-auto overflow-x-hidden"
@@ -1933,12 +1933,13 @@
19331933
</template>
19341934

19351935
<script>
1936-
// const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
1936+
import i18n from "@/i18n/i18n-current";
19371937
19381938
export default {
19391939
name: "ProtocolConnections",
19401940
19411941
data: () => ({
1942+
msg: { ...i18n },
19421943
itemsSizeOfCOT: [1, 2],
19431944
itemsSizeOfCA: [1, 2],
19441945
itemsSizeOfIOA: [1, 2, 3],

src/htdocs-admin/src/components/ProtocolDriverInstances.vue

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<v-card>
33
<v-row class="pa-4" justify="space-between">
4-
<v-col cols="5">
5-
<v-treeview style="max-height: 500px" class="overflow-y-auto overflow-x-hidden"
4+
<v-col>
5+
<v-treeview style="max-height: 500px;min-width: 250px" class="overflow-y-auto overflow-x-hidden"
66
:active.sync="active"
77
:items="items"
88
:load-children="fetchDriverInstances"
@@ -45,17 +45,17 @@
4545
v-else
4646
:key="selected.id"
4747
class="pt-6 mx-auto"
48-
flat
49-
max-width="440"
48+
flat
5049
>
51-
<v-row class="pb-8 mx-auto" justify="space-between">
50+
<v-row min-width="500px" class="mx-auto" justify="space-between">
5251
<v-select
5352
prepend-inner-icon="mdi-cogs"
5453
:items="driverNameItems"
5554
label="Protocol driver"
5655
v-model="selected.protocolDriver"
5756
outlined
5857
@change="updateProtocolDriverInstance"
58+
full-width
5959
></v-select>
6060

6161
<v-tooltip bottom>
@@ -75,13 +75,7 @@
7575
</template>
7676
<span>Delete driver instance!</span>
7777
</v-tooltip>
78-
<v-switch
79-
v-model="selected.enabled"
80-
inset
81-
color="primary"
82-
:label="`Enabled: ${selected.enabled.toString()}`"
83-
@change="updateProtocolDriverInstance"
84-
></v-switch>
78+
8579
<v-dialog v-model="dialogDelInst" max-width="290">
8680
<v-card>
8781
<v-card-title class="headline">
@@ -114,6 +108,14 @@
114108
</v-dialog>
115109
</v-row>
116110

111+
<v-switch
112+
v-model="selected.enabled"
113+
inset
114+
color="primary"
115+
:label="`Enabled: ${selected.enabled.toString()}`"
116+
@change="updateProtocolDriverInstance"
117+
></v-switch>
118+
117119
<v-text-field
118120
class="pb-8"
119121
prepend-inner-icon="mdi-play-circle"
@@ -211,12 +213,13 @@
211213
</template>
212214

213215
<script>
214-
// const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
216+
import i18n from "@/i18n/i18n-current";
215217
216218
export default {
217219
name: "ProtocolDriversInstances",
218220
219221
data: () => ({
222+
msg: { ...i18n },
220223
dialogAddNode: false,
221224
dialogDelInst: false,
222225
active: [],

0 commit comments

Comments
 (0)