From c63490b9d87728813f75d5584553624f7228c472 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 5 Jun 2018 22:49:12 +0100 Subject: [PATCH] namespaces --- src/vue-poc/components/qd-autoheight.vue | 27 ++++ src/vue-poc/core.js | 3 +- src/vue-poc/features/collection/files.vue | 6 +- src/vue-poc/features/images/images.vue | 2 +- .../images/tasks/pics-02-store-meta.xq | 11 +- src/vue-poc/features/model/namespace.vue | 71 +++++------ src/vue-poc/features/scratch.vue | 21 ++++ src/vue-poc/router.js | 7 +- src/vue-poc/static/app-gen.js | 116 +++++++++++++----- src/vue-poc/static/app.html | 38 +++--- src/vue-poc/tasks/vue-compile.xq | 5 +- 11 files changed, 201 insertions(+), 106 deletions(-) create mode 100644 src/vue-poc/components/qd-autoheight.vue create mode 100644 src/vue-poc/features/scratch.vue diff --git a/src/vue-poc/components/qd-autoheight.vue b/src/vue-poc/components/qd-autoheight.vue new file mode 100644 index 0000000..5363fb8 --- /dev/null +++ b/src/vue-poc/components/qd-autoheight.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/vue-poc/core.js b/src/vue-poc/core.js index 6a8467b..96ce161 100644 --- a/src/vue-poc/core.js +++ b/src/vue-poc/core.js @@ -36,7 +36,8 @@ HTTP.interceptors.response.use((response) => { var c=response.config; var url=response.config.url + "?" + c.paramsSerializer(c.params); //console.log("interceptors time:",s, response.config); - Notification.add(s +" "+ url ); + var b=`${url} Time: ${s}` + Notification.add(b); } return response; }); diff --git a/src/vue-poc/features/collection/files.vue b/src/vue-poc/features/collection/files.vue index fab796e..730563c 100644 --- a/src/vue-poc/features/collection/files.vue +++ b/src/vue-poc/features/collection/files.vue @@ -27,7 +27,7 @@ S: {{selection.length}} - @@ -246,10 +246,10 @@ return (this.protocol=="xmldb")?"developer_mode":"folder" }, xfiles(){ - return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.includes(this.q))}) + return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))}) }, xfolders(){ - return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.includes(this.q))}) + return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))}) }, // array of {name:"that", path:"/this/that/"} for url crumbs(){ diff --git a/src/vue-poc/features/images/images.vue b/src/vue-poc/features/images/images.vue index 62e8ebf..ae0b2f9 100644 --- a/src/vue-poc/features/images/images.vue +++ b/src/vue-poc/features/images/images.vue @@ -7,7 +7,7 @@ - search + filter_list {{ qtext }} string-join("/")) let $todo:= $relpath[not("/vue-poc/meta/" || .|| "/meta.xml"=$done)] return (for $f in subsequence($todo,1, $CHUNK) let $spath:=$cfg:IMAGEDIR || "../" || $f - let $dbpath:="meta/" || $f || "/meta.xml" + let $dbpath:=$meta || $f || "/meta.xml" let $meta:=imgmeta:read($spath) return db:replace($cfg:DB-IMAGE,$dbpath,$meta), db:output($todo=>count())) \ No newline at end of file diff --git a/src/vue-poc/features/model/namespace.vue b/src/vue-poc/features/model/namespace.vue index 22c9468..bd33329 100644 --- a/src/vue-poc/features/model/namespace.vue +++ b/src/vue-poc/features/model/namespace.vue @@ -10,46 +10,27 @@ >Refresh Text - - - - - - - -

- star {{ props.item.xmlns }} -

-
-
-
- {{ props.item.description }} - - - {{ props.item.prefix }} - Fields - - -
-
-
+ + + + + @@ -64,7 +45,14 @@ pagination: { rowsPerPage: 20 }, - selected:[] + selected:[], + headers: [ + + { text: 'xmlns', value: 'xmlns' }, + + { text: 'Description', value: 'description' }, + { text: 'Prefix', value: 'prefix' } + ] } }, methods: { @@ -84,6 +72,7 @@ }); }, + }, created:function(){ this.q=this.$route.query.q || this.q; diff --git a/src/vue-poc/features/scratch.vue b/src/vue-poc/features/scratch.vue new file mode 100644 index 0000000..a91fd63 --- /dev/null +++ b/src/vue-poc/features/scratch.vue @@ -0,0 +1,21 @@ + + + + diff --git a/src/vue-poc/router.js b/src/vue-poc/router.js index 8599d27..34c16b6 100644 --- a/src/vue-poc/router.js +++ b/src/vue-poc/router.js @@ -32,6 +32,8 @@ const router = new VueRouter({ { path: '/entity/:entity', name:"entity1", component: Entity1, props: true, meta:{title:"Entity"} }, { path: '/namespace', component: Namespace, meta:{title:"Namespaces"} }, + { path: '/namespace/item', component: Namespace1, meta:{title:"Namespace"} }, + { path: '/select', component: Select, meta:{title:"Select"} }, { path: '/search', component: Search, meta:{title:"Search"} }, { path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} }, @@ -90,8 +92,9 @@ const router = new VueRouter({ { path: '/form2', component: Formsjson, meta:{title:"Form schema"} }, { path: '/form3', component: Formsschema, meta:{title:"vue-form-json-schema"} }, - { path: '/about', component: About,meta:{title:"About Vue-poc"} }, - { path: '*', component: Notfound,meta:{title:"Page not found"} } + { path: '/scratch', component: Scratch, meta:{title:"scratch"} }, + { path: '/about', component: About, meta:{title:"About Vue-poc"} }, + { path: '*', component: Notfound, meta:{title:"Page not found"} } ], }); router.afterEach(function(route) { diff --git a/src/vue-poc/static/app-gen.js b/src/vue-poc/static/app-gen.js index 5aae412..69d69c6 100644 --- a/src/vue-poc/static/app-gen.js +++ b/src/vue-poc/static/app-gen.js @@ -1,5 +1,30 @@ -// generated 2018-06-01T23:15:21.554+01:00 +// generated 2018-06-05T22:46:09.838+01:00 +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue +Vue.component('qd-autoheight',{template:` +
+ i will auto2 +
+ `, + + props: ['show'], + created:function(){ + console.log("qd-auto"); + }, + methods:{ + onResize(){ + var el=this.$refs["auto"]; + var e=el; + //console.log("top",e.offsetTop) + var h=Math.max(1,window.innerHeight - e.offsetTop -40) + // console.log("h",h) + e.style.height=h +"px"; + } + } +} + + ); + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-confirm.vue Vue.component('qd-confirm',{template:` @@ -888,7 +913,7 @@ const Files=Vue.extend({template:` S: {{selection.length}} - + @@ -1103,10 +1128,10 @@ const Files=Vue.extend({template:` return (this.protocol=="xmldb")?"developer_mode":"folder" }, xfiles(){ - return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.includes(this.q))}) + return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))}) }, xfolders(){ - return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.includes(this.q))}) + return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))}) }, // array of {name:"that", path:"/this/that/"} for url crumbs(){ @@ -2407,7 +2432,7 @@ const Images=Vue.extend({template:` - search + filter_list {{ qtext }} @@ -3262,29 +3287,22 @@ const Namespace=Vue.extend({template:` Refresh Text - - - - - - - -

- star {{ props.item.xmlns }} -

-
-
-
- {{ props.item.description }} - - - {{ props.item.prefix }} - Fields - - -
-
-
+ + + + + `, @@ -3298,7 +3316,14 @@ const Namespace=Vue.extend({template:` pagination: { rowsPerPage: 20 }, - selected:[] + selected:[], + headers: [ + + { text: 'xmlns', value: 'xmlns' }, + + { text: 'Description', value: 'description' }, + { text: 'Prefix', value: 'prefix' } + ] } }, methods: { @@ -3318,6 +3343,7 @@ const Namespace=Vue.extend({template:` }); }, + }, created:function(){ this.q=this.$route.query.q || this.q; @@ -3671,6 +3697,28 @@ const Repo=Vue.extend({template:` ); +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/scratch.vue +const Scratch=Vue.extend({template:` + + + + + + `, + + data: function(){ + return { + message: 'bad route!', + ace:"here" + } + }, + mounted:function(){ + console.log("notfound",this.$route.path) + } +} + + ); + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/search.vue const Search=Vue.extend({template:` @@ -5219,6 +5267,8 @@ const router = new VueRouter({ { path: '/entity/:entity', name:"entity1", component: Entity1, props: true, meta:{title:"Entity"} }, { path: '/namespace', component: Namespace, meta:{title:"Namespaces"} }, + { path: '/namespace/item', component: Namespace1, meta:{title:"Namespace"} }, + { path: '/select', component: Select, meta:{title:"Select"} }, { path: '/search', component: Search, meta:{title:"Search"} }, { path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} }, @@ -5277,8 +5327,9 @@ const router = new VueRouter({ { path: '/form2', component: Formsjson, meta:{title:"Form schema"} }, { path: '/form3', component: Formsschema, meta:{title:"vue-form-json-schema"} }, - { path: '/about', component: About,meta:{title:"About Vue-poc"} }, - { path: '*', component: Notfound,meta:{title:"Page not found"} } + { path: '/scratch', component: Scratch, meta:{title:"scratch"} }, + { path: '/about', component: About, meta:{title:"About Vue-poc"} }, + { path: '*', component: Notfound, meta:{title:"Page not found"} } ], }); router.afterEach(function(route) { @@ -5610,7 +5661,8 @@ HTTP.interceptors.response.use((response) => { var c=response.config; var url=response.config.url + "?" + c.paramsSerializer(c.params); //console.log("interceptors time:",s, response.config); - Notification.add(s +" "+ url ); + var b=`${url} Time: ${s}` + Notification.add(b); } return response; }); diff --git a/src/vue-poc/static/app.html b/src/vue-poc/static/app.html index c0d2544..865031d 100644 --- a/src/vue-poc/static/app.html +++ b/src/vue-poc/static/app.html @@ -34,28 +34,28 @@ - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - + + - - - + + + diff --git a/src/vue-poc/tasks/vue-compile.xq b/src/vue-poc/tasks/vue-compile.xq index 1113619..39a5f36 100644 --- a/src/vue-poc/tasks/vue-compile.xq +++ b/src/vue-poc/tasks/vue-compile.xq @@ -1,5 +1,4 @@ import module namespace vue = 'quodatum:vue.compile' at "../lib/vue-compile/vue-compile.xqm"; -let $proj:="C:/Users/andy/git/vue-poc/src/vue-poc/" - -return vue:compile( $proj) \ No newline at end of file +declare variable $proj external :="C:/Users/andy/git/vue-poc/src/vue-poc/"; +vue:compile( $proj) \ No newline at end of file