diff --git a/.settings/de.loskutov.FileSync.prefs b/.settings/de.loskutov.FileSync.prefs index 957dcbf..7813a27 100644 --- a/.settings/de.loskutov.FileSync.prefs +++ b/.settings/de.loskutov.FileSync.prefs @@ -1,5 +1,5 @@ WARNING=DO NOT MODIFY THIS FILE IF YOU DON'T UNDERSTAND -defaultDestination=C\:/Users/andy/Desktop/basex.versions/webapp +defaultDestination=C\:/Users/andy/basex.home/webapp defaultVariables= eclipse.preferences.version=1 includeTeamPrivateFiles=false diff --git a/src/vue-poc/app.vue b/src/vue-poc/app.vue index ea2f4d3..d2c2f28 100644 --- a/src/vue-poc/app.vue +++ b/src/vue-poc/app.vue @@ -164,7 +164,8 @@ text: 'Server' , model: false, children: [ - {href: '/server/jobs',text: 'Running jobs',icon: 'dashboard'}, + {href: '/server/jobs',text: 'Running jobs',icon: 'dashboard'}, + {href: '/server/services',text: 'Services',icon: 'dashboard'}, {href: '/server/logs',text: 'Server logs',icon: 'dns'}, {href: '/server/users',text: 'Users',icon: 'supervisor_account'}, {href: '/server/repo',text: 'Server code repository',icon: 'local_library'}, diff --git a/src/vue-poc/features/collection/collections.xqm b/src/vue-poc/features/collection/collections.xqm index b3ec937..d123683 100644 --- a/src/vue-poc/features/collection/collections.xqm +++ b/src/vue-poc/features/collection/collections.xqm @@ -42,6 +42,8 @@ function vue-api:xqdoc( ) (:~ : Returns folder info. + : @param $url location + : @param $protocol 'file' or 'xmldb' :) declare %rest:GET %rest:path("/vue-poc/api/collection") diff --git a/src/vue-poc/features/images/config.xqm b/src/vue-poc/features/images/config.xqm index d15f222..4de1a81 100644 --- a/src/vue-poc/features/images/config.xqm +++ b/src/vue-poc/features/images/config.xqm @@ -2,7 +2,7 @@ xquery version "3.1"; (:~ data locations for image feature :) module namespace cfg = "quodatum:media.image.configure"; -declare variable $cfg:DB-IMAGE:="media-images-20180817"; +declare variable $cfg:DB-IMAGE:="media-images"; declare variable $cfg:IMAGEDIR:="P:/pictures/Pictures/"; declare variable $cfg:THUMBDIR:="C:/tmp/"; diff --git a/src/vue-poc/features/images/image.vue b/src/vue-poc/features/images/image.vue index 1eb4323..338e936 100644 --- a/src/vue-poc/features/images/image.vue +++ b/src/vue-poc/features/images/image.vue @@ -16,6 +16,7 @@ Image: {{ id }} file_download + @@ -24,7 +25,8 @@ - + + @@ -40,18 +42,22 @@ }), computed: { path(){ - return this.loaded?'/vue-poc/api/images/list/'+ this.id+ '/image':null + var a=this.loaded?'/vue-poc/api/images/list/'+ this.id+ '/image':null + console.log("path",a) + return a }, meta(){ return this.loaded?'/vue-poc/api/images/list/'+ this.id+ '/meta':null } }, created:function(){ - var id=this._props.id + var id=this.id + HTTP.get("images/list/"+id) .then(r=>{ this.image=r.data this.loaded=true + }) } } diff --git a/src/vue-poc/features/images/images.vue b/src/vue-poc/features/images/images.vue index 1407c6b..80e51c9 100644 --- a/src/vue-poc/features/images/images.vue +++ b/src/vue-poc/features/images/images.vue @@ -38,39 +38,52 @@ + - - - arrow_back - - - - - arrow_forward - - + + + arrow_back + + + + + + arrow_forward + + - + + {{image.name}} + #{{image.keywords}} + + place + + + + + search + + + + +
- #{{image.keywords}} - - place - +
- {{image.id}} +
check_circle
diff --git a/src/vue-poc/features/images/ireport.vue b/src/vue-poc/features/images/ireport.vue index 586e3ef..b38b335 100644 --- a/src/vue-poc/features/images/ireport.vue +++ b/src/vue-poc/features/images/ireport.vue @@ -3,32 +3,19 @@ image report --> - diff --git a/src/vue-poc/features/model/documentation.vue b/src/vue-poc/features/model/documentation.vue index 7746a25..05498cd 100644 --- a/src/vue-poc/features/model/documentation.vue +++ b/src/vue-poc/features/model/documentation.vue @@ -23,8 +23,11 @@ :key="item.id" > - {{ item.id }} - {{ item.name }} + + {{ item.name }} + + {{ item.id }} + {{ item.created | formatDate }} go @@ -46,9 +49,11 @@ }, methods:{ get() { + this.loading=true; HTTP.get('xqdocjob') .then((res) => { this.items = res.data; + this.loading=false; }); }, doEdit(item){ diff --git a/src/vue-poc/features/model/entity.vue b/src/vue-poc/features/model/entity.vue index 8ae7be1..456de41 100644 --- a/src/vue-poc/features/model/entity.vue +++ b/src/vue-poc/features/model/entity.vue @@ -45,7 +45,7 @@ md4 lg3 > - + @@ -56,13 +56,14 @@ - {{ props.item.description }} - + {{ props.item.description }} + + Fields {{ props.item.nfields }} Fields - +
diff --git a/src/vue-poc/features/model/xqdocs.xqm b/src/vue-poc/features/model/xqdocs.xqm index e4ca05d..ff1044a 100644 --- a/src/vue-poc/features/model/xqdocs.xqm +++ b/src/vue-poc/features/model/xqdocs.xqm @@ -14,13 +14,17 @@ declare function j:list() as element(json) { - let $jlist:=file:list(db:option("webpath") || "/static/xqdoc/") + let $xqdoc-folder:=db:option("webpath") || "/static/xqdoc/" return - {for $j in reverse($jlist) + {for $di in file:list($xqdoc-folder) + let $meta:= $xqdoc-folder || $di || "xqdoca.xml" + where fn:doc-available($meta) +let $doc:=doc($meta)/xqdoca return <_ type="object"> - { $j } - todo - /static/xqdoc/{ $j }index.html + { $di} + { $doc/@created/string() } + { $doc/project/string() } + /static/xqdoc/{ $di }index.html } }; diff --git a/src/vue-poc/features/server/dicetest.vue b/src/vue-poc/features/server/dicetest.vue index 3958fcd..78a319d 100644 --- a/src/vue-poc/features/server/dicetest.vue +++ b/src/vue-poc/features/server/dicetest.vue @@ -12,7 +12,7 @@

Read json data for 1st page for entity.

@@ -38,10 +38,10 @@ - {{ url && url.name }} + {{ entity && entity.name }} - + Read compare_arrows @@ -87,7 +87,7 @@ return { getValues: new perfStat(), repeat: {get:false}, - url: null, + entity: null, counter: 0, result: null, entities: null @@ -97,8 +97,8 @@ get(){ var _start = performance.now(); - console.log("FFFFF"," "+ this.url.parentlink) - HTTP.get(this.url.parentlink,axios_json) + console.log("entity:", this.entity) + HTTP.get(this.entity.datalink,axios_json) .then(r=>{ var elapsed=Math.floor(performance.now() - _start); this.counter++; diff --git a/src/vue-poc/features/tasks/xqdoc/tx-xqdoc3.xq b/src/vue-poc/features/tasks/xqdoc/tx-xqdoc3.xq index 42b1eea..47c307d 100644 --- a/src/vue-poc/features/tasks/xqdoc/tx-xqdoc3.xq +++ b/src/vue-poc/features/tasks/xqdoc/tx-xqdoc3.xq @@ -15,8 +15,10 @@ import module namespace store = 'quodatum.store' at "../../../lib/store.xqm"; declare variable $efolder as xs:anyURI external := xs:anyURI("C:/Users/andy/git/vue-poc/src/vue-poc"); declare variable $id as element(last-id):=db:open("vue-poc","/state.xml")/state/last-id; +let $path:="static/xqdoc/" || "33" || "/" +let $root:=db:option("webpath")=>file:path-to-uri() +let $target:=resolve-uri($path,$root) -let $target:="file:///" || db:option("webpath") || "/static/xqdoc/" || $id || "/" let $state:=xqd:read($efolder)=>trace("READ: ") let $opts:=map{ diff --git a/src/vue-poc/lib/mimetype.xqm b/src/vue-poc/lib/mimetype.xqm index 621f557..f296fb0 100644 --- a/src/vue-poc/lib/mimetype.xqm +++ b/src/vue-poc/lib/mimetype.xqm @@ -1,4 +1,5 @@ xquery version "3.1"; + module namespace mt = 'quodatum.data.mimetype'; declare namespace MediaType='java:org.basex.util.http.MediaType'; declare %basex:lazy variable $mt:lines:="media-types.properties"=>fn:unparsed-text-lines(); diff --git a/src/vue-poc/models.gen.xqm b/src/vue-poc/models.gen.xqm index 0da61b2..81c70eb 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: 2019-02-23T22:59:34.827Z + : auto generated from xml files in entities folder at: 2019-07-04T23:21:15.539+01:00 :) module namespace entity = 'quodatum.models.generated'; @@ -188,13 +188,14 @@ hof:top-k-by(admin:logs(), string#1, 2) ", "access": map{ "code": function($_ as element()) as xs:string? {$_/ent:data }, + "datalink": function($_ as element()) as xs:string {$_/fn:concat("/data/",@name,"") }, "description": function($_ as element()) as xs:string {$_/ent:description }, "fieldslink": function($_ as element()) as xs:string {$_/fn:concat("/data/entity/",@name,"/field") }, "iconclass": function($_ as element()) as xs:string {$_/ent:views/@iconclass }, - "modules": function($_ as element()) as xs:string? {$_/ent:module/concat("import module namespace ",@prefix,"='",@namespace,"'; + "modules": function($_ as element()) as xs:string? {$_/ent:module/concat("import module namespace ",@prefix,"='",@namespace,"'; ")=>string-join() }, "name": function($_ as element()) as xs:string {$_/@name }, - "namespaces": function($_ as element()) as xs:string? {$_/ent:namespace/concat("declare namespace ",@prefix,"='",@uri,"'; + "namespaces": function($_ as element()) as xs:string? {$_/ent:namespace/concat("declare namespace ",@prefix,"='",@uri,"'; ")=>string-join() }, "nfields": function($_ as element()) as xs:integer {$_/fn:count(ent:fields/ent:field) }, "parent": function($_ as element()) as xs:string? {$_/ent:parent/@name }, @@ -210,6 +211,10 @@ hof:top-k-by(admin:logs(), string#1, 2) (: xs:string? :) fn:data($_/ent:data)!element code { .} }, + "datalink": function($_ as element()) as element(datalink)? { + (: xs:string :) + fn:data($_/fn:concat("/data/",@name,""))!element datalink { .} + }, "description": function($_ as element()) as element(description)? { (: xs:string :) fn:data($_/ent:description)!element description { .} @@ -224,7 +229,7 @@ hof:top-k-by(admin:logs(), string#1, 2) }, "modules": function($_ as element()) as element(modules)? { (: xs:string? :) - fn:data($_/ent:module/concat("import module namespace ",@prefix,"='",@namespace,"'; + fn:data($_/ent:module/concat("import module namespace ",@prefix,"='",@namespace,"'; ")=>string-join())!element modules { .} }, "name": function($_ as element()) as element(name)? { @@ -233,7 +238,7 @@ hof:top-k-by(admin:logs(), string#1, 2) }, "namespaces": function($_ as element()) as element(namespaces)? { (: xs:string? :) - fn:data($_/ent:namespace/concat("declare namespace ",@prefix,"='",@uri,"'; + fn:data($_/ent:namespace/concat("declare namespace ",@prefix,"='",@uri,"'; ")=>string-join())!element namespaces { .} }, "nfields": function($_ as element()) as element(nfields)? { @@ -503,13 +508,13 @@ hof:top-k-by(admin:logs(), string#1, 2) }, "service": map{ "name": "service", - "description": "basex services ", + "description": "basex services a list of all jobs that have been persistently registered as Services.", "access": map{ "base-uri": function($_ as element()) as xs:string {$_/@base-uri }, "id": function($_ as element()) as xs:string {$_/@id }, "interval": function($_ as element()) as xs:string {$_/@interval }, "query": function($_ as element()) as xs:string {$_/. }, - "running": function($_ as element()) as xs:boolean {$_/jobs:list()=@id } }, + "running": function($_ as element()) as xs:boolean {$_/(@id = jobs:list-details()/@id) } }, "filter": function($item,$q) as xs:boolean{ some $e in ( ) satisfies @@ -534,7 +539,7 @@ hof:top-k-by(admin:logs(), string#1, 2) }, "running": function($_ as element()) as element(running)? { (: xs:boolean :) - fn:data($_/jobs:list()=@id)!element running { attribute type {'boolean'}, .} + fn:data($_/(@id = jobs:list-details()/@id))!element running { attribute type {'boolean'}, .} } }, "data": function() as element(job)* diff --git a/src/vue-poc/models/entities/basexjob.xml b/src/vue-poc/models/entities/basexjob.xml index a439227..6e955b1 100644 --- a/src/vue-poc/models/entities/basexjob.xml +++ b/src/vue-poc/models/entities/basexjob.xml @@ -1,7 +1,7 @@ A BaseX job - - + + unique id @id @@ -10,10 +10,10 @@ state @state - - type of job - @type - + + type of job + @type + user @user @@ -27,29 +27,29 @@ @start - start - @duration - - - interval - @interval - - - text - . - - - reads - @reads - - - writes - @writes - + start + @duration + + + interval + @interval + + + text + . + + + reads + @reads + + + writes + @writes + name description jobs:list()[. != jobs:current()] !jobs:list-details(.)=>reverse() - \ No newline at end of file + diff --git a/src/vue-poc/models/entities/entity.xml b/src/vue-poc/models/entities/entity.xml index d27bf4b..7336d64 100644 --- a/src/vue-poc/models/entities/entity.xml +++ b/src/vue-poc/models/entities/entity.xml @@ -40,6 +40,10 @@ Links for fields description fn:concat("/data/entity/",@name,"/field") + + Link to read data + fn:concat("/data/",@name,"") + parent entity, if any ent:parent/@name diff --git a/src/vue-poc/models/entities/service.xml b/src/vue-poc/models/entities/service.xml index a089a0b..818e5ac 100644 --- a/src/vue-poc/models/entities/service.xml +++ b/src/vue-poc/models/entities/service.xml @@ -19,7 +19,7 @@ service is running - jobs:list()=@id + (@id = jobs:list-details()/@id) diff --git a/src/vue-poc/models/schemas/xqdoc-1.0.01132014.xsd b/src/vue-poc/models/schemas/xqdoc-1.0.01132014.xsd new file mode 100644 index 0000000..a0a9d79 --- /dev/null +++ b/src/vue-poc/models/schemas/xqdoc-1.0.01132014.xsd @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/vue-poc/package.json b/src/vue-poc/package.json index e3b5891..6470860 100644 --- a/src/vue-poc/package.json +++ b/src/vue-poc/package.json @@ -1,13 +1,13 @@ { "name": "vue-poc", - "version": "0.1.99", + "version": "0.2.0", "description": "A vue test", "dependencies": { - "ace": "1.4.3", - "vuetify": "1.5.6", - "vue": "2.6.7", + "ace": "1.4.5", + "vuetify": "1.5.16", + "vue": "2.6.10", "vuex": "3.0.1", - "vue-router": "3.0.2", + "vue-router": "3.0.3", "vue-treeselect": "0.0.25", "google-material": "0.0.0", "js-beautify": "1.9.0", diff --git a/src/vue-poc/router.js b/src/vue-poc/router.js index 6fb5129..2c5587b 100644 --- a/src/vue-poc/router.js +++ b/src/vue-poc/router.js @@ -82,6 +82,7 @@ const router = new VueRouter({ { path: 'jobs', name:"jobs", component: Jobs, meta:{title:"Jobs running"} }, { path: 'jobs/:job', name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} }, + { path: 'services', component: Services, meta:{title:"Services"} }, { path: 'upload', component: Upload,meta:{title:"Upload"} }, { path: 'settings', component: Basexsettings,meta:{title:"BaseX settings"} }, diff --git a/src/vue-poc/static/app-gen.js b/src/vue-poc/static/app-gen.js index e460bf8..9de2f1a 100644 --- a/src/vue-poc/static/app-gen.js +++ b/src/vue-poc/static/app-gen.js @@ -1,5 +1,5 @@ -// generated 2019-04-13T21:49:49.993+01:00 - +// generated 2019-07-24T10:31:16.914+01:00 + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue Vue.component('qd-autoheight',{template:` @@ -3603,6 +3603,7 @@ const Image=Vue.extend({template:` Image: {{ id }} file_download + @@ -3611,8 +3612,9 @@ const Image=Vue.extend({template:` - - + + +
@@ -3626,18 +3628,22 @@ const Image=Vue.extend({template:` }), computed: { path(){ - return this.loaded?'/vue-poc/api/images/list/'+ this.id+ '/image':null + var a=this.loaded?'/vue-poc/api/images/list/'+ this.id+ '/image':null + console.log("path",a) + return a }, meta(){ return this.loaded?'/vue-poc/api/images/list/'+ this.id+ '/meta':null } }, created:function(){ - var id=this._props.id + var id=this.id + HTTP.get("images/list/"+id) .then(r=>{ this.image=r.data this.loaded=true + }) } } @@ -3680,33 +3686,47 @@ const Images=Vue.extend({template:` + - - - arrow_back - - - - - arrow_forward - - + + + arrow_back + + + + + + arrow_forward + + - + -
+ + {{image.name}} #{{image.keywords}} - - place - + + place + + + + + search + + + + + +
+
- {{image.id}} +
check_circle
@@ -4084,31 +4104,17 @@ const Imagesfilter=Vue.extend({template:` ); // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/images/ireport.vue -const Report=Vue.extend({template:` - - - - arrow_back - - Settings - - - - - - - -
    -
  • -
  • -
  • -
-
    {{ report | pretty }}
-    
-
-
-
- `, +const Report=Vue.extend({template:` + +arrow_back Settings + +
    +
  • DB: {{ report.imagedb }}
  • +
  • db
  • +
  • +
+
    {{ report | pretty }}
+    
`, data: ()=>({ busy: false, @@ -4138,17 +4144,14 @@ const Report=Vue.extend({template:` // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/images/keywords.vue const Keywords=Vue.extend({template:` - - - - arrow_back - - click to show - - + + + arrow_back + + click to show + - - + @@ -4166,7 +4169,6 @@ const Keywords=Vue.extend({template:` - `, data: ()=>({ @@ -4243,14 +4245,17 @@ const Job=Vue.extend({template:` lock{{ jobstate.writes }} lock{{ jobstate.reads }} + account_circle {{ jobstate.user }} + timer {{ jobstate.duration }} + refresh @@ -4405,6 +4410,93 @@ const Jobs=Vue.extend({template:` ); +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/job/services.vue +const Services=Vue.extend({template:` + + + + + Stop + + add + + + + {{ autorefresh?'refresh':'arrow_downward' }} + + + + + + + `, + + data: function(){ + return { + headers: [ + { + text: 'Job id', + left: true, + value: 'id' + }, + { text: 'Running', value: 'running' }, + { text: 'Interval', value: 'interval' }, + { text: 'Base-uri', value: 'base-uri' }, + { text: 'Query', value: 'query' }, + + ], + items:[ + ], + selected: [], + search: "", + loading: false, + autorefresh: true, + timer:null + } + }, + methods:{ + load(){ + this.loading= true + HTTP.get("data/service",{params:{q:this.q}}) + .then(r=>{ + this.items= r.data.items + this.loading= false + if(this.autorefresh) this.timer=setTimeout(()=>{ this.load() }, 10000); + }) + + }, + stop(){ + var s=this.selected.map((j)=>{return j.id}).join(",") + console.log("AAA",this.selected) + alert(s) + } + }, + computed: { + // a computed getter + noSelection: function () { + // `this` points to the vm instance + return this.selected.length==0 + }, + }, + created(){ + this.load() + }, + beforeDestroy(){ + if(this.timer) clearTimeout(this.timer); + } +} + + ); + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/login/login.vue const Login=Vue.extend({template:` @@ -4551,8 +4643,11 @@ const Documentation=Vue.extend({template:` - {{ item.id }} - {{ item.name }} + + {{ item.name }} + + {{ item.id }} + {{ item.created | formatDate }} go @@ -4573,9 +4668,11 @@ const Documentation=Vue.extend({template:` }, methods:{ get() { + this.loading=true; HTTP.get('xqdocjob') .then((res) => { this.items = res.data; + this.loading=false; }); }, doEdit(item){ @@ -4615,7 +4712,7 @@ const Entity=Vue.extend({template:` - + @@ -4627,12 +4724,13 @@ const Entity=Vue.extend({template:` {{ props.item.description }} - + + Fields {{ props.item.nfields }} Fields - + @@ -5546,7 +5644,7 @@ const Dicetest=Vue.extend({template:`

Read json data for 1st page for entity.

- + @@ -5569,10 +5667,10 @@ const Dicetest=Vue.extend({template:` - {{ url && url.name }} + {{ entity && entity.name }} - + Read compare_arrows @@ -5617,7 +5715,7 @@ const Dicetest=Vue.extend({template:` return { getValues: new perfStat(), repeat: {get:false}, - url: null, + entity: null, counter: 0, result: null, entities: null @@ -5627,8 +5725,8 @@ const Dicetest=Vue.extend({template:` get(){ var _start = performance.now(); - console.log("FFFFF"," "+ this.url.parentlink) - HTTP.get(this.url.parentlink,axios_json) + console.log("entity:", this.entity) + HTTP.get(this.entity.datalink,axios_json) .then(r=>{ var elapsed=Math.floor(performance.now() - _start); this.counter++; @@ -7234,6 +7332,7 @@ const router = new VueRouter({ { path: 'jobs', name:"jobs", component: Jobs, meta:{title:"Jobs running"} }, { path: 'jobs/:job', name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} }, + { path: 'services', component: Services, meta:{title:"Services"} }, { path: 'upload', component: Upload,meta:{title:"Upload"} }, { path: 'settings', component: Basexsettings,meta:{title:"BaseX settings"} }, @@ -7467,7 +7566,8 @@ const Vuepoc=Vue.extend({template:` text: 'Server' , model: false, children: [ - {href: '/server/jobs',text: 'Running jobs',icon: 'dashboard'}, + {href: '/server/jobs',text: 'Running jobs',icon: 'dashboard'}, + {href: '/server/services',text: 'Services',icon: 'dashboard'}, {href: '/server/logs',text: 'Server logs',icon: 'dns'}, {href: '/server/users',text: 'Users',icon: 'supervisor_account'}, {href: '/server/repo',text: 'Server code repository',icon: 'local_library'}, diff --git a/src/vue-poc/static/app.html b/src/vue-poc/static/app.html index 87dbc99..57c80ec 100644 --- a/src/vue-poc/static/app.html +++ b/src/vue-poc/static/app.html @@ -10,7 +10,7 @@ - + @@ -34,15 +34,15 @@
- - - + + + - - - - + + + +