vuetify 1.2.5

This commit is contained in:
Andy Bunce 2018-09-27 12:50:46 +01:00
parent a22b1fb49c
commit b9ff2b7762
32 changed files with 658 additions and 213 deletions

View file

@ -132,7 +132,8 @@
{href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
{href: '/transform',text: 'XSLT Transform',icon: 'forward'},
{href: '/tasks',text: 'Tasks',icon: 'update'}
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/history/tasks',text: 'history',icon: 'history'}
]},
{
icon: 'folder_open',
@ -142,7 +143,7 @@
{href: '/database', text: 'Databases',icon: 'developer_mode' },
{href: '/files', text: 'File system',icon: 'folder' },
{href: '/history',text: 'history',icon: 'history'}
{href: '/history/files',text: 'history',icon: 'history'}
]},
{
icon: 'memory',

View file

@ -6,7 +6,7 @@
<v-toolbar >
<v-text-field
append-icon="search"
label="Filter user"
label="Filter items..."
single-line
hide-details
v-model="search"
@ -41,8 +41,9 @@
v-model="props.selected"
></v-checkbox>
</td>
<td class="text-xs-left">{{ props.item.name }}</td>
<td class="text-xs-left">{{ props.item.permission }}</td>
<td class="text-xs-left">XX{{ props.item.name }}</td>
<td class="text-xs-left">YY{{ foo(props.item) }}</td>
<td v-for="col in headers" :key="col.name">zz{{ foo(props.index) }}</td>
</template>
</v-data-table>
</v-card>
@ -64,7 +65,7 @@
default: "entity"
},
noDataMsg:{
default: "No USERS found @todo"
default: "No data found."
},
entity:{
default: "entity"
@ -88,6 +89,9 @@
console.log("items",r.data.items,"headers ",this.headers);
this.items=r.data.items;
})
},
foo(x){
return 42
}
},
created:function(){

View file

@ -0,0 +1,3 @@
fetch:xml("http://transpect.io/test/test.xml",
map{"catfile": "C:\Users\andy\Desktop\basex.versions\basex.91.0831\etc\mycatalog.xml"}
)

View file

@ -59,7 +59,7 @@ function vue-api:edit-post($url as xs:string,$data)
: Returns a file content.
:)
declare
%rest:GET %rest:path("/vue-poc/api/get")
%rest:GET %rest:path("/vue-poc/api/get2")
%rest:query-param("url", "{$url}")
function vue-api:get-webfile($url as xs:string?)
as element(json)
@ -79,15 +79,21 @@ as element(json)
(:~
: Returns a file content.
: @param $url starts with protocol
:)
declare
%rest:GET %rest:path("/vue-poc/api/get2")
%rest:GET %rest:path("/vue-poc/api/get")
%rest:query-param("url", "{$url}")
%output:method("json")
function vue-api:get-file($url as xs:string?)
as element(json)
{
let $path := $url
let $protocol := substring-before($url,":")
let $path:=if($protocol eq "webfile") then
substring-after($url,":") =>ufile:web()
else
$url
return if( file:exists($path))then
let $type:=mt:type($path)
let $fetch:=mt:fetch-fn($type("treat-as"))

View file

@ -18,7 +18,7 @@
</v-menu>
<v-menu v-if="active" left transition="v-fade-transition" >
<v-btn icon slot="activator" ><v-icon>subscriptions</v-icon></v-btn>
<v-btn slot="activator" >Action<v-icon>arrow_drop_down</v-icon></v-btn>
<v-list dense>
<v-subheader >Actions</v-subheader>
<v-list-tile @click="format()" >
@ -29,7 +29,7 @@
</v-list-tile>
</v-list>
</v-menu>
<v-btn>*{{ nextId }}</v-btn>
<v-spacer></v-spacer>
@ -338,15 +338,14 @@
beforeRouteEnter (to, from, next) {
Promise.all([settings.getItem('settings/ace'),
settings.getItem('edit/items'),
settings.getItem('edit/currentId'),
settings.getItem('edit/items')
])
.then(function(values) {
next(vm => {
vm.aceSettings = values[0];
vm.items = values[1];
vm.currentId = values[2];
//console.log("done all",values);
vm.currentId = vm.items.length+1;
console.log("nextid: ",vm.currentId);
})
})
},
@ -356,14 +355,16 @@
// be navigated away from.
// has access to `this` component instance.
settings.setItem('edit/items',this.items);
settings.setItem('edit/currentId',this.currentId);
next(true);
},
created:function(){
var url=this.$route.query.url;
if(url)this.loadItem(url);
if(url){
this.loadItem(url);
}else{
var id=this.$route.query.id;
this.currentId=id?id:null;
}
}
}</script>

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<template id="history">
<template id="filehistory">
<v-container >
<v-card>
<v-card-title>History</v-card-title>
<v-card-title>File History</v-card-title>
<v-card-text>
<v-list>
<v-list-tile v-for="item in items" v-bind:key="item.title" avatar>
@ -12,13 +12,14 @@
<v-list-tile-content>
<v-list-tile-title v-text="item.url"></v-list-tile-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn @click="doEdit(item)" icon ripple>
<v-btn :to="{name:'edit', query:{ url:item.url, protocol:item.protocol}}" icon ripple>
<v-icon color="grey lighten-1">info</v-icon>
</v-btn>
</v-list-tile-action>
<v-list-tile-action>
<v-btn @click="doEdit2(item)" icon ripple>
<v-btn :to="{name:'multi-edit', query:{ url:item.protocol + ':' +item.url }}" icon ripple>
<v-icon color="grey lighten-1">switch_camera</v-icon>
</v-btn>
</v-list-tile-action>
@ -43,13 +44,6 @@
this.items = res.data.items;
console.log("items",this.items)
});
},
doEdit(item){
console.log("history: ",item)
router.push({ path: 'edit', query: { url:item.url, protocol:item.protocol }})
},
doEdit2(item){
router.push({ path: 'tabs', query: { url:item.protocol + ":" +item.url }})
}
},
created:function(){

View file

@ -0,0 +1,75 @@
<!DOCTYPE html>
<template id="taskhistory">
<v-container fluid>
<v-progress-linear v-if="loading" v-bind:indeterminate="true" ></v-progress-linear>
<v-card>
<v-toolbar>
<v-toolbar-title>
<v-breadcrumbs >
<v-breadcrumbs-item to="/tasks" :exact="true">
Tasks
</v-breadcrumbs-item>
</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>
<vp-entitylink entity="task"></vp-entitylink>
</v-toolbar>
<v-card-text>
<v-data-table
:headers="headers"
:items="items"
hide-actions
:search="q"
class="elevation-1"
>
<template slot="items" slot-scope="props">
<td ><router-link :to="'tasks/' + props.item.to" v-text="props.item.title"></router-link></td>
<td >{{ props.item.description }}</td>
</template>
<template slot="no-data">
<v-alert :value="true" icon="warning">
No matching items.
</v-alert>
</template>
</v-data-table>
</v-card-text>
</v-card>
</v-container>
</template>
<script>{
data(){
return {
items: [],
loading: false,
q: null,
headers: [
{ text: 'Task', value: 'title' },
{ text: 'Description', value: 'description' },
]
}
},
methods:{
getTasks(){
this.loading= true;
HTTP.get("tasks")
.then(r=>{
this.items=r.data;
this.loading= false;
})
}
},
created(){
this.getTasks()
}
}
</script>

View file

@ -37,8 +37,22 @@
<div>{{item.description}}</div>
<code>{{item.code}}</code>
</div>
<pre>{{ xml }}</pre>
<v-expansion-panel v-model="panel" expand >
<v-expansion-panel-content>
<div slot="header" class="title">Code</div>
<pre>{{ xml }}</pre>
</v-expansion-panel-content>
<v-expansion-panel-content>
<div slot="header" class="title">Fields#</div>
<qd-table :headers="headers" data-uri="data/entity.field" entity="entity.field" no-data-msg="Nothing found">
</qd-table>
</v-expansion-panel-content>
</v-expansion-panel>
</v-container>
</v-card>
</template>
@ -52,7 +66,16 @@
},
loading: false,
xml: null
xml: null,
selected: [],
headers: [
{ text: 'Name', value: 'name', align: 'left'},
{ text: 'parent', value: 'parent', align: 'left' },
{text: "type", value: "type"},
{text: "description", value: "description"},
{text: "xpath", value: "xpath"}
],
panel: [true,true]
}
},
methods:{

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

View file

@ -34,8 +34,8 @@ declare
%output:method("json")
function vue-rest:task($task)
{
let $task:=doc("taskdef.xml")/tasks/task[@name=$task]
let $url:=resolve-uri($task/@url)
let $taskdef:=doc("taskdef.xml")/tasks/task[@name=$task]
let $url:=resolve-uri($taskdef/@url)
let $info:=query-a:fields($url)
return $info
};
@ -50,12 +50,15 @@ declare
%output:method("json")
function vue-rest:runtask($task)
{
let $task:=doc("taskdef.xml")/tasks/task[@name=$task]
let $url:=resolve-uri($task/@url)
let $taskdef:=doc("taskdef.xml")/tasks/task[@name=$task]
let $url:=resolve-uri($taskdef/@url)
let $params:=query-a:params($url)
let $log:=<task task="{ $task }" url="{ $url }">
{ map:keys($params)!<param name="{.}">{map:get($params,.)}</param> }
</task>
return (
query-a:run($url,$params),
hlog:save(<task url="{ $url }"/>)
hlog:save($log)
)
};

View file

@ -15,10 +15,8 @@
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn color="primary" @click="submit()" :loading="loading"
:disabled="loading" icon>
<v-icon>history</v-icon>
</v-btn>
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon></router-link>
<v-btn color="primary" @click="submit()" :loading="loading"
:disabled="loading">
<v-icon>play_circle_outline</v-icon>
@ -54,7 +52,8 @@
return {
loading: false,
snackbar: {show:false,msg:"",context:"success"},
valid: false
valid: false,
id: null
}
},
@ -64,7 +63,7 @@
this.$refs.params.submit()
.then(r=>{
this.loading= false
this.id=r.data.id;
this.snackbar= {show:true,
msg: r.data && r.data.msg,
context:"success"

View file

@ -15,7 +15,12 @@
<description>Generate documentation for folder</description>
</task>
<task name="xqdoc-rest" url="xqdoc/tx-xqdoc2.xq">
<task name="xqdoc2" url="xqdoc/tx-xqdoc2.xq">
<title>XQdoc 2</title>
<description>Generate xquery documentation for folder. Using standard task.</description>
</task>
<task name="xqdoc-rest" url="xqdoc/tx-xqrest.xq">
<title>XQdoc rest</title>
<description>XQdoc...</description>
</task>

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<template id="task">
<template id="tasks">
<v-container fluid>
<v-progress-linear v-if="loading" v-bind:indeterminate="true" ></v-progress-linear>
<v-card>

View file

@ -4,6 +4,7 @@
module namespace vue-api = 'quodatum:vue.api';
import module namespace query-a = 'vue-poc/query-a' at "../../../lib/query-a.xqm";
import module namespace hlog = 'quodatum.data.history' at '../../../lib/history.xqm';
declare variable $vue-api:query as xs:anyURI :=resolve-uri("tx-xqdoc.xq");
@ -18,7 +19,13 @@ declare
%updating
function vue-api:model()
{
resolve-uri($vue-api:query)=>query-a:update(query-a:params($vue-api:query))
let $params:=query-a:params($vue-api:query)
let $log:=<task task="xqdoc" url="url?">
todo
</task>
return (query-a:update($vue-api:query,$params),
hlog:save($log)
)
};
(:~

View file

@ -1,5 +1,6 @@
(:~
: Generate html for for XQuery sources
: @return info about the run (json format)
:)
import module namespace fw="quodatum:file.walker";
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";

View file

@ -1,69 +1,37 @@
(:~
: XQDoc: generate restxq.html from resources located at $target
: Generate html for for XQuery sources
: @return info about the run (json format)
:)
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
import module namespace fw="quodatum:file.walker";
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
declare namespace c="http://www.w3.org/ns/xproc-step";
declare namespace xqdoc="http://www.xqdoc.org/1.0";
(:~ URL of the root folder to document
: @default C:/Users/andy/git/vue-poc/src/vue-poc
:)
declare variable $efolder as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc";
(:~ URL of the doc source
(:~ URL of the schema to use
: @default C:/tmp/xqdoc/
:)
declare variable $target as xs:anyURI external :=
"C:/tmp/xqdoc/" cast as xs:anyURI;
declare variable $target as xs:anyURI external :="C:/tmp/xqdoc/";
declare variable $files :=doc(resolve-uri("files.xml",$target));
declare function local:foo($a,$k){
if($a) then map{"k":$k,"d":$a} else ()
};
declare variable $state as element(state):=db:open("vue-poc","/state.xml")/state;
let $base:=$files/*/@xml:base/string()
let $files:= $files//c:file
let $names:= $files!string-join(ancestor-or-self::*/@name,"/")
let $xqdocs:=$files!doc(resolve-uri(``[F`{ position() }`/xqdoc.xml]``,$target))
let $paths:= $xqdocs!local:foo(xqd:rxq(*),position())
let $items:=
for $annots in $paths
let $uri:=$annots?d/string()
group by $uri
order by $uri
return <li>
<h3>{ $uri }</h3>
<ol>{
for $annot in $annots
let $fun:=$annot?d/../..
let $funname:=concat($fun/xqdoc:name/string(),'#',$fun/@arity/string())
let $href:="F12/index.html#field-list"
return <li><a href="{$href}">{$funname}</a>{$annot?k}</li>
}</ol>
<a>{ $uri }</a>
</li>
return <div>
<nav id="toc">
<div>
<a href="index.html">
Index
</a>
</div>
<h2>
<a id="contents"></a>
<span class="namespace">
RestXQ
</span>
</h2>
<ol class="toc">
<li>
<a href="#main">
<span class="secno">1 </span>
<span class="content">Introduction</span>
</a>
</li>
</ol>
</nav>
<a href="index.html">index: { $base }</a>
<ul>{ $items }</ul>
</div>
=>xqd:page(map{"resources":"resources/"})
=>xqd:store(resolve-uri("restxq.html",$target),$xqd:HTML5)
let $project:=tokenize($efolder,"[/\\]")[last()]=>trace("xqdoc: ")
let $files:= fw:directory-list($efolder,map{"include-filter":".*\.xqm"})
let $id:=$state/last-id
let $opts:=map{
"project": $project,
"id": $id/string()
}
let $op:=xqd:save-xq($files,$target,$opts)
let $result:=<json type="object">
<extra>hello</extra>
<msg> {$target}, {count($files//c:file)} files processed.</msg>
<id>{$id/string()}</id>
</json>
return (
update:output($result),
replace value of node $id with 1+$state/last-id
)

View file

@ -0,0 +1,69 @@
(:~
: XQDoc: generate restxq.html from resources located at $target
:)
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
declare namespace c="http://www.w3.org/ns/xproc-step";
declare namespace xqdoc="http://www.xqdoc.org/1.0";
(:~ URL of the doc source
: @default C:/tmp/xqdoc/
:)
declare variable $target as xs:anyURI external :=
"C:/tmp/xqdoc/" cast as xs:anyURI;
declare variable $files :=doc(resolve-uri("files.xml",$target));
declare function local:foo($a,$k){
if($a) then map{"k":$k,"d":$a} else ()
};
let $base:=$files/*/@xml:base/string()
let $files:= $files//c:file
let $names:= $files!string-join(ancestor-or-self::*/@name,"/")
let $xqdocs:=$files!doc(resolve-uri(``[F`{ position() }`/xqdoc.xml]``,$target))
let $paths:= $xqdocs!local:foo(xqd:rxq(*),position())
let $items:=
for $annots in $paths
let $uri:=$annots?d/string()
group by $uri
order by $uri
return <li>
<h3>{ $uri }</h3>
<ol>{
for $annot in $annots
let $fun:=$annot?d/../..
let $funname:=concat($fun/xqdoc:name/string(),'#',$fun/@arity/string())
let $href:="F12/index.html#field-list"
return <li><a href="{$href}">{$funname}</a>{$annot?k}</li>
}</ol>
<a>{ $uri }</a>
</li>
return <div>
<nav id="toc">
<div>
<a href="index.html">
Index
</a>
</div>
<h2>
<a id="contents"></a>
<span class="namespace">
RestXQ
</span>
</h2>
<ol class="toc">
<li>
<a href="#main">
<span class="secno">1 </span>
<span class="content">Introduction</span>
</a>
</li>
</ol>
</nav>
<a href="index.html">index: { $base }</a>
<ul>{ $items }</ul>
</div>
=>xqd:page(map{"resources":"resources/"})
=>xqd:store(resolve-uri("restxq.html",$target),$xqd:HTML5)

View file

@ -7,6 +7,7 @@
<v-card-title >
<span class="white--text">Task: Generate <code>xqdoc</code></span>
</v-card-title>
<a>{{ id }}</a>
<v-spacer></v-spacer>
<v-btn color="primary" @click="submit()" :loading="waiting"
:disabled="waiting">
@ -55,6 +56,7 @@
},
waiting:false,
alert:{msg:"",success:false,error:false},
id: null
}
},
methods:{
@ -63,7 +65,8 @@
this.alert={msg:"Loading..",success:false,error:false}
HTTP.post("tasks/xqdoc",Qs.stringify(this.params))
.then(r=>{
this.waiting=false
this.waiting=false;
this.id= r.data.id;
this.alert={msg:r.data.msg,success:true,error:false}
console.log(r.data)
settings.setItem('tasks/xqdoc',this.params)

View file

@ -11,7 +11,7 @@ declare
function hlog:save($item as element(*))
{
let $id:=$hlog:doc/@next-id/string(.)
let $n:=<hist:event id="{$id}" when="{fn:current-dateTime()}">{$item}</hist:event>
let $n:=<hist:event id="{$id}" when="{fn:current-dateTime()}" user="admin">{$item}</hist:event>
return (insert node $n as first into $hlog:doc,
replace value of node $hlog:doc/@next-id with number($id)+1
)

View file

@ -34,7 +34,8 @@ let $type:= if($a="application/sparql-query") then
"text"
else
"binary"
return map{"type":MediaType:type($a) ,"treat-as":$type}
return map{"type": MediaType:type($a) ,
"treat-as": $type}
};
@ -44,7 +45,7 @@ declare function mt:base-ext($filepath as xs:string)
{
let $ext:=file:name($filepath)=>substring-after(".")
let $types:=map{"vue":".html","sch":".xml"}
return if($types($ext)) then $types($ext) else $ext
return ($types($ext),$ext)=>head()
};
(:~

View file

@ -0,0 +1,7 @@
import module namespace store = 'quodatum.store' at "store.xqm";
let $d:=<doc>test</doc>
let $r:=map{"uri":"foo/test.xml","serialization":map{},"document":$d}
let $base:="xmldb:/vuepoc-test/123/"
(: let $base:=file:path-to-uri("c:\tmp\") :)
return store:store($r,$base)

51
src/vue-poc/lib/store.xqm Normal file
View file

@ -0,0 +1,51 @@
xquery version "3.1";
module namespace store = 'quodatum.store';
(:~
: store o/ps below $base
: @param $docs sequence of maps
: @param $base a uri "file:..", "xmldb:.."
:)
declare %updating
function store:store($docs as map(*)*,$base as xs:string)
{
$docs!store:store1(.,$base)
};
declare %updating
function store:store1($doc as map(*),$base as xs:string)
{
let $uri:=resolve-uri($doc?uri,$base)
let $opts:=if($doc?uri instance of map(*)) then $doc?uri else map{}
return switch (substring-before($uri,":"))
case "file" return store:file($doc?document,$uri,$opts)
case "xmldb" return store:xmldb($doc?document,$uri,$opts)
default return error("unknown protocol")
};
(:~
:save $data to $url , create fdolder if missing)
:)
declare %updating
function store:file($data,$uri as xs:string,$params as map(*))
{
let $p:=file:parent($uri)
return (
if(file:is-dir($p)) then () else file:create-dir($p),
file:write($uri,$data,$params)
)
};
(:~
:save $data to $uri to db
:)
declare %updating
function store:xmldb($data,$uri as xs:string,$params as map(*))
{
let $a:=analyze-string(substring-after($uri,":"),"/([^/]*)/(.*)")
let $db:=$a//*[@nr="1"]
let $path:=$a//*[@nr="2"]
return db:replace($db,$path,$data)
};

View file

@ -6,6 +6,8 @@
:)
module namespace xqd = 'quodatum:build.xqdoc';
import module namespace xp="expkg-zone58:text.parse";
import module namespace store = 'quodatum.store' at '../store.xqm';
declare namespace c="http://www.w3.org/ns/xproc-step";
declare namespace xqdoc="http://www.xqdoc.org/1.0";
@ -67,6 +69,36 @@ declare function xqd:gendoc(
)
};
(:~
: save xqdoc and html for source file $f
: @param $f <c:file/>
: @param $target destination folder
: @param map
: @param
:)
declare function xqd:gendoc2(
$f as element(c:file),
$op as xs:string,
$target as xs:string,
$params as map(*)
)
{
let $ip:= $f/@name/resolve-uri(.,base-uri(.))
let $xqdoc:= xqd:xqdoc($ip,map{})
let $xq:= fetch:text($ip)
let $params:=map:merge((map{
"source":$xq,
"filename":$f/@name/string(),
"cache":true(),
"show-private":true(),
"resources":"../resources/"},
$params))
return (
xqd:store2(xqd:parse($xq), "xparse.xml",$xqd:XML),
xqd:store2($xqdoc,"xqdoc.xml",$xqd:XML),
xqd:store2(xqd:xqdoc-html($xqdoc,$params), "index.html",$xqd:HTML5)
)
};
(:~
:save $data to $url , create fdolder if missing)
:)
@ -78,6 +110,14 @@ declare function xqd:store($data,$url as xs:string,$params as map(*))
file:write($url,$data,$params)
)
};
(:~
:save $data to $url , create fdolder if missing)
:)
declare function xqd:store2($data,$url as xs:string,$params as map(*))
{
map{"document": $data, "uri":$url,"opts":$params}
};
(:~ parse XQuery
: result is <XQuery> or <ERROR>

View file

@ -0,0 +1,29 @@
<entity name="taskhistory" xmlns="https://github.com/Quodatum/app-doc/entity">
<description>vue-poc task view events </description>
<namespace prefix="h" uri="urn:quodatum:vue-poc.history" />
<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="protocol" type="xs:string">
<description>mode eg file basexdb</description>
<xpath>h:file/@mode</xpath>
</field>
<field name="url" type="xs:string">
<description>path</description>
<xpath>h:file/@url</xpath>
</field>
</fields>
<views iconclass="fa fa-calendar"/>
<data type="element(h:event)">doc("vue-poc/history.xml")/h:history/h:event[task]</data>
</entity>

View file

@ -36,14 +36,14 @@ const router = new VueRouter({
{ path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test"} },
{ path: '/login', component: Login,meta:{title:"login"} },
{ path: '/edit', component: Edit,meta:{title:"Ace editor"} },
{ path: '/tabs', name: "multi-edit", component: Tabs,meta:{title:"tab test"} },
{ path: '/edit', name: "edit",component: Edit,meta:{title:"Ace editor"} },
{ path: '/server/users', component: Users,meta:{title:"Users"} },
{ path: '/server/repo', component: Repo,meta:{title:"Repository"} },
{ path: '/files', component: Files,meta:{title:"File system"},props:{protocol:"webfile"} },
{ path: '/database', component: Files,meta:{title:"Databases"},props:{protocol:"xmldb"} },
{ path: '/login', component: Login,meta:{title:"login"} },
{ path: '/settings', component: { template: '<router-view/>' }
,children: [
{
@ -88,8 +88,14 @@ const router = new VueRouter({
{ path: 'settings', component: Basexsettings,meta:{title:"BaseX settings"} }
]
},
{ path: '/history', component: History, meta:{title:"File History"} },
{ 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: '/puzzle', component: Puzzle, meta:{title:"Jigsaw"} },
{ path: '/svg', component: Svg, meta:{title:"SVG"} },
{ path: '/svg2', component: Svg2, meta:{title:"SVG2"} },
@ -101,7 +107,7 @@ const router = new VueRouter({
{ path: '/logs', component: Log, meta:{title:"Server logs"} },
{ path: '/tasks', component: Task, meta:{title:"Runnable tasks"} },
{ path: '/tasks', component: Tasks, meta:{title:"Runnable tasks"} },
{ path: '/tasks/model', component: Model, meta:{title:"build model"} },
{ path: '/tasks/xqdoc', component: Xqdoc, meta:{title:"build xqdoc"} },
{ path: '/tasks/vuecompile', component: Vuecompile, meta:{title:"vue compile"} },

View file

@ -1,4 +1,4 @@
// generated 2018-09-15T23:02:38.496+01:00
// generated 2018-09-26T22:20:16.666+01:00
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
Vue.component('qd-autoheight',{template:`
@ -247,7 +247,7 @@ Vue.component('qd-table',{template:`
<v-container fluid="">
<v-card>
<v-toolbar>
<v-text-field append-icon="search" label="Filter user" single-line="" hide-details="" v-model="search" clearable=""></v-text-field>
<v-text-field append-icon="search" label="Filter items..." single-line="" hide-details="" v-model="search" clearable=""></v-text-field>
<v-spacer></v-spacer>
<v-btn icon="" :loading="loading" :disabled="loading" @click="getItems">
<v-icon>refresh</v-icon>
@ -260,8 +260,9 @@ Vue.component('qd-table',{template:`
<td>
<v-checkbox primary="" hide-details="" v-model="props.selected"></v-checkbox>
</td>
<td class="text-xs-left">{{ props.item.name }}</td>
<td class="text-xs-left">{{ props.item.permission }}</td>
<td class="text-xs-left">XX{{ props.item.name }}</td>
<td class="text-xs-left">YY{{ foo(props.item) }}</td>
<td v-for="col in headers" :key="col.name">zz{{ foo(props.index) }}</td>
</template>
</v-data-table>
</v-card>
@ -282,7 +283,7 @@ Vue.component('qd-table',{template:`
default: "entity"
},
noDataMsg:{
default: "No USERS found @todo"
default: "No data found."
},
entity:{
default: "entity"
@ -306,6 +307,9 @@ Vue.component('qd-table',{template:`
console.log("items",r.data.items,"headers ",this.headers);
this.items=r.data.items;
})
},
foo(x){
return 42
}
},
created:function(){
@ -1613,67 +1617,6 @@ const Files=Vue.extend({template:`
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/collection/history.vue
const History=Vue.extend({template:`
<v-container>
<v-card>
<v-card-title>History</v-card-title>
<v-card-text>
<v-list>
<v-list-tile v-for="item in items" v-bind:key="item.title" avatar="">
<v-list-tile-action>
<v-chip v-text="item.protocol">Example Chip</v-chip>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title v-text="item.url"></v-list-tile-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn @click="doEdit(item)" icon="" ripple="">
<v-icon color="grey lighten-1">info</v-icon>
</v-btn>
</v-list-tile-action>
<v-list-tile-action>
<v-btn @click="doEdit2(item)" icon="" ripple="">
<v-icon color="grey lighten-1">switch_camera</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
</v-list>
</v-card-text>
</v-card>
</v-container>
`,
data: function(){
return {
message: 'Hello Vue.js!',
items:[]
}
},
methods:{
get() {
HTTP.get('history')
.then((res) => {
this.items = res.data.items;
console.log("items",this.items)
});
},
doEdit(item){
console.log("history: ",item)
router.push({ path: 'edit', query: { url:item.url, protocol:item.protocol }})
},
doEdit2(item){
router.push({ path: 'tabs', query: { url:item.protocol + ":" +item.url }})
}
},
created:function(){
this.get()
console.log("history")
}
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/components/svg.vue
const Svg=Vue.extend({template:`
<v-container fluid="">
@ -2336,7 +2279,7 @@ const Tabs=Vue.extend({template:`
</v-menu>
<v-menu v-if="active" left="" transition="v-fade-transition">
<v-btn icon="" slot="activator"><v-icon>subscriptions</v-icon></v-btn>
<v-btn slot="activator">Action<v-icon>arrow_drop_down</v-icon></v-btn>
<v-list dense="">
<v-subheader>Actions</v-subheader>
<v-list-tile @click="format()">
@ -2347,7 +2290,7 @@ const Tabs=Vue.extend({template:`
</v-list-tile>
</v-list>
</v-menu>
<v-btn>*{{ nextId }}</v-btn>
<v-spacer></v-spacer>
@ -2635,15 +2578,14 @@ const Tabs=Vue.extend({template:`
beforeRouteEnter (to, from, next) {
Promise.all([settings.getItem('settings/ace'),
settings.getItem('edit/items'),
settings.getItem('edit/currentId'),
settings.getItem('edit/items')
])
.then(function(values) {
next(vm => {
vm.aceSettings = values[0];
vm.items = values[1];
vm.currentId = values[2];
//console.log("done all",values);
vm.currentId = vm.items.length+1;
console.log("nextid: ",vm.currentId);
})
})
},
@ -2653,15 +2595,17 @@ const Tabs=Vue.extend({template:`
// be navigated away from.
// has access to `this` component instance.
settings.setItem('edit/items',this.items);
settings.setItem('edit/currentId',this.currentId);
next(true);
},
created:function(){
var url=this.$route.query.url;
if(url)this.loadItem(url);
if(url){
this.loadItem(url);
}else{
var id=this.$route.query.id;
this.currentId=id?id:null;
}
}
}
);
@ -3171,6 +3115,129 @@ const Formsjson=Vue.extend({template:`
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/history/filehistory.vue
const Filehistory=Vue.extend({template:`
<v-container>
<v-card>
<v-card-title>File History</v-card-title>
<v-card-text>
<v-list>
<v-list-tile v-for="item in items" v-bind:key="item.title" avatar="">
<v-list-tile-action>
<v-chip v-text="item.protocol">Example Chip</v-chip>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title v-text="item.url"></v-list-tile-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn :to="{name:'edit', query:{ url:item.url, protocol:item.protocol}}" icon="" ripple="">
<v-icon color="grey lighten-1">info</v-icon>
</v-btn>
</v-list-tile-action>
<v-list-tile-action>
<v-btn :to="{name:'multi-edit', query:{ url:item.protocol + ':' +item.url }}" icon="" ripple="">
<v-icon color="grey lighten-1">switch_camera</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
</v-list>
</v-card-text>
</v-card>
</v-container>
`,
data: function(){
return {
message: 'Hello Vue.js!',
items:[]
}
},
methods:{
get() {
HTTP.get('history')
.then((res) => {
this.items = res.data.items;
console.log("items",this.items)
});
}
},
created:function(){
this.get()
console.log("history")
}
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/history/taskhistory.vue
const Taskhistory=Vue.extend({template:`
<v-container fluid="">
<v-progress-linear v-if="loading" v-bind:indeterminate="true"></v-progress-linear>
<v-card>
<v-toolbar>
<v-toolbar-title>
<v-breadcrumbs>
<v-breadcrumbs-item to="/tasks" :exact="true">
Tasks
</v-breadcrumbs-item>
</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>
<vp-entitylink entity="task"></vp-entitylink>
</v-toolbar>
<v-card-text>
<v-data-table :headers="headers" :items="items" hide-actions="" :search="q" class="elevation-1">
<template slot="items" slot-scope="props">
<td><router-link :to="'tasks/' + props.item.to" v-text="props.item.title"></router-link></td>
<td>{{ props.item.description }}</td>
</template>
<template slot="no-data">
<v-alert :value="true" icon="warning">
No matching items.
</v-alert>
</template>
</v-data-table>
</v-card-text>
</v-card>
</v-container>
`,
data(){
return {
items: [],
loading: false,
q: null,
headers: [
{ text: 'Task', value: 'title' },
{ text: 'Description', value: 'description' },
]
}
},
methods:{
getTasks(){
this.loading= true;
HTTP.get("tasks")
.then(r=>{
this.items=r.data;
this.loading= false;
})
}
},
created(){
this.getTasks()
}
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/home.vue
const Home=Vue.extend({template:`
@ -4377,8 +4444,22 @@ const Entity1=Vue.extend({template:`
<div>{{item.description}}</div>
<code>{{item.code}}</code>
</div>
<pre>{{ xml }}</pre>
<v-expansion-panel v-model="panel" expand="">
<v-expansion-panel-content>
<div slot="header" class="title">Code</div>
<pre>{{ xml }}</pre>
</v-expansion-panel-content>
<v-expansion-panel-content>
<div slot="header" class="title">Fields#</div>
<qd-table :headers="headers" data-uri="data/entity.field" entity="entity.field" no-data-msg="Nothing found">
</qd-table>
</v-expansion-panel-content>
</v-expansion-panel>
</v-container>
</v-card>
`,
@ -4391,7 +4472,16 @@ const Entity1=Vue.extend({template:`
},
loading: false,
xml: null
xml: null,
selected: [],
headers: [
{ text: 'Name', value: 'name', align: 'left'},
{ text: 'parent', value: 'parent', align: 'left' },
{text: "type", value: "type"},
{text: "description", value: "description"},
{text: "xpath", value: "xpath"}
],
panel: [true,true]
}
},
methods:{
@ -5489,9 +5579,8 @@ const Runtask=Vue.extend({template:`
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn color="primary" @click="submit()" :loading="loading" :disabled="loading" icon="">
<v-icon>history</v-icon>
</v-btn>
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon></router-link>
<v-btn color="primary" @click="submit()" :loading="loading" :disabled="loading">
<v-icon>play_circle_outline</v-icon>
Run</v-btn>
@ -5521,7 +5610,8 @@ const Runtask=Vue.extend({template:`
return {
loading: false,
snackbar: {show:false,msg:"",context:"success"},
valid: false
valid: false,
id: null
}
},
@ -5531,7 +5621,7 @@ const Runtask=Vue.extend({template:`
this.$refs.params.submit()
.then(r=>{
this.loading= false
this.id=r.data.id;
this.snackbar= {show:true,
msg: r.data && r.data.msg,
context:"success"
@ -5550,7 +5640,7 @@ const Runtask=Vue.extend({template:`
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/tasks/tasks.vue
const Task=Vue.extend({template:`
const Tasks=Vue.extend({template:`
<v-container fluid="">
<v-progress-linear v-if="loading" v-bind:indeterminate="true"></v-progress-linear>
<v-card>
@ -5703,6 +5793,7 @@ const Xqdoc=Vue.extend({template:`
<v-card-title>
<span class="white--text">Task: Generate <code>xqdoc</code></span>
</v-card-title>
<a>{{ id }}</a>
<v-spacer></v-spacer>
<v-btn color="primary" @click="submit()" :loading="waiting" :disabled="waiting">
<v-icon>play_circle_outline</v-icon>
@ -5745,6 +5836,7 @@ const Xqdoc=Vue.extend({template:`
},
waiting:false,
alert:{msg:"",success:false,error:false},
id: null
}
},
methods:{
@ -5753,7 +5845,8 @@ const Xqdoc=Vue.extend({template:`
this.alert={msg:"Loading..",success:false,error:false}
HTTP.post("tasks/xqdoc",Qs.stringify(this.params))
.then(r=>{
this.waiting=false
this.waiting=false;
this.id= r.data.id;
this.alert={msg:r.data.msg,success:true,error:false}
console.log(r.data)
settings.setItem('tasks/xqdoc',this.params)
@ -6281,14 +6374,14 @@ const router = new VueRouter({
{ path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test"} },
{ path: '/login', component: Login,meta:{title:"login"} },
{ path: '/edit', component: Edit,meta:{title:"Ace editor"} },
{ path: '/tabs', name: "multi-edit", component: Tabs,meta:{title:"tab test"} },
{ path: '/edit', name: "edit",component: Edit,meta:{title:"Ace editor"} },
{ path: '/server/users', component: Users,meta:{title:"Users"} },
{ path: '/server/repo', component: Repo,meta:{title:"Repository"} },
{ path: '/files', component: Files,meta:{title:"File system"},props:{protocol:"webfile"} },
{ path: '/database', component: Files,meta:{title:"Databases"},props:{protocol:"xmldb"} },
{ path: '/login', component: Login,meta:{title:"login"} },
{ path: '/settings', component: { template: '<router-view/>' }
,children: [
{
@ -6333,8 +6426,14 @@ const router = new VueRouter({
{ path: 'settings', component: Basexsettings,meta:{title:"BaseX settings"} }
]
},
{ path: '/history', component: History, meta:{title:"File History"} },
{ 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: '/puzzle', component: Puzzle, meta:{title:"Jigsaw"} },
{ path: '/svg', component: Svg, meta:{title:"SVG"} },
{ path: '/svg2', component: Svg2, meta:{title:"SVG2"} },
@ -6346,7 +6445,7 @@ const router = new VueRouter({
{ path: '/logs', component: Log, meta:{title:"Server logs"} },
{ path: '/tasks', component: Task, meta:{title:"Runnable tasks"} },
{ path: '/tasks', component: Tasks, meta:{title:"Runnable tasks"} },
{ path: '/tasks/model', component: Model, meta:{title:"build model"} },
{ path: '/tasks/xqdoc', component: Xqdoc, meta:{title:"build xqdoc"} },
{ path: '/tasks/vuecompile', component: Vuecompile, meta:{title:"vue compile"} },
@ -6514,7 +6613,8 @@ const Vuepoc=Vue.extend({template:`
{href: '/tabs',text: 'Tabs',icon: 'switch_camera'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
{href: '/transform',text: 'XSLT Transform',icon: 'forward'},
{href: '/tasks',text: 'Tasks',icon: 'update'}
{href: '/tasks',text: 'Tasks',icon: 'update'},
{href: '/history/tasks',text: 'history',icon: 'history'}
]},
{
icon: 'folder_open',
@ -6524,7 +6624,7 @@ const Vuepoc=Vue.extend({template:`
{href: '/database', text: 'Databases',icon: 'developer_mode' },
{href: '/files', text: 'File system',icon: 'folder' },
{href: '/history',text: 'history',icon: 'history'}
{href: '/history/files',text: 'history',icon: 'history'}
]},
{
icon: 'memory',

View file

@ -9,8 +9,8 @@
<title>Vue Router Test</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"/>
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"/>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="//unpkg.com/vuetify@1.2.3/dist/vuetify.min.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link rel="stylesheet" href="//unpkg.com/vuetify@1.2.5/dist/vuetify.min.css" type="text/css"/>
<link rel="stylesheet" href="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.css">
<link rel="stylesheet" href="//unpkg.com/vue-form-generator@2.2.2/dist/vfg-core.css"/>
<link rel="stylesheet" href="//unpkg.com/leaflet@1.0.3/dist/leaflet.css"/>
@ -38,7 +38,7 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.1/vue-router.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/axios/0.17.1/axios.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js" crossorigin="anonymous" ></script>
<script src="//unpkg.com/vuetify@1.2.3/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vuetify@1.2.5/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ace.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ext-language_tools.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ext-linking.js" type="text/javascript" charset="utf-8"></script>

View file

@ -0,0 +1,5 @@
java -classpath C:\Users\andy\Desktop\basex.versions\basex.902\lib\jing-20091111.jar com.thaiopensource.relaxng.util.Driver -t schema.rng test.xml
rem echo "OXYGEN"
rem java -classpath C:\Program Files\Oxygen XML Developer 19\lib\jing.jar com.thaiopensource.relaxng.util.Driver schema.rng test.xml

View file

@ -0,0 +1,10 @@
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
element test {
element link{
attribute to{xsd:IDREF}
},
element target{
attribute id{xsd:ID}
}
}

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<element name="test" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<element name="link">
<attribute name="to">
<data type="IDREF"/>
</attribute>
</element>
<element name="target">
<attribute name="id">
<data type="ID"/>
</attribute>
</element>
</element>

View file

@ -0,0 +1,4 @@
<test>
<link to='a' />
<target id='a1' />
</test>