5858 </v-toolbar >
5959
6060
61-
62-
6361 <v-data-table
6462 :headers =" defaultMeta"
6563 :items =" items"
7977 <td v-for =" met in defaultMeta" >
8078 <a v-if =" met.properties.datatype==='json' && props.item[met.name]"
8179 :href =" '#/'+props.item['endpoint']+'/'+JSON.parse(props.item[met.name].value).link" >
82- <v-chip color =" green" dark >{{ JSON.parse(props.item[met.name].value).label }}</v-chip >
80+ <v-chip color =" green" dark >
81+ {{ JSON.parse(props.item[met.name].value).label }}
82+ </v-chip >
8383 </a >
8484 <span v-else-if =" met.properties.datatype" >{{ props.item[met.name] | formatDate }}</span >
8585 <span v-else >{{ props.item[met.name] }}</span >
@@ -104,32 +104,39 @@ export default {
104104 return {
105105 meta: [],
106106 items: [],
107+ descending: false ,
107108 pagination: {
108- rowsPerPage: - 1
109+ rowsPerPage: - 1 ,
110+ sortBy: ' '
109111 },
110112 dialog: false ,
111113 dialog2: false ,
112114 isLoading: false
113115 }
114116 },
115117 created : function () {
116- this .isLoading = true
117- this .$http .get (this .$store .getters .preparedTypeUri ).then (
118- response => {
119- this .meta = response .body [0 ]
120- }
121- )
122- this .$http .get (this .$store .getters .preparedUri ).then (
123- response => {
124- this .items = response .body
125- if (this .items .length >= 15 && this .message === this .getPageCount ()) {
126- this .increasePageCount ()
118+ // if (this.$store.state.allConnections.length > 0) {
119+ this .isLoading = true
120+ this .$http .get (this .$store .getters .preparedTypeUri ).then (
121+ response => {
122+ this .meta = response .body [0 ]
127123 }
128- this .isLoading = false
129- }
130- )
124+ )
125+ this .$http .get (this .$store .getters .preparedUri ).then (
126+ response => {
127+ this .items = response .body
128+ if (this .items .length >= 15 && this .message === this .getPageCount ()) {
129+ this .increasePageCount ()
130+ }
131+ this .isLoading = false
132+ }
133+ )
134+ // }
131135 },
132136 computed: {
137+ getSort () {
138+ return this .pagination
139+ },
133140 defaultMeta : function () {
134141 if (this .meta .metadata ) {
135142 return this .meta .metadata .filter ( v => { return v .properties .visible !== false } )
@@ -153,6 +160,15 @@ export default {
153160 }
154161 },
155162 watch: {
163+ getSort (newValue ) {
164+ if (newValue .descending === true ) {
165+ this .$store .commit (' setSort' , { " field" : newValue .sortBy , " ord" : " desc" })
166+ } else if (newValue .descending === false ) {
167+ this .$store .commit (' setSort' , { " field" : newValue .sortBy , " ord" : " asc" })
168+ } else {
169+ this .$store .commit (' setSort' , {})
170+ }
171+ },
156172 count (newValue ) {
157173 this .meta = []
158174 this .$http .get (newValue).then (
0 commit comments