Commit 36a2b302 authored by Mathew Parker's avatar Mathew Parker

more cleanup

parent 53c890ca
Pipeline #98 failed with stages
in 1 minute and 14 seconds
import SVG from 'svg.js' import SVG from 'svg.js'
// next two libaries used within SVG.js // next two libaries used within SVG.js
//
/* eslint-disable no-unused-vars */
import { draggy } from 'svg.draggy.js' import { draggy } from 'svg.draggy.js'
import { connectable } from 'svg.connectable.js' import { connectable } from 'svg.connectable.js'
/* global exports draggy */
/* global exports connectable */
export function svg() { export function svg() {
// SVG UI next // SVG UI next
var that = {} var that = {}
...@@ -32,3 +37,4 @@ export function svg() { ...@@ -32,3 +37,4 @@ export function svg() {
} }
return that return that
} }
/* eslint-enable no-unused-vars */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<script> <script>
import spatialui from './spatial-ui.vue' import spatialui from './spatial-ui.vue'
// helper to access data from vuex // helper to access data from vuex
import { mapActions, mapGetters } from 'vuex' //import { mapActions, mapGetters } from 'vuex'
export default { export default {
name: 'current-instance', name: 'current-instance',
......
...@@ -17,58 +17,57 @@ import pouchdb from 'pouchdb' ...@@ -17,58 +17,57 @@ import pouchdb from 'pouchdb'
// server admin has to create DB first and CORS allows specific domains. // server admin has to create DB first and CORS allows specific domains.
var db = new pouchdb('https://nn.adamprocter.co.uk/testingdb'); var db = new pouchdb('https://nn.adamprocter.co.uk/testingdb');
export default { export default {
name: 'register-account', name: 'register-account',
data() { data() {
return { return {
name:'', name: '',
email:'', email: '',
domain:'', domain: '',
permissions:1, permissions: 1,
verified:false verified: false
} }
},
mounted() {
this.checkData()
}, },
mounted() {
this.checkData();
},
methods: { methods: {
register() { register() {
var uniqueid = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); var uniqueid
= Math.random()
.toString(36)
.substring(2, 15) + Math.random().toString(36).substring(2, 15)
db.put({ db.put({
_id:uniqueid, _id: uniqueid,
name:this.name, name: this.name,
email:this.email, email: this.email,
domain:this.domain, domain: this.domain,
permissions:this.permissions, permissions: this.permissions,
verified:this.verified verified: this.verified
}) })
}, },
checkData(){
checkData(){ db.info()
db.info().then(function (info) { .then(function () {
// console.log(info); //.then(function (info) {
}) })
// db.get('one').then(function (doc) { // db.get('one').then(function (doc) {
// console.log(doc); // console.log(doc);
// }); // });
db.allDocs({ db.allDocs({
include_docs: true, include_docs: true,
attachments: true attachments: true
}).then(function (result) { }).then(function () {
// handle result //}).then(function (result) {
// console.log(result) // handle result
}).catch(function (err) { // console.log(result)
// console.log(err); }).catch(function () {
}); //}).catch(function (err) {
// console.log(err);
})
}
}
} }
} }
</script> </script>
......
...@@ -29,7 +29,7 @@ export default new Vuex.Store({ ...@@ -29,7 +29,7 @@ export default new Vuex.Store({
} }
}, },
actions: { actions: {
login({ commit }, creds) { login({ commit }) {
commit(LOGIN); commit(LOGIN);
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(() => { setTimeout(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment