From 65f868fae43ac5587969bacd476bd5b07f97fe6a Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 25 Aug 2017 22:00:59 +0100 Subject: [PATCH] entity allows config --- src/vue-poc/data/vue-poc/state.xml | 3 + src/vue-poc/features/collection/files.vue | 42 +++++---- src/vue-poc/features/eval/eval.vue | 22 +++-- src/vue-poc/features/images/config.xqm | 3 +- src/vue-poc/features/images/images.vue | 35 +++++--- src/vue-poc/features/images/images.xqm | 10 +-- src/vue-poc/lib/entity-gen.xqm | 39 ++++---- src/vue-poc/lib/vue-compile/vue-compile.xqm | 4 +- src/vue-poc/models.gen.xqm | 6 +- src/vue-poc/models/thumbnail.xml | 2 +- src/vue-poc/static/app-gen.js | 99 +++++++++++++-------- src/vue-poc/tasks/generate-model-local.xq | 13 ++- 12 files changed, 166 insertions(+), 112 deletions(-) create mode 100644 src/vue-poc/data/vue-poc/state.xml diff --git a/src/vue-poc/data/vue-poc/state.xml b/src/vue-poc/data/vue-poc/state.xml new file mode 100644 index 0000000..d4ba18d --- /dev/null +++ b/src/vue-poc/data/vue-poc/state.xml @@ -0,0 +1,3 @@ + + 3 + \ No newline at end of file diff --git a/src/vue-poc/features/collection/files.vue b/src/vue-poc/features/collection/files.vue index c575018..24eccc8 100644 --- a/src/vue-poc/features/collection/files.vue +++ b/src/vue-poc/features/collection/files.vue @@ -9,15 +9,15 @@ {{icon}} - - - {{ item.name }} - - + + + {{ item.name }} + + - + view_module @@ -30,7 +30,9 @@ - Folders + + Folders ({{ folders.length }}) + {{ item.icon }} @@ -47,7 +49,9 @@ - Files + + Files ({{ files.length }}) + {{ item.icon }} @@ -93,7 +97,6 @@ url: "", folders: [], files: [], - items: ["root"], q: "", busy: false, showInfo: false, @@ -123,10 +126,8 @@ }); }, - root(){ - this.$router.push({ query: { url: this.url }}) - }, - filter(){ + + setfilter(){ console.log("TODO",this.q) this.$router.push({ query: {url:this.url,q:this.q }}) }, @@ -148,21 +149,24 @@ icon(){ return (this.protocol=="basexdb")?"developer_mode":"folder" }, + // array of {name:"that", path:"/this/that/"} for url crumbs(){ var parts=this.url.split("/").filter((a)=>a.length>0) - var a=parts.map(function(v,i,a){return {name:v, - path:"/"+a.slice(0,i+1).join("/")+"/"}}) - return a + var a=parts.map( + function(v,i,a){return {name:v, path:"/"+a.slice(0,i+1).join("/")+"/"}} + ) + return a } }, watch:{ url(v){ this.$router.push({ query: { url: this.url }}) }, - $route(v){ + $route(vnew,vold){ + //console.log("ROUTE",vnew,vold) var url=this.$route.query.url this.url=url?url:"/"; - this.load(this.url) + if(vnew.query.url != vold.query.url) this.load(this.url) } }, created:function(){ diff --git a/src/vue-poc/features/eval/eval.vue b/src/vue-poc/features/eval/eval.vue index c023f0c..83fa8c9 100644 --- a/src/vue-poc/features/eval/eval.vue +++ b/src/vue-poc/features/eval/eval.vue @@ -9,9 +9,12 @@ play_circle_outline Submit - - play_circle_outline + + library_books Imports + + label + Namespaces more_vert @@ -31,9 +34,7 @@ > - - {{result}} - + {{jobId}} @@ -53,6 +54,11 @@ {{elapsed}}ms + + + {{result}} + + { - this.result=r.data.result + this.result=r.data.result+" " }) }, hitme(){ @@ -151,6 +157,9 @@ imports(){ alert("@TODO imports") }, + namespaces(){ + alert("@TODO namespaces") + }, plan(){ this.awaitResult(false) HTTP.post("eval/plan",Qs.stringify({xq:this.xq})) @@ -166,6 +175,7 @@ }, awaitResult(show){ // ace slow when setting large text while hidden + this.showError=false this.show=show this.result="(Please wait..)" this.showResult=true diff --git a/src/vue-poc/features/images/config.xqm b/src/vue-poc/features/images/config.xqm index 5b5051d..60ef33c 100644 --- a/src/vue-poc/features/images/config.xqm +++ b/src/vue-poc/features/images/config.xqm @@ -2,7 +2,8 @@ xquery version "3.1"; (:~ data locations for image feature :) module namespace cfg = "quodatum:media.image.configure"; -declare variable $cfg:DB:="vue-poc"; +declare variable $cfg:DB-IMAGE:="vue-poc"; + declare variable $cfg:IMAGEDIR:="P:/pictures/Pictures/"; declare variable $cfg:THUMBDIR:="C:/tmp/"; diff --git a/src/vue-poc/features/images/images.vue b/src/vue-poc/features/images/images.vue index 3b663d2..c642892 100644 --- a/src/vue-poc/features/images/images.vue +++ b/src/vue-poc/features/images/images.vue @@ -159,20 +159,20 @@