vuetify 1.0.0-beta 5

This commit is contained in:
Andy Bunce 2018-01-29 09:44:30 +00:00
parent a6332894cd
commit df59344aca
34 changed files with 963 additions and 439 deletions

View file

@ -62,7 +62,10 @@ function vue-api:test-select($q )
{
<json type="object" >
<items type="array">
{(1 to 100)!(<_>A{.}</_>)}
{(1 to 100)!(<_ type="object">
<name>A{ . }</name>
<value>V{ . }</value>
</_>)}
</items>
</json>
};

View file

@ -5,22 +5,37 @@
absolute
v-model="showNotifications"
right
clipped
:disable-route-watcher="true"
app
width="500"
>
<v-card>
<v-toolbar class="teal white--text">
<v-toolbar class="amber white--text">
<v-toolbar-title >Notifications </v-toolbar-title>
{{ $notification.nextId }}
<v-spacer></v-spacer>
<v-btn @click="showNotifications = false" icon><v-icon>close</v-icon></v-btn>
</v-toolbar>
<v-card-text>
<ul>
<li v-for="msg in $notification.messages" :key="msg.index">
{{msg.text}}
</li>
</ul>
<v-list three-line>
<template v-for="msg in $notification.messages" >
<v-list-tile avatar v-bind:key="msg.index" @click="">
<v-list-tile-avatar>
<v-icon color="red">swap_horiz</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-tooltip>
<v-list-tile-title slot="activator">{{ msg.created | fromNow("from") }}</v-list-tile-title>
<span v-text="msg.created"></span>
</v-tooltip>
<v-list-tile-sub-title v-html="msg.text"></v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-list-tile-action-text>{{ msg.index }}</v-list-tile-action-text>
</v-list-tile-action>
</v-list-tile>
</template>
</v-list>
</v-card-text>
</v-card>
</v-navigation-drawer>
@ -107,7 +122,10 @@
</v-menu>
<qd-fullscreen></qd-fullscreen>
<v-btn @click="showNotifications = ! showNotifications" icon flat title="Notifications">
<v-badge overlap color="orange">
<span slot="badge" v-if=" $notification.unseen" >{{ $notification.unseen }}</span>
<v-icon>notifications</v-icon>
</v-badge>
</v-btn>
</v-toolbar>
@ -211,7 +229,7 @@
]},
{href: '/settings',text: 'Settings',icon: 'settings' },
{href: '/about',text: 'About', icon: 'help' },
{href: '/about',text: 'About (v1.1.1)' , icon: 'help' },
]
}},
@ -238,9 +256,13 @@
alert("@TODO")
}
},
watch: {
showNotifications: function (val) {
console.log("showNotifications",val);
if(!val)this.$notification.unseen=0;
}
},
created(){
console.log("create-----------")
var that=this
this.$on("theme",this.onDark)
@ -252,19 +274,6 @@
that.showAlert("vue error:\n"+msg)
//alert("vue error");
};
// Add a response interceptor
HTTP.interceptors.response.use(
(response)=> {
// Do something with response data
return response;
},
(error) =>{
// interupt restxq single
console.log("$$$$$$$$$$$",error)
if(460 != error.response.status)this.showAlert("http error:\n"+error.response.data)
return Promise.reject(error);
});
HTTP.get("status")
.then(r=>{

View file

@ -6,7 +6,9 @@
Vue.filter("formatDate", function(date) {
return moment(date).format("MMMM D, YYYY")
});
Vue.filter("fromNow", function(date) {
return moment(date).fromNow()
});
Vue.filter('readablizeBytes', function (bytes,decimals) {
if(bytes == 0) return '0 Bytes';
var k = 1000,

View file

@ -4,64 +4,41 @@ for nav drawer
-->
<template id="qd-navlist">
<v-list dense>
<template v-for="(item, i) in items">
<v-layout
row
v-if="item.heading"
align-center
:key="i"
>
<v-flex xs6>
<v-subheader v-if="item.heading">
{{ item.heading }}
</v-subheader>
</v-flex>
<v-flex xs6 class="text-xs-center">
<a href="#!" class="body-2 black--text">EDIT</a>
</v-flex>
</v-layout>
<v-list-group v-else-if="item.children" v-model="item.model" no-action>
<v-list-tile :to="item.href" ripple slot="item">
<v-list-tile-action>
<v-icon>{{ item.icon }}</v-icon>
</v-list-tile-action>
<v-list-tile-title>
{{ item.text }}
</v-list-tile-title>
<v-spacer></v-spacer>
<v-list-tile-action>
<v-icon>{{ item.model ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</v-icon>
</v-list-tile-action>
</v-list-tile>
<template v-for="(child, i) in item.children" >
<v-list-tile :to="child.href" :key="i" ripple>
<v-list-tile-action >
<v-icon></v-icon>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>
<v-icon>{{ child.icon }}</v-icon>&nbsp;{{ child.text }}
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</template>
</v-list-group>
<v-list-tile v-else :to="item.href" ripple>
<v-list-tile-action>
<v-icon>{{ item.icon }}</v-icon>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>
{{ item.text }}
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</template>
</v-list>
<template v-for="(item, i) in items">
<v-list-group v-if="item.children"
v-bind:key="item.text"
:prepend-icon="item.icon"
no-action
>
<v-list-tile slot="activator" >
<v-list-tile-content>
<v-list-tile-title>{{ item.text }}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile v-for="subItem in item.children" v-bind:key="subItem.text"
:prepend-icon="subItem.icon"
:to="subItem.href" avatar ripple >
<v-list-tile-avatar>
<v-icon>{{ subItem.icon }}</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>{{ subItem.text }}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-list-group>
<v-list-tile v-else v-bind:key="item.text" :to="item.href" ripple>
<v-list-tile-avatar>
<v-icon>{{ item.icon }}</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>{{ item.text }}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</template>
</v-list>
</template>
<script>{

View file

@ -35,8 +35,8 @@
</v-card-text>
<!-- result -->
<v-card-text >
<v-flex xs12 style="height:200px;" fill-height>
<vue-ace :content="aresult" mode="xquery" wrap="true" read-only="true" ></vue-ace>
<v-flex xs12 fill-height>
<vue-ace :content="aresult" mode="xquery" min-lines="1" wrap="true" read-only="true" ></vue-ace>
</v-flex>
</v-card-text>
</v-card>

View file

@ -14,7 +14,8 @@ event fired cmd outline
'wrap',
'readOnly',
'events',
'settings'
'settings',
'minLines',
],
data () {
return {
@ -106,7 +107,10 @@ event fired cmd outline
this.applySettings(this.aceSettings)
this.editor.$blockScrolling = Infinity
this.editor.setValue(this.content, 1)
this.editor.setOptions({ readOnly:this.readOnly })
this.editor.setOptions({ readOnly:this.readOnly });
if(this.minLines){
this.editor.setOptions({ minLines: this.minLines})
};
var session=this.editor.getSession()
session.setMode(`ace/mode/${mode}`)
session.setUseWrapMode(wrap)

View file

@ -11,12 +11,41 @@ const AXIOS_CONFIG={
}
};
// time requests
// Add a response interceptor
axios.interceptors.response.use(function (response) {
// Do something with response data
console.log("AXIOS",response);
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
});
// errors displayed by interceptor
const HTTP = axios.create(AXIOS_CONFIG);
HTTP.interceptors.request.use((config) => {
config.qdStartTime=performance.now();
return config;
});
HTTP.interceptors.response.use((response) => {
// Do something with response data
if(response.config && response.config.qdStartTime){
var s=Math.floor(performance.now() - response.config.qdStartTime);
var c=response.config;
var url=response.config.url + "?" + c.paramsSerializer(c.params);
console.log("interceptors time:",s, response.config);
Notification.add(s +" "+ url );
}
return response;
});
// errors hidden
const HTTPNE = axios.create(AXIOS_CONFIG);
const axios_json={ headers: {accept: 'application/json'}};
// Authorization Object
const Auth={
user:"guest",
@ -31,8 +60,18 @@ Vue.use(Auth);
//Notification Object
const Notification={
messages:[],
nextId: 0,
unseen:0,
add(msg){
this.messages.unshift({text: msg, index: this.messages.length})
var data={
text: msg,
index: ++this.nextId,
created: new Date()
};
this.messages.unshift(data);
this.messages.length = Math.min(this.messages.length, 30);
++this.unseen;
},
install(Vue){
Object.defineProperty(Vue.prototype, '$notification', {
@ -167,9 +206,9 @@ const Fullscreen={
Vue.use(Fullscreen);
//leaflet
Vue.component('v-map', Vue2Leaflet.Map);
Vue.component('v-tilelayer', Vue2Leaflet.TileLayer);
Vue.component('v-marker', Vue2Leaflet.Marker);
//Vue.component('v-map', Vue2Leaflet.Map);
//Vue.component('v-tilelayer', Vue2Leaflet.TileLayer);
//Vue.component('v-marker', Vue2Leaflet.Marker);
Vue.use(Vuetify);
new Vuepoc().$mount('#app')

View file

@ -9,7 +9,6 @@
<dependency name="js-beautify" version="1.6.12" />
<dependency name="axios" version="0.16.1" />
<dependency name="qs" version="6.4.0" />
<dependency name="vue-multiselect" version="2.0.0-beta.14" />
<dependency name="localforage" version="1.5.0" />
<dependency name="moment.js" version="2.18.1" />
<dependency name="file-walker" version="0.5.2" />

View file

@ -62,7 +62,8 @@
pagination:{sortBy: 'time',descending:true,rowsPerPage:25},
selected:[],
search:"",
loading:false
loading:false,
timer:null
}
},
methods:{
@ -74,12 +75,15 @@
//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
setTimeout(()=>{ this.getItems() }, 5000);
this.timer=setTimeout(()=>{ this.getItems() }, 5000);
})
}
},
created:function(){
this.getItems()
},
beforeDestroy(){
if(this.timer) clearTimeout(this.timer);
}
}
</script>

View file

@ -39,7 +39,6 @@ declare
function vue-api:file($url as xs:string,$protocol as xs:string)
as element(json)
{
let $_:=trace($protocol,"proto:")
let $reader:=map{
"webfile":ufile:webfile#1,
"xmldb":ufile:xmldb#1
@ -58,7 +57,7 @@ as element(json)
{for $f in $items/*
order by $f/@name/lower-case(.)
return <_ type="object">
{vue-api:details($f=>trace("foo"),"folder")}
{vue-api:details($f,"folder")}
</_>
}
</items>

View file

@ -43,9 +43,10 @@
<v-tooltip top>
<v-chip @click="acecmd('goToNextError')" slot="activator" >
<v-avatar class="green ">{{annotations && annotations.info}}</v-avatar>
<v-avatar class="yellow ">{{annotations && annotations.warning}}</v-avatar>
<v-avatar class="red " small>{{annotations && annotations.error}}</v-avatar>
<span class="red " >{{annotations && annotations.error}}</span>
<span class="yellow ">{{annotations && annotations.warning}}</span>
<span class="green ">{{annotations && annotations.info}}</span>
<v-avatar>
<v-icon black >navigate_next</v-icon>
</v-avatar>
@ -57,16 +58,44 @@
<v-icon>label_outline</v-icon>
</v-btn>
<v-btn icon @click="togglefold" title="fold toggle">
<v-icon>vertical_align_center</v-icon>
</v-btn>
<v-btn icon @click="wrap=!wrap">
<v-icon>wrap_text</v-icon>
</v-btn>
<v-menu left transition="v-fade-transition">
<v-btn icon slot="activator" title="display settings">
<v-icon>playlist_play</v-icon>
</v-btn>
<v-list dense>
<v-subheader>Display settings</v-subheader>
<v-list-tile @click="togglefold" avatar >
<v-list-tile-avatar>
<v-icon >vertical_align_center</v-icon>
</v-list-tile-avatar>
<v-list-tile-title >Toggle folds</v-list-tile-title>
</v-list-tile>
<v-list-tile @click="wrap=!wrap" avatar >
<v-list-tile-avatar>
<v-icon >wrap_text</v-icon>
</v-list-tile-avatar>
<v-list-tile-title >Soft wrap</v-list-tile-title>
</v-list-tile>
<v-divider></v-divider>
<v-subheader>Help</v-subheader>
<v-list-tile @click="acecmd('showSettingsMenu')" avatar >
<v-list-tile-avatar>
<v-icon >settings</v-icon>
</v-list-tile-avatar>
<v-list-tile-title @click="acecmd('showSettingsMenu')" >Show ACE settings</v-list-tile-title>
</v-list-tile>
<v-list-tile @click="acecmd('showKeyboardShortcuts')" avatar>
<v-list-tile-avatar>
<v-icon >keyboard</v-icon>
</v-list-tile-avatar>
<v-list-tile-title @click="acecmd('showKeyboardShortcuts')" >Show ACE keyboard shortcuts</v-list-tile-title>
</v-list-tile>
</v-list>
</v-menu>
<v-btn icon @click="beautify()">
<v-icon>format_align_center</v-icon>

View file

@ -88,16 +88,19 @@
<v-card-text v-if="showError">
<v-alert color="error" v-model="showError">Error </v-alert>
</v-card-text>
<v-card-text v-if="showResult">
<v-flex xs12 style="height:200px" fill-height>
<vue-ace :content="result" mode="text" wrap="false" read-only="true" :settings="aceSettings"
></vue-ace>
<v-flex xs12 style="height:200px" fill-height>
<vue-ace :content="result" mode="text" wrap="false" read-only="true" :settings="aceSettings"
></vue-ace>
</v-flex>
</v-card-text>
</v-card-text>
<v-card-text>
BEFORE<vp-job :job="job" :result:="result"
:job-state="jobState" :elapsed="elapsed">IN</vp-job>AFTER
</v-card-text>
</v-card>
</v-container>

View file

@ -42,7 +42,8 @@
return {
jobstate:{state:"?",user:"?",duration:"?"},
result:null,
loading:false
loading:false,
timer:null
}
},
methods:{
@ -53,7 +54,7 @@
this.loading=false
this.jobstate=r.data
if(!this.jobstate.id) this.jobstate={state:"cached", text:"Job not found"}
if(!this.finished)setTimeout(()=>{ this.getJob() }, 10000);
if(!this.finished)this.timer=setTimeout(()=>{ this.getJob() }, 10000);
})
},
@ -74,6 +75,9 @@
},
created(){
this.getJob()
},
beforeDestroy(){
if(this.timer) clearTimeout(this.timer);
}
}
</script>

View file

@ -79,7 +79,8 @@
selected: [],
search: "",
loading: false,
autorefresh: true
autorefresh: true,
timer:null
}
},
methods:{
@ -89,7 +90,7 @@
.then(r=>{
this.loading=false
this.items=r.data
if(this.autorefresh) setTimeout(()=>{ this.getJobs() }, 10000);
if(this.autorefresh) this.timer=setTimeout(()=>{ this.getJobs() }, 10000);
})
},
@ -108,6 +109,9 @@
},
created(){
this.getJobs()
},
beforeDestroy(){
if(this.timer) clearTimeout(this.timer);
}
}
</script>

View file

@ -1,38 +0,0 @@
<!DOCTYPE html>
<template id="map">
<v-container fluid>
<v-layout row wrap>
<v-flex xs12 ref="page" v-resize="onResize" style="height:400px">
<v-map :zoom="zoom" :center="center" >
<v-tilelayer :url="url" :attribution="attribution"></v-tilelayer>
<v-marker :lat-lng="marker"></v-marker>
</v-map>
</v-flex>
</v-layout>
</v-container>
</template>
<script>{
data: function(){
return {
zoom: 13,
center: [54.320498718, -2.739663708],
url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
marker: L.latLng(54.320498718, -2.739663708)
}
},
methods:{
onResize(){
var el=this.$refs["page"]
console.log("top",el.offsetTop)
var h=Math.max(1,window.innerHeight - el.offsetTop)-60
console.log("h",h)
el.style.height=h +"px"
}
},
created:function(){
console.log("map")
}
}
</script>

View file

@ -16,16 +16,41 @@
<v-flex xs6>
<p>some text</p>
<multiselect v-model="value" :options="options" @search-change="asyncFind" :loading="isLoading"
placeholder="select one"></multiselect>
<pre>{{$data.value }}</pre>
<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-select>
<pre>{{$data.value }}</pre>
</v-flex>
<v-flex xs6 >
<p>multi select</p>
<multiselect v-model="value2" :options="options" multiple
placeholder="Select many"></multiselect>
<pre>{{$data.value2 }}</pre>
<v-select
label="Select"
v-bind:items="options"
v-model="value2"
item-text="name"
item-value="name"
multiple
chips
deletable-chips
max-height="auto"
autocomplete
>v-select</v-select>
<pre>{{$data.value2 }}</pre>
</v-flex>
</v-layout>
</v-flex>
@ -46,7 +71,6 @@
</template>
<script>{
components: { multiselect: VueMultiselect.Multiselect},
data: function(){
return {
value: null,
@ -66,6 +90,7 @@
HTTP.get("test-select?q="+query,axios_json)
.then(function(r){
that.isLoading = false
console.log("data::::",r.data);
that.options=r.data.items;
})
.catch(function (error) {

View file

@ -7,25 +7,52 @@ module namespace vue-rest = 'quodatum:vue.tasks';
: list tasks
:)
declare
%rest:GET %rest:path("/vue-poc/api/tasks/list")
%rest:GET %rest:path("/vue-poc/api/tasks")
%rest:produces("application/json")
%output:method("json")
function vue-rest:tasks()
{
let $a:=42
return <json type="array">
<_ type="object">
<to>tasks/model</to>
<text>model</text>
</_>
<_ type="object">
<to>tasks/xqdoc</to>
<text>XQdoc</text>
</_>
<_ type="object">
<to>tasks/vuecompile</to>
<text>vue compile</text>
let $tasks:=doc("taskdef.xml")/tasks/task
return <json type="array">{
$tasks!<_ type="object">
<to>{ @name/string() }</to>
<text>{ title/text() }</text>
</_>
}</json>
};
(:~
: task details
:)
declare
%rest:GET %rest:path("/vue-poc/api/tasks/{$task}")
%rest:produces("application/json")
%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>
};
(:~
: task run
:)
declare
%rest:POST %rest:path("/vue-poc/api/tasks/{$task}")
%rest:produces("application/json")
%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>
};

View file

@ -0,0 +1,86 @@
<!DOCTYPE html>
<template id="runtask">
<v-container fluid>
<v-card >
<v-toolbar class="orange darken-1">
<v-btn icon to="/tasks"><v-icon>arrow_back</v-icon></v-btn>
<v-card-title >
<span class="white--text">Task: {{ task }}</span>
</v-card-title>
<v-spacer></v-spacer>
<v-btn color="primary" @click="submit()" :loading="waiting"
:disabled="waiting">
<v-icon>play_circle_outline</v-icon>
Run</v-btn>
</v-toolbar>
<v-card-text>
<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>
</v-flex>
</v-layout>
</v-container>
</v-card-text>
<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-container>
</template>
<script>{
props:["task"],
data: function(){
return {
params:{
proj:"C:/Users/andy/git/vue-poc/src/vue-poc/"
},
waiting:false,
snackbar:{show:false,msg:"",context:"success"},
}
},
methods:{
submit(){
this.waiting=true
HTTP.post("tasks/" + this.task, Qs.stringify(this.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
this.snackbar={show:true,msg:"Problem",context:"error"}
console.log(error);
});
}
},
created:function(){
var task=this.task
HTTP.get("tasks/"+task)
.then(r=>{
console.log(r);
alert("OK");
})
},
computed:{
code(){return 'code here'}
}
}
</script>

View file

@ -0,0 +1,63 @@
(:~
: task
:)
module namespace vue-rest = 'quodatum:vue.rest';
(:~
: run compile task.
:)
declare
%rest:POST %rest:path("/vue-poc/api/tasks/task")
%rest:form-param("name", "{$name}")
%rest:produces("application/json")
%output:method("json")
%updating
function vue-rest:vue($name)
{
db:output(<json type="object"><msg> { $name }.</msg></json>)
};
(:~
: new app
:)
declare function vue-rest: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!vue-rest: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 vue-rest: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 vue-rest:update-extract($extract as xs:base64Binary,
$from as xs:string,
$to as xs:string )
as xs:base64Binary{
if(vue-rest: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
};

View file

@ -10,4 +10,20 @@
<param name="target">Path to xqm file to generate</param>
</params>
</task>
<task name="tasks/xqdoc">
<title>XQdoc</title>
<description>Generate XQdoc as html</description>
</task>
<task name="tasks/vuecompile">
<title>vue compile</title>
</task>
<task name="tasks/newapp">
<title>application template</title>
<params>
<param name="appname">Name for new application</param>
</params>
</task>
</tasks>

View file

@ -2,13 +2,7 @@
<template id="task">
<v-container fluid>
<h3>Available Tasks</h3>
<v-snackbar
:bottom="true"
v-model="snackbar"
>
got tasks, currently ignoring
<v-btn flat class="pink--text" @click.native="snackbar = false">Close</v-btn>
</v-snackbar>
<ul>
<li v-for="task in tasks" :key="task.to">
<router-link :to="task.to" v-text="task.text"></router-link>
@ -20,15 +14,13 @@
<script>{
data(){
return {
tasks: [],
snackbar: false
tasks: []
}
},
methods:{
getTasks(){
HTTP.get("tasks/list")
HTTP.get("tasks")
.then(r=>{
this.snackbar=true
this.tasks=r.data
})
}

View file

@ -20,4 +20,3 @@ function vue-rest:vue($proj )
let $op:=vue:compile($proj)
return db:output(<json type="object"><msg> { $proj }.</msg></json>)
};

View file

@ -50,7 +50,7 @@ as element(c:directory)
(: db:list-details($db as xs:string, $path as xs:string) as element(resource)* :)
return if($map($name)="file") then
let $x:=db:list-details($db , $path || $name)=>trace("detail")
let $x:=db:list-details($db , $path || $name)
return <c:file name="{$name}" size="0"/>
else
<c:directory name="{$name}" content-type="text/directory" size="0"/>

View file

@ -74,5 +74,5 @@ function tree:test(){
"/api/suite/{$suite}/",
"/api/execute/zz")
let $t:=tree:build($a)
return unit:assert(fn:true())
return unit:assert(fn:true(),$t)
};

View file

@ -11,7 +11,7 @@ declare namespace Element="java:ch.digitalfondue.jfiveparse.Element";
declare namespace Node="java:ch.digitalfondue.jfiveparse.Node";
declare namespace functx = "http://www.functx.com";
declare variable $vue:PROJ:="C:/Users/andy/git/vue-poc/src/vue-poc/";
declare variable $vue:FEATURES:="features/";
declare variable $vue:COMPONENTS:="components/";
declare variable $vue:CORE:="components/core.js";
@ -20,9 +20,10 @@ declare variable $vue:DEST:="static/app-gen.js";
(:~
: generate javascript vue call from vue files in source folder and core.js
: @param $doc url for vue file
: @param $doc is a ch.digitalfondue.jfiveparse.Document
: @param $url for vue file
:)
declare function vue:feature($doc,$isComp as xs:boolean)
declare function vue:feature($doc,$url as xs:string,$isComp as xs:boolean)
as xs:string
{
let $p:=vue:parse($doc)
@ -30,13 +31,18 @@ let $script:= $p?script=>substring-after("{")
return if(empty($p?id)) then
()
else if($isComp) then
``[Vue.component('`{ $p?id }`',{template:` `{ $p?template }` `,
else
if($isComp) then
``[
// src: `{ $url }`
Vue.component('`{ $p?id }`',{template:` `{ $p?template }` `,
`{$script}`
);
]``
else
``[const `{ vue:capitalize-first($p?id) }`=Vue.extend({template:` `{ $p?template }` `,
``[
// src: `{ $url }`
const `{ vue:capitalize-first($p?id) }`=Vue.extend({template:` `{ $p?template }` `,
`{ $script }`
);
]``
@ -77,7 +83,7 @@ as xs:string*
declare function vue:feature-build($url as xs:string,$isComp as xs:boolean)
as xs:string
{
fetch:text($url)=>html5:doc()=>vue:feature($isComp)
fetch:text($url)=>html5:doc()=>vue:feature($url ,$isComp)
};
(:~
@ -92,7 +98,7 @@ let $FILTERS:="components/filters.js"=>file:resolve-path($proj)
let $CORE:="core.js"=>file:resolve-path($proj)
let $ROUTER:="router.js"=>file:resolve-path($proj)
let $APP:="vue-poc.vue"=>file:resolve-path($proj)
let $APP:="app.vue"=>file:resolve-path($proj)
let $DEST:="static/app-gen.js"=>file:resolve-path($proj)
@ -106,9 +112,20 @@ let $comps:=$files!vue:feature-build(.,true())
let $comment:="// generated " || current-dateTime() || "&#xA;&#xD;"
return file:write-text($DEST,string-join(($comment,
$comps,
fetch:text($FILTERS),
vue:js-test($FILTERS),
$feats,
fetch:text($ROUTER),
vue:js-test($ROUTER),
$APP!vue:feature-build(.,false()),
fetch:text($CORE))))
vue:js-test($CORE))))
};
(:~
: javascript source with comment
:)
declare function vue:js-test($url as xs:string)
{
``[
// src: `{ $url }`
`{ fetch:text($url) }`
]``
};

View file

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generates html index page. Project: xqdoc Author: Andy Bunce Date: 20170101
Version: 0.1 Comments: I/p is files e.g <c:directory name="adminlog" xml:base="file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/adminlog/">
<c:file name="logs.xqm"/> -->
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
xmlns:doc="http://www.xqdoc.org/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
@ -32,11 +35,14 @@
<script src="{$resources}prettify.js" type="text/javascript">&#160;</script>
<script src="{$resources}lang-xq.js" type="text/javascript">&#160;</script>
</head>
<body class="home" id="top">
<div id="main">
<h1>
XQDoc for <xsl:value-of select="$project"/>
</h1>
<h1>
XQDoc for
<xsl:value-of select="$project" />
</h1>
<xsl:call-template name="toc" />
<ul>
<xsl:apply-templates select=".//c:file" />
</ul>
@ -58,11 +64,47 @@
<xsl:template match="c:file">
<li>
<a href="F{position()}/index.html">
<xsl:value-of select="@name" />
<xsl:value-of select="qd:path(@name)" />
</a>
<xsl:value-of select="position()" />
<xsl:value-of select="position()" />
</li>
</xsl:template>
<xsl:template name="toc">
<nav id="toc">
<h2>
<a id="contents"></a>
<span class="namespace">
<xsl:value-of select="$project" />
</span>
</h2>
<ol class="toc">
<li>
<a href="#main">
<span class="secno">1 </span>
<span class="content">Introduction</span>
</a>
</li>
<li>
<a href="#ns">
<span class="secno">2 </span>
<span class="content">Namespaces</span>
</a>
</li>
<li>
<a href="#file">
<span class="secno">3 </span>
<span class="content">Files</span>
</a>
</li>
</ol>
</nav>
</xsl:template>
<!-- path -->
<xsl:function name="qd:path" as="xs:string">
<xsl:param name="file" />
<xsl:sequence select="concat('*',$file)" />
</xsl:function>
</xsl:stylesheet>

View file

@ -89,12 +89,12 @@
<xsl:template match="doc:module">
<h1>
<xsl:value-of select="@type" />
module: &#160;
<span class="namespace">
<xsl:value-of select="doc:uri" />
</span>
&#160;<xsl:value-of select="@type" />
module
</h1>
<dl>
<xsl:apply-templates select="doc:comment/doc:description" />

View file

@ -20,7 +20,7 @@ declare variable $xqd:index-xslt external :="html-index.xsl";
declare function xqd:save-xq($files,$target)
{
let $params:=map{
"project":"BCH" }
"project":"project" }
let $f:= document{$files} transform with { delete node //c:directory[not(.//c:file)]}
return (

View file

@ -1,5 +1,5 @@
(: entity access maps
: auto generated from xml files in entities folder at: 2017-10-22T20:37:22.427+01:00
: auto generated from xml files in entities folder at: 2018-01-03T10:05:58.06Z
:)
module namespace entity = 'quodatum.models.generated';
@ -10,7 +10,7 @@ declare namespace c='http://www.w3.org/ns/xproc-step';
declare variable $entity:list:=map {
"basexlog": map{
"name": "basexlog",
"description": "BaseX log entry ",
"description": "BaseX log entry",
"access": map{
"address": function($_ as element()) as xs:string {$_/@address },
"ms": function($_ as element()) as xs:integer {$_/@ms },
@ -58,7 +58,7 @@ declare variable $entity:list:=map {
},
"filehistory": map{
"name": "filehistory",
"description": "vue-poc file view events ",
"description": "vue-poc file view events",
"access": map{
"created": function($_ as element()) as xs:string {$_/@when },
"id": function($_ as element()) as xs:string {$_/@id },
@ -126,8 +126,7 @@ declare variable $entity:list:=map {
} },
"data": function() as element(namespace)*
{ collection("vuepoc")/namespaces/namespace
},
{ collection("vuepoc")/namespaces/namespace },
"views": map{
'filter': 'xmlns description'
@ -170,8 +169,7 @@ declare variable $entity:list:=map {
} },
"data": function() as element(query)*
{ collection("replx/queries")/query
},
{ collection("replx/queries")/query },
"views": map{
'filter': 'name description'

View file

@ -51,6 +51,7 @@ const router = new VueRouter({
{ 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"} },
{ path: '/tasks/:task', component: Runtask, props: true, meta:{title:"Run task"} },
{ path: '/jobs', component: Jobs, meta:{title:"Jobs running"} },
{ path: '/jobs/:job', name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} },
{ path: '/timeline', component: Timeline,meta:{title:"timeline"} },

File diff suppressed because it is too large Load diff

View file

@ -9,11 +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="https://unpkg.com/vuetify@0.17.3/dist/vuetify.min.css" rel="stylesheet" type="text/css"/>
<link href="https://unpkg.com/vue-multiselect@2.0.0-beta.15/dist/vue-multiselect.min.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"
integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ=="
crossorigin=""/>
<link href="https://unpkg.com/vuetify@1.0.0-beta.5/dist/vuetify.min.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://unpkg.com/vue-form-generator@2.1.0/dist/vfg.css"/>
<link href="/vue-poc/ui/app.css" rel="stylesheet" type="text/css"/>
<link href="/vue-poc/ui/svg-pan-zoom.css" rel="stylesheet" type="text/css"/>
@ -35,12 +32,11 @@
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.11/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.1/vue-router.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.17.1/axios.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js"></script>
<script src="https://unpkg.com/vuetify@0.17.3/dist/vuetify.min.js"></script>
<script src="https://unpkg.com/vue-multiselect@2.0.0-beta.15/dist/vue-multiselect.min.js"></script>
<script src="https://unpkg.com/vuetify@1.0.0-beta.5/dist/vuetify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ext-language_tools.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
@ -52,10 +48,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.js"></script>
<script src="https://unpkg.com/vue-form-generator@2.1.1/dist/vfg.js"></script>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"
integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log=="
crossorigin=""></script>
<script src="https://unpkg.com/vue2-leaflet@0.0.55/dist/vue2-leaflet.js"></script>
<script src="/vue-poc/ui/svg-pan-zoom.js"></script>
<script src="/vue-poc/ui/perf-stat.js"></script>

View file

@ -1,4 +1,6 @@
// performance monitoring. of value stream
// var t=new perfStat()
// t.log(newValue)
// stores max min etc
function perfStat() {
this.data={count:0,max:null,min:null,total:0,median:0,last:null,avg:null};