From ac9cb9ff8d899fdc11b54765067c8e146be7fdce Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 31 Jul 2018 23:45:40 +0100 Subject: [PATCH] vuetify 1.1.9 --- src/vue-poc/api.xqm | 27 +- src/vue-poc/app.vue | 17 +- src/vue-poc/components/auth.js | 17 + src/vue-poc/components/qd-search.vue | 1 + src/vue-poc/components/vp-paramform.vue | 7 +- src/vue-poc/core.js | 18 +- src/vue-poc/features/collection/files.vue | 2 +- .../features/components/components.xqm | 13 +- src/vue-poc/features/components/tree.vue | 136 ++- src/vue-poc/features/home.vue | 4 +- src/vue-poc/features/images/keywords.vue | 2 +- src/vue-poc/features/job/jobs.vue | 18 +- src/vue-poc/features/login/login.vue | 84 +- src/vue-poc/features/model/entity.vue | 13 +- src/vue-poc/features/model/entity1.vue | 31 +- src/vue-poc/features/model/namespace.vue | 26 +- src/vue-poc/features/model/namespace1.vue | 31 +- src/vue-poc/features/model/rxq-entity.xqm | 18 + src/vue-poc/features/{ => search}/search.vue | 0 src/vue-poc/features/search/search.xqm | 34 + .../features/{ping => server}/ping.vue | 0 .../features/{ping => server}/ping.xqm | 0 src/vue-poc/features/session.vue | 3 + src/vue-poc/features/tasks/rxq-tasks.xqm | 1 + src/vue-poc/features/tasks/task/task.vue | 65 +- .../features/tasks/task/tx-dbimport.xq | 8 +- src/vue-poc/features/tasks/tasks.vue | 40 +- .../tasks/vue-compile/tx-vuecompile.xq | 6 +- src/vue-poc/features/validate/rq-validate.xqm | 3 +- src/vue-poc/features/validate/tx-validate.xq | 7 +- src/vue-poc/lib/history.xqm | 5 +- src/vue-poc/lib/query-a.xqm | 71 +- src/vue-poc/models.gen.xqm | 2 +- src/vue-poc/static/app-gen.js | 790 ++++++++++-------- src/vue-poc/static/app.html | 6 +- .../static/resources/xslt/xipr-1-0.xsl | 230 +++++ 36 files changed, 1118 insertions(+), 618 deletions(-) create mode 100644 src/vue-poc/components/auth.js rename src/vue-poc/features/{ => search}/search.vue (100%) create mode 100644 src/vue-poc/features/search/search.xqm rename src/vue-poc/features/{ping => server}/ping.vue (100%) rename src/vue-poc/features/{ping => server}/ping.xqm (100%) create mode 100644 src/vue-poc/static/resources/xslt/xipr-1-0.xsl diff --git a/src/vue-poc/api.xqm b/src/vue-poc/api.xqm index 753c0b8..bf25ff3 100644 --- a/src/vue-poc/api.xqm +++ b/src/vue-poc/api.xqm @@ -7,8 +7,8 @@ module namespace vue-api = 'quodatum:vue.api'; import module namespace rest = "http://exquery.org/ns/restxq"; import module namespace session = "http://basex.org/modules/session"; import module namespace entity = 'quodatum.models.generated' at "models.gen.xqm"; -import module namespace dice = 'quodatum.web.dice/v4' at "lib/dice.xqm"; -import module namespace web = 'quodatum.web.utils4' at "lib/webutils.xqm"; + + declare namespace c="http://www.w3.org/ns/xproc-step"; @@ -27,29 +27,6 @@ declare () }; -(:~ - : Returns search results - :) -declare -%rest:path("/vue-poc/api/search") -%rest:query-param("q", "{$q}") -%rest:produces("application/json") -%output:method("json") -function vue-api:search($q ) -{ - let $entity:=$entity:list("search-result") - let $items:=( - No search yet: {$q} - database?url=%2F - , - - soon - ping - ) - - return dice:response($items,$entity,web:dice()) -}; - (:~ diff --git a/src/vue-poc/app.vue b/src/vue-poc/app.vue index e85a3fa..ce49a61 100644 --- a/src/vue-poc/app.vue +++ b/src/vue-poc/app.vue @@ -71,8 +71,8 @@ notifications - - + + more_vert @@ -82,6 +82,11 @@ + + + Refresh: + .init + @@ -202,7 +207,9 @@ }}, methods: { - + init(){ + HTTP.get("../../.init"); + }, session(){ this.$router.push({path: '/about'}) @@ -210,7 +217,9 @@ logout(){ HTTP.get("logout").then(r=>{ - alert("logout") + this.$auth.role=null; + this.$auth.user="guest"; + this.$router.push({path: '/'}); }) }, showAlert(msg){ diff --git a/src/vue-poc/components/auth.js b/src/vue-poc/components/auth.js new file mode 100644 index 0000000..9e21250 --- /dev/null +++ b/src/vue-poc/components/auth.js @@ -0,0 +1,17 @@ +// Authorization Object +const Auth={ + user:"guest", + permission:null, + session:null, + created:null, + install: function(Vue){ + Object.defineProperty(Vue.prototype, '$auth', { + get () { return Auth } + }) + }, + logout(){ + Auth.user="guest"; + Auth.permission=null; + } +}; +Vue.use(Auth); diff --git a/src/vue-poc/components/qd-search.vue b/src/vue-poc/components/qd-search.vue index 71fc0cd..898ce89 100644 --- a/src/vue-poc/components/qd-search.vue +++ b/src/vue-poc/components/qd-search.vue @@ -27,6 +27,7 @@ }, methods: { querySelections (v) { + console.log("QQ",this.si," r:",this.$router.options.routes); this.loading = true // Simulated ajax query setTimeout(() => { diff --git a/src/vue-poc/components/vp-paramform.vue b/src/vue-poc/components/vp-paramform.vue index 2370805..24ffb4a 100644 --- a/src/vue-poc/components/vp-paramform.vue +++ b/src/vue-poc/components/vp-paramform.vue @@ -3,7 +3,8 @@ manage parameters for query --> @@ -57,7 +58,7 @@ return [this.rules.required]; }, submit(){ - return this.params; + return HTTP.post(this.endpoint, Qs.stringify(this.params)); }, valid(){ return this.$refs.form.validate() diff --git a/src/vue-poc/core.js b/src/vue-poc/core.js index 5234955..d743180 100644 --- a/src/vue-poc/core.js +++ b/src/vue-poc/core.js @@ -3,8 +3,7 @@ const AXIOS_CONFIG={ baseURL: "/vue-poc/api/", headers: { - 'X-Custom-Header': 'vue-poc', - accept: 'application/json' + 'X-Custom-Header': 'vue-poc' }, paramsSerializer: function(params) { return Qs.stringify(params) @@ -47,21 +46,6 @@ const HTTPNE = axios.create(AXIOS_CONFIG); const axios_json={ headers: {accept: 'application/json'}}; -// Authorization Object -const Auth={ - user:"guest", - permission:null, - session:null, - created:null, - install: function(Vue){ - Object.defineProperty(Vue.prototype, '$auth', { - get () { return Auth } - }) } -}; -Vue.use(Auth); - - - // Settings read and write list clear localforage.config({ name: 'vuepoc' diff --git a/src/vue-poc/features/collection/files.vue b/src/vue-poc/features/collection/files.vue index 730563c..9731444 100644 --- a/src/vue-poc/features/collection/files.vue +++ b/src/vue-poc/features/collection/files.vue @@ -29,7 +29,7 @@ + :append-icon="this.q?'clear':''" @click:append="e=>this.q=''"> diff --git a/src/vue-poc/features/components/components.xqm b/src/vue-poc/features/components/components.xqm index 541ae9e..70ce166 100644 --- a/src/vue-poc/features/components/components.xqm +++ b/src/vue-poc/features/components/components.xqm @@ -4,11 +4,14 @@ module namespace j = 'quodatum.test.components'; declare function j:tax($items){ for $a in $items return <_ type="object"> -{$a/@id/string()} - -{if($a/item)then - {j:tax($a/item)} - else ()} + {$a/@id/string()} + + {if($a/item)then ( + {j:tax($a/item)} + , + ) else ( + fa fa-tag + )} }; diff --git a/src/vue-poc/features/components/tree.vue b/src/vue-poc/features/components/tree.vue index 12d0d70..0c8e702 100644 --- a/src/vue-poc/features/components/tree.vue +++ b/src/vue-poc/features/components/tree.vue @@ -7,8 +7,25 @@ todo + + + {{ selected }} + + - + + + + + + +
+    {{ JSON.stringify(data, null, '\t') }}
+    
+
+
+
@@ -18,82 +35,55 @@ diff --git a/src/vue-poc/features/tasks/task/tx-dbimport.xq b/src/vue-poc/features/tasks/task/tx-dbimport.xq index 921dfe3..769196d 100644 --- a/src/vue-poc/features/tasks/task/tx-dbimport.xq +++ b/src/vue-poc/features/tasks/task/tx-dbimport.xq @@ -1,5 +1,5 @@ (:~ -: import to db +: Import a file or directory into a database : @author andy bunce : @since july 2018 :) @@ -11,10 +11,10 @@ import module namespace dbtools = 'quodatum.dbtools' at "../../../lib/dbtools.xq :) declare variable $srcpath as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities"; -(:~ base db path for import files - : @default / +(:~ Target BaseX db root path for imported files + : @default /vuepoc-test/ :) -declare variable $targetpath as xs:anyURI external :="/"; +declare variable $targetpath as xs:anyURI external :="/vuepoc-test"; (:~ unused boolean test : @default true diff --git a/src/vue-poc/features/tasks/tasks.vue b/src/vue-poc/features/tasks/tasks.vue index e07579b..7829469 100644 --- a/src/vue-poc/features/tasks/tasks.vue +++ b/src/vue-poc/features/tasks/tasks.vue @@ -1,14 +1,37 @@ @@ -16,7 +39,8 @@ data(){ return { tasks: [], - loading: false + loading: false, + q: null } }, methods:{ diff --git a/src/vue-poc/features/tasks/vue-compile/tx-vuecompile.xq b/src/vue-poc/features/tasks/vue-compile/tx-vuecompile.xq index 641a63c..040f4d7 100644 --- a/src/vue-poc/features/tasks/vue-compile/tx-vuecompile.xq +++ b/src/vue-poc/features/tasks/vue-compile/tx-vuecompile.xq @@ -9,12 +9,14 @@ import module namespace vue = 'quodatum:vue.compile' at "../../../lib/vue-compil (:~ URL of the doc to validate : @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml :) -declare variable $doc as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml"; +declare variable $doc as xs:anyURI external := +"C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml" cast as xs:anyURI; (:~ URL of the schema to use : @default C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd :) -declare variable $schema as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd"; +declare variable $schema as xs:anyURI external := +"C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd" cast as xs:anyURI; let $result:=TODO return $result diff --git a/src/vue-poc/features/validate/rq-validate.xqm b/src/vue-poc/features/validate/rq-validate.xqm index 776be17..cf79431 100644 --- a/src/vue-poc/features/validate/rq-validate.xqm +++ b/src/vue-poc/features/validate/rq-validate.xqm @@ -19,8 +19,7 @@ declare %updating function tx:run( ) { - let $r:= resolve-uri("tx-validate.xq")=>query-a:run(query-a:params()) - return $r=>update:output() + resolve-uri("tx-validate.xq")=>query-a:run(query-a:params()) }; (:~ validation settings diff --git a/src/vue-poc/features/validate/tx-validate.xq b/src/vue-poc/features/validate/tx-validate.xq index 3dff32e..d395bb0 100644 --- a/src/vue-poc/features/validate/tx-validate.xq +++ b/src/vue-poc/features/validate/tx-validate.xq @@ -10,12 +10,15 @@ import module namespace qv = 'quodatum.validate' at "../../lib/validate.xqm"; (:~ URL of the doc to validate : @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml :) -declare variable $doc as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml"; +declare variable $doc as xs:anyURI external := +"C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml" cast as xs:anyURI; + (:~ URL of the schema to use : @default C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd :) -declare variable $schema as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd"; +declare variable $schema as xs:anyURI external := +"C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd" cast as xs:anyURI; let $validators:=qv:xsd(?,$schema) let $report:= qv:validation($doc ,$validators,attribute type {"xsd"}) diff --git a/src/vue-poc/lib/history.xqm b/src/vue-poc/lib/history.xqm index d772e21..02403cd 100644 --- a/src/vue-poc/lib/history.xqm +++ b/src/vue-poc/lib/history.xqm @@ -1,4 +1,7 @@ xquery version "3.1"; +(:~ + : log an event + :) module namespace hlog = 'quodatum.data.history'; declare namespace hist="urn:quodatum:vue-poc.history"; declare variable $hlog:doc as element(hist:history):=db:open("vue-poc","/history.xml")/hist:history; @@ -9,7 +12,7 @@ function hlog:save($item as element(*)) { let $id:=$hlog:doc/@next-id/string(.) let $n:={$item} -return (insert node $n into $hlog:doc, +return (insert node $n as first into $hlog:doc, replace value of node $hlog:doc/@next-id with number($id)+1 ) }; diff --git a/src/vue-poc/lib/query-a.xqm b/src/vue-poc/lib/query-a.xqm index bb7bdf4..ff5f22b 100644 --- a/src/vue-poc/lib/query-a.xqm +++ b/src/vue-poc/lib/query-a.xqm @@ -4,10 +4,12 @@ : @author Andy Bunce, 2018 :) module namespace query-a = 'vue-poc/query-a'; +import module namespace hlog = 'quodatum.data.history' at 'history.xqm'; import module namespace request = "http://exquery.org/ns/request"; - +declare namespace map2='http://www.woerteler.de/xquery/modules/map-extras'; (:~ - : attributes of a stored query + : attributes of a stored query including parameters and updating status. + : @return json format :) declare function query-a:fields($mod as xs:anyURI) as element(json) @@ -32,6 +34,29 @@ return }; +(:~ + :convert type +:) +declare function query-a:cast($val as item(),$type as xs:string) +as item() +{ + switch($type) + case "xs:anyURI" return xs:anyURI($val) + default return $val +}; + +(:~ + :@return map param->type +:) +declare function query-a:types($mod as xs:anyURI) +as map(*) +{ + let $vars:=inspect:module($mod)/variable[@external="true"] + return map:merge( + $vars!map:entry(@name/string(),@type/string()) + ) +}; + declare function query-a:params() as map(*) @@ -41,10 +66,25 @@ as map(*) ) }; -declare +declare +%updating function query-a:run($query as xs:anyURI,$params as map(*)) { - xquery:invoke($query,$params) + let $types:=query-a:types($query) + let $params:=query-a:map-with-key($params, + function($key,$val){ + switch($types($key)=>trace("CONV")) + case "xs:anyURI" return xs:anyURI($val) + default return $val + } + ) + + return ( + xquery:invoke($query,$params)=>update:output(), + hlog:save( + + ) + ) }; declare @@ -52,4 +92,25 @@ declare function query-a:update($query as xs:anyURI,$params as map(*)) { xquery:invoke-update($query,$params) -}; \ No newline at end of file +}; + +(:~ + : Maps a function over all entries of the map $map. + : Each entry ($key, $value) in the map is replaced by a new + : entry ($key, $f($key, $value)), the keys are not touched. + : + : @param $f function to be applies to all entries + : @param $map input map + : @return copy of $map where all values $value + : are replaced by $f($key, $value) + :) +declare function query-a:map-with-key( + $map as map(*), + $f as function(item(), item()*) as item()* +) as map(*) +{ + map:merge( + for $key in map:keys($map) + return map:entry($key, $f($key, $map($key))) + ) +}; diff --git a/src/vue-poc/models.gen.xqm b/src/vue-poc/models.gen.xqm index d0ad6ec..eafe4e7 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: 2018-07-17T22:21:31.112+01:00 + : auto generated from xml files in entities folder at: 2018-07-31T22:46:52.921+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 1be25ef..4d4c03a 100644 --- a/src/vue-poc/static/app-gen.js +++ b/src/vue-poc/static/app-gen.js @@ -1,4 +1,4 @@ -// generated 2018-07-22T22:53:58.139+01:00 +// generated 2018-07-31T23:44:22.364+01:00 // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue Vue.component('qd-autoheight',{template:` @@ -206,6 +206,7 @@ Vue.component('qd-search',{template:` }, methods: { querySelections (v) { + console.log("QQ",this.si," r:",this.$router.options.routes); this.loading = true // Simulated ajax query setTimeout(() => { @@ -544,7 +545,8 @@ Vue.component('vp-notifications',{template:` // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-paramform.vue Vue.component('vp-paramform',{template:` - + +
{{ description }}
@@ -555,7 +557,7 @@ Vue.component('vp-paramform',{template:` -
{{ description }}
+
`, @@ -589,7 +591,7 @@ Vue.component('vp-paramform',{template:` return [this.rules.required]; }, submit(){ - return this.params; + return HTTP.post(this.endpoint, Qs.stringify(this.params)); }, valid(){ return this.$refs.form.validate() @@ -856,6 +858,26 @@ Vue.component('vue-ace',{template:` } ); +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/auth.js +// Authorization Object +const Auth={ + user:"guest", + permission:null, + session:null, + created:null, + install: function(Vue){ + Object.defineProperty(Vue.prototype, '$auth', { + get () { return Auth } + }) + }, + logout(){ + Auth.user="guest"; + Auth.permission=null; + } +}; +Vue.use(Auth); + + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/filters.js /** * some vue filters, requires moment @@ -1300,7 +1322,7 @@ const Files=Vue.extend({template:` S: {{selection.length}} - + @@ -1805,8 +1827,23 @@ const Tree=Vue.extend({template:` todo + + + {{ selected }} + + - + + + + + + +
    {{ JSON.stringify(data, null, '\t') }}
+    
+
+
+
@@ -1815,82 +1852,55 @@ const Tree=Vue.extend({template:` data:function(){ return { - data: [ - { - "text": "Same but with checkboxes", - "children": [ - { - "text": "initially selected", - "selected": true - }, - { - "text": "custom icon", - "icon": "fa fa-warning icon-state-danger" - }, - { - "text": "initially open", - "icon": "fa fa-folder icon-state-default", - "opened": true, - "children": [ - { - "text": "Another node" - } - ] - }, - { - "text": "custom icon", - "icon": "fa fa-warning icon-state-warning" - }, - { - "text": "disabled node", - "icon": "fa fa-check icon-state-success", - "disabled": true - } - ] - }, - { - "text": "Same but with checkboxes", - "opened": true, - "children": [ - { - "text": "initially selected", - "selected": true - }, - { - "text": "custom icon", - "icon": "fa fa-warning icon-state-danger" - }, - { - "text": "initially open", - "icon": "fa fa-folder icon-state-default", - "opened": true, - "children": [ - { - "text": "Another node" - } - ] - }, - { - "text": "custom icon", - "icon": "fa fa-warning icon-state-warning" - }, - { - "text": "disabled node", - "icon": "fa fa-check icon-state-success", - "disabled": true - } - ] - }, - { - "text": "And wholerow selection" - } - ] -} + data: [], + + loadData: function (oriNode, resolve) { + var id = oriNode.data.id ? oriNode.data.id : 0 + console.log("LOAD DATA",id); + HTTP.get("components/tree") + .then(r=>{ + console.log(r); + resolve(r.data) + }) + .catch(error=> { + console.log(error); + + alert("Get query error"+url) + }); + } + } }, + methods: { + itemClick (node) { - console.log(node.model.text + ' clicked !') + node.model.selected= !node.model.selected; + console.log(' clicked !',node.model) + }, + + load(){ + this.asyncData = [this.$refs.tree.initializeLoading()]; + this.$refs.tree.handleAsyncLoad(this.asyncData, this.$refs.tree) + }, + + sel1(item){ + if(item.children){ + var res=[]; + for (const node of item.children) {res.push(this.sel1(node))} + return res; + }else{ + return item.selected?item.label:[] + } } +}, + +computed:{ + selected(){ + return this.sel1(this.data); + }, +}, +mounted: function(){ + this.load() } } @@ -3151,8 +3161,8 @@ const Home=Vue.extend({template:`

    -
  • vue-poc files
  • -
  • vue-poc db
  • +
  • developer_modevue-poc files
  • +
  • foldervue-poc db
  • doc
  • DBA app
  • db
  • @@ -3657,7 +3667,7 @@ const Keywords=Vue.extend({template:` - + @@ -3827,10 +3837,10 @@ const Job=Vue.extend({template:` const Jobs=Vue.extend({template:` - - + + Stop - + add @@ -3916,28 +3926,32 @@ const Jobs=Vue.extend({template:` // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/login/login.vue const Login=Vue.extend({template:` - - - - Login - - - {{message}} - - - - - - - - - - - - Continue - - - + + + + + + Please login as user with permission is required + + + {{message}} + + + + + + + + + + + + + Continue + + + + `, data () { @@ -3963,8 +3977,10 @@ const Login=Vue.extend({template:` .then(r=>{ console.log("login",r.data) if(r.data.status){ - this.$auth.role="admin" - this.$router.replace(this.redirect) + this.$auth.role="admin"; + this.$auth.user=this.name; + console.log("redirect",this.redirect); + this.$router.replace({path: this.redirect}); }else{ this.message=r.data.message this.showMessage=true; @@ -4026,11 +4042,16 @@ const Documentation=Vue.extend({template:` const Entity=Vue.extend({template:` - Entities + + + + Entities + + - + Refresh - Text + @@ -4103,15 +4124,27 @@ const Entity=Vue.extend({template:` const Entity1=Vue.extend({template:` - Entity: {{ entity }} + + + + Entities + + + + {{ entity }} + + + Refresh + + XML - hello +
    {{ xml }}
    `, @@ -4121,19 +4154,27 @@ const Entity1=Vue.extend({template:` return { q: 'filter', item: {}, - loading: false + loading: false, + xml: null } }, methods:{ getItem(){ this.loading=true - HTTP.get("data/entity",{params:this.q}) + HTTP.get("data/entity/"+this.entity,{params:this.q}) .then(r=>{ this.loading=false //console.log(r.data) //var items=r.data.items.filter(item=>{return item.text!="[GET] http://localhost:8984/vue-poc/api/log"}) this.item=r.data.items }) + }, + getxml(){ + HTTP.get("data/entity/"+this.entity,{params:this.q, headers: {Accept: "text/xml"}}) + .then(r=>{ + console.log(r.data) + this.xml=r.data; + }) } }, created:function(){ @@ -4145,22 +4186,29 @@ const Entity1=Vue.extend({template:` // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/model/namespace.vue const Namespace=Vue.extend({template:` - - - - Namespaces + + + + + + + Namespaces + + + + - refresh + refresh - + - + - - +
    + + `, data: function(){ @@ -4243,10 +4292,22 @@ const Namespace=Vue.extend({template:` const Namespace1=Vue.extend({template:` - Namespace: {{ namespace }} + + + + Namespaces + + + + {{ xmlns }} + + + + + - Refresh - + refresh + @@ -4256,10 +4317,9 @@ const Namespace1=Vue.extend({template:` `, - props: ['namespace'], data: function(){ return { - q: 'filter', + xmlns: '', item: {}, loading: false } @@ -4267,188 +4327,22 @@ const Namespace1=Vue.extend({template:` methods:{ getItem(){ this.loading=true - HTTP.get("data/namespace",{params:this.q}) + HTTP.get("data/namespace/item",{id: this.xmlns}) .then(r=>{ - this.loading=false - //console.log(r.data) - //var items=r.data.items.filter(item=>{return item.text!="[GET] http://localhost:8984/vue-poc/api/log"}) - this.item=r.data.items + this.loading=false; + console.log(r.data) + }) } }, created:function(){ + this.xmlns=this.$route.query.xmlns; this.getItem() }, } ); -// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/ping/ping.vue -const Ping=Vue.extend({template:` - - - - Simple performance measure - - Reset - - -

    Read or increment a database value. This measures round trip times browser-database-browser.

    -

    Counter: {{counter}}

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ActionOnceRepeatLastCountAvgminmaxMedian
    Get - - radio_button_checked - - - - - - - {{getValues.last}} - - {{getValues.count}} - - {{getValues.avg | round(2)}} - - {{getValues.min}} - - {{getValues.max}} - - {{getValues.median}} -
    Update - - radio_button_checked - - - - - {{postValues.last}} - - {{postValues.count}} - - {{postValues.avg | round(2)}} - - {{postValues.min}} - - {{postValues.max}} - - {{postValues.median}} -
    -
    -
    - -
    - `, - - data: function(){ - return { - getValues: new perfStat(), - postValues: new perfStat(), - repeat:{get:false,post:false}, - counter:null - } - }, - methods:{ - update () { - var _start = performance.now(); - HTTP.post("ping",axios_json) - .then(r=>{ - var elapsed=Math.floor(performance.now() - _start); - this.counter=r.data - Object.assign(this.postValues,this.postValues.log(elapsed)) - if(this.repeat.post){ - this.update(); //does this leak?? - } - }) - }, - - get(){ - var _start = performance.now(); - HTTP.get("ping",axios_json) - .then(r=>{ - var elapsed=Math.floor(performance.now() - _start); - this.counter=r.data - Object.assign(this.getValues,this.getValues.log(elapsed)) - this.$forceUpdate() - if(this.repeat.get){ - this.get(); //does this leak?? - } - }) - }, - gchange(v){ - if(v)this.get() - }, - pchange(v){ - if(v)this.update() - }, - reset(){ - Object.assign(this.getValues,this.getValues.clear()); - Object.assign(this.postValues,this.postValues.clear()); - this.$forceUpdate() - } - }, - beforeRouteLeave(to, from, next){ - var on=this.repeat.get || this.repeat.post - - if (on) { - alert("running!") //<--undefined - return next(false) - } else { - return next() - } - } -} - - ); - // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/puzzle.vue const Puzzle=Vue.extend({template:` @@ -4610,7 +4504,7 @@ const Scratch=Vue.extend({template:` ); -// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/search.vue +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/search/search.vue const Search=Vue.extend({template:` Not finished @@ -4766,6 +4660,172 @@ const Select=Vue.extend({template:` ); +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/server/ping.vue +const Ping=Vue.extend({template:` + + + + Simple performance measure + + Reset + + +

    Read or increment a database value. This measures round trip times browser-database-browser.

    +

    Counter: {{counter}}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ActionOnceRepeatLastCountAvgminmaxMedian
    Get + + radio_button_checked + + + + + + + {{getValues.last}} + + {{getValues.count}} + + {{getValues.avg | round(2)}} + + {{getValues.min}} + + {{getValues.max}} + + {{getValues.median}} +
    Update + + radio_button_checked + + + + + {{postValues.last}} + + {{postValues.count}} + + {{postValues.avg | round(2)}} + + {{postValues.min}} + + {{postValues.max}} + + {{postValues.median}} +
    +
    +
    + +
    + `, + + data: function(){ + return { + getValues: new perfStat(), + postValues: new perfStat(), + repeat:{get:false,post:false}, + counter:null + } + }, + methods:{ + update () { + var _start = performance.now(); + HTTP.post("ping",axios_json) + .then(r=>{ + var elapsed=Math.floor(performance.now() - _start); + this.counter=r.data + Object.assign(this.postValues,this.postValues.log(elapsed)) + if(this.repeat.post){ + this.update(); //does this leak?? + } + }) + }, + + get(){ + var _start = performance.now(); + HTTP.get("ping",axios_json) + .then(r=>{ + var elapsed=Math.floor(performance.now() - _start); + this.counter=r.data + Object.assign(this.getValues,this.getValues.log(elapsed)) + this.$forceUpdate() + if(this.repeat.get){ + this.get(); //does this leak?? + } + }) + }, + gchange(v){ + if(v)this.get() + }, + pchange(v){ + if(v)this.update() + }, + reset(){ + Object.assign(this.getValues,this.getValues.clear()); + Object.assign(this.postValues,this.postValues.clear()); + this.$forceUpdate() + } + }, + beforeRouteLeave(to, from, next){ + var on=this.repeat.get || this.repeat.post + + if (on) { + alert("running!") //<--undefined + return next(false) + } else { + return next() + } + } +} + + ); + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/session.vue const Session=Vue.extend({template:` @@ -4797,6 +4857,8 @@ const Session=Vue.extend({template:` +
            {{ $auth }}
    +        
    `, @@ -5137,19 +5199,21 @@ const Model=Vue.extend({template:` const Runtask=Vue.extend({template:` - - arrow_back - - Task: {{ task }} - + + + + + Tasks + + + + {{ task }} + + + - Clear - Reset - - - play_circle_outline - Run - + + @@ -5161,7 +5225,14 @@ const Runtask=Vue.extend({template:` - + + Clear + Reset + + + play_circle_outline + Run + {{ snackbar.msg }} Close @@ -5173,31 +5244,27 @@ const Runtask=Vue.extend({template:` props:["task"], data: function(){ return { - waiting:false, - snackbar:{show:false,msg:"",context:"success"}, + loading: false, + snackbar: {show:false,msg:"",context:"success"}, valid: false } }, methods:{ submit(){ - this.waiting=true; - var params=this.$refs.params.submit(); - HTTP.post("tasks/" + this.task, Qs.stringify(params)) + this.loading=true; + this.$refs.params.submit() .then(r=>{ - this.waiting=false - this.snackbar={show:true,msg:r.data.msg,context:"success"} + this.loading= false + this.snackbar= {show:true,msg:r.data.msg,context:"success"} console.log(r.data) }) .catch(error=>{ - this.waiting=false - this.snackbar={show:true,msg:"Problem",context:"error"} + this.loading= false + this.snackbar= {show:true,msg:"Problem",context:"error"} console.log(error); }); } - }, - computed:{ - code(){return 'code here'} } } @@ -5206,21 +5273,43 @@ const Runtask=Vue.extend({template:` // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/tasks/tasks.vue const Task=Vue.extend({template:` -

    Available Tasks

    - -
      -
    • - -
      -
    • + + + + + + + Tasks + + + + + + + + + + + + +
        +
      • + +
        +
      +
      + +
      + `, data(){ return { tasks: [], - loading: false + loading: false, + q: null } }, methods:{ @@ -6045,7 +6134,7 @@ const Vuepoc=Vue.extend({template:` - + more_vert @@ -6055,6 +6144,11 @@ const Vuepoc=Vue.extend({template:` + + + Refresh: + .init + @@ -6174,7 +6268,9 @@ const Vuepoc=Vue.extend({template:` }}, methods: { - + init(){ + HTTP.get("../../.init"); + }, session(){ this.$router.push({path: '/about'}) @@ -6182,7 +6278,9 @@ const Vuepoc=Vue.extend({template:` logout(){ HTTP.get("logout").then(r=>{ - alert("logout") + this.$auth.role=null; + this.$auth.user="guest"; + this.$router.push({path: '/'}); }) }, showAlert(msg){ @@ -6256,8 +6354,7 @@ const Vuepoc=Vue.extend({template:` const AXIOS_CONFIG={ baseURL: "/vue-poc/api/", headers: { - 'X-Custom-Header': 'vue-poc', - accept: 'application/json' + 'X-Custom-Header': 'vue-poc' }, paramsSerializer: function(params) { return Qs.stringify(params) @@ -6300,21 +6397,6 @@ const HTTPNE = axios.create(AXIOS_CONFIG); const axios_json={ headers: {accept: 'application/json'}}; -// Authorization Object -const Auth={ - user:"guest", - permission:null, - session:null, - created:null, - install: function(Vue){ - Object.defineProperty(Vue.prototype, '$auth', { - get () { return Auth } - }) } -}; -Vue.use(Auth); - - - // Settings read and write list clear localforage.config({ name: 'vuepoc' diff --git a/src/vue-poc/static/app.html b/src/vue-poc/static/app.html index e2edff2..270e52e 100644 --- a/src/vue-poc/static/app.html +++ b/src/vue-poc/static/app.html @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@
      -

      vue-poc (v0.3.6)

      +

      vue-poc (v0.3.8)

      @@ -38,7 +38,7 @@ - + diff --git a/src/vue-poc/static/resources/xslt/xipr-1-0.xsl b/src/vue-poc/static/resources/xslt/xipr-1-0.xsl new file mode 100644 index 0000000..be6bd37 --- /dev/null +++ b/src/vue-poc/static/resources/xslt/xipr-1-0.xsl @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file