vuetify 1.1.7

This commit is contained in:
Andy Bunce 2018-07-22 22:55:12 +01:00
parent a8dff34139
commit a077b4180f
27 changed files with 4706 additions and 261 deletions

View file

@ -21,13 +21,13 @@ display button that invokes a save favorite form
<v-card-text>
<h6>{{$route.meta.title}}</h6>
<v-select
<v-combobox multiple
v-model="tags"
label="tags"
chips
tags
:items="taglist"
></v-select>
></v-combobox>
</v-card-text>
<v-card-actions>

View file

@ -0,0 +1,69 @@
<!DOCTYPE html>
<!--
manage parameters for query
-->
<template id="vp-paramform">
<v-form ref="form" lazy-validation>
<v-flex v-for="field in fields" :key="field.model">
<v-text-field v-if="field.type === 'xs:anyURI'" xs10
v-model="params[field.model]" :label="field.label"
clearable :rules="fieldrules(field)" box
append-outer-icon="send" @click:append-outer="source(field)"
></v-text-field>
<v-switch v-else-if="field.type === 'xs:boolean'" xs10 :label="field.label" v-model="params[field.model]">
</v-switch>
<v-text-field v-else xs10 amber
v-model="params[field.model]" :label="field.type"
clearable box
></v-text-field>
</v-flex>
<div>{{ description }}</div>
</v-form>
</template>
<script>{
props: ['endpoint'],
data: function(){
return {
fields: [],
params: null,
description: null,
rules: {
required: value => !!value || 'Required.'
}
}
},
methods:{
reset(){
HTTP.get(this.endpoint)
.then(r=>{
this.fields=r.data.fields;
this.description=r.data.description;
this.params = Object.assign({}, this.params, r.data.values);
})
},
source(field){
router.push({ path: 'tabs', query: { url:this.params[field.model]}})
},
clear () {
this.$refs.form.reset()
},
fieldrules(field){
return [this.rules.required];
},
submit(){
return this.params;
},
valid(){
return this.$refs.form.validate()
}
},
created:function(){
this.reset();
}
}</script>

View file

@ -97,12 +97,12 @@
<v-card>
<v-card-title>Select Tab</v-card-title>
<v-card-actions>
<v-select :items="sorted" v-model="a1"
<v-autocomplete :items="sorted" v-model="a1"
label="File" class="input-group--focused"
item-text="name" item-value="id"
autocomplete @change="setItem"
@change="setItem"
clearable open-on-clear
></v-select>
></v-autocomplete>
</v-card-actions>
</v-card>
</v-menu>

View file

@ -88,11 +88,11 @@
</v-toolbar>
<v-card-text>
<v-select
<v-autocomplete
v-bind:items="keywords"
v-model="query.keyword"
label="Keyword" item-value="text" item-text="text"
autocomplete clearable
clearable
>
<template slot="item" slot-scope="data">
<v-list-tile-content>
@ -100,7 +100,7 @@
<v-list-tile-sub-title v-html="data.item.count"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-select>
</v-autocomplete>
<v-menu
lazy

View file

@ -10,18 +10,18 @@
<v-card-text>
<p>Read or increment a database value. This measures round trip times browser-database-browser.</p>
<h3>Counter: <v-chip color="amber" text-color="white">{{counter}}</v-chip></h3>
<table class="table">
<table >
<thead>
<tr>
<th>Action</th>
<th>Once</th>
<th >Repeat</th>
<th >Last</th>
<th >Count</th>
<th >Avg</th>
<th >min</th>
<th >max</th>
<th>Median</th>
<th xs1>Action</th>
<th xs1>Once</th>
<th xs1>Repeat</th>
<th xs1>Last</th>
<th xs1>Count</th>
<th xs1>Avg</th>
<th xs1>min</th>
<th xs1>max</th>
<th xs1>Median</th>
</tr>
</thead>
<tbody>

View file

@ -18,7 +18,7 @@
<p>some text</p>
<v-select
<v-autocomplete
label="Select"
v-bind:items="options"
v-model="value"
@ -26,12 +26,11 @@
item-value="name"
chips
max-height="auto"
autocomplete
clearable
deletable-chips
>
</v-select>
</v-autocomplete>
<pre>{{$data.value }}</pre>
</v-flex>

View file

@ -77,6 +77,13 @@
},
computed:{
code(){return 'import module namespace entity = "quodatum.models.generated" at "'+this.params.target+'";'}
}
},
created:function(){
var task=this.task
HTTP.get("tasks/model")
.then(r=>{
console.log(r);
})
},
}
</script>

View file

@ -7,25 +7,31 @@
module namespace vue-api = 'quodatum:vue.api';
import module namespace bf = 'quodatum.tools.buildfields' at "./../../../lib/entity-gen.xqm";
import module namespace query-a = 'vue-poc/query-a' at "../../../lib/query-a.xqm";
declare variable $vue-api:query:="tx-model.xq";
(:~
: Returns a file content.
:)
declare
%rest:POST %rest:path("/vue-poc/api/tasks/model")
%rest:form-param("efolder", "{$efolder}")
%rest:form-param("target", "{$target}")
%rest:produces("application/json")
%output:method("json")
%updating
function vue-api:model($efolder ,$target )
function vue-api:model( )
{
let $config:='import module namespace cfg = "quodatum:media.image.configure" at "config.xqm";'
let $src:=bf:module(bf:entities($efolder),$config)
return (
prof:variables(),
file:write-text($target,$src),
update:output(<json type="object"><msg>Updated: {$target}</msg></json>)
)
resolve-uri($vue-api:query)=>query-a:update(query-a:params())
};
(:~
: model settings.
:)
declare
%rest:GET %rest:path("/vue-poc/api/tasks/model")
%rest:produces("application/json")
%output:method("json")
function vue-api:settings()
{
let $xq:=resolve-uri($vue-api:query)
return query-a:fields($xq)
};

View file

@ -0,0 +1,27 @@
(:~
: Update `generated/models.xqm` from XML files in `data/models`
:)
import module namespace bf = 'quodatum.tools.buildfields' at "./../../../lib/entity-gen.xqm";
(:~
: Folder containing model definitions as xml
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities
:)
declare variable $efolder as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities";
(:~
: Path to xqm file to generate
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models.gen.xqm
:)
declare variable $target as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models.gen.xqm";
let $config:='import module namespace cfg = "quodatum:media.image.configure" at "config.xqm";'
let $src:=bf:module(bf:entities($efolder),$config)
return (
prof:variables(),
file:write-text($target,$src),
update:output(<json type="object"><msg>Updated: {$target}</msg></json>)
)

View file

@ -2,6 +2,7 @@
: tasks
:)
module namespace vue-rest = 'quodatum:vue.tasks';
import module namespace query-a = 'vue-poc/query-a' at "../../lib/query-a.xqm";
(:~
: list tasks
@ -12,10 +13,12 @@ declare
%output:method("json")
function vue-rest:tasks()
{
let $tasks:=doc("taskdef.xml")/tasks/task
let $tasks:=doc("taskdef.xml")/tasks/task[@url]
return <json type="array">{
$tasks!<_ type="object">
<to>{ @name/string() }</to>
<url>{ @url/string() }</url>
<title>{ title/text() }</title>
<description>{ fn:serialize(description/node()) }</description>
</_>
@ -31,12 +34,10 @@ declare
%output:method("json")
function vue-rest:task($task)
{
let $tasks:=doc("taskdef.xml")/tasks/task[@name=$task]
return <json type="object">
<to>{ $tasks/@name/string() }</to>
<text>{ $tasks/title/string() }</text>
<params>{ count($tasks/params/*) }</params>
</json>
let $task:=doc("taskdef.xml")/tasks/task[@name=$task]
let $url:=resolve-uri($task/@url)
let $info:=query-a:fields($url)
return $info
};
(:~
@ -48,12 +49,9 @@ declare
%output:method("json")
function vue-rest:runtask($task)
{
let $tasks:=doc("taskdef.xml")/tasks/task
return <json type="array">{
$tasks!<_ type="object">
<to>{ @name/string() }</to>
<text>{ title/text() }</text>
</_>
}</json>
let $task:=doc("taskdef.xml")/tasks/task[@name=$task]
let $url:=resolve-uri($task/@url)
return query-a:run($url,query-a:params())
};

View file

@ -7,6 +7,13 @@
<v-card-title >
<span class="white--text">Task: {{ task }}</span>
</v-card-title>
<v-spacer></v-spacer>
<v-btn @click="$refs.params.clear()" :loading="loading"
:disabled="loading"
>Clear</v-btn>
<v-btn @click="$refs.params.reset()" :loading="loading"
:disabled="loading"
>Reset</v-btn>
<v-spacer></v-spacer>
<v-btn color="primary" @click="submit()" :loading="waiting"
:disabled="waiting">
@ -17,16 +24,10 @@
<v-container fluid>
<v-layout row wrap>
<v-flex xs12>
<v-text-field v-model="params.proj"
label="vue project to compile"
></v-text-field>
</v-flex>
</v-layout>
<v-layout row wrap>
<v-flex xs12>
<code>{{code}}</code>
<vp-paramform ref="params" :endpoint="'tasks/'+task"></vp-paramform>
</v-flex>
</v-layout>
</v-container>
</v-card-text>
@ -47,22 +48,21 @@
props:["task"],
data: function(){
return {
params:{
proj:"C:/Users/andy/git/vue-poc/src/vue-poc/"
},
waiting:false,
snackbar:{show:false,msg:"",context:"success"},
valid: false
}
},
methods:{
submit(){
this.waiting=true
HTTP.post("tasks/" + this.task, Qs.stringify(this.params))
this.waiting=true;
var params=this.$refs.params.submit();
HTTP.post("tasks/" + this.task, Qs.stringify(params))
.then(r=>{
this.waiting=false
this.snackbar={show:true,msg:r.data.msg,context:"success"}
console.log(r.data)
settings.setItem('tasks/vuecompile',this.params)
})
.catch(error=>{
this.waiting=false
@ -71,14 +71,6 @@
});
}
},
created:function(){
var task=this.task
HTTP.get("tasks/"+task)
.then(r=>{
console.log(r);
alert("OK");
})
},
computed:{
code(){return 'code here'}
}

View file

@ -0,0 +1,25 @@
(:~
: import to db
: @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";
(:~ base db path for import files
: @default /
:)
declare variable $targetpath as xs:anyURI external :="/";
(:~ unused boolean test
: @default true
:)
declare variable $boolean as xs:boolean external :=false();
let $result:=<json type="object"><hello>TODO</hello></json>
return $result

View file

@ -0,0 +1,57 @@
(:~
: create new app
: @author andy bunce
: @since july 2018
:)
(:~
: name of the app to create
: @default myapp
:)
declare variable $name as xs:string external :="myapp";
(:~
: new app
:)
declare function local:new($name as xs:string){
let $archive:=file:read-binary(fn:resolve-uri('./data/vuetif.zip'))
let $contents := archive:extract-binary($archive)
let $entries:= archive:entries($archive)
(: update paths :)
let $entries:=$entries!fn:replace(.,'vuetif',$name)
let $contents:=$contents!local:update-extract(.,'[Vv]uetif',$name)
return archive:create($entries,$contents)
};
(:~
: test for text
: @see http://stackoverflow.com/questions/2644938/how-to-tell-binary-from-text-files-in-linux
:)
declare function local:is-text($b as xs:base64Binary )
as xs:boolean{
fn:empty(bin:find($b, 0,bin:hex("00")))
};
(:~
: if context is text replace string else return unchanged
:)
declare function local:update-extract($extract as xs:base64Binary,
$from as xs:string,
$to as xs:string )
as xs:base64Binary{
if(local:is-text($extract))
then try{
(: escape chars etc :)
let $t:=convert:binary-to-string($extract)
let $t:=fn:replace($t,$from,$to)
return convert:string-to-base64($t)
} catch * {
$extract
}
else
$extract
};
update:output(<json type="object"><msg> { $name }.</msg></json>)

View file

@ -1,35 +1,31 @@
<tasks>
<task name="tasks/model">
<task name="model" url="model.build/tx-model.xq">
<title>Generate model.gen.xqm</title>
<description> Generate
<code>model.gen.xqm</code></description>
<params>
<param name="efolder">Folder containing model definitions as xml</param>
<param name="target">Path to xqm file to generate</param>
</params>
</task>
<task name="tasks/import">
<task name="import" url="task/tx-dbimport.xq">
<title>Load files into database</title>
<description>Load files into database</description>
</task>
<task name="tasks/xqdoc">
<task name="xqdoc" url="xqdoc/tx-xqdoc.xq">
<title>XQdoc</title>
<description>Generate XQdoc to db</description>
<description>Generate documentation for folder</description>
</task>
<task name="tasks/xqdocdb">
<task name="xqdocdb">
<title>XQdoc to db</title>
<description>Generate XQdoc to save</description>
</task>
<task name="tasks/vuecompile">
<task name="vuecompile">
<title>vue compile</title>
<description>compile</description>
</task>
<task name="tasks/newapp">
<task name="newapp" url="task/tx-newapp.xq">
<title>application template</title>
<description>application template</description>
<params>

View file

@ -5,7 +5,7 @@
<v-progress-linear v-if="loading" v-bind:indeterminate="true" ></v-progress-linear>
<ul>
<li v-for="task in tasks" :key="task.to">
<router-link :to="task.to" v-text="task.title"></router-link>
<router-link :to="'tasks/' + task.to" v-text="task.title"></router-link>
<div v-html="task.description"></div>
</li>
</ul>

View file

@ -0,0 +1,20 @@
(:~
: vue compile
: @author andy bunce
: @since july 2018
:)
import module namespace vue = 'quodatum:vue.compile' at "../../../lib/vue-compile/vue-compile.xqm";
(:~ URL of the doc to validate
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml
:)
declare variable $doc as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities/adminlog.xml";
(:~ URL of the schema to use
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd
:)
declare variable $schema as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/schemas/entity.xsd";
let $result:=<json type="object"><hello>TODO</hello></json>
return $result

View file

@ -2,14 +2,11 @@
: Generate html for for XQuery sources
:)
module namespace vue-api = 'quodatum:vue.api';
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
import module namespace query-a = 'vue-poc/query-a' at "../../../lib/query-a.xqm";
import module namespace fw="quodatum:file.walker";
declare namespace c="http://www.w3.org/ns/xproc-step";
import module namespace query-a = 'vue-poc/query-a' at "../../../lib/query-a.xqm";
declare variable $vue-api:query:="tx-xqdoc.xq";
declare variable $vue-api:state as element(state):=db:open("vue-poc","/state.xml")/state;
(:~
: run xqdoc task.

View file

@ -26,6 +26,7 @@ let $opts:=map{
}
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>

View file

@ -1,15 +1,7 @@
<!DOCTYPE html>
<template id="validate">
<v-container fluid >
<v-snackbar v-model="snackbar.show"
:timeout="6000"
:success="snackbar.context === 'success'"
:error="snackbar.context === 'error'"
>
{{ snackbar.msg }}
<v-btn dark flat @click="snackbar.show = false">Close</v-btn>
</v-snackbar>
<v-card>
<v-card>
<v-toolbar class="orange">
@ -17,15 +9,15 @@
><v-icon>play_circle_outline</v-icon>validate</v-btn>
<span v-text="elapsed">?</span>ms.
<v-spacer></v-spacer>
<v-btn @click="clear" :loading="loading"
<v-btn @click="$refs.params.clear()" :loading="loading"
:disabled="loading"
>Clear</v-btn>
<v-btn @click="settings" :loading="loading"
<v-btn @click="$refs.params.reset()" :loading="loading"
:disabled="loading"
>Reset</v-btn>
<v-btn @click="valid2" :loading="loading"
<v-btn :loading="loading"
:disabled="loading"
>is ok?</v-btn>
<v-menu offset-y left>
@ -44,18 +36,11 @@
<v-container fluid>
<v-layout row wrap>
<v-flex xs8>
<v-form ref="form" v-model="valid" lazy-validation>
<v-flex v-for="field in fields" :key="field.model" >
<v-text-field xs10
v-model="params[field.model]" :label="field.label"
clearable :rules="[rules.required]" box
append-outer-icon="send" @click:append-outer="source(field)"
></v-text-field>
</v-flex>
</v-form>
<v-flex >
<vp-paramform ref="params" endpoint="validate"></vp-paramform>
</v-flex>
<v-flex xs4 green fill-height style="height:100%;overflow:scroll">
<v-flex green fill-height >
<vp-validationreport :report="result"></vp-validationreport>
</v-flex>
</v-layout>
@ -72,13 +57,7 @@
loading: false,
elapsed: null,
height: null,
result: null,
fields:[],
rules: {
required: value => !!value || 'Required.'
},
params:null,
snackbar:{show:false,msg:"",context:"success"}
result: null
}
},
methods:{
@ -90,33 +69,22 @@
//console.log("resize h",h,el.style)
el.style.height=h +"px";
},
submit () {
if (this.$refs.form.validate()) {
submit () {
if (this.$refs.params.valid()) {
// Native form submission is not yet supported
this.validate()
}
},
clear () {
this.$refs.form.reset()
},
rules(field){
return [field.required?this.rules.required:[]];
},
source(field){
console.log("field: ",field);
router.push({ path: 'tabs', query: { url:this.params[field.model]}})
},
valid2(){
alert("State:"+ this.$refs.form.validate());
this.$refs.params.clear();
},
validate(){
this.loading=true
this.start = performance.now();
HTTP.post("validate",Qs.stringify(this.params))
var params=this.$refs.params.submit();
HTTP.post("validate",Qs.stringify(params))
.then(r=>{
console.log(r);
this.snackbar={show:true,msg:r.data.msg,context:"success"};
this.elapsed=Math.floor(performance.now() - this.start);
this.loading=false
if(r.data.rc==0){
this.result=r.data
@ -126,31 +94,11 @@
})
.catch(r=> {
console.log("error",r.response.data)
this.snackbar={show: true, msg: r.response.data, context: "error"}
this.result=r.message + ": "+ r.config.url + "\n"+ r.response.data
this.loading=false
});
},
settings(){
HTTP.get("validate")
.then(r=>{
this.fields=r.data.fields;
this.params = Object.assign({}, this.params, r.data.values)
console.log("settings",this.params);
})
},
isvalid(){
return this.$refs && this.$refs.form && this.$refs.form.validate()
}
},
computed:{
valid(){
console.log("valid------------")
return this.$refs && this.$refs.form && this.$refs.form.validate()
}},
created: function(){
this.settings();
}
}
</script>

View file

@ -12,10 +12,12 @@ import module namespace request = "http://exquery.org/ns/request";
declare function query-a:fields($mod as xs:anyURI)
as element(json)
{
let $updating:=xquery:parse-uri($mod)/@updating/string()
let $d:=inspect:module($mod)
let $vars:=$d/variable[@external="true"]
return <json type="object">
<description>{ $d/description/string() }</description>
<updating type="boolean" >{ $updating }</updating>
<fields type="array">{
$vars!
<_ type="object">

View file

@ -1,5 +1,5 @@
(: entity access maps
: auto generated from xml files in entities folder at: 2018-07-12T21:56:08.166+01:00
: auto generated from xml files in entities folder at: 2018-07-17T22:21:31.112+01:00
:)
module namespace entity = 'quodatum.models.generated';

View file

@ -36,7 +36,7 @@ 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",requiresAuth: true} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test"} },
{ path: '/login', component: Login,meta:{title:"login"} },
{ path: '/edit', component: Edit,meta:{title:"Ace editor"} },
{ path: '/server/users', component: Users,meta:{title:"Users"} },
@ -48,7 +48,7 @@ const router = new VueRouter({
,children: [
{
path: '',
component: Settings, meta:{title:"Settings"}
component: Settings, meta:{title:"Settings", requiresAuth:true}
},
{
path: 'keys',
@ -67,7 +67,7 @@ const router = new VueRouter({
,children: [
{
path: '',
component: Settings, meta:{title:"Settings"}
component: Settings, meta:{title:"Settings ***", requiresAuth:true }
},
{
path: 'logs', name:"logs",
@ -79,6 +79,7 @@ const router = new VueRouter({
component: Logadd,
meta:{title:"add Server logs"}
},
{ path: 'jobs', name:"jobs", component: Jobs, meta:{title:"Jobs running"} },
{ path: 'jobs/:job', name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} },
{ path: 'ping', component: Ping,meta:{title:"Ping"} }
@ -122,10 +123,12 @@ router.afterEach(function(route) {
});
router.beforeEach((to, from, next) => {
console.log("before: ",to)
if (to.matched.some(record => record.meta.requiresAuth)) {
// this route requires auth, check if logged in
// if not, redirect to login page.
if ("admin"==Auth.permission) {
console.log("matched: ",Auth)
if ("admin"!=Auth.permission) {
next({
path: '/login',
query: { redirect: to.fullPath }

View file

@ -1,4 +1,4 @@
// generated 2018-07-15T22:47:31.919+01:00
// generated 2018-07-22T22:53:58.139+01:00
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
Vue.component('qd-autoheight',{template:`
@ -352,7 +352,7 @@ Vue.component('vp-favorite',{template:`
<v-card-text>
<h6>{{$route.meta.title}}</h6>
<v-select v-model="tags" label="tags" chips="" tags="" :items="taglist"></v-select>
<v-combobox multiple="" v-model="tags" label="tags" chips="" tags="" :items="taglist"></v-combobox>
</v-card-text>
<v-card-actions>
@ -542,6 +542,65 @@ Vue.component('vp-notifications',{template:`
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-paramform.vue
Vue.component('vp-paramform',{template:`
<v-form ref="form" lazy-validation="">
<v-flex v-for="field in fields" :key="field.model">
<v-text-field v-if="field.type === 'xs:anyURI'" xs10="" v-model="params[field.model]" :label="field.label" clearable="" :rules="fieldrules(field)" box="" append-outer-icon="send" @click:append-outer="source(field)"></v-text-field>
<v-switch v-else-if="field.type === 'xs:boolean'" xs10="" :label="field.label" v-model="params[field.model]">
</v-switch>
<v-text-field v-else="" xs10="" amber="" v-model="params[field.model]" :label="field.type" clearable="" box=""></v-text-field>
</v-flex>
<div>{{ description }}</div>
</v-form>
`,
props: ['endpoint'],
data: function(){
return {
fields: [],
params: null,
description: null,
rules: {
required: value => !!value || 'Required.'
}
}
},
methods:{
reset(){
HTTP.get(this.endpoint)
.then(r=>{
this.fields=r.data.fields;
this.description=r.data.description;
this.params = Object.assign({}, this.params, r.data.values);
})
},
source(field){
router.push({ path: 'tabs', query: { url:this.params[field.model]}})
},
clear () {
this.$refs.form.reset()
},
fieldrules(field){
return [this.rules.required];
},
submit(){
return this.params;
},
valid(){
return this.$refs.form.validate()
}
},
created:function(){
this.reset();
}
}
);
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-selectpath.vue
Vue.component('vp-selectpath',{template:`
<v-dialog v-model="frmfav" persistent="" max-width="800">
@ -2308,7 +2367,7 @@ const Tabs=Vue.extend({template:`
<v-card>
<v-card-title>Select Tab</v-card-title>
<v-card-actions>
<v-select :items="sorted" v-model="a1" label="File" class="input-group--focused" item-text="name" item-value="id" autocomplete="" @change="setItem" clearable="" open-on-clear=""></v-select>
<v-autocomplete :items="sorted" v-model="a1" label="File" class="input-group--focused" item-text="name" item-value="id" @change="setItem" clearable="" open-on-clear=""></v-autocomplete>
</v-card-actions>
</v-card>
</v-menu>
@ -3316,14 +3375,14 @@ const Images=Vue.extend({template:`
</v-toolbar>
<v-card-text>
<v-select v-bind:items="keywords" v-model="query.keyword" label="Keyword" item-value="text" item-text="text" autocomplete="" clearable="">
<v-autocomplete v-bind:items="keywords" v-model="query.keyword" label="Keyword" item-value="text" item-text="text" clearable="">
<template slot="item" slot-scope="data">
<v-list-tile-content>
<v-list-tile-title v-html="data.item.text"></v-list-tile-title>
<v-list-tile-sub-title v-html="data.item.count"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-select>
</v-autocomplete>
<v-menu lazy="" :close-on-content-click="false" v-model="menu2" transition="scale-transition" offset-y="" full-width="" :nudge-left="40" max-width="290px">
<v-text-field slot="activator" label="Earliest date" v-model="query.from" prepend-icon="event" readonly=""></v-text-field>
@ -4236,18 +4295,18 @@ const Ping=Vue.extend({template:`
<v-card-text>
<p>Read or increment a database value. This measures round trip times browser-database-browser.</p>
<h3>Counter: <v-chip color="amber" text-color="white">{{counter}}</v-chip></h3>
<table class="table">
<table>
<thead>
<tr>
<th>Action</th>
<th>Once</th>
<th>Repeat</th>
<th>Last</th>
<th>Count</th>
<th>Avg</th>
<th>min</th>
<th>max</th>
<th>Median</th>
<th xs1="">Action</th>
<th xs1="">Once</th>
<th xs1="">Repeat</th>
<th xs1="">Last</th>
<th xs1="">Count</th>
<th xs1="">Avg</th>
<th xs1="">min</th>
<th xs1="">max</th>
<th xs1="">Median</th>
</tr>
</thead>
<tbody>
@ -4644,9 +4703,9 @@ const Select=Vue.extend({template:`
<p>some text</p>
<v-select label="Select" v-bind:items="options" v-model="value" item-text="name" item-value="name" chips="" max-height="auto" autocomplete="" clearable="" deletable-chips="">
<v-autocomplete label="Select" v-bind:items="options" v-model="value" item-text="name" item-value="name" chips="" max-height="auto" clearable="" deletable-chips="">
</v-select>
</v-autocomplete>
<pre>{{$data.value }}</pre>
</v-flex>
@ -5062,7 +5121,14 @@ const Model=Vue.extend({template:`
},
computed:{
code(){return 'import module namespace entity = "quodatum.models.generated" at "'+this.params.target+'";'}
}
},
created:function(){
var task=this.task
HTTP.get("tasks/model")
.then(r=>{
console.log(r);
})
},
}
);
@ -5076,6 +5142,9 @@ const Runtask=Vue.extend({template:`
<v-card-title>
<span class="white--text">Task: {{ task }}</span>
</v-card-title>
<v-spacer></v-spacer>
<v-btn @click="$refs.params.clear()" :loading="loading" :disabled="loading">Clear</v-btn>
<v-btn @click="$refs.params.reset()" :loading="loading" :disabled="loading">Reset</v-btn>
<v-spacer></v-spacer>
<v-btn color="primary" @click="submit()" :loading="waiting" :disabled="waiting">
<v-icon>play_circle_outline</v-icon>
@ -5085,14 +5154,10 @@ const Runtask=Vue.extend({template:`
<v-container fluid="">
<v-layout row="" wrap="">
<v-flex xs12="">
<v-text-field v-model="params.proj" label="vue project to compile"></v-text-field>
</v-flex>
</v-layout>
<v-layout row="" wrap="">
<v-flex xs12="">
<code>{{code}}</code>
<vp-paramform ref="params" :endpoint="'tasks/'+task"></vp-paramform>
</v-flex>
</v-layout>
</v-container>
</v-card-text>
@ -5108,22 +5173,21 @@ const Runtask=Vue.extend({template:`
props:["task"],
data: function(){
return {
params:{
proj:"C:/Users/andy/git/vue-poc/src/vue-poc/"
},
waiting:false,
snackbar:{show:false,msg:"",context:"success"},
valid: false
}
},
methods:{
submit(){
this.waiting=true
HTTP.post("tasks/" + this.task, Qs.stringify(this.params))
this.waiting=true;
var params=this.$refs.params.submit();
HTTP.post("tasks/" + this.task, Qs.stringify(params))
.then(r=>{
this.waiting=false
this.snackbar={show:true,msg:r.data.msg,context:"success"}
console.log(r.data)
settings.setItem('tasks/vuecompile',this.params)
})
.catch(error=>{
this.waiting=false
@ -5132,14 +5196,6 @@ const Runtask=Vue.extend({template:`
});
}
},
created:function(){
var task=this.task
HTTP.get("tasks/"+task)
.then(r=>{
console.log(r);
alert("OK");
})
},
computed:{
code(){return 'code here'}
}
@ -5154,7 +5210,7 @@ const Task=Vue.extend({template:`
<v-progress-linear v-if="loading" v-bind:indeterminate="true"></v-progress-linear>
<ul>
<li v-for="task in tasks" :key="task.to">
<router-link :to="task.to" v-text="task.title"></router-link>
<router-link :to="'tasks/' + task.to" v-text="task.title"></router-link>
<div v-html="task.description"></div>
</li>
</ul>
@ -5495,22 +5551,18 @@ created:function(){
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/validate/validate.vue
const Validate=Vue.extend({template:`
<v-container fluid="">
<v-snackbar v-model="snackbar.show" :timeout="6000" :success="snackbar.context === 'success'" :error="snackbar.context === 'error'">
{{ snackbar.msg }}
<v-btn dark="" flat="" @click="snackbar.show = false">Close</v-btn>
</v-snackbar>
<v-card>
<v-card>
<v-toolbar class="orange">
<v-btn @click="submit" :loading="loading" :disabled="false"><v-icon>play_circle_outline</v-icon>validate</v-btn>
<span v-text="elapsed">?</span>ms.
<v-spacer></v-spacer>
<v-btn @click="clear" :loading="loading" :disabled="loading">Clear</v-btn>
<v-btn @click="settings" :loading="loading" :disabled="loading">Reset</v-btn>
<v-btn @click="$refs.params.clear()" :loading="loading" :disabled="loading">Clear</v-btn>
<v-btn @click="$refs.params.reset()" :loading="loading" :disabled="loading">Reset</v-btn>
<v-btn @click="valid2" :loading="loading" :disabled="loading">is ok?</v-btn>
<v-btn :loading="loading" :disabled="loading">is ok?</v-btn>
<v-menu offset-y="" left="">
<v-btn icon="" slot="activator"><v-icon>settings</v-icon></v-btn>
<v-card>
@ -5527,14 +5579,11 @@ const Validate=Vue.extend({template:`
<v-container fluid="">
<v-layout row="" wrap="">
<v-flex xs8="">
<v-form ref="form" v-model="valid" lazy-validation="">
<v-flex v-for="field in fields" :key="field.model">
<v-text-field xs10="" v-model="params[field.model]" :label="field.label" clearable="" :rules="[rules.required]" box="" append-outer-icon="send" @click:append-outer="source(field)"></v-text-field>
</v-flex>
</v-form>
<v-flex>
<vp-paramform ref="params" endpoint="validate"></vp-paramform>
</v-flex>
<v-flex xs4="" green="" fill-height="" style="height:100%;overflow:scroll">
<v-flex green="" fill-height="">
<vp-validationreport :report="result"></vp-validationreport>
</v-flex>
</v-layout>
@ -5550,13 +5599,7 @@ const Validate=Vue.extend({template:`
loading: false,
elapsed: null,
height: null,
result: null,
fields:[],
rules: {
required: value => !!value || 'Required.'
},
params:null,
snackbar:{show:false,msg:"",context:"success"}
result: null
}
},
methods:{
@ -5568,33 +5611,22 @@ const Validate=Vue.extend({template:`
//console.log("resize h",h,el.style)
el.style.height=h +"px";
},
submit () {
if (this.$refs.form.validate()) {
submit () {
if (this.$refs.params.valid()) {
// Native form submission is not yet supported
this.validate()
}
},
clear () {
this.$refs.form.reset()
},
rules(field){
return [field.required?this.rules.required:[]];
},
source(field){
console.log("field: ",field);
router.push({ path: 'tabs', query: { url:this.params[field.model]}})
},
valid2(){
alert("State:"+ this.$refs.form.validate());
this.$refs.params.clear();
},
validate(){
this.loading=true
this.start = performance.now();
HTTP.post("validate",Qs.stringify(this.params))
var params=this.$refs.params.submit();
HTTP.post("validate",Qs.stringify(params))
.then(r=>{
console.log(r);
this.snackbar={show:true,msg:r.data.msg,context:"success"};
this.elapsed=Math.floor(performance.now() - this.start);
this.loading=false
if(r.data.rc==0){
this.result=r.data
@ -5604,32 +5636,12 @@ const Validate=Vue.extend({template:`
})
.catch(r=> {
console.log("error",r.response.data)
this.snackbar={show: true, msg: r.response.data, context: "error"}
this.result=r.message + ": "+ r.config.url + "\n"+ r.response.data
this.loading=false
});
},
settings(){
HTTP.get("validate")
.then(r=>{
this.fields=r.data.fields;
this.params = Object.assign({}, this.params, r.data.values)
console.log("settings",this.params);
})
},
isvalid(){
return this.$refs && this.$refs.form && this.$refs.form.validate()
}
},
computed:{
valid(){
console.log("valid------------")
return this.$refs && this.$refs.form && this.$refs.form.validate()
}},
created: function(){
this.settings();
}
}
);
@ -5862,7 +5874,7 @@ 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",requiresAuth: true} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test"} },
{ path: '/login', component: Login,meta:{title:"login"} },
{ path: '/edit', component: Edit,meta:{title:"Ace editor"} },
{ path: '/server/users', component: Users,meta:{title:"Users"} },
@ -5874,7 +5886,7 @@ const router = new VueRouter({
,children: [
{
path: '',
component: Settings, meta:{title:"Settings"}
component: Settings, meta:{title:"Settings", requiresAuth:true}
},
{
path: 'keys',
@ -5893,7 +5905,7 @@ const router = new VueRouter({
,children: [
{
path: '',
component: Settings, meta:{title:"Settings"}
component: Settings, meta:{title:"Settings ***", requiresAuth:true }
},
{
path: 'logs', name:"logs",
@ -5905,6 +5917,7 @@ const router = new VueRouter({
component: Logadd,
meta:{title:"add Server logs"}
},
{ path: 'jobs', name:"jobs", component: Jobs, meta:{title:"Jobs running"} },
{ path: 'jobs/:job', name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} },
{ path: 'ping', component: Ping,meta:{title:"Ping"} }
@ -5948,10 +5961,12 @@ router.afterEach(function(route) {
});
router.beforeEach((to, from, next) => {
console.log("before: ",to)
if (to.matched.some(record => record.meta.requiresAuth)) {
// this route requires auth, check if logged in
// if not, redirect to login page.
if ("admin"==Auth.permission) {
console.log("matched: ",Auth)
if ("admin"!=Auth.permission) {
next({
path: '/login',
query: { redirect: to.fullPath }

View file

@ -11,7 +11,7 @@
<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.1.4/dist/vuetify.min.css" rel="stylesheet" type="text/css"/>
<link href="//unpkg.com/vuetify@1.1.7/dist/vuetify.min.css" rel="stylesheet" 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 href="/vue-poc/ui/app.css" rel="stylesheet" type="text/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.1.4/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vuetify@1.1.7/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ext-language_tools.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ext-linking.js" type="text/javascript" charset="utf-8"></script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
import module namespace schematron = "http://github.com/Schematron/schematron-basex";
let $sch := schematron:compile(doc('C:\Users\andy\git\vue-poc\src\vue-poc\static\resources\schematron\docbook-mods.sch'))
let $xml := fn:doc('C:\Users\andy\git\vue-poc\src\vue-poc\static\resources\schematron\test.xml')
let $validation := schematron:validate($xml, $sch)
return $validation