Skip to content

Commit 3d472ba

Browse files
committed
#326 fix
1 parent aa57e4e commit 3d472ba

6 files changed

Lines changed: 29 additions & 25 deletions

File tree

src/main/malewicz/src/components/ConnectionsListPanel.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
<li class="list-group-item list-group-item-primary">Connections:</li>
44
<div v-for="connection in connections" class="list-group-item" v-bind:class="{ disabled: isDisabled(connection.health) }" :key="connection.name" >
55
<label>
6-
<!--<input type="checkbox" id="defaultCheck1" v-if="isActiveConnection(connection.name)" checked="checked" />-->
7-
<!--<input type="checkbox" id="defaultCheck2" v-else />-->
8-
96
<input type="checkbox" :value="connection.name" v-model="checkedNames" />
107
<i :class="connection.properties.css_class"></i>
118
{{connection.name}}
@@ -31,12 +28,15 @@ export default {
3128
)
3229
this.doLoading()
3330
},
31+
watch: {
32+
connections: function (newVal, oldVal) {
33+
this.$store.commit('setConnection', newVal[0].name)
34+
}
35+
},
3436
methods: {
3537
isDisabled (health) {
36-
if (health === 'Ok') {
37-
return false
38-
}
39-
return true
38+
return health !== 'Ok';
39+
4040
},
4141
doLoading () {
4242
this.$sse('http://localhost:8007/connections/health', { format: 'json' }) // or { format: 'plain' }
@@ -67,8 +67,6 @@ export default {
6767
isActiveConnection (connectionName) {
6868
return this.$store.state.connections.includes(connectionName)
6969
}
70-
},
71-
props: {
7270
}
7371
}
7472
</script>

src/main/malewicz/src/components/HelloWorld.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ export default {
3939
return this.$store.getters.getSimpleUri
4040
}
4141
},
42-
methods: {
43-
changeUri: function (event) {
44-
return this.$store.commit('changeUri', event.target.value)
45-
}
46-
},
4742
created: function () {
4843
if (this.$router.currentRoute.fullPath && this.$router.currentRoute.fullPath !== '/') {
4944
this.$store.commit('changeUri', this.$router.currentRoute.fullPath)

src/main/malewicz/src/components/ObjectsTablePanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<li class="page-item" v-bind:class="{ active: isActivePage(4) }">
2323
<a class="page-link" href="#" v-on:click="setPageNumber(4)">4</a>
2424
</li>
25-
<li class="page-item" v-bind:class="{ disabled: isActivePage(4) }">
25+
<li class="page-item">
2626
<a class="page-link" href="#" aria-label="Next" v-on:click="nextPage">
2727
<span aria-hidden="false">&raquo;</span>
2828
<span class="sr-only">Next</span>

src/main/malewicz/src/components/TypesListPanel.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ export default {
2929
return this.$store.commit('setType', type)
3030
}
3131
},
32-
created: function () {
33-
this.$http.get(this.$store.state.host + '/api/' + this.$store.state.connections + '/types').then(
34-
response => {
35-
this.types = response.body
36-
}
37-
)
32+
computed: {
33+
getPreparedTypesUri () {
34+
this.$http.get(this.$store.getters.preparedTypesUri).then (
35+
response => {
36+
this.types = response.body
37+
}
38+
)
39+
return this.$store.getters.preparedTypesUri
40+
}
3841
},
39-
props: {
40-
uri: String
42+
watch: {
43+
getPreparedTypesUri (newVal, oldVal) {
44+
45+
}
4146
}
4247
}
4348
</script>

src/main/malewicz/src/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Vue.config.productionTip = false
3232
const store = new Vuex.Store({
3333
state: {
3434
host: 'http://localhost:8007/',
35-
connections: ['h2'],
35+
connections: '',
3636
type: 'table',
3737
path: [''],
3838
page: { 'number': 1, 'size': 15 },
@@ -41,6 +41,9 @@ const store = new Vuex.Store({
4141
cache: false
4242
},
4343
getters: {
44+
preparedTypesUri: state => {
45+
return state.host + '/api/' + state.connections + '/types'
46+
},
4447
preparedMetaUri: state => {
4548
return state.host + '/api/meta/' + state.connections + '/' + state.type + '/'
4649
},
@@ -56,6 +59,9 @@ const store = new Vuex.Store({
5659
}
5760
},
5861
mutations: {
62+
setConnection (state, connectionName) {
63+
state.connections = connectionName
64+
},
5965
setType (state, typeName) {
6066
state.type = typeName
6167
},

src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ conf:
2323
"jdbc.user": "",
2424
"jdbc.password": "",
2525
"os.query.rest.port": "8082",
26-
"visible": false,
26+
"visible": true,
2727
"description": "Embedded db for unit tests only"
2828
}
2929

0 commit comments

Comments
 (0)