From df59344aca4be35cb5f9bac4a8df898ec8dc70cd Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 29 Jan 2018 09:44:30 +0000 Subject: [PATCH] vuetify 1.0.0-beta 5 --- src/vue-poc/{vue-api2.xqm => api.xqm} | 5 +- src/vue-poc/{vue-poc.vue => app.vue} | 55 +- src/vue-poc/{vue-poc.xqm => app.xqm} | 0 src/vue-poc/components/filters.js | 4 +- src/vue-poc/components/qd-navlist.vue | 93 +-- src/vue-poc/components/vp-job.vue | 4 +- src/vue-poc/components/vue-ace.vue | 8 +- src/vue-poc/core.js | 47 +- src/vue-poc/expath-pkg.xml | 1 - src/vue-poc/features/adminlog/logs.vue | 8 +- .../features/collection/collections.xqm | 3 +- src/vue-poc/features/edit/edit.vue | 55 +- src/vue-poc/features/eval/eval.vue | 11 +- src/vue-poc/features/job/job.vue | 8 +- src/vue-poc/features/job/jobs.vue | 8 +- src/vue-poc/features/map.vue | 38 -- src/vue-poc/features/select.vue | 39 +- src/vue-poc/features/tasks/rxq-tasks.xqm | 55 +- src/vue-poc/features/tasks/task/task.vue | 86 +++ src/vue-poc/features/tasks/task/task.xqm | 63 ++ src/vue-poc/features/tasks/taskdef.xml | 16 + src/vue-poc/features/tasks/tasks.vue | 14 +- .../tasks/vue-compile/rxq-vue-compile.xqm | 1 - src/vue-poc/lib/file.xqm | 2 +- src/vue-poc/lib/tree.xqm | 2 +- src/vue-poc/lib/vue-compile/vue-compile.xqm | 39 +- src/vue-poc/lib/xqdoc/html-index.xsl | 54 +- src/vue-poc/lib/xqdoc/html-module.xsl | 6 +- src/vue-poc/lib/xqdoc/xqdoc-proj.xqm | 2 +- src/vue-poc/models.gen.xqm | 12 +- src/vue-poc/router.js | 1 + src/vue-poc/static/app-gen.js | 643 ++++++++++++------ src/vue-poc/static/app.html | 17 +- src/vue-poc/static/perf-stat.js | 2 + 34 files changed, 963 insertions(+), 439 deletions(-) rename src/vue-poc/{vue-api2.xqm => api.xqm} (93%) rename src/vue-poc/{vue-poc.vue => app.vue} (85%) rename src/vue-poc/{vue-poc.xqm => app.xqm} (100%) delete mode 100644 src/vue-poc/features/map.vue create mode 100644 src/vue-poc/features/tasks/task/task.vue create mode 100644 src/vue-poc/features/tasks/task/task.xqm diff --git a/src/vue-poc/vue-api2.xqm b/src/vue-poc/api.xqm similarity index 93% rename from src/vue-poc/vue-api2.xqm rename to src/vue-poc/api.xqm index 183632e..6923a31 100644 --- a/src/vue-poc/vue-api2.xqm +++ b/src/vue-poc/api.xqm @@ -62,7 +62,10 @@ function vue-api:test-select($q ) { - {(1 to 100)!(<_>A{.})} + {(1 to 100)!(<_ type="object"> + A{ . } + V{ . } + )} }; diff --git a/src/vue-poc/vue-poc.vue b/src/vue-poc/app.vue similarity index 85% rename from src/vue-poc/vue-poc.vue rename to src/vue-poc/app.vue index abb8c65..535784a 100644 --- a/src/vue-poc/vue-poc.vue +++ b/src/vue-poc/app.vue @@ -5,22 +5,37 @@ absolute v-model="showNotifications" right - clipped :disable-route-watcher="true" app + width="500" > - + Notifications + {{ $notification.nextId }} close -
    -
  • - {{msg.text}} -
  • -
+ + +
@@ -107,7 +122,10 @@ + + {{ $notification.unseen }} notifications + @@ -211,7 +229,7 @@ ]}, {href: '/settings',text: 'Settings',icon: 'settings' }, - {href: '/about',text: 'About', icon: 'help' }, + {href: '/about',text: 'About (v1.1.1)' , icon: 'help' }, ] }}, @@ -238,9 +256,13 @@ alert("@TODO") } }, - + watch: { + showNotifications: function (val) { + console.log("showNotifications",val); + if(!val)this.$notification.unseen=0; + } + }, created(){ - console.log("create-----------") var that=this this.$on("theme",this.onDark) @@ -252,19 +274,6 @@ that.showAlert("vue error:\n"+msg) //alert("vue error"); }; - // Add a response interceptor - - HTTP.interceptors.response.use( - (response)=> { - // Do something with response data - return response; - }, - (error) =>{ - // interupt restxq single - console.log("$$$$$$$$$$$",error) - if(460 != error.response.status)this.showAlert("http error:\n"+error.response.data) - return Promise.reject(error); - }); HTTP.get("status") .then(r=>{ diff --git a/src/vue-poc/vue-poc.xqm b/src/vue-poc/app.xqm similarity index 100% rename from src/vue-poc/vue-poc.xqm rename to src/vue-poc/app.xqm diff --git a/src/vue-poc/components/filters.js b/src/vue-poc/components/filters.js index 56482f1..f266b86 100644 --- a/src/vue-poc/components/filters.js +++ b/src/vue-poc/components/filters.js @@ -6,7 +6,9 @@ Vue.filter("formatDate", function(date) { return moment(date).format("MMMM D, YYYY") }); - +Vue.filter("fromNow", function(date) { + return moment(date).fromNow() +}); Vue.filter('readablizeBytes', function (bytes,decimals) { if(bytes == 0) return '0 Bytes'; var k = 1000, diff --git a/src/vue-poc/components/qd-navlist.vue b/src/vue-poc/components/qd-navlist.vue index a860035..659e444 100644 --- a/src/vue-poc/components/qd-navlist.vue +++ b/src/vue-poc/components/qd-navlist.vue @@ -4,64 +4,41 @@ for nav drawer --> diff --git a/src/vue-poc/features/collection/collections.xqm b/src/vue-poc/features/collection/collections.xqm index f1b7c9c..a0d32d9 100644 --- a/src/vue-poc/features/collection/collections.xqm +++ b/src/vue-poc/features/collection/collections.xqm @@ -39,7 +39,6 @@ declare function vue-api:file($url as xs:string,$protocol as xs:string) as element(json) { - let $_:=trace($protocol,"proto:") let $reader:=map{ "webfile":ufile:webfile#1, "xmldb":ufile:xmldb#1 @@ -58,7 +57,7 @@ as element(json) {for $f in $items/* order by $f/@name/lower-case(.) return <_ type="object"> - {vue-api:details($f=>trace("foo"),"folder")} + {vue-api:details($f,"folder")} } diff --git a/src/vue-poc/features/edit/edit.vue b/src/vue-poc/features/edit/edit.vue index d3b51cb..31746f1 100644 --- a/src/vue-poc/features/edit/edit.vue +++ b/src/vue-poc/features/edit/edit.vue @@ -43,9 +43,10 @@ - {{annotations && annotations.info}} - {{annotations && annotations.warning}} - {{annotations && annotations.error}} + {{annotations && annotations.error}} + {{annotations && annotations.warning}} + {{annotations && annotations.info}} + navigate_next @@ -57,16 +58,44 @@ label_outline - - - vertical_align_center - - - - wrap_text - - - + + + playlist_play + + + + Display settings + + + + vertical_align_center + + Toggle folds + + + + + wrap_text + + Soft wrap + + + Help + + + settings + + Show ACE settings + + + + + keyboard + + Show ACE keyboard shortcuts + + + format_align_center diff --git a/src/vue-poc/features/eval/eval.vue b/src/vue-poc/features/eval/eval.vue index f888807..f6690bd 100644 --- a/src/vue-poc/features/eval/eval.vue +++ b/src/vue-poc/features/eval/eval.vue @@ -88,16 +88,19 @@ Error + - - + + - + + BEFOREINAFTER + diff --git a/src/vue-poc/features/job/job.vue b/src/vue-poc/features/job/job.vue index c4e7cf6..5d6e2d6 100644 --- a/src/vue-poc/features/job/job.vue +++ b/src/vue-poc/features/job/job.vue @@ -42,7 +42,8 @@ return { jobstate:{state:"?",user:"?",duration:"?"}, result:null, - loading:false + loading:false, + timer:null } }, methods:{ @@ -53,7 +54,7 @@ this.loading=false this.jobstate=r.data if(!this.jobstate.id) this.jobstate={state:"cached", text:"Job not found"} - if(!this.finished)setTimeout(()=>{ this.getJob() }, 10000); + if(!this.finished)this.timer=setTimeout(()=>{ this.getJob() }, 10000); }) }, @@ -74,6 +75,9 @@ }, created(){ this.getJob() + }, + beforeDestroy(){ + if(this.timer) clearTimeout(this.timer); } } diff --git a/src/vue-poc/features/job/jobs.vue b/src/vue-poc/features/job/jobs.vue index 1dc61ae..a7e90b7 100644 --- a/src/vue-poc/features/job/jobs.vue +++ b/src/vue-poc/features/job/jobs.vue @@ -79,7 +79,8 @@ selected: [], search: "", loading: false, - autorefresh: true + autorefresh: true, + timer:null } }, methods:{ @@ -89,7 +90,7 @@ .then(r=>{ this.loading=false this.items=r.data - if(this.autorefresh) setTimeout(()=>{ this.getJobs() }, 10000); + if(this.autorefresh) this.timer=setTimeout(()=>{ this.getJobs() }, 10000); }) }, @@ -108,6 +109,9 @@ }, created(){ this.getJobs() + }, + beforeDestroy(){ + if(this.timer) clearTimeout(this.timer); } } diff --git a/src/vue-poc/features/map.vue b/src/vue-poc/features/map.vue deleted file mode 100644 index 5199e50..0000000 --- a/src/vue-poc/features/map.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - diff --git a/src/vue-poc/features/select.vue b/src/vue-poc/features/select.vue index e1c8ed8..fd45750 100644 --- a/src/vue-poc/features/select.vue +++ b/src/vue-poc/features/select.vue @@ -16,16 +16,41 @@

some text

- -
{{$data.value }}
+ + + + + +
{{$data.value }}

multi select

- -
{{$data.value2 }}
+ + v-select +
{{$data.value2 }}
@@ -46,7 +71,6 @@ diff --git a/src/vue-poc/features/tasks/task/task.xqm b/src/vue-poc/features/tasks/task/task.xqm new file mode 100644 index 0000000..2ec1dfb --- /dev/null +++ b/src/vue-poc/features/tasks/task/task.xqm @@ -0,0 +1,63 @@ +(:~ + : task + :) +module namespace vue-rest = 'quodatum:vue.rest'; + + +(:~ + : run compile task. + :) +declare +%rest:POST %rest:path("/vue-poc/api/tasks/task") +%rest:form-param("name", "{$name}") +%rest:produces("application/json") +%output:method("json") +%updating +function vue-rest:vue($name) +{ + db:output( { $name }.) +}; + +(:~ +: new app +:) +declare function vue-rest:new($name as xs:string){ + let $archive:=file:read-binary(fn:resolve-uri('./data/vuetif.zip')) + let $contents := archive:extract-binary($archive) + let $entries:= archive:entries($archive) + (: update paths :) + let $entries:=$entries!fn:replace(.,'vuetif',$name) + let $contents:=$contents!vue-rest:update-extract(.,'[Vv]uetif',$name) + + return archive:create($entries,$contents) +}; + +(:~ + : test for text + : @see http://stackoverflow.com/questions/2644938/how-to-tell-binary-from-text-files-in-linux + :) +declare function vue-rest:is-text($b as xs:base64Binary ) +as xs:boolean{ + fn:empty(bin:find($b, 0,bin:hex("00"))) +}; + +(:~ + : if context is text replace string else return unchanged + :) +declare function vue-rest:update-extract($extract as xs:base64Binary, + $from as xs:string, + $to as xs:string ) +as xs:base64Binary{ + if(vue-rest:is-text($extract)) + then try{ + (: escape chars etc :) + let $t:=convert:binary-to-string($extract) + let $t:=fn:replace($t,$from,$to) + return convert:string-to-base64($t) + } catch * { + $extract + } + else + $extract +}; + \ No newline at end of file diff --git a/src/vue-poc/features/tasks/taskdef.xml b/src/vue-poc/features/tasks/taskdef.xml index 5b35567..27f00a0 100644 --- a/src/vue-poc/features/tasks/taskdef.xml +++ b/src/vue-poc/features/tasks/taskdef.xml @@ -10,4 +10,20 @@ Path to xqm file to generate + + + XQdoc + Generate XQdoc as html + + + + vue compile + + + + application template + + Name for new application + + \ No newline at end of file diff --git a/src/vue-poc/features/tasks/tasks.vue b/src/vue-poc/features/tasks/tasks.vue index 728bc01..44d64ab 100644 --- a/src/vue-poc/features/tasks/tasks.vue +++ b/src/vue-poc/features/tasks/tasks.vue @@ -2,13 +2,7 @@