From d9a9f99d27dcfd960db19d9d39bca21d8910faae Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 27 Jul 2017 21:44:30 +0100 Subject: [PATCH] vuetify 0.14.7 --- README.md | 22 + src/vue-poc/components/core.js | 48 +- .../{my-component.vue => qd-link.vue} | 7 +- .../{nav-list.vue => qd-navlist.vue} | 11 +- src/vue-poc/components/vis-time-line.vue | 22 + src/vue-poc/expath-pkg.xml | 5 +- src/vue-poc/features/about.vue | 4 +- src/vue-poc/features/adminlog/logs.vue | 85 ++ src/vue-poc/features/adminlog/logs.xqm | 45 + src/vue-poc/features/collection/files.vue | 127 +-- src/vue-poc/features/collection/history.xml | 1 + src/vue-poc/features/edit/edit.vue | 3 +- src/vue-poc/features/eval/eval.vue | 2 +- src/vue-poc/features/home.vue | 4 +- src/vue-poc/features/images/image.vue | 15 + src/vue-poc/features/images/images.vue | 10 +- src/vue-poc/features/job/jobs.vue | 2 +- src/vue-poc/features/logs.vue | 18 - src/vue-poc/features/people.vue | 70 -- src/vue-poc/features/ping/ping.vue | 25 +- src/vue-poc/features/select.vue | 28 +- src/vue-poc/features/session.vue | 69 ++ src/vue-poc/features/settings.vue | 33 +- .../{ => tasks}/model.build/entity-gen.xqm | 0 .../{ => tasks}/model.build/model.vue | 5 +- .../{ => tasks}/model.build/rxq-model.xqm | 0 src/vue-poc/features/{ => tasks}/tasks.vue | 12 +- .../features/tasks/xqdoc/html-module.xsl | 459 ++++++++++ .../features/tasks/xqdoc/rxq-xqdoc.xqm | 57 ++ src/vue-poc/features/tasks/xqdoc/xqdoc.vue | 88 ++ src/vue-poc/features/timeline.vue | 43 + src/vue-poc/lib/dice.xqm | 2 +- src/vue-poc/lib/file.xqm | 4 +- src/vue-poc/lib/mimetype.xqm | 2 +- src/vue-poc/lib/webutils.xqm | 137 +++ src/vue-poc/models.gen.xqm | 50 +- src/vue-poc/models/adminlog.xml | 34 + src/vue-poc/static/app-gen.js | 821 ++++++++++++------ src/vue-poc/static/app.html | 15 +- src/vue-poc/static/resources/ark/ark.sch | 12 + src/vue-poc/static/resources/ark/ark.xml | 59 ++ src/vue-poc/static/resources/ark/ark.xsd | 74 ++ src/vue-poc/tasks/createimage.xq | 5 +- src/vue-poc/tasks/createwadl.xq | 29 + 44 files changed, 2054 insertions(+), 510 deletions(-) rename src/vue-poc/components/{my-component.vue => qd-link.vue} (64%) rename src/vue-poc/components/{nav-list.vue => qd-navlist.vue} (94%) create mode 100644 src/vue-poc/components/vis-time-line.vue create mode 100644 src/vue-poc/features/adminlog/logs.vue create mode 100644 src/vue-poc/features/adminlog/logs.xqm create mode 100644 src/vue-poc/features/images/image.vue delete mode 100644 src/vue-poc/features/logs.vue delete mode 100644 src/vue-poc/features/people.vue create mode 100644 src/vue-poc/features/session.vue rename src/vue-poc/features/{ => tasks}/model.build/entity-gen.xqm (100%) rename src/vue-poc/features/{ => tasks}/model.build/model.vue (93%) rename src/vue-poc/features/{ => tasks}/model.build/rxq-model.xqm (100%) rename src/vue-poc/features/{ => tasks}/tasks.vue (70%) create mode 100644 src/vue-poc/features/tasks/xqdoc/html-module.xsl create mode 100644 src/vue-poc/features/tasks/xqdoc/rxq-xqdoc.xqm create mode 100644 src/vue-poc/features/tasks/xqdoc/xqdoc.vue create mode 100644 src/vue-poc/features/timeline.vue create mode 100644 src/vue-poc/lib/webutils.xqm create mode 100644 src/vue-poc/models/adminlog.xml create mode 100644 src/vue-poc/static/resources/ark/ark.sch create mode 100644 src/vue-poc/static/resources/ark/ark.xml create mode 100644 src/vue-poc/static/resources/ark/ark.xsd create mode 100644 src/vue-poc/tasks/createwadl.xq diff --git a/README.md b/README.md index 77933d5..4074acd 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,25 @@ A test of using `vue.js` as UI Includes: * material design (using `vuetify`) * ace editor +* localforage for persistence + + +## Settings +Global `settings` provides `getItem(name)` and `setItem(name.value)` +Example usage +``` + created: function () { + settings.getItem('settings/ace') + .then((v)=>{ + this.ace=v + }) + + }, + watch: {"ace":{ + handler:function(v){ + settings.setItem('settings/ace',this.ace) + }, + deep:true + } + +``` \ No newline at end of file diff --git a/src/vue-poc/components/core.js b/src/vue-poc/components/core.js index 0d69a52..b59c66c 100644 --- a/src/vue-poc/components/core.js +++ b/src/vue-poc/components/core.js @@ -20,6 +20,38 @@ const Auth={ }) } }; Vue.use(Auth); + +// https://vuejs.org/v2/guide/state-management.html +var settings = { + debug: true, + getItem (key) { + if (this.debug) console.log('getItem',key); + return new Promise((resolve, reject) => { + localforage.getItem(key) + .then((value) => { + console.log('GET setting', key,value); + resolve(value) + }).catch((err) => { + console.log('GET failed'); + reject(err) + }); + }); + }, + setItem (key,value,callback) { + if (this.debug) console.log('setItem',key,value); + return new Promise((resolve, reject) => { + localforage.setItem(key, value) + .then((value) => { + console.log('SET ',key, value); + return new Promise((resolve, reject) => {resolve(value);}) + }).catch((err) => { + console.log('set failed'); + return new Promise((resolve, reject) => {reject(err);}) + }); + }) + } + }; + Vue.config.errorHandler = function (err, vm, info) { // handle error // `info` is a Vue-specific error info, e.g. which lifecycle hook @@ -37,8 +69,9 @@ const router = new VueRouter({ mode: 'history', routes: [ { path: '/', component: Home,meta:{title:"Home"} }, - { path: '/people', component: People ,meta:{title:"People"}}, + { path: '/session', component: Session ,meta:{title:"Session"}}, { path: '/images', component: Images,meta:{title:"Images"} }, + { path: '/images/:id', name:"image",component: Image, props: true,meta:{title:"Image details"}}, { path: '/select', component: Select,meta:{title:"Select"} }, { path: '/search', component: Search,meta:{title:"Search"} }, { path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} }, @@ -55,7 +88,9 @@ const router = new VueRouter({ { path: '/logs', component: Log,meta:{title:"Server logs"} }, { path: '/tasks', component: Task,meta:{title:"Runnable tasks"} }, { path: '/tasks/model', component: Model,meta:{title:"build model"} }, + { path: '/tasks/xqdoc', component: Xqdoc,meta:{title:"build xqdoc"} }, { path: '/jobs', component: Job,meta:{title:"Jobs"} }, + { path: '/timeline', component: Timeline,meta:{title:"timeline"} }, { path: '*', component: Notfound,meta:{title:"Page not found"} } ], }); @@ -98,8 +133,7 @@ const app = new Vue({ {href: '/database', text: 'Databases',icon: 'account_balance' }, {href: '/files', text: 'File system',icon: 'folder' }, {href: '/edit',text: 'edit',icon: 'mode_edit'}, - {href: '/history',text: 'history',icon: 'history'}, - {href: '/logs',text: 'Server logs',icon: 'dns'} + {href: '/history',text: 'history',icon: 'history'} ]}, { icon: 'directions_run', @@ -110,17 +144,19 @@ const app = new Vue({ {href: '/jobs',text: 'Running jobs',icon: 'dashboard'}, {href: '/tasks',text: 'Tasks',icon: 'history'} ]}, + {href: '/logs',text: 'Server logs',icon: 'dns'}, { icon: 'more_horiz', text: 'More' , model: false, children: [ - {href: '/people',text: 'People',icon: 'person'}, + {href: '/session',text: 'Session',icon: 'person'}, {href: '/select',text: 'select',icon: 'extension'}, {href: '/puzzle',text: 'Puzzle',icon: 'extension'}, {href: '/images',text: 'Images',icon: 'camera_roll'}, {href: '/tabs',text: 'tabs',icon: 'switch_camera'}, {href: '/ping',text: 'ping',icon: 'update'}, + {href: '/timeline',text: 'time line',icon: 'timelapse'}, {href: '/thumbnail',text: 'thumbnail',icon: 'touch_app'} ]}, {href: '/settings',text: 'settings',icon: 'settings' } @@ -128,7 +164,9 @@ const app = new Vue({ }}, methods: { - + session(){ + this.$router.push({path: '/session'}) + }, search(){ this.$router.push({path: '/search',query: { q: this.q }}) }, diff --git a/src/vue-poc/components/my-component.vue b/src/vue-poc/components/qd-link.vue similarity index 64% rename from src/vue-poc/components/my-component.vue rename to src/vue-poc/components/qd-link.vue index 60dd53f..322683d 100644 --- a/src/vue-poc/components/my-component.vue +++ b/src/vue-poc/components/qd-link.vue @@ -1,12 +1,15 @@ - + add REPLACED diff --git a/src/vue-poc/features/images/images.vue b/src/vue-poc/features/images/images.vue index 0fb214b..31252ba 100644 --- a/src/vue-poc/features/images/images.vue +++ b/src/vue-poc/features/images/images.vue @@ -49,8 +49,9 @@ v-for="image in images" :key="image.name" > - - + + @@ -60,7 +61,7 @@ bookmark - + share @@ -112,6 +113,9 @@ selected(image){ this.selitem=image; this.showInfo=true; + }, + go(image){ + this.$router.push({ name: 'image', params: { id: image.id }}) } }, diff --git a/src/vue-poc/features/job/jobs.vue b/src/vue-poc/features/job/jobs.vue index 6ffd002..93b54ce 100644 --- a/src/vue-poc/features/job/jobs.vue +++ b/src/vue-poc/features/job/jobs.vue @@ -19,7 +19,7 @@ - - - diff --git a/src/vue-poc/features/people.vue b/src/vue-poc/features/people.vue deleted file mode 100644 index 1136896..0000000 --- a/src/vue-poc/features/people.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - diff --git a/src/vue-poc/features/ping/ping.vue b/src/vue-poc/features/ping/ping.vue index 74f8141..a907591 100644 --- a/src/vue-poc/features/ping/ping.vue +++ b/src/vue-poc/features/ping/ping.vue @@ -10,12 +10,10 @@ Repeat Last Count - Avg - min max - Median + Median @@ -23,10 +21,10 @@ - Get count + Get count - + {{getValues.last}} @@ -49,13 +47,14 @@ {{getValues.median}} + - Update count + Update count - + {{postValues.last}} @@ -63,9 +62,7 @@ {{postValues.count}} - - {{postValues.median}} - + {{postValues.avg | round(2)}} @@ -78,9 +75,13 @@ {{postValues.max}} + + {{postValues.median}} + + Reset @@ -119,6 +120,10 @@ this.get(); //does this leak?? } }) + }, + reset(){ + this.getValues.clear(); + this.postValues.clear(); } }, computed: { diff --git a/src/vue-poc/features/select.vue b/src/vue-poc/features/select.vue index 34e2528..3ea1a55 100644 --- a/src/vue-poc/features/select.vue +++ b/src/vue-poc/features/select.vue @@ -2,12 +2,15 @@