Skip to content

Commit

Permalink
#326 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgramin committed May 30, 2019
1 parent aa57e4e commit 3d472ba
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
16 changes: 7 additions & 9 deletions src/main/malewicz/src/components/ConnectionsListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<li class="list-group-item list-group-item-primary">Connections:</li>
<div v-for="connection in connections" class="list-group-item" v-bind:class="{ disabled: isDisabled(connection.health) }" :key="connection.name" >
<label>
<!--<input type="checkbox" id="defaultCheck1" v-if="isActiveConnection(connection.name)" checked="checked" />-->
<!--<input type="checkbox" id="defaultCheck2" v-else />-->

<input type="checkbox" :value="connection.name" v-model="checkedNames" />
<i :class="connection.properties.css_class"></i>
{{connection.name}}
Expand All @@ -31,12 +28,15 @@ export default {
)
this.doLoading()
},
watch: {
connections: function (newVal, oldVal) {
this.$store.commit('setConnection', newVal[0].name)
}
},
methods: {
isDisabled (health) {
if (health === 'Ok') {
return false
}
return true
return health !== 'Ok';
},
doLoading () {
this.$sse('http://localhost:8007/connections/health', { format: 'json' }) // or { format: 'plain' }
Expand Down Expand Up @@ -67,8 +67,6 @@ export default {
isActiveConnection (connectionName) {
return this.$store.state.connections.includes(connectionName)
}
},
props: {
}
}
</script>
5 changes: 0 additions & 5 deletions src/main/malewicz/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ export default {
return this.$store.getters.getSimpleUri
}
},
methods: {
changeUri: function (event) {
return this.$store.commit('changeUri', event.target.value)
}
},
created: function () {
if (this.$router.currentRoute.fullPath && this.$router.currentRoute.fullPath !== '/') {
this.$store.commit('changeUri', this.$router.currentRoute.fullPath)
Expand Down
2 changes: 1 addition & 1 deletion src/main/malewicz/src/components/ObjectsTablePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<li class="page-item" v-bind:class="{ active: isActivePage(4) }">
<a class="page-link" href="#" v-on:click="setPageNumber(4)">4</a>
</li>
<li class="page-item" v-bind:class="{ disabled: isActivePage(4) }">
<li class="page-item">
<a class="page-link" href="#" aria-label="Next" v-on:click="nextPage">
<span aria-hidden="false">&raquo;</span>
<span class="sr-only">Next</span>
Expand Down
21 changes: 13 additions & 8 deletions src/main/malewicz/src/components/TypesListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@ export default {
return this.$store.commit('setType', type)
}
},
created: function () {
this.$http.get(this.$store.state.host + '/api/' + this.$store.state.connections + '/types').then(
response => {
this.types = response.body
}
)
computed: {
getPreparedTypesUri () {
this.$http.get(this.$store.getters.preparedTypesUri).then (
response => {
this.types = response.body
}
)
return this.$store.getters.preparedTypesUri
}
},
props: {
uri: String
watch: {
getPreparedTypesUri (newVal, oldVal) {
}
}
}
</script>
8 changes: 7 additions & 1 deletion src/main/malewicz/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Vue.config.productionTip = false
const store = new Vuex.Store({
state: {
host: 'http://localhost:8007/',
connections: ['h2'],
connections: '',
type: 'table',
path: [''],
page: { 'number': 1, 'size': 15 },
Expand All @@ -41,6 +41,9 @@ const store = new Vuex.Store({
cache: false
},
getters: {
preparedTypesUri: state => {
return state.host + '/api/' + state.connections + '/types'
},
preparedMetaUri: state => {
return state.host + '/api/meta/' + state.connections + '/' + state.type + '/'
},
Expand All @@ -56,6 +59,9 @@ const store = new Vuex.Store({
}
},
mutations: {
setConnection (state, connectionName) {
state.connections = connectionName
},
setType (state, typeName) {
state.type = typeName
},
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ conf:
"jdbc.user": "",
"jdbc.password": "",
"os.query.rest.port": "8082",
"visible": false,
"visible": true,
"description": "Embedded db for unit tests only"
}
Expand Down

0 comments on commit 3d472ba

Please sign in to comment.