Skip to content

Commit 4ad576b

Browse files
committed
1 parent 0e4fcfa commit 4ad576b

6 files changed

Lines changed: 23 additions & 30 deletions

File tree

src/main/malewicz/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"vue-notification": "^1.3.16",
2828
"vue-router": "^3.0.1",
2929
"vue-sse": "^1.0.2",
30-
"vue-tree-navigation": "^4.0.1",
3130
"vuetify": "^1.5.14",
3231
"vuex": "^3.0.1"
3332
},

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<v-list>
77
<v-list-tile v-for="item in connections" :key="item.name">
88
<v-list-tile-action>
9-
<v-checkbox v-model="$store.state.uri.newConnections" :value="item.name"/>
9+
<v-checkbox v-model="$store.state.uri.connections" :value="item.name"/>
1010
</v-list-tile-action>
1111
<v-list-tile-content>
1212
<v-list-tile-title>{{ item.name }}</v-list-tile-title>
@@ -27,12 +27,9 @@
2727
created: function () {
2828
this.$http.get(this.$store.state.uri.host + '/endpoints').then(
2929
response => {
30-
this.connections = response.body.filter(v => {
31-
return v.properties.visible !== false
32-
})
30+
this.connections = response.body.filter(v => { return v.properties.visible !== false })
3331
}
3432
)
3533
}
36-
3734
}
3835
</script>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@
4242
name: 'HelloWorld',
4343
components: {ObjectsTablePanel, ConnectionsListPanel, TypesListPanel},
4444
watch: {
45-
4645
$route(to, from) {
4746
this.$store.commit('changeUri', to.fullPath)
4847
},
49-
5048
getSimpleUri: function (newUri, oldUri) {
5149
this.$router.push({path: '/' + newUri})
5250
}
@@ -57,9 +55,7 @@
5755
}
5856
},
5957
created: function () {
60-
// if (this.$router.currentRoute.fullPath && this.$router.currentRoute.fullPath !== '/') {
6158
this.$store.commit('changeUri', this.$router.currentRoute.fullPath)
62-
// }
6359
}
6460
}
6561

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@
4646
</v-btn>
4747
</template>
4848
<v-card>
49-
<v-card-title class="headline grey lighten-2" primary-title>
50-
Privacy Policy
51-
</v-card-title>
49+
<v-card-title class="headline grey lighten-2" primary-title>SQL-query</v-card-title>
5250
<v-card-text>
5351
<pre v-highlightjs="meta.query" class="text-sm-left"><code class="sql"></code></pre>
5452
</v-card-text>
5553
</v-card>
5654
</v-dialog>
5755

56+
<v-btn @click="call()" icon>
57+
<v-icon>refresh</v-icon>
58+
</v-btn>
59+
5860
</v-toolbar>
5961

6062

@@ -81,6 +83,7 @@
8183
{{ JSON.parse(props.item[met.name].value).label }}
8284
</v-chip>
8385
</a>
86+
<pre v-else-if="met.properties.format==='sql'" v-highlightjs="props.item[met.name]" class="text-sm-left"><code class="sql"></code></pre>
8487
<span v-else-if="met.properties.datatype">{{ props.item[met.name] | formatDate }}</span>
8588
<span v-else>{{ props.item[met.name] }}</span>
8689
</td>
@@ -114,7 +117,7 @@ export default {
114117
}
115118
},
116119
created: function () {
117-
if (this.$store.state.uri.newConnections.length > 0) {
120+
if (this.$store.state.uri.connections.length > 0) {
118121
this.isLoading = true
119122
this.$http.get(this.$store.getters.preparedTypeUri).then(
120123
response => {
@@ -143,10 +146,10 @@ export default {
143146
return this.meta.metadata
144147
}
145148
},
146-
count () {
149+
typeUri () {
147150
return this.$store.getters.preparedTypeUri
148151
},
149-
uri () {
152+
objectUri () {
150153
return this.$store.getters.preparedUri
151154
},
152155
message: {
@@ -168,7 +171,7 @@ export default {
168171
this.$store.commit('setSort', {})
169172
}
170173
},
171-
count (newValue) {
174+
typeUri (newValue) {
172175
this.meta = []
173176
this.$http.get(newValue).then(
174177
response => {
@@ -177,7 +180,7 @@ export default {
177180
}
178181
)
179182
},
180-
uri (newValue) {
183+
objectUri (newValue) {
181184
this.items = []
182185
this.isLoading = true
183186
this.$http.get(newValue).then(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
computed: {
7474
getPreparedTypesUri() {
75-
if (this.$store.state.uri.newConnections.length > 0) {
75+
if (this.$store.state.uri.connections.length > 0) {
7676
this.$http.get(this.$store.getters.preparedTypesUri).then(
7777
response => {
7878
this.types = response.body

src/main/malewicz/src/main.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import Vuex from 'vuex'
3737
import App from './App'
3838
import router from './router'
3939
import VueResource from 'vue-resource'
40-
import VueTreeNavigation from 'vue-tree-navigation'
4140

4241
import Notifications from 'vue-notification'
4342
import JsonExcel from 'vue-json-excel'
@@ -52,7 +51,6 @@ import 'vuetify/dist/vuetify.min.css' // Ensure you are using css-loader
5251

5352
Vue.use(VueResource)
5453
Vue.use(Vuex)
55-
Vue.use(VueTreeNavigation)
5654
Vue.use(Notifications)
5755
Vue.component('downloadExcel', JsonExcel)
5856
Vue.use(VueSSE)
@@ -83,19 +81,22 @@ const store = new Vuex.Store({
8381
}
8482
},
8583
getters: {
84+
uri: state => {
85+
return state.uri
86+
},
8687
preparedTypesUri: state => {
87-
return state.uri.host + '/api/' + state.uri.newConnections[0] + '/types'
88+
return state.uri.host + '/api/' + state.uri.connections[0] + '/types'
8889
},
8990
preparedTypeUri: state => {
90-
return state.uri.host + '/api/' + state.uri.newConnections[0] + '/types' + '/' + state.uri.type
91+
return state.uri.host + '/api/' + state.uri.connections[0] + '/types' + '/' + state.uri.type
9192
},
9293
preparedUri: state => {
93-
return state.uri.host + '/api/' + state.uri.newConnections.join('|') + '/' + state.uri.type + '/' + state.uri.path +
94+
return state.uri.host + '/api/' + state.uri.connections.join('|') + '/' + state.uri.type + '/' + state.uri.path +
9495
'?page=' + state.uri.page.number + ',' + state.uri.page.size +
9596
(state.uri.orderby.field ? ('&orderby=' + state.uri.orderby.field + '-' + state.uri.orderby.ord) : '')
9697
},
9798
getSimpleUri: state => {
98-
return state.uri.newConnections.join('|') + '/' + state.uri.type + '/' + (state.uri.path ? state.uri.path : '') +
99+
return state.uri.connections.join('|') + '/' + state.uri.type + '/' + (state.uri.path ? state.uri.path : '') +
99100
'?page=' + state.uri.page.number + ',' + state.uri.page.size +
100101
(state.uri.orderby.field ? ('&orderby=' + state.uri.orderby.field + '-' + state.uri.orderby.ord) : '')
101102
},
@@ -109,13 +110,10 @@ const store = new Vuex.Store({
109110
return state.uri.page.number
110111
},
111112
getConnections: state => {
112-
return state.uri.newConnections
113+
return state.uri.connections
113114
}
114115
},
115116
mutations: {
116-
setNewConnection (state, connectionName) {
117-
state.uri.newConnections = connectionName
118-
},
119117
setType (state, typeName) {
120118
state.uri.type = typeName
121119
},
@@ -150,7 +148,7 @@ const store = new Vuex.Store({
150148
const path = url.pathname.split('/').filter(v => v);
151149
const rawConnections = path[0]
152150
if (rawConnections) {
153-
state.uri.newConnections = path[0].split('|')
151+
state.uri.connections = path[0].split('|')
154152
state.uri.type = path[1]
155153
if (path[2]) {
156154
state.uri.path = path[2]

0 commit comments

Comments
 (0)