@live-change/db-admin 0.5.8 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front/src/CodeEditor.vue +5 -0
- package/front/src/Data.vue +24 -7
- package/front/src/DataRangeView.vue +3 -2
- package/front/src/DataView.vue +3 -2
- package/front/src/Database.vue +6 -43
- package/front/src/DatabaseAdmin.vue +29 -22
- package/front/src/Databases.vue +1 -1
- package/front/src/PathEditor.vue +19 -6
- package/front/src/links.js +39 -0
- package/front/src/main.js +0 -6
- package/front/src/routes.js +6 -4
- package/index.js +3 -0
- package/package.json +16 -16
package/front/src/CodeEditor.vue
CHANGED
|
@@ -49,6 +49,11 @@
|
|
|
49
49
|
|
|
50
50
|
const code = ref(props.initialCode !== undefined ? props.initialCode : stringify(props.initialData, null, " "))
|
|
51
51
|
|
|
52
|
+
watch(() => props.initialCode, () => {
|
|
53
|
+
if(props.initialCode == code.value) return
|
|
54
|
+
code.value = props.initialCode !== undefined ? props.initialCode : stringify(props.initialData, null, " ")
|
|
55
|
+
})
|
|
56
|
+
|
|
52
57
|
function highlight(code) {
|
|
53
58
|
return Prism.highlight(code, Prism.languages.js, "js")
|
|
54
59
|
}
|
package/front/src/Data.vue
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<PathEditor v-model="path"
|
|
4
|
-
@update:read="v => read = v"
|
|
4
|
+
@update:read="v => { read = v; version++ }"
|
|
5
5
|
@update:write="v => write = v"
|
|
6
6
|
@update:remove="v => remove = v" />
|
|
7
7
|
|
|
8
8
|
<!-- <p>{{ path }}</p>-->
|
|
9
9
|
|
|
10
10
|
<template v-if="read?.external?.includes('range')">
|
|
11
|
-
<DataRangeView v-if="read && write && remove" :
|
|
11
|
+
<DataRangeView v-if="read && write && remove" :key="'rangeView' + version"
|
|
12
|
+
:dbApi="dbApi" :read="read.result" :write="write.result" :remove="remove.result" />
|
|
12
13
|
</template>
|
|
13
14
|
<template v-else>
|
|
14
|
-
<DataView v-if="read && write && remove" :
|
|
15
|
+
<DataView v-if="read && write && remove" :key="'view' + version"
|
|
16
|
+
:dbApi="dbApi" :read="read.result" :write="write.result" :remove="remove.result" />
|
|
15
17
|
</template>
|
|
16
18
|
|
|
17
19
|
</template>
|
|
18
20
|
|
|
19
21
|
<script setup>
|
|
22
|
+
import { computed } from 'vue'
|
|
23
|
+
|
|
20
24
|
import PathEditor from "./PathEditor.vue"
|
|
21
25
|
import DataRangeView from "./DataRangeView.vue"
|
|
22
26
|
import DataView from "./DataView.vue"
|
|
23
27
|
|
|
24
28
|
const props = defineProps({
|
|
29
|
+
dbApi: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'serverDatabase'
|
|
32
|
+
},
|
|
25
33
|
position: {
|
|
26
34
|
type: String,
|
|
27
35
|
required: true
|
|
@@ -44,19 +52,27 @@
|
|
|
44
52
|
}
|
|
45
53
|
})
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
for(let i = 0; i < props.params.length/2; i++) pathParams[i] = [props.params[i * 2], props.params[i * 2 + 1]]
|
|
55
|
+
|
|
49
56
|
|
|
50
57
|
import { ref, watch } from 'vue'
|
|
51
58
|
import { useRouter, useRoute } from 'vue-router'
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
function computePath() {
|
|
61
|
+
const pathParams = new Array(props.params.length / 2)
|
|
62
|
+
for(let i = 0; i < props.params.length/2; i++) pathParams[i] = [props.params[i * 2], props.params[i * 2 + 1]]
|
|
63
|
+
return { read: props.read, write: props.write, remove: props.remove, params: pathParams }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const propsPath = computed(() => computePath())
|
|
67
|
+
|
|
68
|
+
const path = ref(propsPath.value)
|
|
69
|
+
watch(() => propsPath.value, () => path.value = propsPath.value)
|
|
54
70
|
|
|
55
71
|
const router = useRouter()
|
|
56
72
|
const route = useRoute()
|
|
57
73
|
|
|
58
74
|
watch(() => path.value, value => {
|
|
59
|
-
console.log("PATH VALUE UPDATED", value)
|
|
75
|
+
console.log("PATH VALUE UPDATED", JSON.stringify(value, null, ' '))
|
|
60
76
|
const paramsArray = value.params.flat()
|
|
61
77
|
router.replace({ name: route.name, params: {
|
|
62
78
|
read: value.read,
|
|
@@ -67,6 +83,7 @@
|
|
|
67
83
|
/// TODO: update URL
|
|
68
84
|
})
|
|
69
85
|
|
|
86
|
+
const version = ref(0)
|
|
70
87
|
const read = ref()
|
|
71
88
|
const write = ref()
|
|
72
89
|
const remove = ref()
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
class="surface-0 shadow-1 w-full">
|
|
10
10
|
<!-- {{ JSON.stringify(row) }}-->
|
|
11
11
|
<object-editor :currentData="JSON.stringify(row)"
|
|
12
|
-
:write="write" :remove="remove"
|
|
12
|
+
:write="props.write" :remove="props.remove"
|
|
13
13
|
:dbApi="dbApi" />
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import { dbViewSugar } from "./dbSugar.js"
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const props = defineProps({
|
|
31
31
|
dbApi: {
|
|
32
32
|
type: String,
|
|
33
33
|
default: 'serverDatabase'
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
})
|
|
48
48
|
|
|
49
|
+
const { dbApi, read } = props
|
|
49
50
|
|
|
50
51
|
const [ dataBuckets ] = await Promise.all([
|
|
51
52
|
rangeBuckets((range, p) => [dbApi, ...JSON.parse(JSON.stringify(read({ range }, dbViewSugar)))])
|
package/front/src/DataView.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
class="surface-0 shadow-1 w-full">
|
|
5
5
|
<!-- {{ JSON.stringify(row) }}-->
|
|
6
6
|
<object-editor :currentData="JSON.stringify(row)"
|
|
7
|
-
:write="write" :remove="remove"
|
|
7
|
+
:write="props.write" :remove="props.remove"
|
|
8
8
|
:dbApi="dbApi" />
|
|
9
9
|
</div>
|
|
10
10
|
</div>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { dbViewSugar } from "./dbSugar.js"
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const props = defineProps({
|
|
22
22
|
dbApi: {
|
|
23
23
|
type: String,
|
|
24
24
|
default: 'serverDatabase'
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
+
const { dbApi, read } = props
|
|
40
41
|
|
|
41
42
|
const [ dataRows ] = await Promise.all([
|
|
42
43
|
live({
|
package/front/src/Database.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="surface-card p-4 shadow-2 border-round w-full">
|
|
3
3
|
<div class="text-center mb-3">
|
|
4
|
-
<div class="text-900 text-3xl font-medium mb-3">Database "{{ dbName }}"</div>
|
|
4
|
+
<div class="text-900 text-3xl font-medium mb-3">Database "{{ dbName }}" @ {{ dbApi }}</div>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="text-center mb-3">
|
|
7
7
|
<div v-if="tables.length > 0" class="text-900 text-2xl font-medium mb-3">Tables</div>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<form v-if="tableRename == slotProps.data.id" @submit="ev => finishTableRename(ev, slotProps.data.id)">
|
|
17
17
|
<InputText v-model="tableNewName" />
|
|
18
18
|
</form>
|
|
19
|
-
<router-link v-else :to="tableLink(slotProps.data.id)">
|
|
19
|
+
<router-link v-else :to="tableLink(dbName, slotProps.data.id)">
|
|
20
20
|
{{ slotProps.data.id }}
|
|
21
21
|
</router-link>
|
|
22
22
|
</template>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<form v-if="logRename == slotProps.data.id" @submit="ev => finishLogRename(ev, slotProps.data.id)">
|
|
56
56
|
<InputText v-model="logNewName" />
|
|
57
57
|
</form>
|
|
58
|
-
<router-link v-else :to="logLink(slotProps.data.id)">
|
|
58
|
+
<router-link v-else :to="logLink(dbName, slotProps.data.id)">
|
|
59
59
|
{{ slotProps.data.id }}
|
|
60
60
|
</router-link>
|
|
61
61
|
</template>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<form v-if="indexRename == slotProps.data.id" @submit="ev => finishIndexRename(ev, slotProps.data.id)">
|
|
95
95
|
<InputText v-model="indexNewName" />
|
|
96
96
|
</form>
|
|
97
|
-
<router-link v-else :to="indexLink(slotProps.data.id)">
|
|
97
|
+
<router-link v-else :to="indexLink(dbName, slotProps.data.id)">
|
|
98
98
|
{{ slotProps.data.id }}
|
|
99
99
|
</router-link>
|
|
100
100
|
</template>
|
|
@@ -126,6 +126,8 @@
|
|
|
126
126
|
import ConfirmPopup from 'primevue/confirmpopup'
|
|
127
127
|
import Toast from 'primevue/toast'
|
|
128
128
|
|
|
129
|
+
import { tableLink, logLink, indexLink } from "./links.js"
|
|
130
|
+
|
|
129
131
|
const { dbApi, dbName } = defineProps({
|
|
130
132
|
dbApi: {
|
|
131
133
|
type: String,
|
|
@@ -307,45 +309,6 @@
|
|
|
307
309
|
})())
|
|
308
310
|
}
|
|
309
311
|
|
|
310
|
-
function tableLink(table) {
|
|
311
|
-
return { name: 'db:data', params: {
|
|
312
|
-
position: " ",
|
|
313
|
-
read: `db.tableRange($.db,$.table,$.range)`,
|
|
314
|
-
write: `db.put($.db,$.table,$.object)`,
|
|
315
|
-
remove: `db.delete($.db,$.table,$.object.id)`,
|
|
316
|
-
params: [
|
|
317
|
-
'db', JSON.stringify(dbName),
|
|
318
|
-
'table', JSON.stringify(table)
|
|
319
|
-
]
|
|
320
|
-
} }
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
function logLink(table) {
|
|
324
|
-
return { name: 'db:data', params: {
|
|
325
|
-
position: " ",
|
|
326
|
-
read: `db.logRange($.db,$.table,$.range)`,
|
|
327
|
-
write: false,
|
|
328
|
-
remove: false,
|
|
329
|
-
params: [
|
|
330
|
-
'db', JSON.stringify(dbName),
|
|
331
|
-
'table', JSON.stringify(table)
|
|
332
|
-
]
|
|
333
|
-
} }
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function indexLink(table) {
|
|
337
|
-
return { name: 'db:data', params: {
|
|
338
|
-
position: " ",
|
|
339
|
-
read: `db.indexRange($.db,$.table,$.range)`,
|
|
340
|
-
write: false,
|
|
341
|
-
remove: false,
|
|
342
|
-
params: [
|
|
343
|
-
'db', JSON.stringify(dbName),
|
|
344
|
-
'table', JSON.stringify(table)
|
|
345
|
-
]
|
|
346
|
-
} }
|
|
347
|
-
}
|
|
348
|
-
|
|
349
312
|
const [ tables, indexes, logs ] = await Promise.all([
|
|
350
313
|
live(dao, {
|
|
351
314
|
what: [dbApi, 'tables', dbName],
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
<ul class="list-none p-0 m-0 ml-3 overflow-hidden hidden" :id="`db-menu-${database.id}`">
|
|
23
23
|
<li>
|
|
24
|
-
<a v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
25
|
-
|
|
24
|
+
<a v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
25
|
+
hover:surface-100 transition-duration-150 transition-colors p-ripple"
|
|
26
26
|
v-styleclass="{ selector: '@next', enterClass: 'hidden', enterActiveClass: 'slidedown',
|
|
27
27
|
leaveToClass: 'hidden', leaveActiveClass: 'slideup' }">
|
|
28
28
|
<i class="pi pi-table mr-2"></i>
|
|
@@ -32,48 +32,54 @@
|
|
|
32
32
|
<ul class="list-none py-0 pl-3 pr-0 m-0 hidden overflow-y-hidden transition-all
|
|
33
33
|
transition-duration-400 transition-ease-in-out">
|
|
34
34
|
<li v-for="table in database?.tables">
|
|
35
|
-
<
|
|
35
|
+
<router-link
|
|
36
|
+
:to="tableLink(database.id, table)"
|
|
37
|
+
v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
36
38
|
hover:surface-100 transition-duration-150 transition-colors p-ripple">
|
|
37
39
|
<span class="font-medium">{{ table }}</span>
|
|
38
|
-
</
|
|
40
|
+
</router-link>
|
|
39
41
|
</li>
|
|
40
42
|
</ul>
|
|
41
43
|
</li>
|
|
42
44
|
<li>
|
|
43
|
-
<a v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
44
|
-
|
|
45
|
+
<a v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
46
|
+
hover:surface-100 transition-duration-150 transition-colors p-ripple"
|
|
45
47
|
v-styleclass="{ selector: '@next', enterClass: 'hidden', enterActiveClass: 'slidedown',
|
|
46
48
|
leaveToClass: 'hidden', leaveActiveClass: 'slideup' }">
|
|
47
|
-
<i class="pi pi-
|
|
48
|
-
<span class="font-medium">{{ database?.
|
|
49
|
+
<i class="pi pi-list mr-2"></i>
|
|
50
|
+
<span class="font-medium">{{ database?.logs?.length }} LOGS</span>
|
|
49
51
|
<i class="pi pi-chevron-down ml-auto"></i>
|
|
50
52
|
</a>
|
|
51
53
|
<ul class="list-none py-0 pl-3 pr-0 m-0 hidden overflow-y-hidden transition-all
|
|
52
54
|
transition-duration-400 transition-ease-in-out">
|
|
53
|
-
<li v-for="
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
<li v-for="log in database?.logs">
|
|
56
|
+
<router-link
|
|
57
|
+
:to="logLink(database.id, log)"
|
|
58
|
+
v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
59
|
+
hover:surface-100 transition-duration-150 transition-colors p-ripple">
|
|
60
|
+
<span class="font-medium">{{ log }}</span>
|
|
61
|
+
</router-link>
|
|
58
62
|
</li>
|
|
59
63
|
</ul>
|
|
60
64
|
</li>
|
|
61
65
|
<li>
|
|
62
|
-
<a v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
63
|
-
|
|
66
|
+
<a v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
67
|
+
hover:surface-100 transition-duration-150 transition-colors p-ripple"
|
|
64
68
|
v-styleclass="{ selector: '@next', enterClass: 'hidden', enterActiveClass: 'slidedown',
|
|
65
69
|
leaveToClass: 'hidden', leaveActiveClass: 'slideup' }">
|
|
66
|
-
<i class="pi pi-
|
|
67
|
-
<span class="font-medium">{{ database?.
|
|
70
|
+
<i class="pi pi-external-link mr-2"></i>
|
|
71
|
+
<span class="font-medium">{{ database?.indexes?.length }} INDEXES</span>
|
|
68
72
|
<i class="pi pi-chevron-down ml-auto"></i>
|
|
69
73
|
</a>
|
|
70
74
|
<ul class="list-none py-0 pl-3 pr-0 m-0 hidden overflow-y-hidden transition-all
|
|
71
75
|
transition-duration-400 transition-ease-in-out">
|
|
72
|
-
<li v-for="
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
<li v-for="index in database?.indexes">
|
|
77
|
+
<router-link
|
|
78
|
+
:to="indexLink(database.id, index)"
|
|
79
|
+
v-ripple class="flex align-items-center cursor-pointer p-3 border-round text-700
|
|
80
|
+
hover:surface-100 transition-duration-150 transition-colors p-ripple">
|
|
81
|
+
<span class="font-medium">{{ index }}</span>
|
|
82
|
+
</router-link>
|
|
77
83
|
</li>
|
|
78
84
|
</ul>
|
|
79
85
|
</li>
|
|
@@ -104,6 +110,7 @@
|
|
|
104
110
|
</template>
|
|
105
111
|
|
|
106
112
|
<script setup>
|
|
113
|
+
import { tableLink, logLink, indexLink } from "./links.js"
|
|
107
114
|
|
|
108
115
|
const { dbApi } = defineProps({
|
|
109
116
|
dbApi: {
|
package/front/src/Databases.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<Toast v-if="isMounted"></Toast>
|
|
5
5
|
|
|
6
6
|
<div class="text-center mb-5">
|
|
7
|
-
<div class="text-900 text-3xl font-medium mb-3">Databases</div>
|
|
7
|
+
<div class="text-900 text-3xl font-medium mb-3">Databases @ {{ dbApi }}</div>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<DataTable :value="databases" responsiveLayout="scroll">
|
package/front/src/PathEditor.vue
CHANGED
|
@@ -63,8 +63,9 @@
|
|
|
63
63
|
import { dbRequestSugar, dbViewSugar } from "./dbSugar.js";
|
|
64
64
|
|
|
65
65
|
import { ref, reactive, computed, watch } from "vue"
|
|
66
|
+
import { toRefs } from "@vueuse/core"
|
|
66
67
|
|
|
67
|
-
const
|
|
68
|
+
const props = defineProps({
|
|
68
69
|
modelValue: {
|
|
69
70
|
type: Object,
|
|
70
71
|
required: true
|
|
@@ -73,7 +74,16 @@
|
|
|
73
74
|
|
|
74
75
|
const emit = defineEmits(['update:modelValue', 'update:read', 'update:write', 'update:remove'])
|
|
75
76
|
|
|
76
|
-
const path = reactive(modelValue)
|
|
77
|
+
const path = reactive(JSON.parse(JSON.stringify(props.modelValue)))
|
|
78
|
+
|
|
79
|
+
watch(() => props.modelValue, value => {
|
|
80
|
+
if(JSON.stringify(path) != JSON.stringify(value)) {
|
|
81
|
+
path.read = value.read
|
|
82
|
+
path.write = value.write
|
|
83
|
+
path.remove = value.remove
|
|
84
|
+
path.params = JSON.parse(JSON.stringify(value.params))
|
|
85
|
+
}
|
|
86
|
+
})
|
|
77
87
|
|
|
78
88
|
|
|
79
89
|
function handleReadChange(result) {
|
|
@@ -112,10 +122,9 @@
|
|
|
112
122
|
allParams.push(...extractParams(path.write))
|
|
113
123
|
allParams.push(...extractParams(path.remove))
|
|
114
124
|
for(const field of path.params) {
|
|
115
|
-
console.log("FD", field, "=>", extractParams(field[1]))
|
|
125
|
+
//console.log("FD", field, "=>", extractParams(field[1]))
|
|
116
126
|
allParams.push(...extractParams(field[1]))
|
|
117
127
|
}
|
|
118
|
-
|
|
119
128
|
const paramsSet = new Set(allParams)
|
|
120
129
|
paramsSet.delete('range')
|
|
121
130
|
paramsSet.delete('object')
|
|
@@ -149,8 +158,12 @@
|
|
|
149
158
|
})
|
|
150
159
|
|
|
151
160
|
watch(() => output.value, value => {
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
if(JSON.stringify(props.modelValue) != JSON.stringify(value)) {
|
|
162
|
+
console.log("EMIT OUTPUT!", JSON.stringify(props.modelValue), JSON.stringify(value))
|
|
163
|
+
emit('update:modelValue', output.value)
|
|
164
|
+
} else {
|
|
165
|
+
console.log("DROP OUTPUT CHANGE", JSON.stringify(props.modelValue), JSON.stringify(value))
|
|
166
|
+
}
|
|
154
167
|
})
|
|
155
168
|
|
|
156
169
|
const readCompiled = computed(() => {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
export function tableLink(dbName, table) {
|
|
3
|
+
return { name: 'db:data', params: {
|
|
4
|
+
position: " ",
|
|
5
|
+
read: `db.tableRange($.db,$.table,$.range)`,
|
|
6
|
+
write: `db.put($.db,$.table,$.object)`,
|
|
7
|
+
remove: `db.delete($.db,$.table,$.object.id)`,
|
|
8
|
+
params: [
|
|
9
|
+
'db', JSON.stringify(dbName),
|
|
10
|
+
'table', JSON.stringify(table)
|
|
11
|
+
]
|
|
12
|
+
} }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function logLink(dbName, table) {
|
|
16
|
+
return { name: 'db:data', params: {
|
|
17
|
+
position: " ",
|
|
18
|
+
read: `db.logRange($.db,$.table,$.range)`,
|
|
19
|
+
write: false,
|
|
20
|
+
remove: false,
|
|
21
|
+
params: [
|
|
22
|
+
'db', JSON.stringify(dbName),
|
|
23
|
+
'table', JSON.stringify(table)
|
|
24
|
+
]
|
|
25
|
+
} }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function indexLink(dbName, table) {
|
|
29
|
+
return { name: 'db:data', params: {
|
|
30
|
+
position: " ",
|
|
31
|
+
read: `db.indexRange($.db,$.table,$.range)`,
|
|
32
|
+
write: false,
|
|
33
|
+
remove: false,
|
|
34
|
+
params: [
|
|
35
|
+
'db', JSON.stringify(dbName),
|
|
36
|
+
'table', JSON.stringify(table)
|
|
37
|
+
]
|
|
38
|
+
} }
|
|
39
|
+
}
|
package/front/src/main.js
CHANGED
|
@@ -17,16 +17,10 @@ import App from './App.vue'
|
|
|
17
17
|
import Page from './Page.vue'
|
|
18
18
|
import { createRouter } from './router'
|
|
19
19
|
|
|
20
|
-
import emailValidator from "@live-change/email-service/clientEmailValidator.js"
|
|
21
|
-
import passwordValidator from "@live-change/password-authentication-service/clientPasswordValidator.js"
|
|
22
|
-
|
|
23
20
|
// SSR requires a fresh app instance per request, therefore we export a function
|
|
24
21
|
// that creates a fresh app instance. If using Vuex, we'd also be creating a
|
|
25
22
|
// fresh store here.
|
|
26
23
|
export function createApp(api) {
|
|
27
|
-
api.validators.email = emailValidator
|
|
28
|
-
api.validators.password = passwordValidator
|
|
29
|
-
|
|
30
24
|
const app = createSSRApp(App)
|
|
31
25
|
app.config.devtools = true
|
|
32
26
|
|
package/front/src/routes.js
CHANGED
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
export function routes(config = {}) {
|
|
3
3
|
const { prefix = '/', route = (r) => r } = config
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const { dbApi = 'serverDatabase' } = config
|
|
6
6
|
|
|
7
|
+
return [
|
|
7
8
|
route({
|
|
8
9
|
path: prefix,
|
|
9
10
|
name: 'db:databases',
|
|
10
|
-
component: () => import("./Databases.vue")
|
|
11
|
+
component: () => import("./Databases.vue"),
|
|
12
|
+
props: (route) => ({ ...route.params, dbApi })
|
|
11
13
|
}),
|
|
12
14
|
|
|
13
15
|
route({
|
|
14
16
|
path: prefix+'db/:dbName',
|
|
15
17
|
name: 'db:database',
|
|
16
18
|
component: () => import("./Database.vue"),
|
|
17
|
-
props:
|
|
19
|
+
props: (route) => ({ ...route.params, dbApi })
|
|
18
20
|
}),
|
|
19
21
|
|
|
20
22
|
route({
|
|
@@ -22,7 +24,7 @@ export function routes(config = {}) {
|
|
|
22
24
|
name: 'db:data',
|
|
23
25
|
meta: { pageType: 'wide' },
|
|
24
26
|
component: () => import("./Data.vue"),
|
|
25
|
-
props:
|
|
27
|
+
props: (route) => ({ ...route.params, dbApi })
|
|
26
28
|
}),
|
|
27
29
|
|
|
28
30
|
]
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-admin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "lcli memDev --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "rm tmp.db; lcli localDev --initScript ./init.js --dbAccess",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"debug": "node --inspect-brk server"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@live-change/cli": "0.6.
|
|
21
|
-
"@live-change/dao": "0.4.
|
|
22
|
-
"@live-change/dao-vue3": "0.4.
|
|
23
|
-
"@live-change/dao-websocket": "0.4.
|
|
24
|
-
"@live-change/framework": "0.6.
|
|
25
|
-
"@live-change/message-authentication-service": "0.2.
|
|
26
|
-
"@live-change/secret-code-service": "0.2.
|
|
27
|
-
"@live-change/secret-link-service": "0.2.
|
|
28
|
-
"@live-change/vue3-components": "0.2.
|
|
29
|
-
"@live-change/vue3-ssr": "0.2.
|
|
20
|
+
"@live-change/cli": "0.6.5",
|
|
21
|
+
"@live-change/dao": "0.4.10",
|
|
22
|
+
"@live-change/dao-vue3": "0.4.11",
|
|
23
|
+
"@live-change/dao-websocket": "0.4.10",
|
|
24
|
+
"@live-change/framework": "0.6.5",
|
|
25
|
+
"@live-change/message-authentication-service": "0.2.33",
|
|
26
|
+
"@live-change/secret-code-service": "0.2.33",
|
|
27
|
+
"@live-change/secret-link-service": "0.2.33",
|
|
28
|
+
"@live-change/vue3-components": "0.2.10",
|
|
29
|
+
"@live-change/vue3-ssr": "0.2.10",
|
|
30
30
|
"@vitejs/plugin-vue": "^2.3.1",
|
|
31
31
|
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
|
32
32
|
"@vue/compiler-sfc": "^3.2.33",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"javascript-stringify": "^2.1.0",
|
|
39
39
|
"primeflex": "^3.1.3",
|
|
40
40
|
"primeicons": "^5.0.0",
|
|
41
|
-
"primevue": "^3.12.
|
|
41
|
+
"primevue": "^3.12.6",
|
|
42
42
|
"prism-es6": "^1.2.0",
|
|
43
43
|
"prismjs": "^1.28.0",
|
|
44
44
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"serialize-javascript": "^6.0.0",
|
|
47
47
|
"serve-static": "^1.15.0",
|
|
48
48
|
"v-shared-element": "3.1.0",
|
|
49
|
-
"vite": "^2.9.
|
|
49
|
+
"vite": "^2.9.6",
|
|
50
50
|
"vite-plugin-compression": "0.5.1",
|
|
51
51
|
"vite-plugin-vue-images": "^0.6.1",
|
|
52
52
|
"vue": "^3.2.33",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"vue3-scroll-border": "0.1.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@live-change/codeceptjs-helper": "0.6.
|
|
59
|
+
"@live-change/codeceptjs-helper": "0.6.5",
|
|
60
60
|
"@wdio/selenium-standalone-service": "^7.19.5",
|
|
61
|
-
"codeceptjs": "^3.3.
|
|
61
|
+
"codeceptjs": "^3.3.1",
|
|
62
62
|
"generate-password": "1.7.0",
|
|
63
63
|
"playwright": "^1.21.1",
|
|
64
64
|
"random-profile-generator": "^2.3.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"author": "",
|
|
69
69
|
"license": "ISC",
|
|
70
70
|
"description": "",
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "459aba0a8b3096f664d4820df8cac99a7ea0d26e"
|
|
72
72
|
}
|