diff --git a/src/vue-poc/components/core.js b/src/vue-poc/components/core.js
index 6be0fbe..cc7d3c0 100644
--- a/src/vue-poc/components/core.js
+++ b/src/vue-poc/components/core.js
@@ -93,6 +93,7 @@ const router = new VueRouter({
{ path: '/tasks/vuecompile', component: Vuecompile,meta:{title:"vue compile"} },
{ path: '/jobs', component: Job,meta:{title:"Jobs"} },
{ path: '/timeline', component: Timeline,meta:{title:"timeline"} },
+ { path: '/about', component: About,meta:{title:"About Vue-poc"} },
{ path: '*', component: Notfound,meta:{title:"Page not found"} }
],
});
@@ -135,7 +136,7 @@ const app = new Vue({
children: [
{href: '/database', text: 'Databases',icon: 'account_balance' },
{href: '/files', text: 'File system',icon: 'folder' },
- {href: '/edit',text: 'edit',icon: 'mode_edit'},
+ {href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/history',text: 'history',icon: 'history'}
]},
{
@@ -153,7 +154,7 @@ const app = new Vue({
children: [
{href: '/jobs',text: 'Running jobs',icon: 'dashboard'},
{href: '/logs',text: 'Server logs',icon: 'dns'},
- {href: '/ping',text: 'ping',icon: 'update'}
+ {href: '/ping',text: 'Ping',icon: 'update'}
]},
{
icon: 'camera_roll',
@@ -161,7 +162,7 @@ const app = new Vue({
model: false,
children: [
{href: '/images',text: 'Collection',icon: 'photo_camera'},
- {href: '/thumbnail',text: 'thumbnail',icon: 'touch_app'}
+ {href: '/thumbnail',text: 'Thumbnail',icon: 'touch_app'}
]},
{
icon: 'more_horiz',
@@ -169,12 +170,14 @@ const app = new Vue({
model: false,
children: [
{href: '/session',text: 'Session',icon: 'person'},
- {href: '/select',text: 'select',icon: 'extension'},
+ {href: '/select',text: 'Select',icon: 'extension'},
{href: '/puzzle',text: 'Puzzle',icon: 'extension'},
- {href: '/tabs',text: 'tabs',icon: 'switch_camera'},
- {href: '/timeline',text: 'time line',icon: 'timelapse'}
+ {href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
+ {href: '/timeline',text: 'Time line',icon: 'timelapse'}
]},
- {href: '/settings',text: 'settings',icon: 'settings' }
+
+ {href: '/settings',text: 'Settings',icon: 'settings' },
+ {href: '/about',text: 'About', icon: 'help' },
]
}},
diff --git a/src/vue-poc/expath-pkg.xml b/src/vue-poc/expath-pkg.xml
index d3c584d..0a53225 100644
--- a/src/vue-poc/expath-pkg.xml
+++ b/src/vue-poc/expath-pkg.xml
@@ -2,7 +2,7 @@
abbrev="vue-poc" version="0.0.4" spec="1.0">
vue-poc test of vue.js.
-
+
diff --git a/src/vue-poc/features/about.vue b/src/vue-poc/features/about.vue
index 6bef888..8b83cbd 100644
--- a/src/vue-poc/features/about.vue
+++ b/src/vue-poc/features/about.vue
@@ -1,7 +1,7 @@
+ height="200px" class="pa-5 indigo accent-3">
VUE-POC
v0.0.2
diff --git a/src/vue-poc/features/adminlog/logs.vue b/src/vue-poc/features/adminlog/logs.vue
index 8e31209..591315b 100644
--- a/src/vue-poc/features/adminlog/logs.vue
+++ b/src/vue-poc/features/adminlog/logs.vue
@@ -2,7 +2,7 @@
-
+
{
this.elapsed=Math.floor(performance.now() - this.start);
this.result=r.data.result
diff --git a/src/vue-poc/features/home.vue b/src/vue-poc/features/home.vue
index 089e422..802987e 100644
--- a/src/vue-poc/features/home.vue
+++ b/src/vue-poc/features/home.vue
@@ -1,7 +1,7 @@
+ height="200px" class="pa-5 indigo">
VUE-POC
v0.0.2
diff --git a/src/vue-poc/features/images/image.vue b/src/vue-poc/features/images/image.vue
index 507a872..1bbefac 100644
--- a/src/vue-poc/features/images/image.vue
+++ b/src/vue-poc/features/images/image.vue
@@ -5,11 +5,23 @@
-->
- Image: {{id}}
+ Image: {{ id }}
+ doc {{ image && image.doc }}
diff --git a/src/vue-poc/features/images/images.vue b/src/vue-poc/features/images/images.vue
index 31252ba..1ebd533 100644
--- a/src/vue-poc/features/images/images.vue
+++ b/src/vue-poc/features/images/images.vue
@@ -6,42 +6,90 @@
-
-
-
+
+
+
+
+
+ Set filter...
+
+ close
+
+
+
+
-
-
+
- Cancel
- Save
+ Cancel
+ Save
-
- Clear
-
- next
- {{query.page}}
- back
+
+
+
+
+
+
+ Apply
+
+
+
+ clear
+
+
+
+
+ Page:{{ query.page+1 }}
+
+ arrow_back
+
+
+ arrow_forward
+
+
+
{{selitem.name}}
- highlight_off
+ highlight_off
blah blah
@@ -91,7 +139,9 @@
keyword:null
},
modal:false, // showing datepicker
-
+ showFilter:false,
+ busy:false,
+ menu2:false,
keywords:[],
showInfo:false,
selitem:"TODO"
@@ -101,14 +151,17 @@
return "data:image/jpeg;base64,"+item.data
},
getImages(){
+ this.busy=true
HTTP.get("images/list",{params:this.query})
.then(r=>{
+ this.busy=false
this.images=r.data.items
})
},
clear(){
this.query.from=null;
this.query.keyword=null;
+ this.query.page=0;
},
selected(image){
this.selitem=image;
@@ -119,6 +172,12 @@
}
},
+ computed:{
+ qtext(){
+ var k=this.query.keyword,f=this.query.from
+ return (k?" keyword:'"+k+"'":"")+ (f?" from:" + f:"")
+ }
+ },
watch:{
"query":{
handler:function(v){
diff --git a/src/vue-poc/features/images/images.xqm b/src/vue-poc/features/images/images.xqm
index d184afb..8e1037c 100644
--- a/src/vue-poc/features/images/images.xqm
+++ b/src/vue-poc/features/images/images.xqm
@@ -8,8 +8,29 @@ import module namespace fw="quodatum:file.walker";
import module namespace entity = 'quodatum.models.generated' at "../../models.gen.xqm";
declare namespace c="http://www.w3.org/ns/xproc-step";
-declare variable $vue-api:PICS:="c:\tmp\";
+declare variable $vue-api:IMAGEDIR:="P:/pictures/";
+declare variable $vue-api:THUMBDIR:="C:/tmp/";
+(:
+declare variable $vue-api:IMAGEDIR:="/mnt/sda1/pictures/";
+declare variable $vue-api:THUMBDIR:="/mnt/sda1/pictures/thumbs/";
+:)
+declare variable $vue-api:entity:=$entity:list("thumbnail");
+(:~
+ : do a thumbnail
+ :)
+declare
+%rest:GET %rest:path("/vue-poc/api/images/list/{ $id }")
+%rest:produces("application/json")
+%output:method("json")
+function vue-api:id( $id as xs:integer)
+{
+ let $image:=db:open-id("vue-poc",$id)
+ return
+ { serialize($image) }
+ { vue-api:get-image($image) }
+
+};
(:~
: do a thumbnail
:)
@@ -27,8 +48,7 @@ $keyword
{
let $a:=trace(($from,$keyword),"----------")
let $rowsPerPage:=24
- let $entity:=$entity:list("thumbnail")
- let $images:=$entity("data")()
+ let $images:=$vue-api:entity("data")()
let $images:=if($from)then $images[datetaken ge $from] else $images
let $images:=if($keyword)then $images[keywords/keyword = $keyword] else $images
let $images:=subsequence($images,1+$rowsPerPage*$page,$rowsPerPage)
@@ -37,7 +57,7 @@ $keyword
{
for $f in $images
return <_ type="object">
- {vue-api:get-image($f,$entity)}
+ {vue-api:get-image($f)}
}
@@ -63,14 +83,15 @@ return
};
-declare function vue-api:get-image($image as element(image),$entity)
+(:~ fields for image for json :)
+declare function vue-api:get-image($image as element(image))
as element(*)*
{
-let $id:=$entity?access?id($image)
-let $path:=$entity?access?path($image)
-let $name:=$entity?access?name($image)
-let $thumb:= $vue-api:PICS || $path
-let $thumb:=if(file:exists($thumb)) then $thumb else "C:\tmp\art.jpg"
+let $id:=$vue-api:entity?access?id($image)
+let $path:=$vue-api:entity?access?path($image)
+let $name:=$vue-api:entity?access?name($image)
+let $thumb:= $vue-api:THUMBDIR || $path
+let $thumb:=if(file:exists($thumb)) then $thumb else $vue-api:THUMBDIR || "missing.jpg"
return ( {$id}
,{$name}
,{fetch:binary($thumb)}
diff --git a/src/vue-poc/features/job/jobs.vue b/src/vue-poc/features/job/jobs.vue
index 93b54ce..c9d0805 100644
--- a/src/vue-poc/features/job/jobs.vue
+++ b/src/vue-poc/features/job/jobs.vue
@@ -1,7 +1,7 @@
-
+
- Simple performance measure. Read or increment a database value.
- Counter:{{counter}}
+
+
+ Simple performance measure
+
+ Reset
+
+
+ Read or increment a database value.
+ Counter:{{counter}}
- Reset
+
+
+
diff --git a/src/vue-poc/lib/vue-compile/vue-compile.xqm b/src/vue-poc/lib/vue-compile/vue-compile.xqm
index 5eb854c..e410ee9 100644
--- a/src/vue-poc/lib/vue-compile/vue-compile.xqm
+++ b/src/vue-poc/lib/vue-compile/vue-compile.xqm
@@ -70,7 +70,7 @@ declare function vue:capitalize-first
:)
declare function vue:compile($proj as xs:string)
{
-let $FEATURES:="features/"=>file:resolve-path($proj)
+let $FEATURES:="features/"=>file:resolve-path($proj=>trace("proj:"))
let $COMPONENTS:="components/"=>file:resolve-path($proj)
let $CORE:="components/core.js"=>file:resolve-path($proj)
let $FILTERS:="components/filters.js"=>file:resolve-path($proj)
diff --git a/src/vue-poc/models.gen.xqm b/src/vue-poc/models.gen.xqm
index 9d0bc2f..6583be9 100644
--- a/src/vue-poc/models.gen.xqm
+++ b/src/vue-poc/models.gen.xqm
@@ -1,5 +1,5 @@
(: entity access maps
- : auto generated from xml files in entities folder at: 2017-08-09T10:36:00.509+01:00
+ : auto generated from xml files in entities folder at: 2017-08-09T12:18:41.183+01:00
:)
module namespace entity = 'quodatum.models.generated';
diff --git a/src/vue-poc/static/app-gen.js b/src/vue-poc/static/app-gen.js
index 79b60ff..aba6293 100644
--- a/src/vue-poc/static/app-gen.js
+++ b/src/vue-poc/static/app-gen.js
@@ -1,4 +1,4 @@
-// generated 2017-08-09T10:37:44.029+01:00
+// generated 2017-08-13T11:45:59.085+01:00
Vue.component('qd-link',{template:`
{{href}}link
`,
@@ -145,7 +145,7 @@ Vue.filter('round', function(value, decimals) {
}
);
- const About=Vue.extend({template:`
+ const About=Vue.extend({template:`
VUE-POC
v0.0.2
@@ -170,7 +170,7 @@ v0.0.2
const Log=Vue.extend({template:`
-
+
refresh
@@ -788,10 +788,9 @@ v0.0.2
},
run(){
- var data={xq:this.xq}
this.showError=this.show=false
this.start = performance.now();
- HTTP.post("eval/execute",Qs.stringify(data))
+ HTTP.post("eval/execute",Qs.stringify({xq:this.xq}))
.then(r=>{
this.elapsed=Math.floor(performance.now() - this.start);
this.result=r.data.result
@@ -857,7 +856,7 @@ v0.0.2
}
);
- const Home=Vue.extend({template:`
+ const Home=Vue.extend({template:`
VUE-POC
v0.0.2
@@ -881,37 +880,78 @@ v0.0.2
);
const Image=Vue.extend({template:`
- Image: {{id}}
+ Image: {{ id }}
+ doc {{ image && image.doc }}
`,
- props:["id"]
+ props:["id"],
+ data: ()=>( {
+ image:null
+ }),
+ created:function(){
+ var id=this._props.id
+ HTTP.get("images/list/"+id)
+ .then(r=>{
+ console.log(r.data)
+ this.image=r.data
+ })
+ }
}
);
const Images=Vue.extend({template:`
-
-
-
-
-
+
+
+
+
+
+
+ Set filter...
+
+ close
+
+
+
+
+
+
+
- Cancel
- Save
+ Cancel
+ Save
-
- Clear
-
- next
- {{query.page}}
- back
+
+
+
+
+
+
+ Apply
+
+
+
+ clear
+
+
+
+
+ Page:{{ query.page+1 }}
+
+ arrow_back
+
+
+ arrow_forward
+
+
+
@@ -939,7 +979,7 @@ v0.0.2
{{selitem.name}}
- highlight_off
+ highlight_off
blah blah
@@ -955,7 +995,9 @@ v0.0.2
keyword:null
},
modal:false, // showing datepicker
-
+ showFilter:false,
+ busy:false,
+ menu2:false,
keywords:[],
showInfo:false,
selitem:"TODO"
@@ -965,14 +1007,17 @@ v0.0.2
return "data:image/jpeg;base64,"+item.data
},
getImages(){
+ this.busy=true
HTTP.get("images/list",{params:this.query})
.then(r=>{
+ this.busy=false
this.images=r.data.items
})
},
clear(){
this.query.from=null;
this.query.keyword=null;
+ this.query.page=0;
},
selected(image){
this.selitem=image;
@@ -983,6 +1028,12 @@ v0.0.2
}
},
+ computed:{
+ qtext(){
+ var k=this.query.keyword,f=this.query.from
+ return (k?" keyword:'"+k+"'":"")+ (f?" from:" + f:"")
+ }
+ },
watch:{
"query":{
handler:function(v){
@@ -1009,7 +1060,7 @@ v0.0.2
);
const Job=Vue.extend({template:`
-
+
refresh
@@ -1153,8 +1204,15 @@ v0.0.2
);
const Ping=Vue.extend({template:`
- Simple performance measure. Read or increment a database value.
- Counter:{{counter}}
+
+
+ Simple performance measure
+
+ Reset
+
+
+ Read or increment a database value.
+ Counter:{{counter}}
@@ -1233,7 +1291,9 @@ v0.0.2
- Reset
+
+
+
`,
@@ -2091,6 +2151,7 @@ const router = new VueRouter({
{ path: '/tasks/vuecompile', component: Vuecompile,meta:{title:"vue compile"} },
{ path: '/jobs', component: Job,meta:{title:"Jobs"} },
{ path: '/timeline', component: Timeline,meta:{title:"timeline"} },
+ { path: '/about', component: About,meta:{title:"About Vue-poc"} },
{ path: '*', component: Notfound,meta:{title:"Page not found"} }
],
});
@@ -2133,7 +2194,7 @@ const app = new Vue({
children: [
{href: '/database', text: 'Databases',icon: 'account_balance' },
{href: '/files', text: 'File system',icon: 'folder' },
- {href: '/edit',text: 'edit',icon: 'mode_edit'},
+ {href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/history',text: 'history',icon: 'history'}
]},
{
@@ -2151,7 +2212,7 @@ const app = new Vue({
children: [
{href: '/jobs',text: 'Running jobs',icon: 'dashboard'},
{href: '/logs',text: 'Server logs',icon: 'dns'},
- {href: '/ping',text: 'ping',icon: 'update'}
+ {href: '/ping',text: 'Ping',icon: 'update'}
]},
{
icon: 'camera_roll',
@@ -2159,7 +2220,7 @@ const app = new Vue({
model: false,
children: [
{href: '/images',text: 'Collection',icon: 'photo_camera'},
- {href: '/thumbnail',text: 'thumbnail',icon: 'touch_app'}
+ {href: '/thumbnail',text: 'Thumbnail',icon: 'touch_app'}
]},
{
icon: 'more_horiz',
@@ -2167,12 +2228,14 @@ const app = new Vue({
model: false,
children: [
{href: '/session',text: 'Session',icon: 'person'},
- {href: '/select',text: 'select',icon: 'extension'},
+ {href: '/select',text: 'Select',icon: 'extension'},
{href: '/puzzle',text: 'Puzzle',icon: 'extension'},
- {href: '/tabs',text: 'tabs',icon: 'switch_camera'},
- {href: '/timeline',text: 'time line',icon: 'timelapse'}
+ {href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
+ {href: '/timeline',text: 'Time line',icon: 'timelapse'}
]},
- {href: '/settings',text: 'settings',icon: 'settings' }
+
+ {href: '/settings',text: 'Settings',icon: 'settings' },
+ {href: '/about',text: 'About', icon: 'help' },
]
}},
diff --git a/src/vue-poc/static/app.html b/src/vue-poc/static/app.html
index bca1fbf..f2a9b07 100644
--- a/src/vue-poc/static/app.html
+++ b/src/vue-poc/static/app.html
@@ -60,9 +60,9 @@
-
+
- {{$route.meta.title}}
+ {{$route.meta.title}}
diff --git a/src/vue-poc/tasks/createthumbs.xq b/src/vue-poc/tasks/createthumbs.xq
deleted file mode 100644
index e79ade4..0000000
--- a/src/vue-poc/tasks/createthumbs.xq
+++ /dev/null
@@ -1,15 +0,0 @@
-(:~ update image meta data docs :)
-import module namespace imgmeta = "expkg-zone58:image.metadata" ;
-declare namespace c="http://www.w3.org/ns/xproc-step";
-declare variable $DB:="vue-poc";
-let $done:=uri-collection("vue-poc/Pictures")
-let $files:= doc("/vue-poc/pics.xml")//c:file[ends-with(lower-case(@name),".jpg")]
-
-let $relpath:= $files!( ancestor-or-self::*/@name=>string-join("/"))
-
-let $todo:= $relpath[not("/vue-poc/" || .|| "/meta.xml"=$done)]
-return ((for $f in subsequence($todo,1, 1000)
-let $spath:="P:/pictures/" || $f
-let $dbpath:=$f || "/meta.xml"
-let $meta:=imgmeta:read($spath)
-return db:replace($DB,$dbpath,$meta)),db:output($todo=>count()))
\ No newline at end of file
diff --git a/src/vue-poc/tasks/scanpics.xq b/src/vue-poc/tasks/pics-01-store-directory.xq
similarity index 86%
rename from src/vue-poc/tasks/scanpics.xq
rename to src/vue-poc/tasks/pics-01-store-directory.xq
index 62762ff..0420f06 100644
--- a/src/vue-poc/tasks/scanpics.xq
+++ b/src/vue-poc/tasks/pics-01-store-directory.xq
@@ -1,4 +1,5 @@
-(:~ create xml file list
+(:~
+: create xml file list by scanning $SRC and write to vue-poc
:)
import module namespace fw="quodatum:file.walker";
declare namespace c="http://www.w3.org/ns/xproc-step";
diff --git a/src/vue-poc/tasks/pics-02-store-meta.xq b/src/vue-poc/tasks/pics-02-store-meta.xq
new file mode 100644
index 0000000..3947281
--- /dev/null
+++ b/src/vue-poc/tasks/pics-02-store-meta.xq
@@ -0,0 +1,22 @@
+(:~
+ : store meta.xml document for all jpgs referenced in doc("/vue-poc/pics.xml")
+ : done in batches of 1000
+ : @return initial number of missing docs
+:)
+import module namespace imgmeta = "expkg-zone58:image.metadata" ;
+declare namespace c="http://www.w3.org/ns/xproc-step";
+declare variable $DB:="vue-poc";
+declare variable $IMAGEDIR:="P:/pictures/";
+
+let $done:=uri-collection("vue-poc/Pictures")
+let $files:= doc("/vue-poc/pics.xml")//c:file[ends-with(lower-case(@name),".jpg")]
+
+let $relpath:= $files!( ancestor-or-self::*/@name=>string-join("/"))
+
+let $todo:= $relpath[not("/vue-poc/" || .|| "/meta.xml"=$done)]
+return (for $f in subsequence($todo,1, 1000)
+ let $spath:=$IMAGEDIR || $f
+ let $dbpath:=$f || "/meta.xml"
+ let $meta:=imgmeta:read($spath)
+ return db:replace($DB,$dbpath,$meta),
+ db:output($todo=>count()))
\ No newline at end of file
diff --git a/src/vue-poc/tasks/createimage.xq b/src/vue-poc/tasks/pics-03-store-image.xq
similarity index 100%
rename from src/vue-poc/tasks/createimage.xq
rename to src/vue-poc/tasks/pics-03-store-image.xq
diff --git a/src/vue-poc/tasks/pics-04-store-thumbs.xq b/src/vue-poc/tasks/pics-04-store-thumbs.xq
new file mode 100644
index 0000000..ee47155
--- /dev/null
+++ b/src/vue-poc/tasks/pics-04-store-thumbs.xq
@@ -0,0 +1,46 @@
+(:~
+ : generate thumbs
+ : @return initial number of missing docs
+:)
+import module namespace t="expkg-zone58:image.thumbnailator";
+
+declare namespace c="http://www.w3.org/ns/xproc-step";
+declare variable $DB:="vue-poc";
+declare variable $IMAGEDIR:="P:/pictures/";
+declare variable $THUMBDIR:="C:/tmp/";
+
+(:
+declare variable $IMAGEDIR:="/mnt/sda1/pictures/";
+declare variable $THUMBDIR:="/mnt/sda1/pictures/thumbs/";
+:)
+
+declare %updating function local:store-thumb($f as xs:string)
+{
+ let $src:=$IMAGEDIR || trace($f)
+ let $trg:= $THUMBDIR || $f
+ return fetch:binary($src)=>t:size(80)=>local:write-binary($trg)
+};
+(:~ create folder if missing) :)
+declare %updating function local:write-binary($data,$url as xs:string)
+{
+ let $p:=file:parent($url)
+ return (if(file:is-dir($p)) then
+ ()
+ else
+ file:create-dir($p),
+ file:write-binary($url,$data)
+ )
+};
+let $done:=uri-collection("vue-poc/Pictures")
+let $files:= doc("/vue-poc/pics.xml")//c:file[ends-with(lower-case(@name),".jpg")]
+
+let $relpath:= $files!( ancestor-or-self::*/@name=>string-join("/"))
+let $relpath:=filter($relpath,function($f){
+ not(file:exists($THUMBDIR || $f)) and file:exists($IMAGEDIR || $f)
+ })
+let $todo:= $relpath=>subsequence(1, 400)
+
+return (
+ $todo!local:store-thumb(.),
+ db:output($relpath=>count())
+ )
\ No newline at end of file
diff --git a/src/vue-poc/tasks/vue-compile.xq b/src/vue-poc/tasks/vue-compile.xq
new file mode 100644
index 0000000..4287f83
--- /dev/null
+++ b/src/vue-poc/tasks/vue-compile.xq
@@ -0,0 +1,5 @@
+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