namespaces

This commit is contained in:
Andy Bunce 2018-06-05 22:49:12 +01:00
parent f8acb23e8d
commit c63490b9d8
11 changed files with 201 additions and 106 deletions

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<!--
size contents to fit bottom to track window
-->
<template id="qd-autoheight">
<div style="height:200px;overflow:hidden;" ref="auto" v-resize="onResize" class="green">
<slot >i will auto2</slot>
</div>
</template>
<script>{
props: ['show'],
created:function(){
console.log("qd-auto");
},
methods:{
onResize(){
var el=this.$refs["auto"];
var e=el;
//console.log("top",e.offsetTop)
var h=Math.max(1,window.innerHeight - e.offsetTop -40)
// console.log("h",h)
e.style.height=h +"px";
}
}
}
</script>

View File

@ -36,7 +36,8 @@ HTTP.interceptors.response.use((response) => {
var c=response.config;
var url=response.config.url + "?" + c.paramsSerializer(c.params);
//console.log("interceptors time:",s, response.config);
Notification.add(s +" "+ url );
var b=`<a href="${url}" target="vp-notification" >${url}</a> Time: ${s}`
Notification.add(b);
}
return response;
});

View File

@ -27,7 +27,7 @@
<v-spacer></v-spacer>
<v-btn v-if="selection.length" @click="selectNone">S: {{selection.length}}</v-btn>
<v-text-field v-if="!selection.length" prepend-icon="search" label="Filter..." v-model="q" type="search"
<v-text-field v-if="!selection.length" prepend-icon="filter_list" label="Filter..." v-model="q" type="search"
hide-details single-line @keyup.enter="setfilter"
:append-icon="this.q?'clear':''" :append-icon-cb="e=>this.q=''"></v-text-field>
@ -246,10 +246,10 @@
return (this.protocol=="xmldb")?"developer_mode":"folder"
},
xfiles(){
return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.includes(this.q))})
return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))})
},
xfolders(){
return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.includes(this.q))})
return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))})
},
// array of {name:"that", path:"/this/that/"} for url
crumbs(){

View File

@ -7,7 +7,7 @@
<v-card>
<v-toolbar dense >
<v-btn @click.stop="showFilter = true" icon><v-icon>search</v-icon></v-btn>
<v-btn @click.stop="showFilter = true" icon><v-icon>filter_list</v-icon></v-btn>
<v-toolbar-title>{{ qtext }}</v-toolbar-title>
<v-tooltip top v-if="query.keyword || query.from || query.until">
<v-btn @click="clear" icon slot="activator"

View File

@ -7,17 +7,20 @@ import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm
import module namespace imgmeta = "expkg-zone58:image.metadata" ;
declare namespace c="http://www.w3.org/ns/xproc-step";
declare variable $KEY:="20180603";
declare variable $dir-uri:=``[`{ $cfg:DB-IMAGE }`/`{ $KEY }`-pics.xml]``;
declare variable $doc:=doc( $dir-uri);
declare variable $CHUNK:=1000;
let $done:=uri-collection($cfg:DB-IMAGE || "/meta")
let $files:= doc($cfg:DB-IMAGE || "/pics.xml")//c:file[ends-with(lower-case(@name),".jpg")]
declare variable $meta:="/meta2/";
let $done:=uri-collection($cfg:DB-IMAGE ||$meta)
let $files:= $doc//c:file[ends-with(lower-case(@name),".jpg")]
let $relpath:= $files!( ancestor-or-self::*/@name=>string-join("/"))
let $todo:= $relpath[not("/vue-poc/meta/" || .|| "/meta.xml"=$done)]
return (for $f in subsequence($todo,1, $CHUNK)
let $spath:=$cfg:IMAGEDIR || "../" || $f
let $dbpath:="meta/" || $f || "/meta.xml"
let $dbpath:=$meta || $f || "/meta.xml"
let $meta:=imgmeta:read($spath)
return db:replace($cfg:DB-IMAGE,$dbpath,$meta),
db:output($todo=>count()))

View File

@ -10,46 +10,27 @@
>Refresh</v-btn>
Text
</v-toolbar>
<v-data-iterator
content-tag="v-layout"
row
wrap
:loading="loading"
:items="items"
:rows-per-page-items="rowsPerPageItems"
:pagination.sync="pagination"
select-all
:value="selected"
>
<v-flex
slot="item"
slot-scope="props"
xs12
sm6
md4
lg3
>
<v-card :hover="true" active-class="default-class qd-active" height="200px">
<v-data-table
:headers="headers"
:items="items"
hide-actions
class="elevation-1"
>
<template slot="items" slot-scope="props">
<td ><router-link :to="{path:'namespace/item?xmlns='+ props.item.xmlns}">
{{ props.item.xmlns }}
</router-link></td>
<td >{{ props.item.description }}</td>
<td >{{ props.item.prefix }}</td>
</template>
<template slot="no-data">
<v-alert :value="true" color="error" icon="warning">
Sorry, nothing to display here :(
</v-alert>
</template>
</v-data-table>
<v-toolbar color="amber">
<v-card-title >
<router-link :to="{path:'namespace/'+ props.item.name}">
<h3>
<v-icon>star</v-icon> {{ props.item.xmlns }}
</h3>
</router-link>
</v-card-title>
</v-toolbar>
<v-card-text>{{ props.item.description }}</<v-card-text>
<v-card-text>
<v-badge color="red">
<span slot="badge">{{ props.item.prefix }}</span>
Fields
</v-badge>
</v-card-text>
</v-card>
</v-flex>
</v-data-iterator>
</v-container>
</template>
@ -64,7 +45,14 @@
pagination: {
rowsPerPage: 20
},
selected:[]
selected:[],
headers: [
{ text: 'xmlns', value: 'xmlns' },
{ text: 'Description', value: 'description' },
{ text: 'Prefix', value: 'prefix' }
]
}
},
methods: {
@ -84,6 +72,7 @@
});
},
},
created:function(){
this.q=this.$route.query.q || this.q;

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<template id="scratch">
<v-container fluid>
<qd-autoheight>
<vue-ace :content="ace" mode="xml" ></vue-ace>
</qd-autoheight>
</v-container>
</template>
<script>{
data: function(){
return {
message: 'bad route!',
ace:"<xml>here</xml>"
}
},
mounted:function(){
console.log("notfound",this.$route.path)
}
}
</script>

View File

@ -32,6 +32,8 @@ const router = new VueRouter({
{ path: '/entity/:entity', name:"entity1", component: Entity1, props: true, meta:{title:"Entity"} },
{ path: '/namespace', component: Namespace, meta:{title:"Namespaces"} },
{ path: '/namespace/item', component: Namespace1, meta:{title:"Namespace"} },
{ path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} },
@ -90,8 +92,9 @@ const router = new VueRouter({
{ path: '/form2', component: Formsjson, meta:{title:"Form schema"} },
{ path: '/form3', component: Formsschema, meta:{title:"vue-form-json-schema"} },
{ path: '/about', component: About,meta:{title:"About Vue-poc"} },
{ path: '*', component: Notfound,meta:{title:"Page not found"} }
{ path: '/scratch', component: Scratch, meta:{title:"scratch"} },
{ path: '/about', component: About, meta:{title:"About Vue-poc"} },
{ path: '*', component: Notfound, meta:{title:"Page not found"} }
],
});
router.afterEach(function(route) {

View File

@ -1,4 +1,29 @@
// generated 2018-06-01T23:15:21.554+01:00
// generated 2018-06-05T22:46:09.838+01:00
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
Vue.component('qd-autoheight',{template:`
<div style="height:200px;overflow:hidden;" ref="auto" v-resize="onResize" class="green">
<slot>i will auto2</slot>
</div>
`,
props: ['show'],
created:function(){
console.log("qd-auto");
},
methods:{
onResize(){
var el=this.$refs["auto"];
var e=el;
//console.log("top",e.offsetTop)
var h=Math.max(1,window.innerHeight - e.offsetTop -40)
// console.log("h",h)
e.style.height=h +"px";
}
}
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-confirm.vue
Vue.component('qd-confirm',{template:`
@ -888,7 +913,7 @@ const Files=Vue.extend({template:`
<v-spacer></v-spacer>
<v-btn v-if="selection.length" @click="selectNone">S: {{selection.length}}</v-btn>
<v-text-field v-if="!selection.length" prepend-icon="search" label="Filter..." v-model="q" type="search" hide-details="" single-line="" @keyup.enter="setfilter" :append-icon="this.q?'clear':''" :append-icon-cb="e=>this.q=''"></v-text-field>
<v-text-field v-if="!selection.length" prepend-icon="filter_list" label="Filter..." v-model="q" type="search" hide-details="" single-line="" @keyup.enter="setfilter" :append-icon="this.q?'clear':''" :append-icon-cb="e=>this.q=''"></v-text-field>
<v-toolbar-items v-if="!selection.length">
@ -1103,10 +1128,10 @@ const Files=Vue.extend({template:`
return (this.protocol=="xmldb")?"developer_mode":"folder"
},
xfiles(){
return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.includes(this.q))})
return this.items.filter(item=>{return item.type!="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))})
},
xfolders(){
return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.includes(this.q))})
return this.items.filter(item=>{return item.type=="folder" &&((!this.q) || item.name.toLowerCase().includes(this.q.toLowerCase()))})
},
// array of {name:"that", path:"/this/that/"} for url
crumbs(){
@ -2407,7 +2432,7 @@ const Images=Vue.extend({template:`
<v-card>
<v-toolbar dense="">
<v-btn @click.stop="showFilter = true" icon=""><v-icon>search</v-icon></v-btn>
<v-btn @click.stop="showFilter = true" icon=""><v-icon>filter_list</v-icon></v-btn>
<v-toolbar-title>{{ qtext }}</v-toolbar-title>
<v-tooltip top="" v-if="query.keyword || query.from || query.until">
<v-btn @click="clear" icon="" slot="activator">
@ -3262,29 +3287,22 @@ const Namespace=Vue.extend({template:`
<v-btn @click="load" :loading="loading" :disabled="loading">Refresh</v-btn>
Text
</v-toolbar>
<v-data-iterator content-tag="v-layout" row="" wrap="" :loading="loading" :items="items" :rows-per-page-items="rowsPerPageItems" :pagination.sync="pagination" select-all="" :value="selected">
<v-flex slot="item" slot-scope="props" xs12="" sm6="" md4="" lg3="">
<v-card :hover="true" active-class="default-class qd-active" height="200px">
<v-data-table :headers="headers" :items="items" hide-actions="" class="elevation-1">
<template slot="items" slot-scope="props">
<td><router-link :to="{path:'namespace/item?xmlns='+ props.item.xmlns}">
{{ props.item.xmlns }}
</router-link></td>
<td>{{ props.item.description }}</td>
<td>{{ props.item.prefix }}</td>
</template>
<template slot="no-data">
<v-alert :value="true" color="error" icon="warning">
Sorry, nothing to display here :(
</v-alert>
</template>
</v-data-table>
<v-toolbar color="amber">
<v-card-title>
<router-link :to="{path:'namespace/'+ props.item.name}">
<h3>
<v-icon>star</v-icon> {{ props.item.xmlns }}
</h3>
</router-link>
</v-card-title>
</v-toolbar>
<v-card-text>{{ props.item.description }}<!--<v-card-text-->
<v-card-text>
<v-badge color="red">
<span slot="badge">{{ props.item.prefix }}</span>
Fields
</v-badge>
</v-card-text>
</v-card-text></v-card>
</v-flex>
</v-data-iterator>
</v-container>
`,
@ -3298,7 +3316,14 @@ const Namespace=Vue.extend({template:`
pagination: {
rowsPerPage: 20
},
selected:[]
selected:[],
headers: [
{ text: 'xmlns', value: 'xmlns' },
{ text: 'Description', value: 'description' },
{ text: 'Prefix', value: 'prefix' }
]
}
},
methods: {
@ -3318,6 +3343,7 @@ const Namespace=Vue.extend({template:`
});
},
},
created:function(){
this.q=this.$route.query.q || this.q;
@ -3671,6 +3697,28 @@ const Repo=Vue.extend({template:`
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/scratch.vue
const Scratch=Vue.extend({template:`
<v-container fluid="">
<qd-autoheight>
<vue-ace :content="ace" mode="xml"></vue-ace>
</qd-autoheight>
</v-container>
`,
data: function(){
return {
message: 'bad route!',
ace:"<xml>here</xml>"
}
},
mounted:function(){
console.log("notfound",this.$route.path)
}
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/search.vue
const Search=Vue.extend({template:`
<v-container fluid="">
@ -5219,6 +5267,8 @@ const router = new VueRouter({
{ path: '/entity/:entity', name:"entity1", component: Entity1, props: true, meta:{title:"Entity"} },
{ path: '/namespace', component: Namespace, meta:{title:"Namespaces"} },
{ path: '/namespace/item', component: Namespace1, meta:{title:"Namespace"} },
{ path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} },
@ -5277,8 +5327,9 @@ const router = new VueRouter({
{ path: '/form2', component: Formsjson, meta:{title:"Form schema"} },
{ path: '/form3', component: Formsschema, meta:{title:"vue-form-json-schema"} },
{ path: '/about', component: About,meta:{title:"About Vue-poc"} },
{ path: '*', component: Notfound,meta:{title:"Page not found"} }
{ path: '/scratch', component: Scratch, meta:{title:"scratch"} },
{ path: '/about', component: About, meta:{title:"About Vue-poc"} },
{ path: '*', component: Notfound, meta:{title:"Page not found"} }
],
});
router.afterEach(function(route) {
@ -5610,7 +5661,8 @@ HTTP.interceptors.response.use((response) => {
var c=response.config;
var url=response.config.url + "?" + c.paramsSerializer(c.params);
//console.log("interceptors time:",s, response.config);
Notification.add(s +" "+ url );
var b=`<a href="${url}" target="vp-notification" >${url}</a> Time: ${s}`
Notification.add(b);
}
return response;
});

View File

@ -34,28 +34,28 @@
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.1/vue-router.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/axios/0.17.1/axios.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js"></script>
<script src="//unpkg.com/vuetify@1.0.18/dist/vuetify.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ext-language_tools.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.1/vue-router.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/axios/0.17.1/axios.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js" crossorigin="anonymous" ></script>
<script src="//unpkg.com/vuetify@1.0.18/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ext-language_tools.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ext-linking.js" type="text/javascript" charset="utf-8"></script>
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify-css.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify-html.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/localforage/1.7.1/localforage.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.js"></script>
<script src="//d3js.org/d3.v4.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify-css.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify-html.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/localforage/1.7.1/localforage.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-jstree@1.0.11/dist/vue-jstree.js"></script>
<script src="//unpkg.com/@riophae/vue-treeselect@0.0.28/dist/vue-treeselect.min.js"></script>
<script src="//unpkg.com/vue-jstree@1.0.11/dist/vue-jstree.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/@riophae/vue-treeselect@0.0.28/dist/vue-treeselect.min.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-form-generator@2.2.2/dist/vfg-core.js"></script>
<script src="//unpkg.com/vue-json-schema@1.1.0/dist/vue-json-schema.js"></script>
<script src="//unpkg.com/vue-form-json-schema@1.15.3/dist/vue-form-json-schema.umd.js"></script>
<script src="//unpkg.com/vue-form-generator@2.2.2/dist/vfg-core.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-json-schema@1.1.0/dist/vue-json-schema.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-form-json-schema@1.15.3/dist/vue-form-json-schema.umd.js" crossorigin="anonymous"></script>
<script src="/vue-poc/ui/svg/d3-svg.js"></script>
<script src="/vue-poc/ui/perf-stat.js"></script>

View File

@ -1,5 +1,4 @@
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)
declare variable $proj external :="C:/Users/andy/git/vue-poc/src/vue-poc/";
vue:compile( $proj)