File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 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" >» ; </span >
2828 <span class =" sr-only" >Next</span >
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ Vue.config.productionTip = false
3232const 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 } ,
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments