[MOD] beef up models

This commit is contained in:
Andy Bunce 2020-09-30 18:29:01 +01:00
parent 50f8daa2f3
commit 5946f6f76d
44 changed files with 1248 additions and 409 deletions

View file

@ -142,13 +142,14 @@
frmfav: false,
items: [
{href: '/',text: 'Dashboard', icon: 'dashboard' },
{href: '/',text: 'Dashboard', icon: 'home' },
{
icon: 'input',
text: 'Actions' ,
model: false,
children: [
{href: '/eval',text: 'Query',icon: 'play_circle_outline'},
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
@ -163,8 +164,8 @@
children: [
{href: '/database', text: 'Databases',icon: 'developer_mode' },
{href: '/files', text: 'File system',icon: 'folder' },
{href: '/documentation', text: 'Documentation',icon: 'library_books' },
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/logdate',text: 'XML logs',icon: 'dns'},
{href: '/history/files',text: 'history',icon: 'history'}
]},
@ -173,9 +174,11 @@
text: 'Models' ,
model: false,
children: [
{href: '/entity', text: 'Entities',icon: 'redeem' },
{href: '/documentation', text: 'Documentation',icon: 'library_books' },
{href: '/namespace', text: 'Namespaces',icon: 'label' },
{href: '/model/entity', text: 'Entities',icon: 'redeem' },
{href: '/model/namespace', text: 'Namespaces',icon: 'dns' },
{href: '/model/schema', text: 'Schemas',icon: 'verified' },
{href: '/model/taxonomy', text: 'Taxonomies',icon: 'local_offer' },
{href: '/model/mimetype', text: 'Mimetypes',icon: 'assignment' },
]},
{
@ -225,7 +228,7 @@
children: [
{href: '/labs/scratch',text: 'Scratch pad',icon: 'filter_frames'},
{href: '/labs/form',text: 'Forms',icon: 'subtitles' },
{href: '/labs/timeline',text: 'Time line',icon: 'timelapse'},
{href: '/labs/timeline',text: 'Time line',icon: 'event_note'},
{href: '/labs/svg',text: 'SVG',icon: 'extension'},
{href: '/labs/svg2',text: 'SVG2',icon: 'extension'},
{href: '/labs/tree',text: 'Tree',icon: 'nature'},

View file

@ -20,7 +20,7 @@
var e=el;
// console.log("top",e.offsetTop,e.getBoundingClientRect().top,window.innerHeight);
var h=window.innerHeight - e.getBoundingClientRect().top -10;
var h=Math.max(1,h) ;
h=Math.max(1,h) ;
// console.log("h",h)
e.style.height=h +"px";
}

View file

@ -17,18 +17,17 @@
>
<template slot="item" slot-scope="{ index, item, parent }" >
<v-list-item-action>
<v-btn icon :to="item.value">
<v-icon>arrow_forward</v-icon>
</v-btn>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>
{{ item.text }}
</v-list-item-title>
<v-list-item-subtitle>Page {{ item.value }}</v-list-item-subtitle>
<v-list-item-title>Search "{{ item.text }}"</v-list-item-title>
<v-list-item-subtitle>or goto
<router-link :to="item.value">
{{ item.value }}
<v-icon>launch</v-icon>
</router-link>
</v-list-item-subtitle>
</v-list-item-content>
</template>
</v-combobox>
@ -51,7 +50,7 @@
this.loading = true
// Simulated ajax query
setTimeout(() => {
this.items2 = this.si?this.matchItems(this.si.toLowerCase()):[],
this.items2 = this.si?this.matchItems(this.si.toLowerCase()):[]
this.loading = false
}, 500)
},
@ -62,7 +61,7 @@
matchItems(typed){
var hits=this.titles;
var typed=typed.toLowerCase();
typed=typed.toLowerCase();
hits=hits.filter(item=>item.title.indexOf(typed) !== -1)
return hits.map(r=>{return {text:r.title,
value:r.path}

View file

@ -3,7 +3,7 @@
show a entity link
-->
<template id="vp-entitylink">
<router-link :to="'entity/'+entity">E</router-link>
<router-link :to="'/entity/'+entity">E</router-link>
</template>
<script>{

View file

@ -17,12 +17,16 @@ display button that invokes a save favorite form
<v-card style="width:400px;">
<v-toolbar class="green">
<v-card-title>
Bookmark this page
Add to favorites
</v-card-title>
<v-spacer></v-spacer>
<v-btn @click="set(false)" icon><v-icon>close</v-icon></v-btn>
</v-toolbar>
<v-card-text>
<h6>{{$route.meta.title}}</h6>
<h6>{{$route.meta.title}}
<v-btn v-if="canCopy" @click="setclip" icon title="Copy location"><v-icon>content_copy</v-icon></v-btn>
</h6>
<v-combobox multiple
v-model="tags"
label="tags"
@ -33,9 +37,10 @@ display button that invokes a save favorite form
</v-card-text>
<v-card-actions>
<v-btn color="primary" text @click.stop="favorite(); set(false)">Done</v-btn>
<v-spacer></v-spacer>
<v-btn color="primary" text @click.stop="set(false)">Cancel</v-btn>
<v-btn color="primary" text @click.stop="favorite(); set(false)">Save</v-btn>
<v-btn text @click.stop="set(false)">Cancel</v-btn>
</v-card-actions>
</v-card>
</v-menu></template>
@ -45,25 +50,26 @@ display button that invokes a save favorite form
},
data(){
return {
canCopy:false,
tags: [],
taglist: [
'todo',
'find',
'some',
'good',
'tags'
],
taglist: [ 'todo', 'find', 'some', 'good', 'tags' ],
}
},
methods:{
set(v){
this.$emit('update:frmfav', v)
},
async setclip(){
await navigator.clipboard.writeText(this.$route.fullPath);
alert('Copied!' + this.$route.fullPath);
},
favorite(){
this.$store.commit('increment')
console.log(this.$store.state.count)
alert("save");
}
}
},
created() {
this.canCopy = !!navigator.clipboard;
},
}</script>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
manage parameters for query
including submit form function
A form to manage parameters for query
including submit form function via POST
-->
<template id="vp-paramform">
<v-card >
@ -21,7 +21,7 @@
<v-flex v-for="field in fields" :key="field.model" >
<v-text-field v-if="field.type === 'xs:anyURI'"
v-model="params[field.model]" :label="field.label"
v-model="params[field.model]" :label="field.label && field.model"
clearable :rules="fieldrules(field)" filled
append-outer-icon="send" @click:append-outer="source(field)"
></v-text-field>

View file

@ -0,0 +1,25 @@
<entity name="favorites" xmlns="https://github.com/Quodatum/app-doc/entity">
<description>vue-poc favourites </description>
<fields>
<field name="created" type="xs:string">
<description>time of event</description>
<xpath>@when</xpath>
</field>
<field name="user" type="xs:string">
<description>user</description>
<xpath>@user</xpath>
</field>
<field name="id" type="xs:string">
<description>id</description>
<xpath>@id</xpath>
</field>
<field name="url" type="xs:string">
<description>path</description>
<xpath>@url</xpath>
</field>
</fields>
<views iconclass="star_border"/>
<data type="element(favorite)">doc("vue-poc/favorites.xml")/favorites/favorite</data>
</entity>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<favourites xmlns="urn:quodatum:vue-poc.favourite" next-id="1">
<item id="0" when='' user=''>
<tags>
<tag>svg</tag>
</tags>
</item>
</favourites>

View file

@ -66,7 +66,7 @@
<v-card>
<v-toolbar>
<v-card-title>
{{ active.path}}
{{ active.name}}
</v-card-title>
<router-link :to="active.path"><v-icon>link</v-icon></router-link>
<v-spacer></v-spacer>
@ -155,8 +155,8 @@
this.refresh()
if(this.$route.query.index){
const index= parseInt(this.$route.query.index)
//const h= this.findItem(this.routes,index)
//console.log("search",h, index)
const h= this.findItem(this.routes,index)
console.log("search",h, index)
//this.active=h
}
}

View file

@ -1,98 +1,36 @@
<!DOCTYPE html>
<template id="documentation">
<v-container fluid grid-list-md>
<v-data-iterator
:items="items"
:items-per-page.sync="itemsPerPage"
:search="search"
hide-default-footer
>
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>XQDocs</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
clearable
flat
solo-inverted
hide-details
prepend-inner-icon="search"
label="Search"
></v-text-field>
<v-spacer></v-spacer>
<router-link :to="{path:'/tasks/xqdoca'}">
<v-icon>add_circle</v-icon>
</router-link>
<v-btn @click="get" icon :loading="loading"
:disabled="loading"
><v-icon>refresh</v-icon></v-btn>
</v-toolbar>
<v-container fluid >
<v-card>
<v-toolbar dense >
<v-toolbar-title>
<v-breadcrumbs :items="crumbs">
<span slot="divider" style="padding:0;"></span>
<template slot="item" slot-scope="props">
<v-breadcrumbs-item
:to="{ query: { url: props.item.path }}" :exact="true">
<v-icon v-if="props.item.icon">{{ props.item.icon }}</v-icon>
{{ props.item.name }}
</v-breadcrumbs-item>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex
v-for="item in props.items"
:key="item.name"
xs12
sm6
md4
lg3
>
<v-card :hover="true" >
<v-toolbar color="blue lighten-3" dense>
<v-card-title >{{ item.name }}</v-card-title>
<v-spacer></v-spacer>
<a :href="item.href" target="_new">go</a>
</v-breadcrumbs>
</v-toolbar-title>
</v-toolbar>
<v-card-text>{{ item.id }}</v-card-text>
<v-card-text>
<span :title="item.created">{{ item.created | fromNow }}</span>
<ul>
<li>
<router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
</li>
<li>
<router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
</li>
</ul>
</v-card-text>
<v-card-actions>
<v-btn>Run</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
</template>
<script>{
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false
}
},
methods:{
get() {
this.loading=true;
HTTP.get('xqdocjob')
.then((res) => {
this.items = res.data;
this.loading=false;
});
},
doEdit(item){
console.log("history: ",item)
router.push({ path: 'edit', query: { url:item.url, protocol:item.protocol }})
}
},
created:function(){
this.get()
console.log("history")
}
}
</script>

View file

@ -0,0 +1,98 @@
<!DOCTYPE html>
<template id="xqdocs">
<v-container fluid grid-list-md>
<v-data-iterator
:items="items"
:items-per-page.sync="itemsPerPage"
:search="search"
hide-default-footer
>
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>XQDocs</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
clearable
flat
solo-inverted
hide-details
prepend-inner-icon="search"
label="Search"
></v-text-field>
<v-spacer></v-spacer>
<router-link :to="{path:'/tasks/xqdoca'}">
<v-icon>add_circle</v-icon>
</router-link>
<v-btn @click="get" icon :loading="loading"
:disabled="loading"
><v-icon>refresh</v-icon></v-btn>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex
v-for="item in props.items"
:key="item.name"
xs12
sm6
md4
lg3
>
<v-card :hover="true" >
<v-toolbar color="blue lighten-3" dense>
<v-card-title >{{ item.name }}</v-card-title>
<v-spacer></v-spacer>
<a :href="item.href" target="_new">go</a>
</v-toolbar>
<v-card-text>{{ item.id }}</v-card-text>
<v-card-text>
<span :title="item.created">{{ item.created | fromNow }}</span>
</v-card-text>
<v-card-actions>
<v-btn>Run</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
</template>
<script>{
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false
}
},
methods:{
get() {
this.loading=true;
HTTP.get('xqdocjob')
.then((res) => {
this.items = res.data;
this.loading=false;
});
},
doEdit(item){
console.log("history: ",item)
router.push({ path: 'edit', query: { url:item.url, protocol:item.protocol }})
}
},
created:function(){
this.get()
console.log("history")
}
}
</script>

View file

@ -2,11 +2,12 @@
<template id="tree2">
<v-container fluid>
<v-card>
<v-toolbar class="lime darken-1">
<v-toolbar flat floating class="lime darken-1">
<v-card-title ><qd-link href="https://github.com/riophae/vue-treeselect">vue-treeselect@0.0.29</qd-link> </v-card-title>
<v-spacer></v-spacer>
<v-btn>todo</v-btn>
</v-toolbar>
<v-card-text>
<v-layout row wrap>
<v-flex xs4 >

View file

@ -2,5 +2,14 @@ single editor
/vue-poc/api/edit
params
url=url to load
protocol=
XHR
```
HTTP.get("edit",{params: {url:url,protocol:this.protocol}})
```
protocol: webfile
url:

View file

@ -30,7 +30,8 @@ function vue-api:edit-get($url as xs:string)
"xmldb": vue-api:get-basexdb#1
}
let $reader:=trace($reader)
return $reader($protocol)($url)
let $fn:=($reader($protocol),vue-api:get-webfile#1)[1]
return $fn($url)
};
(:~
@ -82,7 +83,7 @@ as element(json)
(:~
: Returns a file content.
: @param $url starts with protocol
: @param $url starts with protocol accepts xmldb:path, file:path, webfile:/ path
:)
declare
%rest:GET %rest:path("/vue-poc/api/get")
@ -124,5 +125,5 @@ as element(json)
<data>{serialize($doc)}</data>
</json>
else
error(xs:QName('vue-api:raw'),$url)
error(xs:QName('vue-api:get-basexdb'),$url)
};

View file

@ -28,6 +28,7 @@
>
<v-icon>{{ autorefresh?'refresh':'arrow_downward' }}</v-icon>
</v-btn>
<vp-entitylink entity="basex.job"></vp-entitylink>
</v-toolbar>
<v-data-table
:headers="headers"

View file

@ -14,7 +14,7 @@
<template v-slot:header>
<v-toolbar >
<v-toolbar-title>
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]" >
<v-breadcrumbs :items="[{text:'Entities',to:'/model/entity'}]" >
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}

View file

@ -4,7 +4,7 @@
<v-toolbar>
<v-toolbar-title>
<qd-breadcrumbs @todo="showmenu= ! showmenu"
:crumbs="[{to: '/entity', text:'Entities'}, {text: entity, disabled: false, menu: 'todo'}]"
:crumbs="[{to: '/model/entity', text:'Entities'}, {text: entity, disabled: false, menu: 'todo'}]"
>crumbs</qd-breadcrumbs>
</v-toolbar-title>
<v-menu v-model="showmenu" >

View file

@ -0,0 +1,109 @@
<!DOCTYPE html>
<template id="mimetype">
<v-container fluid grid-list-md>
<v-data-iterator
:items="items"
:items-per-page.sync="itemsPerPage"
:search="q"
hide-default-footer
select-all
:value="selected"
>
<template v-slot:header>
<v-toolbar >
<v-toolbar-title>
mimetype TODO
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]" >
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search"
hide-details single-line @keyup.enter="setfilter"
clearable></v-text-field>
<v-spacer></v-spacer>
<v-btn @click="getItems" icon
:loading="loading"
:disabled="loading"
><v-icon>refresh</v-icon></v-btn>
<vp-entitylink entity="mimetype"></vp-entitylink>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex
v-for="item in props.items"
:key="item.name"
xs12
sm6
md4
lg3
>
<v-card :hover="true" active-class="default-class qd-active" height="200px" max-height="200px">
<v-toolbar color="blue lighten-3" dense>
<v-toolbar-title>
<router-link :to="{path:'entity/'+ item.name}">
<v-avatar>
<v-icon>{{ item.iconclass }}</v-icon>
</v-avatar> {{ item.name }}
</v-toolbar-title>
</v-card-title>
<v-spacer></v-spacer>
<v-badge >
<span slot="badge">{{ item.nfields }}</span>
</v-badge>
</v-toolbar>
<v-card-text >{{ item.description }}</<v-card-text>
</v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
</template>
<script>{
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false,
q: '',
selected:[]
}
},
methods:{
getItems(){
this.loading=true
HTTP.get("data/entity",{params:{q: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.items=r.data.items
})
},
setfilter(){
console.log("TODO",this.q);
this.$router.push({ query: {url: this.url,
q: this.q }})
}
},
created:function(){
this.getItems()
},
}
</script>

View file

@ -0,0 +1,109 @@
<!DOCTYPE html>
<template id="schema">
<v-container fluid grid-list-md>
<v-data-iterator
:items="items"
:items-per-page.sync="itemsPerPage"
:search="q"
hide-default-footer
select-all
:value="selected"
>
<template v-slot:header>
<v-toolbar >
<v-toolbar-title>
schema TODO
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]" >
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search"
hide-details single-line @keyup.enter="setfilter"
clearable></v-text-field>
<v-spacer></v-spacer>
<v-btn @click="getItems" icon
:loading="loading"
:disabled="loading"
><v-icon>refresh</v-icon></v-btn>
<vp-entitylink entity="taxonomy"></vp-entitylink>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex
v-for="item in props.items"
:key="item.name"
xs12
sm6
md4
lg3
>
<v-card :hover="true" active-class="default-class qd-active" height="200px" max-height="200px">
<v-toolbar color="blue lighten-3" dense>
<v-toolbar-title>
<router-link :to="{path:'entity/'+ item.name}">
<v-avatar>
<v-icon>{{ item.iconclass }}</v-icon>
</v-avatar> {{ item.name }}
</v-toolbar-title>
</v-card-title>
<v-spacer></v-spacer>
<v-badge >
<span slot="badge">{{ item.nfields }}</span>
</v-badge>
</v-toolbar>
<v-card-text >{{ item.description }}</<v-card-text>
</v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
</template>
<script>{
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false,
q: '',
selected:[]
}
},
methods:{
getItems(){
this.loading=true
HTTP.get("data/entity",{params:{q: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.items=r.data.items
})
},
setfilter(){
console.log("TODO",this.q);
this.$router.push({ query: {url: this.url,
q: this.q }})
}
},
created:function(){
this.getItems()
},
}
</script>

View file

@ -0,0 +1,109 @@
<!DOCTYPE html>
<template id="taxonomy">
<v-container fluid grid-list-md>
<v-data-iterator
:items="items"
:items-per-page.sync="itemsPerPage"
:search="q"
hide-default-footer
select-all
:value="selected"
>
<template v-slot:header>
<v-toolbar >
<v-toolbar-title>
Taxonomy TODO
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]" >
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search"
hide-details single-line @keyup.enter="setfilter"
clearable></v-text-field>
<v-spacer></v-spacer>
<v-btn @click="getItems" icon
:loading="loading"
:disabled="loading"
><v-icon>refresh</v-icon></v-btn>
<vp-entitylink entity="taxonomy"></vp-entitylink>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex
v-for="item in props.items"
:key="item.name"
xs12
sm6
md4
lg3
>
<v-card :hover="true" active-class="default-class qd-active" height="200px" max-height="200px">
<v-toolbar color="blue lighten-3" dense>
<v-toolbar-title>
<router-link :to="{path:'entity/'+ item.name}">
<v-avatar>
<v-icon>{{ item.iconclass }}</v-icon>
</v-avatar> {{ item.name }}
</v-toolbar-title>
</v-card-title>
<v-spacer></v-spacer>
<v-badge >
<span slot="badge">{{ item.nfields }}</span>
</v-badge>
</v-toolbar>
<v-card-text >{{ item.description }}</<v-card-text>
</v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
</template>
<script>{
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false,
q: '',
selected:[]
}
},
methods:{
getItems(){
this.loading=true
HTTP.get("data/entity",{params:{q: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.items=r.data.items
})
},
setfilter(){
console.log("TODO",this.q);
this.$router.push({ query: {url: this.url,
q: this.q }})
}
},
created:function(){
this.getItems()
},
}
</script>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xqdocs>
<entry id="279" >
</entry>
<entry id="280">
</entry>
</xqdocs>

View file

@ -1 +1,8 @@
Tasks
* Server code `rxq-tasks.xqm`
* Are defined in `taskdef.xml`
* Each run is logged to `ggg`
* UI vp-paramform

View file

@ -1,4 +1,6 @@
<!DOCTYPE html>
<!-- form to submit a run
-->
<template id="runtask">
<v-container fluid>
<v-card >

View file

@ -1,25 +0,0 @@
(:~
: Import a file or directory into a database
: @author andy bunce
: @since july 2018
:)
import module namespace dbtools = 'quodatum.dbtools' at "../../../lib/dbtools.xqm";
(:~ URL of file or folder to import
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities
:)
declare variable $srcpath as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities";
(:~ Target BaseX db root path for imported files
: @default vue-poc
:)
declare variable $targetpath as xs:anyURI external :="/entities";
(:~ unused boolean test
: @default true
:)
declare variable $boolean as xs:boolean external :=false();
let $todo:="target"
return dbtools:sync-from-path($targetpath, $srcpath,false())

View file

@ -7,18 +7,18 @@ import module namespace dbtools = 'quodatum.dbtools' at "../../../lib/dbtools.xq
(:~ URL of file or folder to import
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities
: @default C:\Users\andy\git\vue-poc\src\vue-poc\data\vue-poc\entities\
:)
declare variable $srcpath as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities";
declare variable $srcpath as xs:string external :="C:\Users\andy\git\vue-poc\src\vue-poc\data\vue-poc\entities\";
(:~ Target BaseX db root path for imported files
: @default /vue-poc/entities
: @default /vue-poc/entities/
:)
declare variable $targetpath as xs:anyURI external :="/vuepoc-test";
declare variable $targetpath as xs:string external :="/vuepoc-test";
(:~ delete from database if not if import files list
: @default false
@default false
:)
declare variable $deleteMissing as xs:boolean external :=false();
declare variable $deleteMissing as xs:boolean external :=true();
dbtools:sync-from-path($targetpath, $srcpath,$deleteMissing )

View file

@ -5,12 +5,8 @@
</description>
</task>
<task name="import" url="task/tx-dbimport.xq">
<title>Load files into database</title>
<description>Load files into database</description>
</task>
<task name="import2" url="task/tx-dbimport2.xq">
<title>Import files into a database</title>
<title>Import files from drive into a database</title>
<description>Load files into database</description>
</task>
@ -29,6 +25,10 @@
<description>xquery documentation</description>
</task>
<task name="primes" url="../../tasks/primes.xq">
<title>Calculate primes</title>
<description>performance</description>
</task>
<task name="newapp" url="task/tx-newapp.xq">
<title>application template</title>
<description>application template</description>

View file

@ -9,6 +9,9 @@
<v-breadcrumbs-item to="/tasks" :exact="true">
Tasks
</v-breadcrumbs-item>
<v-breadcrumbs-item >
History
</v-breadcrumbs-item>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>

View file

@ -19,6 +19,8 @@
hide-details single-line @keyup.enter="setfilter"
clearable></v-text-field>
<v-spacer></v-spacer>
<router-link :to="{path:'/history/tasks'}"><v-icon>history</v-icon>History</router-link>
<v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar>

View file

@ -10,7 +10,26 @@
>crumbs</qd-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn-toggle
v-model="view"
borderless
>
<v-btn value="">
<router-link :to="{path: 'run', append:true }"> <v-icon>home</v-icon>Home</router-link>
</v-btn>
<v-btn value="run">
<router-link :to="{path: 'run', append:true }" > <v-icon>play_circle_outline</v-icon>Run</router-link>
</v-btn>
<v-btn value="edit" v-if="data">
<router-link :to="{name: 'edit', query:{url: data.url} }" > <v-icon>edit</v-icon>Edit</router-link>
</v-btn>
<v-btn value="history">
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon>History</router-link>
</v-btn>
</v-btn-toggle>
<v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar>
@ -18,16 +37,12 @@
<v-card-text>
<h1>{{ task }} </h1>
<ul><li>
<router-link :to="{path: 'run', append:true }" > <v-icon>folder</v-icon>Run</router-link>
</li>
<li>
<router-link :to="{name: 'edit', query:{apple: task} }" > <v-icon>folder</v-icon>Edit</router-link>
</li>
<li>
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon>History</router-link>
</li>
</ul>
<div v-if="data">
<p >{{ data.description }}</p>
<a :href="data.url">{{ data.url }}</a>
</div>
<pre>{{ data | pretty }}</pre>
</v-card-text>
</v-card>
@ -42,27 +57,22 @@
crumbs: [{to: "/tasks", text: "Tasks"},
{ text: this.task}],
items: [],
data: null,
loading: false,
q: null,
headers: [
{ text: 'Task', value: 'to' },
{ text: 'Title', value: 'title' },
{ text: 'Description', value: 'description' },
]
view: null
}
},
methods:{
getTasks(){
this.loading= true;
HTTP.get("tasks")
HTTP.get("tasks/" + this.task)
.then(r=>{
this.items=r.data;
this.data= r.data;
this.loading= false;
})
}
},
created(){
mounted(){
this.getTasks()
}
}

12
src/vue-poc/imp1.js Normal file
View file

@ -0,0 +1,12 @@
var fish = { path: '/tasks', component: { template: '<router-view/>' } ,
children:[
{ path: '', component: Tasks, meta:{title:"Runnable tasks"} },
{ path: 'model', component: Model, meta:{title:"build model"} },
{ path: 'vuecompile', component: Vuecompile, meta:{title:"vue compile"} },
{ path: ':task', props: true, component: { template: '<router-view/>' },
children:[
{path:"", props: true, component: Tasks1 },
{path: "run", component: Runtask, props: true, meta:{title:"Run task"} }
]}
]};
export {fish};

View file

@ -11,9 +11,7 @@ import module namespace db="http://basex.org/modules/db";
import module namespace archive="http://basex.org/modules/archive";
import module namespace hof="http://basex.org/modules/hof";
(: trailing slash :)
declare variable $dbtools:webpath:= db:system()/globaloptions/webpath/fn:string()
|| file:dir-separator();
(:~
: save all in db to zip
@ -69,6 +67,7 @@ let $files:=$files!fn:translate(.,"\","/")
let $files:=fn:filter($files,function($f){file:is-file(fn:concat($path,$f))})
let $dbpath:=tokenize($dbpath,"/")[.]
let $dbname:= head($dbpath)
let $dbpath:=string-join(tail($dbpath),"/") || "/"
return if(db:exists($dbname)) then
(
for $d in db:list($dbname)
@ -78,13 +77,15 @@ return if(db:exists($dbname)) then
for $f in $files
let $_:=fn:trace($path || $f,"file:")
let $content:=$ingest($path || $f)
return db:replace($dbname,$f,$content),
let $dest:= $dbpath || $f
return db:replace($dbname,$dest,$content),
db:optimize($dbname)
)
else
let $full:=$files!fn:concat($path,.)
let $content:=$full!$ingest(.)
return (db:create($dbname,$content,$files))
let $src:= $files!fn:concat($path,.)
let $dest:= $files!fn:concat($dbpath,.)
let $content:= $src!$ingest(.)
return (db:create($dbname,$content,$dest))
};

View file

@ -6,6 +6,9 @@ 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;
(:~
wrap $item in <hist:event id=".." when=".." > node and insert in /history.xml in database vue-poc
:)
declare
%updating
function hlog:save($item as element(*))

View file

@ -1,5 +1,5 @@
(:~
: XQuery evalution helpers library
: XQuery evaluation of uri helper library
: query-a:inspect($mod as xs:anyURI) return {description:.., updating:.., url:.., fields:[{model:..,label:..,type:..}]}
: query-a:params($mod as xs:anyURI)
: query-a:run($query as xs:anyURI,$params as map(*))
@ -47,6 +47,7 @@ declare function query-a:cast($val as item(),$type as xs:string)
as item()
{
switch($type)
case "xs:boolean" return $val="true"
case "xs:anyURI" return xs:anyURI($val)
default return $val
};

View file

@ -1,5 +1,5 @@
(: entity access maps
: auto generated from xml files in entities folder at: 2020-09-04T11:37:53.188+01:00
: auto generated from xml files in entities folder at: 2020-09-30T17:59:30.342+01:00
:)
module namespace entity = 'quodatum.models.generated';
@ -368,6 +368,44 @@ hof:top-k-by(admin:logs(), string#1, 2)
"views": map{
'filter': 'name description'
}
},
"favorites": map{
"name": "favorites",
"description": "vue-poc favourites ",
"access": map{
"created": function($_ as element()) as xs:string {$_/@when },
"id": function($_ as element()) as xs:string {$_/@id },
"url": function($_ as element()) as xs:string {$_/@url },
"user": function($_ as element()) as xs:string {$_/@user } },
"filter": function($item,$q) as xs:boolean{
some $e in ( ) satisfies
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
},
"json": map{
"created": function($_ as element()) as element(created)? {
(: xs:string :)
fn:data($_/@when)!element created { .}
},
"id": function($_ as element()) as element(id)? {
(: xs:string :)
fn:data($_/@id)!element id { .}
},
"url": function($_ as element()) as element(url)? {
(: xs:string :)
fn:data($_/@url)!element url { .}
},
"user": function($_ as element()) as element(user)? {
(: xs:string :)
fn:data($_/@user)!element user { .}
} },
"data": function() as element(favorite)*
{ doc("vue-poc/favorites.xml")/favorites/favorite },
"views": map{
}
},
"filehistory": map{

View file

@ -15,7 +15,7 @@
"qs": "6.4.0",
"localforage": "1.7.1",
"momentjs": "2.24.0",
"@koumoul/vjsf": "1.10.0",
"@koumoul/vjsf": "1.14.0",
"prism": "1.15.0",
"vue-prism-component": "1.1.1",
"vis-timeline-graph2d": "4.20.1",

View file

@ -1,4 +1,5 @@
// vue-poc application routes
const router = new VueRouter({
base:"/vue-poc/ui/",
mode: 'history',
@ -31,12 +32,21 @@ const router = new VueRouter({
{ path: '/documentation', component: Documentation, meta:{title:"documentation"} },
{ path: '/documentation/xqdoc', component: Xqdocs, meta:{title:"XQdoc"} },
{ path: '/logdate', component: Basexlogdate, meta:{title:"log files"} },
{ path: '/logdate/:date', component: Basexlogdate1, props:true, meta:{title:"log files"} },
{ path: '/entity', component: Entity, meta:{title:"Entities"} },
{ path: '/entity/:entity', component: { template: '<router-view/>' }
{path: '/model', component: { template: '<router-view/>' },
children: [
{path: '', redirect: 'schema' },
{ path: 'schema', name:"schema", component: Schema, meta:{title:"Schemas"} },
{ path: 'taxonomy', component: Taxonomy, meta:{title:"Taxonomies"} },
{ path: 'mimetype', component: Mimetype, meta:{title:"Mimetypes"} },
{ path: 'namespace', component: Namespace, meta:{title:"Namespaces"} },
{ path: 'namespace/item', component: Namespace1, meta:{title:"Namespace"} },
{ path: 'entity', component: Entity, meta:{title:"Entities"} },
{ path: 'entity/:entity', component: { template: '<router-view/>' }
,children: [
{
path: '',
@ -46,10 +56,8 @@ const router = new VueRouter({
path: 'data', component: Entity1data, props: true, meta:{title:"Entity data"}
}
]
},
{ 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"} },
@ -111,8 +119,7 @@ const router = new VueRouter({
},
{ path: '/history', component: { template: '<router-view/>' }
,children: [
{ path: 'files', component: Filehistory, meta:{title: "File History"} },
{ path: 'tasks', name: 'taskhistory', component: Taskhistory, meta:{title: "Task History"} },
{ path: 'files', component: Filehistory, meta:{title: "File History"} }
]
},
{ path: '/labs', component: { template: '<router-view/>' }

View file

@ -1,4 +1,4 @@
// generated 2020-09-04T12:21:45.271+01:00
// generated 2020-09-30T18:25:58.643+01:00
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
Vue.component('qd-autoheight',{template:`
@ -17,7 +17,7 @@ Vue.component('qd-autoheight',{template:`
var e=el;
// console.log("top",e.offsetTop,e.getBoundingClientRect().top,window.innerHeight);
var h=window.innerHeight - e.getBoundingClientRect().top -10;
var h=Math.max(1,h) ;
h=Math.max(1,h) ;
// console.log("h",h)
e.style.height=h +"px";
}
@ -346,18 +346,17 @@ Vue.component('qd-search',{template:`
<v-combobox placeholder="Search..." prepend-icon="search" autocomplete :loading="loading" clearable :items="items2" @keyup.enter="goSearch" :search-input.sync="si" v-model="q">
<template slot="item" slot-scope="{ index, item, parent }">
<v-list-item-action>
<v-btn icon :to="item.value">
<v-icon>arrow_forward</v-icon>
</v-btn>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>
{{ item.text }}
</v-list-item-title>
<v-list-item-subtitle>Page {{ item.value }}</v-list-item-subtitle>
<v-list-item-title>Search "{{ item.text }}"</v-list-item-title>
<v-list-item-subtitle>or goto
<router-link :to="item.value">
{{ item.value }}
<v-icon>launch</v-icon>
</router-link>
</v-list-item-subtitle>
</v-list-item-content>
</template>
</v-combobox>
@ -379,7 +378,7 @@ Vue.component('qd-search',{template:`
this.loading = true
// Simulated ajax query
setTimeout(() => {
this.items2 = this.si?this.matchItems(this.si.toLowerCase()):[],
this.items2 = this.si?this.matchItems(this.si.toLowerCase()):[]
this.loading = false
}, 500)
},
@ -390,7 +389,7 @@ Vue.component('qd-search',{template:`
matchItems(typed){
var hits=this.titles;
var typed=typed.toLowerCase();
typed=typed.toLowerCase();
hits=hits.filter(item=>item.title.indexOf(typed) !== -1)
return hits.map(r=>{return {text:r.title,
value:r.path}
@ -608,7 +607,7 @@ Vue.component('vis-time-line',{template:`
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-entitylink.vue
Vue.component('vp-entitylink',{template:`
<router-link :to="'entity/'+entity">E</router-link>
<router-link :to="'/entity/'+entity">E</router-link>
`,
props: ['entity']
@ -627,19 +626,24 @@ Vue.component('vp-favorite',{template:`
<v-card style="width:400px;">
<v-toolbar class="green">
<v-card-title>
Bookmark this page
Add to favorites
</v-card-title>
<v-spacer></v-spacer>
<v-btn @click="set(false)" icon><v-icon>close</v-icon></v-btn>
</v-toolbar>
<v-card-text>
<h6>{{$route.meta.title}}</h6>
<h6>{{$route.meta.title}}
<v-btn v-if="canCopy" @click="setclip" icon title="Copy location"><v-icon>content_copy</v-icon></v-btn>
</h6>
<v-combobox multiple v-model="tags" label="tags" chips tags :items="taglist"></v-combobox>
</v-card-text>
<v-card-actions>
<v-btn color="primary" text @click.stop="favorite(); set(false)">Done</v-btn>
<v-spacer></v-spacer>
<v-btn color="primary" text @click.stop="set(false)">Cancel</v-btn>
<v-btn color="primary" text @click.stop="favorite(); set(false)">Save</v-btn>
<v-btn text @click.stop="set(false)">Cancel</v-btn>
</v-card-actions>
</v-card>
</v-menu> `,
@ -649,27 +653,28 @@ Vue.component('vp-favorite',{template:`
},
data(){
return {
canCopy:false,
tags: [],
taglist: [
'todo',
'find',
'some',
'good',
'tags'
],
taglist: [ 'todo', 'find', 'some', 'good', 'tags' ],
}
},
methods:{
set(v){
this.$emit('update:frmfav', v)
},
async setclip(){
await navigator.clipboard.writeText(this.$route.fullPath);
alert('Copied!' + this.$route.fullPath);
},
favorite(){
this.$store.commit('increment')
console.log(this.$store.state.count)
alert("save");
}
}
},
created() {
this.canCopy = !!navigator.clipboard;
},
}
);
@ -812,7 +817,7 @@ Vue.component('vp-paramform',{template:`
<v-layout column xs8>
<v-flex v-for="field in fields" :key="field.model">
<v-text-field v-if="field.type === 'xs:anyURI'" v-model="params[field.model]" :label="field.label" clearable :rules="fieldrules(field)" filled append-outer-icon="send" @click:append-outer="source(field)"></v-text-field>
<v-text-field v-if="field.type === 'xs:anyURI'" v-model="params[field.model]" :label="field.label &amp;&amp; field.model" clearable :rules="fieldrules(field)" filled append-outer-icon="send" @click:append-outer="source(field)"></v-text-field>
<v-switch v-else-if="field.type === 'xs:boolean'" :label="field.label" v-model="params[field.model]">
</v-switch>
@ -1836,7 +1841,7 @@ const Routes2=Vue.extend({template:`
<v-card>
<v-toolbar>
<v-card-title>
{{ active.path}}
{{ active.name}}
</v-card-title>
<router-link :to="active.path"><v-icon>link</v-icon></router-link>
<v-spacer></v-spacer>
@ -1925,8 +1930,8 @@ const Routes2=Vue.extend({template:`
this.refresh()
if(this.$route.query.index){
const index= parseInt(this.$route.query.index)
//const h= this.findItem(this.routes,index)
//console.log("search",h, index)
const h= this.findItem(this.routes,index)
console.log("search",h, index)
//this.active=h
}
}
@ -2453,77 +2458,36 @@ const Log=Vue.extend({template:`
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/collection/documentation.vue
const Documentation=Vue.extend({template:`
<v-container fluid grid-list-md>
<v-data-iterator :items="items" :items-per-page.sync="itemsPerPage" :search="search" hide-default-footer>
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>XQDocs</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field v-model="search" clearable flat solo-inverted hide-details prepend-inner-icon="search" label="Search"></v-text-field>
<v-spacer></v-spacer>
<router-link :to="{path:'/tasks/xqdoca'}">
<v-icon>add_circle</v-icon>
</router-link>
<v-btn @click="get" icon :loading="loading" :disabled="loading"><v-icon>refresh</v-icon></v-btn>
</v-toolbar>
<v-container fluid>
<v-card>
<v-toolbar dense>
<v-toolbar-title>
<v-breadcrumbs :items="crumbs">
<span slot="divider" style="padding:0;"></span>
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="{ query: { url: props.item.path }}" :exact="true">
<v-icon v-if="props.item.icon">{{ props.item.icon }}</v-icon>
{{ props.item.name }}
</v-breadcrumbs-item>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex v-for="item in props.items" :key="item.name" xs12 sm6 md4 lg3>
<v-card :hover="true">
<v-toolbar color="blue lighten-3" dense>
<v-card-title>{{ item.name }}</v-card-title>
<v-spacer></v-spacer>
<a :href="item.href" target="_new">go</a>
</v-breadcrumbs>
</v-toolbar-title>
</v-toolbar>
<v-card-text>{{ item.id }}</v-card-text>
<v-card-text>
<span :title="item.created">{{ item.created | fromNow }}</span>
<ul>
<li>
<router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
</li>
<li>
<router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
</li>
</ul>
</v-card-text>
<v-card-actions>
<v-btn>Run</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
`,
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false
}
},
methods:{
get() {
this.loading=true;
HTTP.get('xqdocjob')
.then((res) => {
this.items = res.data;
this.loading=false;
});
},
doEdit(item){
console.log("history: ",item)
router.push({ path: 'edit', query: { url:item.url, protocol:item.protocol }})
}
},
created:function(){
this.get()
console.log("history")
}
}
);
@ -2811,6 +2775,83 @@ const Files=Vue.extend({template:`
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/collection/xqdocs.vue
const Xqdocs=Vue.extend({template:`
<v-container fluid grid-list-md>
<v-data-iterator :items="items" :items-per-page.sync="itemsPerPage" :search="search" hide-default-footer>
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>XQDocs</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field v-model="search" clearable flat solo-inverted hide-details prepend-inner-icon="search" label="Search"></v-text-field>
<v-spacer></v-spacer>
<router-link :to="{path:'/tasks/xqdoca'}">
<v-icon>add_circle</v-icon>
</router-link>
<v-btn @click="get" icon :loading="loading" :disabled="loading"><v-icon>refresh</v-icon></v-btn>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex v-for="item in props.items" :key="item.name" xs12 sm6 md4 lg3>
<v-card :hover="true">
<v-toolbar color="blue lighten-3" dense>
<v-card-title>{{ item.name }}</v-card-title>
<v-spacer></v-spacer>
<a :href="item.href" target="_new">go</a>
</v-toolbar>
<v-card-text>{{ item.id }}</v-card-text>
<v-card-text>
<span :title="item.created">{{ item.created | fromNow }}</span>
</v-card-text>
<v-card-actions>
<v-btn>Run</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
`,
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false
}
},
methods:{
get() {
this.loading=true;
HTTP.get('xqdocjob')
.then((res) => {
this.items = res.data;
this.loading=false;
});
},
doEdit(item){
console.log("history: ",item)
router.push({ path: 'edit', query: { url:item.url, protocol:item.protocol }})
}
},
created:function(){
this.get()
console.log("history")
}
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/components/markdown.vue
const Markdown=Vue.extend({template:`
<v-container fluid>
@ -3171,11 +3212,12 @@ created:function(){
const Tree2=Vue.extend({template:`
<v-container fluid>
<v-card>
<v-toolbar class="lime darken-1">
<v-toolbar flat floating class="lime darken-1">
<v-card-title><qd-link href="https://github.com/riophae/vue-treeselect">vue-treeselect@0.0.29</qd-link> </v-card-title>
<v-spacer></v-spacer>
<v-btn>todo</v-btn>
</v-toolbar>
<v-card-text>
<v-layout row wrap>
<v-flex xs4>
@ -5138,6 +5180,7 @@ const Jobs=Vue.extend({template:`
<v-btn icon :loading="loading" @click="getJobs()" @dblclick="autorefresh = !autorefresh" :disabled="loading">
<v-icon>{{ autorefresh?'refresh':'arrow_downward' }}</v-icon>
</v-btn>
<vp-entitylink entity="basex.job"></vp-entitylink>
</v-toolbar>
<v-data-table :headers="headers" :items="items" :search="search" v-model="selected" show-select class="elevation-1" no-data-text="No Jobs currently running">
<template slot="items" slot-scope="props">
@ -5487,7 +5530,7 @@ const Entity=Vue.extend({template:`
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]">
<v-breadcrumbs :items="[{text:'Entities',to:'/model/entity'}]">
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
@ -5573,7 +5616,7 @@ const Entity1=Vue.extend({template:`
<v-card>
<v-toolbar>
<v-toolbar-title>
<qd-breadcrumbs @todo="showmenu= ! showmenu" :crumbs="[{to: '/entity', text:'Entities'}, {text: entity, disabled: false, menu: 'todo'}]">crumbs</qd-breadcrumbs>
<qd-breadcrumbs @todo="showmenu= ! showmenu" :crumbs="[{to: '/model/entity', text:'Entities'}, {text: entity, disabled: false, menu: 'todo'}]">crumbs</qd-breadcrumbs>
</v-toolbar-title>
<v-menu v-model="showmenu">
<template v-slot:activator="{ on }">
@ -5775,6 +5818,279 @@ const Entity1data=Vue.extend({template:`
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/model/mimetype.vue
const Mimetype=Vue.extend({template:`
<v-container fluid grid-list-md>
<v-data-iterator :items="items" :items-per-page.sync="itemsPerPage" :search="q" hide-default-footer select-all :value="selected">
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>
mimetype TODO
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]">
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search" hide-details single-line @keyup.enter="setfilter" clearable></v-text-field>
<v-spacer></v-spacer>
<v-btn @click="getItems" icon :loading="loading" :disabled="loading"><v-icon>refresh</v-icon></v-btn>
<vp-entitylink entity="mimetype"></vp-entitylink>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex v-for="item in props.items" :key="item.name" xs12 sm6 md4 lg3>
<v-card :hover="true" active-class="default-class qd-active" height="200px" max-height="200px">
<v-toolbar color="blue lighten-3" dense>
<v-toolbar-title>
<router-link :to="{path:'entity/'+ item.name}">
<v-avatar>
<v-icon>{{ item.iconclass }}</v-icon>
</v-avatar> {{ item.name }}
</router-link></v-toolbar-title>
<v-spacer></v-spacer>
<v-badge>
<span slot="badge">{{ item.nfields }}</span>
</v-badge>
</v-toolbar>
<v-card-text>{{ item.description }}<!--<v-card-text-->
</v-card-text></v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
`,
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false,
q: '',
selected:[]
}
},
methods:{
getItems(){
this.loading=true
HTTP.get("data/entity",{params:{q: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.items=r.data.items
})
},
setfilter(){
console.log("TODO",this.q);
this.$router.push({ query: {url: this.url,
q: this.q }})
}
},
created:function(){
this.getItems()
},
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/model/schema.vue
const Schema=Vue.extend({template:`
<v-container fluid grid-list-md>
<v-data-iterator :items="items" :items-per-page.sync="itemsPerPage" :search="q" hide-default-footer select-all :value="selected">
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>
schema TODO
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]">
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search" hide-details single-line @keyup.enter="setfilter" clearable></v-text-field>
<v-spacer></v-spacer>
<v-btn @click="getItems" icon :loading="loading" :disabled="loading"><v-icon>refresh</v-icon></v-btn>
<vp-entitylink entity="taxonomy"></vp-entitylink>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex v-for="item in props.items" :key="item.name" xs12 sm6 md4 lg3>
<v-card :hover="true" active-class="default-class qd-active" height="200px" max-height="200px">
<v-toolbar color="blue lighten-3" dense>
<v-toolbar-title>
<router-link :to="{path:'entity/'+ item.name}">
<v-avatar>
<v-icon>{{ item.iconclass }}</v-icon>
</v-avatar> {{ item.name }}
</router-link></v-toolbar-title>
<v-spacer></v-spacer>
<v-badge>
<span slot="badge">{{ item.nfields }}</span>
</v-badge>
</v-toolbar>
<v-card-text>{{ item.description }}<!--<v-card-text-->
</v-card-text></v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
`,
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false,
q: '',
selected:[]
}
},
methods:{
getItems(){
this.loading=true
HTTP.get("data/entity",{params:{q: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.items=r.data.items
})
},
setfilter(){
console.log("TODO",this.q);
this.$router.push({ query: {url: this.url,
q: this.q }})
}
},
created:function(){
this.getItems()
},
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/model/taxonomy.vue
const Taxonomy=Vue.extend({template:`
<v-container fluid grid-list-md>
<v-data-iterator :items="items" :items-per-page.sync="itemsPerPage" :search="q" hide-default-footer select-all :value="selected">
<template v-slot:header>
<v-toolbar>
<v-toolbar-title>
Taxonomy TODO
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]">
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search" hide-details single-line @keyup.enter="setfilter" clearable></v-text-field>
<v-spacer></v-spacer>
<v-btn @click="getItems" icon :loading="loading" :disabled="loading"><v-icon>refresh</v-icon></v-btn>
<vp-entitylink entity="taxonomy"></vp-entitylink>
</v-toolbar>
</template>
<template v-slot:default="props">
<v-layout wrap>
<v-flex v-for="item in props.items" :key="item.name" xs12 sm6 md4 lg3>
<v-card :hover="true" active-class="default-class qd-active" height="200px" max-height="200px">
<v-toolbar color="blue lighten-3" dense>
<v-toolbar-title>
<router-link :to="{path:'entity/'+ item.name}">
<v-avatar>
<v-icon>{{ item.iconclass }}</v-icon>
</v-avatar> {{ item.name }}
</router-link></v-toolbar-title>
<v-spacer></v-spacer>
<v-badge>
<span slot="badge">{{ item.nfields }}</span>
</v-badge>
</v-toolbar>
<v-card-text>{{ item.description }}<!--<v-card-text-->
</v-card-text></v-card>
</v-flex>
</v-layout>
</template>
</v-data-iterator>
</v-container>
`,
data: function(){
return {
itemsPerPage: 100,
page: 1,
items:[],
search: '',
filter: {},
loading: false,
q: '',
selected:[]
}
},
methods:{
getItems(){
this.loading=true
HTTP.get("data/entity",{params:{q: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.items=r.data.items
})
},
setfilter(){
console.log("TODO",this.q);
this.$router.push({ query: {url: this.url,
q: this.q }})
}
},
created:function(){
this.getItems()
},
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/namespaces/namespace.vue
const Namespace=Vue.extend({template:`
<v-container fluid>
@ -7400,6 +7716,9 @@ const Taskhistory=Vue.extend({template:`
<v-breadcrumbs-item to="/tasks" :exact="true">
Tasks
</v-breadcrumbs-item>
<v-breadcrumbs-item>
History
</v-breadcrumbs-item>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
@ -7476,6 +7795,8 @@ const Tasks=Vue.extend({template:`
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search" hide-details single-line @keyup.enter="setfilter" clearable></v-text-field>
<v-spacer></v-spacer>
<router-link :to="{path:'/history/tasks'}"><v-icon>history</v-icon>History</router-link>
<v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar>
@ -7541,7 +7862,23 @@ const Tasks1=Vue.extend({template:`
<qd-breadcrumbs :crumbs="[{to: '/tasks', text:'Tasks'}, {text: task, disabled: true} ]">crumbs</qd-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn-toggle v-model="view" borderless>
<v-btn value>
<router-link :to="{path: 'run', append:true }"> <v-icon>home</v-icon>Home</router-link>
</v-btn>
<v-btn value="run">
<router-link :to="{path: 'run', append:true }"> <v-icon>play_circle_outline</v-icon>Run</router-link>
</v-btn>
<v-btn value="edit" v-if="data">
<router-link :to="{name: 'edit', query:{url: data.url} }"> <v-icon>edit</v-icon>Edit</router-link>
</v-btn>
<v-btn value="history">
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon>History</router-link>
</v-btn>
</v-btn-toggle>
<v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar>
@ -7549,16 +7886,12 @@ const Tasks1=Vue.extend({template:`
<v-card-text>
<h1>{{ task }} </h1>
<ul><li>
<router-link :to="{path: 'run', append:true }"> <v-icon>folder</v-icon>Run</router-link>
</li>
<li>
<router-link :to="{name: 'edit', query:{apple: task} }"> <v-icon>folder</v-icon>Edit</router-link>
</li>
<li>
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon>History</router-link>
</li>
</ul>
<div v-if="data">
<p>{{ data.description }}</p>
<a :href="data.url">{{ data.url }}</a>
</div>
<pre>{{ data | pretty }}</pre>
</v-card-text>
</v-card>
@ -7572,27 +7905,22 @@ const Tasks1=Vue.extend({template:`
crumbs: [{to: "/tasks", text: "Tasks"},
{ text: this.task}],
items: [],
data: null,
loading: false,
q: null,
headers: [
{ text: 'Task', value: 'to' },
{ text: 'Title', value: 'title' },
{ text: 'Description', value: 'description' },
]
view: null
}
},
methods:{
getTasks(){
this.loading= true;
HTTP.get("tasks")
HTTP.get("tasks/" + this.task)
.then(r=>{
this.items=r.data;
this.data= r.data;
this.loading= false;
})
}
},
created(){
mounted(){
this.getTasks()
}
}
@ -8163,6 +8491,7 @@ const Transform=Vue.extend({template:`
// src: C:\Users\andy\git\vue-poc\src\vue-poc\router.js
// vue-poc application routes
const router = new VueRouter({
base:"/vue-poc/ui/",
mode: 'history',
@ -8195,12 +8524,21 @@ const router = new VueRouter({
{ path: '/documentation', component: Documentation, meta:{title:"documentation"} },
{ path: '/documentation/xqdoc', component: Xqdocs, meta:{title:"XQdoc"} },
{ path: '/logdate', component: Basexlogdate, meta:{title:"log files"} },
{ path: '/logdate/:date', component: Basexlogdate1, props:true, meta:{title:"log files"} },
{ path: '/entity', component: Entity, meta:{title:"Entities"} },
{ path: '/entity/:entity', component: { template: '<router-view/>' }
{path: '/model', component: { template: '<router-view/>' },
children: [
{path: '', redirect: 'schema' },
{ path: 'schema', name:"schema", component: Schema, meta:{title:"Schemas"} },
{ path: 'taxonomy', component: Taxonomy, meta:{title:"Taxonomies"} },
{ path: 'mimetype', component: Mimetype, meta:{title:"Mimetypes"} },
{ path: 'namespace', component: Namespace, meta:{title:"Namespaces"} },
{ path: 'namespace/item', component: Namespace1, meta:{title:"Namespace"} },
{ path: 'entity', component: Entity, meta:{title:"Entities"} },
{ path: 'entity/:entity', component: { template: '<router-view/>' }
,children: [
{
path: '',
@ -8210,10 +8548,8 @@ const router = new VueRouter({
path: 'data', component: Entity1data, props: true, meta:{title:"Entity data"}
}
]
},
{ 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"} },
@ -8275,8 +8611,7 @@ const router = new VueRouter({
},
{ path: '/history', component: { template: '<router-view/>' }
,children: [
{ path: 'files', component: Filehistory, meta:{title: "File History"} },
{ path: 'tasks', name: 'taskhistory', component: Taskhistory, meta:{title: "Task History"} },
{ path: 'files', component: Filehistory, meta:{title: "File History"} }
]
},
{ path: '/labs', component: { template: '<router-view/>' }
@ -8483,13 +8818,14 @@ const Vuepoc=Vue.extend({template:`
frmfav: false,
items: [
{href: '/',text: 'Dashboard', icon: 'dashboard' },
{href: '/',text: 'Dashboard', icon: 'home' },
{
icon: 'input',
text: 'Actions' ,
model: false,
children: [
{href: '/eval',text: 'Query',icon: 'play_circle_outline'},
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
@ -8504,8 +8840,8 @@ const Vuepoc=Vue.extend({template:`
children: [
{href: '/database', text: 'Databases',icon: 'developer_mode' },
{href: '/files', text: 'File system',icon: 'folder' },
{href: '/documentation', text: 'Documentation',icon: 'library_books' },
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/logdate',text: 'XML logs',icon: 'dns'},
{href: '/history/files',text: 'history',icon: 'history'}
]},
@ -8514,9 +8850,11 @@ const Vuepoc=Vue.extend({template:`
text: 'Models' ,
model: false,
children: [
{href: '/entity', text: 'Entities',icon: 'redeem' },
{href: '/documentation', text: 'Documentation',icon: 'library_books' },
{href: '/namespace', text: 'Namespaces',icon: 'label' },
{href: '/model/entity', text: 'Entities',icon: 'redeem' },
{href: '/model/namespace', text: 'Namespaces',icon: 'dns' },
{href: '/model/schema', text: 'Schemas',icon: 'verified' },
{href: '/model/taxonomy', text: 'Taxonomies',icon: 'local_offer' },
{href: '/model/mimetype', text: 'Mimetypes',icon: 'assignment' },
]},
{
@ -8566,7 +8904,7 @@ const Vuepoc=Vue.extend({template:`
children: [
{href: '/labs/scratch',text: 'Scratch pad',icon: 'filter_frames'},
{href: '/labs/form',text: 'Forms',icon: 'subtitles' },
{href: '/labs/timeline',text: 'Time line',icon: 'timelapse'},
{href: '/labs/timeline',text: 'Time line',icon: 'event_note'},
{href: '/labs/svg',text: 'SVG',icon: 'extension'},
{href: '/labs/svg2',text: 'SVG2',icon: 'extension'},
{href: '/labs/tree',text: 'Tree',icon: 'nature'},

View file

@ -14,7 +14,7 @@
<link rel="stylesheet" href="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.css"/>
<link rel="stylesheet" href="/vue-poc/ui/prism/prism.css" type="text/css"/>
<link rel="stylesheet" href="//unpkg.com/leaflet@1.6.0/dist/leaflet.css"/>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@koumoul/vjsf@latest/dist/main.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@koumoul/vjsf@1.14.0/dist/main.css">
<link href="/vue-poc/ui/app.css" rel="stylesheet" type="text/css"/>
<link href="/vue-poc/ui/svg/d3-svg.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.css" />
@ -60,7 +60,7 @@
<script src="//unpkg.com/leaflet@1.6.0/dist/leaflet.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue2-leaflet@2.5.2/dist/vue2-leaflet.min.js" crossorigin="anonymous"></script>
<script src="//cdn.jsdelivr.net/npm/@koumoul/vjsf@latest/dist/main.js" crossorigin="anonymous"></script>
<script src="//cdn.jsdelivr.net/npm/@koumoul/vjsf@1.14.0/dist/main.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-native-websocket@2.0.8/dist/build.js" crossorigin="anonymous"></script>
<script src="/vue-poc/ui/svg/d3-svg.js"></script>

View file

@ -1,2 +1,16 @@
declare variable $MAX external:= 100000;
for $i in (2 to $MAX) return if (every $j in (2 to $i - 1) satisfies $i mod $j ne 0) then $i else ()
(:~
: performance test
:)
(:~ calculate primes upto
: @default 100000
:)
declare variable $MAX as xs:integer external:= 100000;
declare function local:go(){
for $i in (2 to $MAX)
return if (every $j in (2 to $i - 1) satisfies $i mod $j ne 0)
then $i
else ()
};
local:go()=>count()=>update:output()

View file

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!DOCTYPE message [
<!ELEMENT message (to,from,subject,text)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT subject (#PCDATA)>
<!ELEMENT text (#PCDATA)>
<!ATTLIST to gender CDATA "male">
]>
<message>
<to>Dave</to>
<from>Susan</from>
<subject>Reminder</subject>
<text>Dont forget to buy milk on the way home.</text>
</message>

View file

@ -0,0 +1 @@
dtd-default get attribute on load