[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, frmfav: false,
items: [ items: [
{href: '/',text: 'Dashboard', icon: 'dashboard' }, {href: '/',text: 'Dashboard', icon: 'home' },
{ {
icon: 'input', icon: 'input',
text: 'Actions' , text: 'Actions' ,
model: false, model: false,
children: [ children: [
{href: '/eval',text: 'Query',icon: 'play_circle_outline'}, {href: '/eval',text: 'Query',icon: 'play_circle_outline'},
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/edit',text: 'Edit',icon: 'mode_edit'}, {href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/tabs',text: 'Tabs',icon: 'switch_camera'}, {href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'}, {href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
@ -163,8 +164,8 @@
children: [ children: [
{href: '/database', text: 'Databases',icon: 'developer_mode' }, {href: '/database', text: 'Databases',icon: 'developer_mode' },
{href: '/files', text: 'File system',icon: 'folder' }, {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: '/logdate',text: 'XML logs',icon: 'dns'},
{href: '/history/files',text: 'history',icon: 'history'} {href: '/history/files',text: 'history',icon: 'history'}
]}, ]},
@ -173,9 +174,11 @@
text: 'Models' , text: 'Models' ,
model: false, model: false,
children: [ children: [
{href: '/entity', text: 'Entities',icon: 'redeem' }, {href: '/model/entity', text: 'Entities',icon: 'redeem' },
{href: '/documentation', text: 'Documentation',icon: 'library_books' }, {href: '/model/namespace', text: 'Namespaces',icon: 'dns' },
{href: '/namespace', text: 'Namespaces',icon: 'label' }, {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: [ children: [
{href: '/labs/scratch',text: 'Scratch pad',icon: 'filter_frames'}, {href: '/labs/scratch',text: 'Scratch pad',icon: 'filter_frames'},
{href: '/labs/form',text: 'Forms',icon: 'subtitles' }, {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/svg',text: 'SVG',icon: 'extension'},
{href: '/labs/svg2',text: 'SVG2',icon: 'extension'}, {href: '/labs/svg2',text: 'SVG2',icon: 'extension'},
{href: '/labs/tree',text: 'Tree',icon: 'nature'}, {href: '/labs/tree',text: 'Tree',icon: 'nature'},

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- <!--
manage parameters for query A form to manage parameters for query
including submit form function including submit form function via POST
--> -->
<template id="vp-paramform"> <template id="vp-paramform">
<v-card > <v-card >
@ -21,7 +21,7 @@
<v-flex v-for="field in fields" :key="field.model" > <v-flex v-for="field in fields" :key="field.model" >
<v-text-field v-if="field.type === 'xs:anyURI'" <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 clearable :rules="fieldrules(field)" filled
append-outer-icon="send" @click:append-outer="source(field)" append-outer-icon="send" @click:append-outer="source(field)"
></v-text-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-card>
<v-toolbar> <v-toolbar>
<v-card-title> <v-card-title>
{{ active.path}} {{ active.name}}
</v-card-title> </v-card-title>
<router-link :to="active.path"><v-icon>link</v-icon></router-link> <router-link :to="active.path"><v-icon>link</v-icon></router-link>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@ -155,8 +155,8 @@
this.refresh() this.refresh()
if(this.$route.query.index){ if(this.$route.query.index){
const index= parseInt(this.$route.query.index) const index= parseInt(this.$route.query.index)
//const h= this.findItem(this.routes,index) const h= this.findItem(this.routes,index)
//console.log("search",h, index) console.log("search",h, index)
//this.active=h //this.active=h
} }
} }

View file

@ -1,98 +1,36 @@
<!DOCTYPE html> <!DOCTYPE html>
<template id="documentation"> <template id="documentation">
<v-container fluid grid-list-md> <v-container fluid >
<v-data-iterator <v-card>
:items="items" <v-toolbar dense >
:items-per-page.sync="itemsPerPage" <v-toolbar-title>
:search="search" <v-breadcrumbs :items="crumbs">
hide-default-footer <span slot="divider" style="padding:0;"></span>
> <template slot="item" slot-scope="props">
<v-breadcrumbs-item
<template v-slot:header> :to="{ query: { url: props.item.path }}" :exact="true">
<v-toolbar> <v-icon v-if="props.item.icon">{{ props.item.icon }}</v-icon>
<v-toolbar-title>XQDocs</v-toolbar-title> {{ props.item.name }}
<v-spacer></v-spacer> </v-breadcrumbs-item>
<v-text-field </template>
v-model="search" </v-breadcrumbs>
clearable </v-toolbar-title>
flat </v-toolbar>
solo-inverted <v-card-text>
hide-details <ul>
prepend-inner-icon="search" <li>
label="Search" <router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
></v-text-field> </li>
<v-spacer></v-spacer> <li>
<router-link :to="{path:'/tasks/xqdoca'}"> <router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
<v-icon>add_circle</v-icon> </li>
</router-link> </ul>
<v-btn @click="get" icon :loading="loading" </v-card-text>
:disabled="loading" </v-card>
><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> </v-container>
</template> </template>
<script>{ <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> </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"> <template id="tree2">
<v-container fluid> <v-container fluid>
<v-card> <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-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-spacer></v-spacer>
<v-btn>todo</v-btn> <v-btn>todo</v-btn>
</v-toolbar> </v-toolbar>
<v-card-text> <v-card-text>
<v-layout row wrap> <v-layout row wrap>
<v-flex xs4 > <v-flex xs4 >

View file

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

View file

@ -30,7 +30,8 @@ function vue-api:edit-get($url as xs:string)
"xmldb": vue-api:get-basexdb#1 "xmldb": vue-api:get-basexdb#1
} }
let $reader:=trace($reader) 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. : Returns a file content.
: @param $url starts with protocol : @param $url starts with protocol accepts xmldb:path, file:path, webfile:/ path
:) :)
declare declare
%rest:GET %rest:path("/vue-poc/api/get") %rest:GET %rest:path("/vue-poc/api/get")
@ -124,5 +125,5 @@ as element(json)
<data>{serialize($doc)}</data> <data>{serialize($doc)}</data>
</json> </json>
else 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-icon>{{ autorefresh?'refresh':'arrow_downward' }}</v-icon>
</v-btn> </v-btn>
<vp-entitylink entity="basex.job"></vp-entitylink>
</v-toolbar> </v-toolbar>
<v-data-table <v-data-table
:headers="headers" :headers="headers"

View file

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

View file

@ -4,7 +4,7 @@
<v-toolbar> <v-toolbar>
<v-toolbar-title> <v-toolbar-title>
<qd-breadcrumbs @todo="showmenu= ! showmenu" <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> >crumbs</qd-breadcrumbs>
</v-toolbar-title> </v-toolbar-title>
<v-menu v-model="showmenu" > <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 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> <!DOCTYPE html>
<!-- form to submit a run
-->
<template id="runtask"> <template id="runtask">
<v-container fluid> <v-container fluid>
<v-card > <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 (:~ 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 (:~ 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 (:~ 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 ) dbtools:sync-from-path($targetpath, $srcpath,$deleteMissing )

View file

@ -5,12 +5,8 @@
</description> </description>
</task> </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"> <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> <description>Load files into database</description>
</task> </task>
@ -28,7 +24,11 @@
<title>Create xqDoc</title> <title>Create xqDoc</title>
<description>xquery documentation</description> <description>xquery documentation</description>
</task> </task>
<task name="primes" url="../../tasks/primes.xq">
<title>Calculate primes</title>
<description>performance</description>
</task>
<task name="newapp" url="task/tx-newapp.xq"> <task name="newapp" url="task/tx-newapp.xq">
<title>application template</title> <title>application template</title>
<description>application template</description> <description>application template</description>

View file

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

View file

@ -19,6 +19,8 @@
hide-details single-line @keyup.enter="setfilter" hide-details single-line @keyup.enter="setfilter"
clearable></v-text-field> 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> <v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink> <vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar> </v-toolbar>

View file

@ -10,7 +10,26 @@
>crumbs</qd-breadcrumbs> >crumbs</qd-breadcrumbs>
</v-toolbar-title> </v-toolbar-title>
<v-spacer></v-spacer> <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> <v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink> <vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar> </v-toolbar>
@ -18,16 +37,12 @@
<v-card-text> <v-card-text>
<h1>{{ task }} </h1> <h1>{{ task }} </h1>
<ul><li> <div v-if="data">
<router-link :to="{path: 'run', append:true }" > <v-icon>folder</v-icon>Run</router-link> <p >{{ data.description }}</p>
</li> <a :href="data.url">{{ data.url }}</a>
<li> </div>
<router-link :to="{name: 'edit', query:{apple: task} }" > <v-icon>folder</v-icon>Edit</router-link>
</li> <pre>{{ data | pretty }}</pre>
<li>
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon>History</router-link>
</li>
</ul>
</v-card-text> </v-card-text>
</v-card> </v-card>
@ -42,27 +57,22 @@
crumbs: [{to: "/tasks", text: "Tasks"}, crumbs: [{to: "/tasks", text: "Tasks"},
{ text: this.task}], { text: this.task}],
items: [], data: null,
loading: false, loading: false,
q: null, view: null
headers: [
{ text: 'Task', value: 'to' },
{ text: 'Title', value: 'title' },
{ text: 'Description', value: 'description' },
]
} }
}, },
methods:{ methods:{
getTasks(){ getTasks(){
this.loading= true; this.loading= true;
HTTP.get("tasks") HTTP.get("tasks/" + this.task)
.then(r=>{ .then(r=>{
this.items=r.data; this.data= r.data;
this.loading= false; this.loading= false;
}) })
} }
}, },
created(){ mounted(){
this.getTasks() 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 archive="http://basex.org/modules/archive";
import module namespace hof="http://basex.org/modules/hof"; 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 : 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 $files:=fn:filter($files,function($f){file:is-file(fn:concat($path,$f))})
let $dbpath:=tokenize($dbpath,"/")[.] let $dbpath:=tokenize($dbpath,"/")[.]
let $dbname:= head($dbpath) let $dbname:= head($dbpath)
let $dbpath:=string-join(tail($dbpath),"/") || "/"
return if(db:exists($dbname)) then return if(db:exists($dbname)) then
( (
for $d in db:list($dbname) for $d in db:list($dbname)
@ -77,14 +76,16 @@ return if(db:exists($dbname)) then
for $f in $files for $f in $files
let $_:=fn:trace($path || $f,"file:") let $_:=fn:trace($path || $f,"file:")
let $content:=$ingest($path || $f) let $content:=$ingest($path || $f)
return db:replace($dbname,$f,$content), let $dest:= $dbpath || $f
return db:replace($dbname,$dest,$content),
db:optimize($dbname) db:optimize($dbname)
) )
else else
let $full:=$files!fn:concat($path,.) let $src:= $files!fn:concat($path,.)
let $content:=$full!$ingest(.) let $dest:= $files!fn:concat($dbpath,.)
return (db:create($dbname,$content,$files)) 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 namespace hist="urn:quodatum:vue-poc.history";
declare variable $hlog:doc as element(hist:history):=db:open("vue-poc","/history.xml")/hist: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 declare
%updating %updating
function hlog:save($item as element(*)) 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:inspect($mod as xs:anyURI) return {description:.., updating:.., url:.., fields:[{model:..,label:..,type:..}]}
: query-a:params($mod as xs:anyURI) : query-a:params($mod as xs:anyURI)
: query-a:run($query as xs:anyURI,$params as map(*)) : 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() as item()
{ {
switch($type) switch($type)
case "xs:boolean" return $val="true"
case "xs:anyURI" return xs:anyURI($val) case "xs:anyURI" return xs:anyURI($val)
default return $val default return $val
}; };

View file

@ -1,5 +1,5 @@
(: entity access maps (: 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'; module namespace entity = 'quodatum.models.generated';
@ -368,6 +368,44 @@ hof:top-k-by(admin:logs(), string#1, 2)
"views": map{ "views": map{
'filter': 'name description' '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{ "filehistory": map{

View file

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

View file

@ -1,4 +1,5 @@
// vue-poc application routes // vue-poc application routes
const router = new VueRouter({ const router = new VueRouter({
base:"/vue-poc/ui/", base:"/vue-poc/ui/",
mode: 'history', mode: 'history',
@ -19,38 +20,45 @@ const router = new VueRouter({
{path: '/images', component: { template: '<router-view/>' }, {path: '/images', component: { template: '<router-view/>' },
children: [ children: [
{path: '', redirect: 'item' }, {path: '', redirect: 'item' },
{ path: 'item', name:'images', component: Images, meta:{title: "Images"} }, { path: 'item', name:'images', component: Images, meta:{title: "Images"} },
{ path: 'report', name:"image-reports", component: Report, props: true, meta:{title: "Image report"}}, { path: 'report', name:"image-reports", component: Report, props: true, meta:{title: "Image report"}},
{ path: 'item/:id', name:"image",component: Image, props: true, meta:{title: "Image details"}}, { path: 'item/:id', name:"image",component: Image, props: true, meta:{title: "Image details"}},
{ path: 'thumbnail', component: Thumbnail, meta:{title:"Thumbnail generator"} }, { path: 'thumbnail', component: Thumbnail, meta:{title:"Thumbnail generator"} },
{ path: 'keywords', component: Keywords, meta:{title:"Image keywords"} }, { path: 'keywords', component: Keywords, meta:{title:"Image keywords"} },
{ path: 'dates', component: Dates, meta:{title:"Image dates"} }, { path: 'dates', component: Dates, meta:{title:"Image dates"} },
{ path: 'people', component: People, meta:{title:"Image people"} } { path: 'people', component: People, meta:{title:"Image people"} }
]}, ]},
{ path: '/documentation', component: Documentation, meta:{title:"documentation"} }, { 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', component: Basexlogdate, meta:{title:"log files"} },
{ path: '/logdate/:date', component: Basexlogdate1, props:true, meta:{title:"log files"} }, { path: '/logdate/:date', component: Basexlogdate1, props:true, meta:{title:"log files"} },
{ path: '/entity', component: Entity, meta:{title:"Entities"} }, {path: '/model', component: { template: '<router-view/>' },
{ path: '/entity/:entity', component: { template: '<router-view/>' } children: [
,children: [ {path: '', redirect: 'schema' },
{ { path: 'schema', name:"schema", component: Schema, meta:{title:"Schemas"} },
path: '', { path: 'taxonomy', component: Taxonomy, meta:{title:"Taxonomies"} },
component: Entity1, props: true, meta:{title:"Entity"} { path: 'mimetype', component: Mimetype, meta:{title:"Mimetypes"} },
}, { path: 'namespace', component: Namespace, meta:{title:"Namespaces"} },
{ { path: 'namespace/item', component: Namespace1, meta:{title:"Namespace"} },
path: 'data', component: Entity1data, props: true, meta:{title:"Entity data"} { path: 'entity', component: Entity, meta:{title:"Entities"} },
} { path: 'entity/:entity', component: { template: '<router-view/>' }
] ,children: [
}, {
path: '',
{ path: '/namespace', component: Namespace, meta:{title:"Namespaces"} }, component: Entity1, props: true, meta:{title:"Entity"}
{ path: '/namespace/item', component: Namespace1, meta:{title:"Namespace"} }, },
{
path: 'data', component: Entity1data, props: true, meta:{title:"Entity data"}
}
]
}
]},
{ path: '/select', component: Select, meta:{title:"Select"} }, { path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} }, { path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', name: "multi-edit", component: Tabs,meta:{title:"tab test"} }, { path: '/tabs', name: "multi-edit", component: Tabs,meta:{title:"tab test"} },
@ -111,8 +119,7 @@ const router = new VueRouter({
}, },
{ path: '/history', component: { template: '<router-view/>' } { path: '/history', component: { template: '<router-view/>' }
,children: [ ,children: [
{ path: 'files', component: Filehistory, meta:{title: "File History"} }, { path: 'files', component: Filehistory, meta:{title: "File History"} }
{ path: 'tasks', name: 'taskhistory', component: Taskhistory, meta:{title: "Task History"} },
] ]
}, },
{ path: '/labs', component: { template: '<router-view/>' } { 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 // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
Vue.component('qd-autoheight',{template:` Vue.component('qd-autoheight',{template:`
@ -17,7 +17,7 @@ Vue.component('qd-autoheight',{template:`
var e=el; var e=el;
// console.log("top",e.offsetTop,e.getBoundingClientRect().top,window.innerHeight); // console.log("top",e.offsetTop,e.getBoundingClientRect().top,window.innerHeight);
var h=window.innerHeight - e.getBoundingClientRect().top -10; var h=window.innerHeight - e.getBoundingClientRect().top -10;
var h=Math.max(1,h) ; h=Math.max(1,h) ;
// console.log("h",h) // console.log("h",h)
e.style.height=h +"px"; 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"> <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 }"> <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-content>
<v-list-item-title> <v-list-item-title>Search "{{ item.text }}"</v-list-item-title>
{{ item.text }} <v-list-item-subtitle>or goto
</v-list-item-title> <router-link :to="item.value">
<v-list-item-subtitle>Page {{ item.value }}</v-list-item-subtitle> {{ item.value }}
<v-icon>launch</v-icon>
</router-link>
</v-list-item-subtitle>
</v-list-item-content> </v-list-item-content>
</template> </template>
</v-combobox> </v-combobox>
@ -379,7 +378,7 @@ Vue.component('qd-search',{template:`
this.loading = true this.loading = true
// Simulated ajax query // Simulated ajax query
setTimeout(() => { setTimeout(() => {
this.items2 = this.si?this.matchItems(this.si.toLowerCase()):[], this.items2 = this.si?this.matchItems(this.si.toLowerCase()):[]
this.loading = false this.loading = false
}, 500) }, 500)
}, },
@ -390,8 +389,8 @@ Vue.component('qd-search',{template:`
matchItems(typed){ matchItems(typed){
var hits=this.titles; var hits=this.titles;
var typed=typed.toLowerCase(); typed=typed.toLowerCase();
hits=hits.filter(item=>item.title.indexOf(typed) !== -1) hits=hits.filter(item=>item.title.indexOf(typed) !== -1)
return hits.map(r=>{return {text:r.title, return hits.map(r=>{return {text:r.title,
value:r.path} 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 // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-entitylink.vue
Vue.component('vp-entitylink',{template:` Vue.component('vp-entitylink',{template:`
<router-link :to="'entity/'+entity">E</router-link> <router-link :to="'/entity/'+entity">E</router-link>
`, `,
props: ['entity'] props: ['entity']
@ -627,19 +626,24 @@ Vue.component('vp-favorite',{template:`
<v-card style="width:400px;"> <v-card style="width:400px;">
<v-toolbar class="green"> <v-toolbar class="green">
<v-card-title> <v-card-title>
Bookmark this page Add to favorites
</v-card-title> </v-card-title>
<v-spacer></v-spacer>
<v-btn @click="set(false)" icon><v-icon>close</v-icon></v-btn>
</v-toolbar> </v-toolbar>
<v-card-text> <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-combobox multiple v-model="tags" label="tags" chips tags :items="taglist"></v-combobox>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
<v-btn color="primary" text @click.stop="favorite(); set(false)">Done</v-btn>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="primary" text @click.stop="set(false)">Cancel</v-btn> <v-btn text @click.stop="set(false)">Cancel</v-btn>
<v-btn color="primary" text @click.stop="favorite(); set(false)">Save</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-menu> `, </v-menu> `,
@ -649,27 +653,28 @@ Vue.component('vp-favorite',{template:`
}, },
data(){ data(){
return { return {
canCopy:false,
tags: [], tags: [],
taglist: [ taglist: [ 'todo', 'find', 'some', 'good', 'tags' ],
'todo',
'find',
'some',
'good',
'tags'
],
} }
}, },
methods:{ methods:{
set(v){ set(v){
this.$emit('update:frmfav', v) this.$emit('update:frmfav', v)
}, },
async setclip(){
await navigator.clipboard.writeText(this.$route.fullPath);
alert('Copied!' + this.$route.fullPath);
},
favorite(){ favorite(){
this.$store.commit('increment') this.$store.commit('increment')
console.log(this.$store.state.count) console.log(this.$store.state.count)
alert("save"); alert("save");
} }
} },
created() {
this.canCopy = !!navigator.clipboard;
},
} }
); );
@ -812,7 +817,7 @@ Vue.component('vp-paramform',{template:`
<v-layout column xs8> <v-layout column xs8>
<v-flex v-for="field in fields" :key="field.model"> <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 v-else-if="field.type === 'xs:boolean'" :label="field.label" v-model="params[field.model]">
</v-switch> </v-switch>
@ -1836,7 +1841,7 @@ const Routes2=Vue.extend({template:`
<v-card> <v-card>
<v-toolbar> <v-toolbar>
<v-card-title> <v-card-title>
{{ active.path}} {{ active.name}}
</v-card-title> </v-card-title>
<router-link :to="active.path"><v-icon>link</v-icon></router-link> <router-link :to="active.path"><v-icon>link</v-icon></router-link>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@ -1925,8 +1930,8 @@ const Routes2=Vue.extend({template:`
this.refresh() this.refresh()
if(this.$route.query.index){ if(this.$route.query.index){
const index= parseInt(this.$route.query.index) const index= parseInt(this.$route.query.index)
//const h= this.findItem(this.routes,index) const h= this.findItem(this.routes,index)
//console.log("search",h, index) console.log("search",h, index)
//this.active=h //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 // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/collection/documentation.vue
const Documentation=Vue.extend({template:` const Documentation=Vue.extend({template:`
<v-container fluid grid-list-md> <v-container fluid>
<v-data-iterator :items="items" :items-per-page.sync="itemsPerPage" :search="search" hide-default-footer> <v-card>
<v-toolbar dense>
<template v-slot:header> <v-toolbar-title>
<v-toolbar> <v-breadcrumbs :items="crumbs">
<v-toolbar-title>XQDocs</v-toolbar-title> <span slot="divider" style="padding:0;"></span>
<v-spacer></v-spacer> <template slot="item" slot-scope="props">
<v-text-field v-model="search" clearable flat solo-inverted hide-details prepend-inner-icon="search" label="Search"></v-text-field> <v-breadcrumbs-item :to="{ query: { url: props.item.path }}" :exact="true">
<v-spacer></v-spacer> <v-icon v-if="props.item.icon">{{ props.item.icon }}</v-icon>
<router-link :to="{path:'/tasks/xqdoca'}"> {{ props.item.name }}
<v-icon>add_circle</v-icon> </v-breadcrumbs-item>
</router-link> </template>
<v-btn @click="get" icon :loading="loading" :disabled="loading"><v-icon>refresh</v-icon></v-btn> </v-breadcrumbs>
</v-toolbar> </v-toolbar-title>
</template> </v-toolbar>
<v-card-text>
<template v-slot:default="props"> <ul>
<v-layout wrap> <li>
<v-flex v-for="item in props.items" :key="item.name" xs12 sm6 md4 lg3> <router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
<v-card :hover="true"> </li>
<v-toolbar color="blue lighten-3" dense> <li>
<v-card-title>{{ item.name }}</v-card-title> <router-link to="documentation/xqdoc"><v-icon>Q</v-icon>XQdoc</router-link>
<v-spacer></v-spacer> </li>
<a :href="item.href" target="_new">go</a> </ul>
</v-toolbar> </v-card-text>
<v-card-text>{{ item.id }}</v-card-text> </v-card>
<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> </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 // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/components/markdown.vue
const Markdown=Vue.extend({template:` const Markdown=Vue.extend({template:`
<v-container fluid> <v-container fluid>
@ -3171,11 +3212,12 @@ created:function(){
const Tree2=Vue.extend({template:` const Tree2=Vue.extend({template:`
<v-container fluid> <v-container fluid>
<v-card> <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-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-spacer></v-spacer>
<v-btn>todo</v-btn> <v-btn>todo</v-btn>
</v-toolbar> </v-toolbar>
<v-card-text> <v-card-text>
<v-layout row wrap> <v-layout row wrap>
<v-flex xs4> <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-btn icon :loading="loading" @click="getJobs()" @dblclick="autorefresh = !autorefresh" :disabled="loading">
<v-icon>{{ autorefresh?'refresh':'arrow_downward' }}</v-icon> <v-icon>{{ autorefresh?'refresh':'arrow_downward' }}</v-icon>
</v-btn> </v-btn>
<vp-entitylink entity="basex.job"></vp-entitylink>
</v-toolbar> </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"> <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"> <template slot="items" slot-scope="props">
@ -5487,7 +5530,7 @@ const Entity=Vue.extend({template:`
<template v-slot:header> <template v-slot:header>
<v-toolbar> <v-toolbar>
<v-toolbar-title> <v-toolbar-title>
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]"> <v-breadcrumbs :items="[{text:'Entities',to:'/model/entity'}]">
<template slot="item" slot-scope="props"> <template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true"> <v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }} {{ props.item.text }}
@ -5573,7 +5616,7 @@ const Entity1=Vue.extend({template:`
<v-card> <v-card>
<v-toolbar> <v-toolbar>
<v-toolbar-title> <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-toolbar-title>
<v-menu v-model="showmenu"> <v-menu v-model="showmenu">
<template v-slot:activator="{ on }"> <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 // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/namespaces/namespace.vue
const Namespace=Vue.extend({template:` const Namespace=Vue.extend({template:`
<v-container fluid> <v-container fluid>
@ -7400,6 +7716,9 @@ const Taskhistory=Vue.extend({template:`
<v-breadcrumbs-item to="/tasks" :exact="true"> <v-breadcrumbs-item to="/tasks" :exact="true">
Tasks Tasks
</v-breadcrumbs-item> </v-breadcrumbs-item>
<v-breadcrumbs-item>
History
</v-breadcrumbs-item>
</v-breadcrumbs> </v-breadcrumbs>
</v-toolbar-title> </v-toolbar-title>
<v-spacer></v-spacer> <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-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> <v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink> <vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar> </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> <qd-breadcrumbs :crumbs="[{to: '/tasks', text:'Tasks'}, {text: task, disabled: true} ]">crumbs</qd-breadcrumbs>
</v-toolbar-title> </v-toolbar-title>
<v-spacer></v-spacer> <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> <v-spacer></v-spacer>
<vp-entitylink entity="quodatum.task"></vp-entitylink> <vp-entitylink entity="quodatum.task"></vp-entitylink>
</v-toolbar> </v-toolbar>
@ -7549,16 +7886,12 @@ const Tasks1=Vue.extend({template:`
<v-card-text> <v-card-text>
<h1>{{ task }} </h1> <h1>{{ task }} </h1>
<ul><li> <div v-if="data">
<router-link :to="{path: 'run', append:true }"> <v-icon>folder</v-icon>Run</router-link> <p>{{ data.description }}</p>
</li> <a :href="data.url">{{ data.url }}</a>
<li> </div>
<router-link :to="{name: 'edit', query:{apple: task} }"> <v-icon>folder</v-icon>Edit</router-link>
</li> <pre>{{ data | pretty }}</pre>
<li>
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon>History</router-link>
</li>
</ul>
</v-card-text> </v-card-text>
</v-card> </v-card>
@ -7572,27 +7905,22 @@ const Tasks1=Vue.extend({template:`
crumbs: [{to: "/tasks", text: "Tasks"}, crumbs: [{to: "/tasks", text: "Tasks"},
{ text: this.task}], { text: this.task}],
items: [], data: null,
loading: false, loading: false,
q: null, view: null
headers: [
{ text: 'Task', value: 'to' },
{ text: 'Title', value: 'title' },
{ text: 'Description', value: 'description' },
]
} }
}, },
methods:{ methods:{
getTasks(){ getTasks(){
this.loading= true; this.loading= true;
HTTP.get("tasks") HTTP.get("tasks/" + this.task)
.then(r=>{ .then(r=>{
this.items=r.data; this.data= r.data;
this.loading= false; this.loading= false;
}) })
} }
}, },
created(){ mounted(){
this.getTasks() this.getTasks()
} }
} }
@ -8163,6 +8491,7 @@ const Transform=Vue.extend({template:`
// src: C:\Users\andy\git\vue-poc\src\vue-poc\router.js // src: C:\Users\andy\git\vue-poc\src\vue-poc\router.js
// vue-poc application routes // vue-poc application routes
const router = new VueRouter({ const router = new VueRouter({
base:"/vue-poc/ui/", base:"/vue-poc/ui/",
mode: 'history', mode: 'history',
@ -8183,38 +8512,45 @@ const router = new VueRouter({
{path: '/images', component: { template: '<router-view/>' }, {path: '/images', component: { template: '<router-view/>' },
children: [ children: [
{path: '', redirect: 'item' }, {path: '', redirect: 'item' },
{ path: 'item', name:'images', component: Images, meta:{title: "Images"} }, { path: 'item', name:'images', component: Images, meta:{title: "Images"} },
{ path: 'report', name:"image-reports", component: Report, props: true, meta:{title: "Image report"}}, { path: 'report', name:"image-reports", component: Report, props: true, meta:{title: "Image report"}},
{ path: 'item/:id', name:"image",component: Image, props: true, meta:{title: "Image details"}}, { path: 'item/:id', name:"image",component: Image, props: true, meta:{title: "Image details"}},
{ path: 'thumbnail', component: Thumbnail, meta:{title:"Thumbnail generator"} }, { path: 'thumbnail', component: Thumbnail, meta:{title:"Thumbnail generator"} },
{ path: 'keywords', component: Keywords, meta:{title:"Image keywords"} }, { path: 'keywords', component: Keywords, meta:{title:"Image keywords"} },
{ path: 'dates', component: Dates, meta:{title:"Image dates"} }, { path: 'dates', component: Dates, meta:{title:"Image dates"} },
{ path: 'people', component: People, meta:{title:"Image people"} } { path: 'people', component: People, meta:{title:"Image people"} }
]}, ]},
{ path: '/documentation', component: Documentation, meta:{title:"documentation"} }, { 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', component: Basexlogdate, meta:{title:"log files"} },
{ path: '/logdate/:date', component: Basexlogdate1, props:true, meta:{title:"log files"} }, { path: '/logdate/:date', component: Basexlogdate1, props:true, meta:{title:"log files"} },
{ path: '/entity', component: Entity, meta:{title:"Entities"} }, {path: '/model', component: { template: '<router-view/>' },
{ path: '/entity/:entity', component: { template: '<router-view/>' } children: [
,children: [ {path: '', redirect: 'schema' },
{ { path: 'schema', name:"schema", component: Schema, meta:{title:"Schemas"} },
path: '', { path: 'taxonomy', component: Taxonomy, meta:{title:"Taxonomies"} },
component: Entity1, props: true, meta:{title:"Entity"} { path: 'mimetype', component: Mimetype, meta:{title:"Mimetypes"} },
}, { path: 'namespace', component: Namespace, meta:{title:"Namespaces"} },
{ { path: 'namespace/item', component: Namespace1, meta:{title:"Namespace"} },
path: 'data', component: Entity1data, props: true, meta:{title:"Entity data"} { path: 'entity', component: Entity, meta:{title:"Entities"} },
} { path: 'entity/:entity', component: { template: '<router-view/>' }
] ,children: [
}, {
path: '',
{ path: '/namespace', component: Namespace, meta:{title:"Namespaces"} }, component: Entity1, props: true, meta:{title:"Entity"}
{ path: '/namespace/item', component: Namespace1, meta:{title:"Namespace"} }, },
{
path: 'data', component: Entity1data, props: true, meta:{title:"Entity data"}
}
]
}
]},
{ path: '/select', component: Select, meta:{title:"Select"} }, { path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} }, { path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', name: "multi-edit", component: Tabs,meta:{title:"tab test"} }, { path: '/tabs', name: "multi-edit", component: Tabs,meta:{title:"tab test"} },
@ -8275,8 +8611,7 @@ const router = new VueRouter({
}, },
{ path: '/history', component: { template: '<router-view/>' } { path: '/history', component: { template: '<router-view/>' }
,children: [ ,children: [
{ path: 'files', component: Filehistory, meta:{title: "File History"} }, { path: 'files', component: Filehistory, meta:{title: "File History"} }
{ path: 'tasks', name: 'taskhistory', component: Taskhistory, meta:{title: "Task History"} },
] ]
}, },
{ path: '/labs', component: { template: '<router-view/>' } { path: '/labs', component: { template: '<router-view/>' }
@ -8483,13 +8818,14 @@ const Vuepoc=Vue.extend({template:`
frmfav: false, frmfav: false,
items: [ items: [
{href: '/',text: 'Dashboard', icon: 'dashboard' }, {href: '/',text: 'Dashboard', icon: 'home' },
{ {
icon: 'input', icon: 'input',
text: 'Actions' , text: 'Actions' ,
model: false, model: false,
children: [ children: [
{href: '/eval',text: 'Query',icon: 'play_circle_outline'}, {href: '/eval',text: 'Query',icon: 'play_circle_outline'},
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/edit',text: 'Edit',icon: 'mode_edit'}, {href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/tabs',text: 'Tabs',icon: 'switch_camera'}, {href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'}, {href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
@ -8504,8 +8840,8 @@ const Vuepoc=Vue.extend({template:`
children: [ children: [
{href: '/database', text: 'Databases',icon: 'developer_mode' }, {href: '/database', text: 'Databases',icon: 'developer_mode' },
{href: '/files', text: 'File system',icon: 'folder' }, {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: '/logdate',text: 'XML logs',icon: 'dns'},
{href: '/history/files',text: 'history',icon: 'history'} {href: '/history/files',text: 'history',icon: 'history'}
]}, ]},
@ -8514,9 +8850,11 @@ const Vuepoc=Vue.extend({template:`
text: 'Models' , text: 'Models' ,
model: false, model: false,
children: [ children: [
{href: '/entity', text: 'Entities',icon: 'redeem' }, {href: '/model/entity', text: 'Entities',icon: 'redeem' },
{href: '/documentation', text: 'Documentation',icon: 'library_books' }, {href: '/model/namespace', text: 'Namespaces',icon: 'dns' },
{href: '/namespace', text: 'Namespaces',icon: 'label' }, {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: [ children: [
{href: '/labs/scratch',text: 'Scratch pad',icon: 'filter_frames'}, {href: '/labs/scratch',text: 'Scratch pad',icon: 'filter_frames'},
{href: '/labs/form',text: 'Forms',icon: 'subtitles' }, {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/svg',text: 'SVG',icon: 'extension'},
{href: '/labs/svg2',text: 'SVG2',icon: 'extension'}, {href: '/labs/svg2',text: 'SVG2',icon: 'extension'},
{href: '/labs/tree',text: 'Tree',icon: 'nature'}, {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="//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="/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="//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/app.css" rel="stylesheet" type="text/css"/>
<link href="/vue-poc/ui/svg/d3-svg.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" /> <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/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="//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="//unpkg.com/vue-native-websocket@2.0.8/dist/build.js" crossorigin="anonymous"></script>
<script src="/vue-poc/ui/svg/d3-svg.js"></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