- | Action |
- Repeat |
- Last |
- Count |
- Avg |
- min |
- max |
- Median |
+ Action |
+ Repeat |
+ Last |
+ Count |
+ Avg |
+ min |
+ max |
+ Median |
@@ -38,24 +38,24 @@
- {{getValues.last}}
+ {{getValues.last}}
|
- {{getValues.count}}
+ {{getValues.count}}
|
- {{getValues.avg | round(2)}}
+ {{getValues.avg | round(2)}}
|
- {{getValues.min}}
+ {{getValues.min}}
|
- {{getValues.max}}
+ {{getValues.max}}
|
- {{getValues.median}}
+ {{getValues.median}}
|
@@ -69,27 +69,25 @@
|
-
- {{postValues.last}}
- |
-
+ |
+ {{postValues.last}}
+ |
+
{{postValues.count}}
|
-
-
-
+
+ |
{{postValues.avg | round(2)}}
|
-
-
- {{postValues.min}}
+ |
+ {{postValues.min}}
|
-
+ |
{{postValues.max}}
|
-
- {{postValues.median}}
+ |
+ {{postValues.median}}
|
diff --git a/src/vue-poc/features/settings/acesettings.vue b/src/vue-poc/features/settings/acesettings.vue
index 76c2efb..9e78238 100644
--- a/src/vue-poc/features/settings/acesettings.vue
+++ b/src/vue-poc/features/settings/acesettings.vue
@@ -7,7 +7,7 @@
crumbs
@@ -17,14 +17,15 @@
-
-
- Ace editor settings
+ Ace editor behaviour
@@ -127,6 +128,7 @@
return obj;
}
},
+
beforeRouteLeave (to, from, next) {
Settings.setItem('settings/ace',this.ace)
.then(v=>{
diff --git a/src/vue-poc/features/users/users.vue b/src/vue-poc/features/users/users.vue
index 160166c..94075d9 100644
--- a/src/vue-poc/features/users/users.vue
+++ b/src/vue-poc/features/users/users.vue
@@ -1,7 +1,7 @@
-
+
map:merge()
+ let $c:=for $h in $hrs return if(map:contains($times,$h)) then map:get($times,$h) else 0
+
+ return
},
"views": map{
@@ -393,11 +526,11 @@ hof:top-k-by(admin:logs(), string#1, 2)
"description": " log entries in XML format",
"access": map{
"address": function($_ as element()) as xs:string {$_/@address },
- "end": function($_ as element()) as xs:string? {$_/self::*[@ms]!(xs:dateTime(concat("2019-01-01",'T',@time))+ xs:dayTimeDuration("PT" || (@ms div 1000) || "S")) },
+ "end": function($_ as element()) as xs:string? {$_/self::*[@ms]!(xs:dateTime(@date)+ xs:dayTimeDuration("PT" || (@ms div 1000) || "S")) },
"ms": function($_ as element()) as xs:integer {$_/@ms },
"status": function($_ as element()) as xs:string {$_/@type },
"text": function($_ as element()) as xs:string {$_/. },
- "time": function($_ as element()) as xs:string {$_/concat("2019-01-01",'T',@time) },
+ "time": function($_ as element()) as xs:string {$_/@date },
"user": function($_ as element()) as xs:string {$_/@user } },
"filter": function($item,$q) as xs:boolean{
@@ -411,7 +544,7 @@ hof:top-k-by(admin:logs(), string#1, 2)
},
"end": function($_ as element()) as element(end)? {
(: xs:string? :)
- fn:data($_/self::*[@ms]!(xs:dateTime(concat("2019-01-01",'T',@time))+ xs:dayTimeDuration("PT" || (@ms div 1000) || "S")))!element end { .}
+ fn:data($_/self::*[@ms]!(xs:dateTime(@date)+ xs:dayTimeDuration("PT" || (@ms div 1000) || "S")))!element end { .}
},
"ms": function($_ as element()) as element(ms)? {
(: xs:integer :)
@@ -427,7 +560,7 @@ hof:top-k-by(admin:logs(), string#1, 2)
},
"time": function($_ as element()) as element(time)? {
(: xs:string :)
- fn:data($_/concat("2019-01-01",'T',@time))!element time { .}
+ fn:data($_/@date)!element time { .}
},
"user": function($_ as element()) as element(user)? {
(: xs:string :)
@@ -436,7 +569,7 @@ hof:top-k-by(admin:logs(), string#1, 2)
"data": function() as element(entry)*
{
- db:open("vue-poc","/logs/")[1]/entries/entry
+ db:open("vue-poc","/logs/")[1]/entries/entry (: test data 1st doc :)
},
"views": map{
@@ -519,39 +652,6 @@ hof:top-k-by(admin:logs(), string#1, 2)
"views": map{
'filter': 'name description'
- }
- },
- "repo": map{
- "name": "repo",
- "description": "An entry in the basex repository",
- "access": map{
- "name": function($_ as element()) as xs:string {$_/@name },
- "type": function($_ as element()) as xs:string {$_/@type },
- "version": function($_ as element()) as xs:string {$_/@version } },
-
- "filter": function($item,$q) as xs:boolean{
- some $e in ( ) satisfies
- fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
- },
- "json": map{
- "name": function($_ as element()) as element(name)? {
- (: xs:string :)
- fn:data($_/@name)!element name { .}
- },
- "type": function($_ as element()) as element(type)? {
- (: xs:string :)
- fn:data($_/@type)!element type { .}
- },
- "version": function($_ as element()) as element(version)? {
- (: xs:string :)
- fn:data($_/@version)!element version { .}
- } },
-
- "data": function() as element(package)*
- { repo:list() },
-
- "views": map{
-
}
},
"search-result": map{
@@ -590,49 +690,6 @@ hof:top-k-by(admin:logs(), string#1, 2)
"views": map{
- }
- },
- "service": map{
- "name": "service",
- "description": "basex services a list of all jobs that have been persistently registered as Services.",
- "access": map{
- "base-uri": function($_ as element()) as xs:string {$_/@base-uri },
- "id": function($_ as element()) as xs:string {$_/@id },
- "interval": function($_ as element()) as xs:string {$_/@interval },
- "query": function($_ as element()) as xs:string {$_/. },
- "running": function($_ as element()) as xs:boolean {$_/(@id = jobs:list-details()/@id) } },
-
- "filter": function($item,$q) as xs:boolean{
- some $e in ( ) satisfies
- fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
- },
- "json": map{
- "base-uri": function($_ as element()) as element(base-uri)? {
- (: xs:string :)
- fn:data($_/@base-uri)!element base-uri { .}
- },
- "id": function($_ as element()) as element(id)? {
- (: xs:string :)
- fn:data($_/@id)!element id { .}
- },
- "interval": function($_ as element()) as element(interval)? {
- (: xs:string :)
- fn:data($_/@interval)!element interval { .}
- },
- "query": function($_ as element()) as element(query)? {
- (: xs:string :)
- fn:data($_/.)!element query { .}
- },
- "running": function($_ as element()) as element(running)? {
- (: xs:boolean :)
- fn:data($_/(@id = jobs:list-details()/@id))!element running { attribute type {'boolean'}, .}
- } },
-
- "data": function() as element(job)*
- { jobs:services() },
-
- "views": map{
-
}
},
"task": map{
@@ -772,34 +829,6 @@ hof:top-k-by(admin:logs(), string#1, 2)
"views": map{
'filter': 'name'
- }
- },
- "user": map{
- "name": "user",
- "description": "A BaseX user ",
- "access": map{
- "name": function($_ as element()) as xs:string {$_/@name },
- "permission": function($_ as element()) as xs:string {$_/@permission } },
-
- "filter": function($item,$q) as xs:boolean{
- some $e in ( ) satisfies
- fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
- },
- "json": map{
- "name": function($_ as element()) as element(name)? {
- (: xs:string :)
- fn:data($_/@name)!element name { .}
- },
- "permission": function($_ as element()) as element(permission)? {
- (: xs:string :)
- fn:data($_/@permission)!element permission { .}
- } },
-
- "data": function() as element(user)*
- { user:list-details() },
-
- "views": map{
-
}
},
"xqdoc": map{
diff --git a/src/vue-poc/package.json b/src/vue-poc/package.json
index 4732f3d..5a716d6 100644
--- a/src/vue-poc/package.json
+++ b/src/vue-poc/package.json
@@ -18,6 +18,6 @@
"vuetify-jsonschema-form": "0.27.1",
"prism": "1.15.0",
"vue-prism-component": "1.1.1",
- "vis": "4.21.0"
+ "vis-timeline-graph2d": "4.21.0"
}
}
\ No newline at end of file
diff --git a/src/vue-poc/static/app-gen.js b/src/vue-poc/static/app-gen.js
index 259eb25..38826b0 100644
--- a/src/vue-poc/static/app-gen.js
+++ b/src/vue-poc/static/app-gen.js
@@ -1,4 +1,4 @@
-// generated 2019-11-07T12:55:30.849Z
+// generated 2019-12-13T23:01:01.285Z
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
Vue.component('qd-autoheight',{template:`
@@ -312,6 +312,35 @@ Vue.component('qd-panel',{template:`
);
+// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-range.vue
+Vue.component('qd-range',{template:`
+
+
+
+ Range
+ arrow_drop_down
+
+
+
+
+ Range
+
+
+
+
+
+
+
+ Reset
+
+
+
+ `,
+
+ props: ['query' ]
+}
+ );
+
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-search.vue
Vue.component('qd-search',{template:`
@@ -549,6 +578,9 @@ Vue.component('vis-time-line',{template:`
items(newItems){
console.log("timeline new:" + newItems.length)
this.rebuild(newItems)
+ },
+ options(newOpts){
+ console.log("opts: ",newOpts)
}
},
mounted: function () {
@@ -1002,11 +1034,14 @@ Vue.component('vue-ace',{template:`
},
"settings":{
handler:function(vnew,vold){
+ //console.log("aCe settings:",vnew,this)
this.applySettings(vnew)
- // alert("setting")
},
deep:true
- }
+ },
+
+ // whenever theme changes, this function will run
+ "$vuetify.theme.dark": function (newState) {this.setTheme()}
},
methods:{
@@ -1054,10 +1089,7 @@ Vue.component('vue-ace',{template:`
}
},
- watch: {
- // whenever theme changes, this function will run
- "$vuetify.theme.dark": function (newState) {this.setTheme()}
- },
+
mounted () {
const mode = this.mode || 'text'
@@ -1621,13 +1653,12 @@ const Basexlogdate=Vue.extend({template:`
- refresh
-
+ refresh
@@ -1639,6 +1670,12 @@ const Basexlogdate=Vue.extend({template:`
{{ item.date }}
|
+
+
+
+
+ |
+
No matching results.
@@ -1660,9 +1697,22 @@ const Basexlogdate=Vue.extend({template:`
selected:[],
headers: [
{ text: 'Date', value: 'date' },
+ {text: 'Entries', value: 'entries', align:"end" },
+ {text: 'Max (secs)', value: 'max', align:"end" },
+ {text: 'Rate', value: 'perhr' },
{ text: 'File name', value: 'name' }
],
- crumbs:[{to:"/logdate", text:"Log files"}]
+ crumbs:[{to:"/logdate", text:"Log files"}],
+ labels: [
+ '.','.','.',
+ '3am','.','.',
+ '6am','.','.',
+ '9am','.','.',
+ 'noon','.','.',
+ '3pm','.','.',
+ '6pm','.','.',
+ '9pm','.','.'
+ ],
}
},
methods: {
@@ -1676,6 +1726,9 @@ const Basexlogdate=Vue.extend({template:`
})
},
+ points(perhr){
+ return perhr.split(' ').map(Number);
+ },
setfilter(){
console.log("TODO",this.q)
this.$router.push({ query: {url:this.url,q:this.q }})
@@ -1703,35 +1756,45 @@ const Basexlogdate=Vue.extend({template:`
const Basexlogdate1=Vue.extend({template:`
-
+
crumbs
-
+
+ skip_previous
+
+
+ skip_next
+
-
-
-
-
-
+
+
fit
refresh
-
- arrow_back
-
-
- arrow_forward
-
+
+
+
+
+ more_vert
+
+
+
+
+
+
+
+
+
@@ -1755,7 +1818,7 @@ const Basexlogdate1=Vue.extend({template:`
timeAxis: {scale: 'minute', step: 1}
},
data:[],
- query:{name: "2019-09-23", start: 1, limit:30, from:"00:00:00", mins:10},
+ query:{date: this.date, start: 1, limit:30, from:"00:00:00", window:600},
showmenu: false,
Events: new Vue({}),
msg:"Select an entry",
@@ -1767,31 +1830,33 @@ methods:{
fit(){
this.Events.$emit('fit');
},
- select(sel){
-
+
+ select(sel){
var hit=this.data.find(item => item.id==sel )
var h=JSON.stringify(hit,null,2)
this.msg= h
},
+
pageNext(){
- this.query.start+= this.query.limit
- this.query.from= this.addtime(this.query.from,this.query.mins)
+ this.query.from= this.addtime(this.query.from,this.query.window)
this.getItems()
},
+
pageBack(){
- this.query.start-= this.query.limit
- this.query.from = this.addtime(this.query.from,-this.query.mins)
+ this.query.from = this.addtime(this.query.from,-this.query.window)
this.getItems()
},
- addtime(time,mins){
- return moment(time,moment.HTML5_FMT.TIME_SECONDS).add(mins,"m").format(moment.HTML5_FMT.TIME_SECONDS)
+
+ addtime(time,secs){
+ var result= moment(time,moment.HTML5_FMT.TIME_SECONDS).add(secs,"s")
+ var result= moment.max(result,moment("00:00:00",moment.HTML5_FMT.TIME_SECONDS))
+ return result.format(moment.HTML5_FMT.TIME_SECONDS)
},
+
getItems(){
this.loading=true
HTTP.get("logxml", {params:this.query})
.then(r=>{
- this.loading=false
-
//var items=r.data.items.filter(item=>{return item.text!="[GET] http://localhost:8984/vue-poc/api/log"})
var items=r.data.items
//console.log("logxml",items)
@@ -1803,15 +1868,32 @@ methods:{
style: x.text.startsWith("[POST] ")?"background-color: red;": "background-color: yellow;",
group: x.user}
))
+ //https://stackoverflow.com/a/39637877/3210344 round(date, moment.duration(15, "minutes"), "ceil")
+ var roundDate= function (date, duration, method) {
+ return moment(Math[method]((+date) / (+duration)) * (+duration));
+ }
+ var start=moment(this.date + "T" + this.query.from)
+ var first=this.data[0]
+ if(first){
+ first=moment(first.time)
+ start=roundDate(first,moment.duration(this.query.window, "seconds"), "floor")
+ //console.log(r.format(moment.HTML5_FMT.TIME_SECONDS))
+ this.query.from=start.format(moment.HTML5_FMT.TIME_SECONDS)
+ }
+ this.options.start=start.toDate()
+ this.options.end=start.add(this.query.window,"s").toDate()
//console.log("data",this.data)
+ this.loading=false
})
}
},
watch:{
"query":{
handler:function(vnew,vold){
- console.log("watch",vnew,vold)
+ //console.log("watch",this.query)
+
this.$router.push({ query: this.query })
+ if(!this.loading) this.getItems()
},
deep:true
}
@@ -1980,7 +2062,7 @@ const Log=Vue.extend({template:`
},
getItems(){
this.loading=true
- HTTP.get("log",{params:this.q})
+ HTTP.get("basex.log",{params:this.q})
.then(r=>{
this.loading=false
//console.log(r.data)
@@ -2014,7 +2096,7 @@ const Documentation=Vue.extend({template:`
-
+
XQDocs
@@ -4804,7 +4886,7 @@ const Services=Vue.extend({template:`
methods:{
load(){
this.loading= true
- HTTP.get("data/service",{params:{q:this.q}})
+ HTTP.get("data/basex.service",{params:{q:this.q}})
.then(r=>{
this.items= r.data.items
this.loading= false
@@ -4838,7 +4920,7 @@ const Services=Vue.extend({template:`
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/login/login.vue
const Login=Vue.extend({template:`
-
+
The current credentials do the give access this page, please login.
@@ -5431,7 +5513,7 @@ const Puzzle=Vue.extend({template:`
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/repository.vue
const Repo=Vue.extend({template:`
-
+
@@ -6089,14 +6171,14 @@ const Ping=Vue.extend({template:`
- | Action |
- Repeat |
- Last |
- Count |
- Avg |
- min |
- max |
- Median |
+ Action |
+ Repeat |
+ Last |
+ Count |
+ Avg |
+ min |
+ max |
+ Median |
@@ -6114,24 +6196,24 @@ const Ping=Vue.extend({template:`
- {{getValues.last}}
+ {{getValues.last}}
|
- {{getValues.count}}
+ {{getValues.count}}
|
- {{getValues.avg | round(2)}}
+ {{getValues.avg | round(2)}}
|
- {{getValues.min}}
+ {{getValues.min}}
|
- {{getValues.max}}
+ {{getValues.max}}
|
- {{getValues.median}}
+ {{getValues.median}}
|
@@ -6145,27 +6227,25 @@ const Ping=Vue.extend({template:`
|
-
- {{postValues.last}}
- |
-
+ |
+ {{postValues.last}}
+ |
+
{{postValues.count}}
|
-
-
-
+
+ |
{{postValues.avg | round(2)}}
|
-
-
- {{postValues.min}}
+ |
+ {{postValues.min}}
|
-
+ |
{{postValues.max}}
|
-
- {{postValues.median}}
+ |
+ {{postValues.median}}
|
@@ -6371,7 +6451,7 @@ const Acesettings=Vue.extend({template:`
- crumbs
+ crumbs
@@ -6380,10 +6460,10 @@ const Acesettings=Vue.extend({template:`
-
+
-
+
@@ -6409,7 +6489,7 @@ const Acesettings=Vue.extend({template:`
- Ace editor settings
+ Ace editor behaviour
@@ -6474,6 +6554,7 @@ const Acesettings=Vue.extend({template:`
return obj;
}
},
+
beforeRouteLeave (to, from, next) {
Settings.setItem('settings/ace',this.ace)
.then(v=>{
@@ -7156,7 +7237,7 @@ const Thumbnail=Vue.extend({template:`
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/users/users.vue
const Users=Vue.extend({template:`
-
+
@@ -7747,8 +7828,7 @@ 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: '/logdate',text: 'XML logs',icon: 'dns'},
+
{href: '/history/tasks',text: 'history',icon: 'history'}
]},
{
@@ -7759,6 +7839,8 @@ const Vuepoc=Vue.extend({template:`
{href: '/database', text: 'Databases',icon: 'developer_mode' },
{href: '/files', text: 'File system',icon: 'folder' },
{href: '/documentation', text: 'Documentation',icon: 'library_books' },
+ {href: '/tasks',text: 'Tasks',icon: 'update'},
+ {href: '/logdate',text: 'XML logs',icon: 'dns'},
{href: '/history/files',text: 'history',icon: 'history'}
]},
{
@@ -8014,8 +8096,6 @@ return $a `},
"edit/query": "todo edit/query"
},
-
-
getItem (key) {
if (this.debug) console.log('getItem',key);
return localforage.getItem(key)
@@ -8029,6 +8109,7 @@ return $a `},
});
},
+
setItem (key,value) {
if (this.debug) console.log('setItem',key,value);
return localforage.setItem(key, value)
@@ -8050,11 +8131,12 @@ return $a `},
}).catch(err => {
console.log('delete failed');
});
- },
+ },
+
keys(){
return localforage.keys() // returns array of keys
-
},
+
clear(){
localforage.clear()
}
diff --git a/src/vue-poc/static/app.html b/src/vue-poc/static/app.html
index 14cabe7..e65f42f 100644
--- a/src/vue-poc/static/app.html
+++ b/src/vue-poc/static/app.html
@@ -10,7 +10,7 @@
-
+
@@ -39,10 +39,10 @@
-
-
-
-
+
+
+
+
| | |