@mixd-id/web-scaffold 0.1.230406344 → 0.1.230406346
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/package.json +1 -1
- package/src/components/Modal.vue +2 -1
- package/src/components/VirtualTable.vue +1 -1
- package/src/index.js +3 -0
- package/src/utils/dashboard.js +33 -2
- package/src/widgets/Dashboard/BarChart.vue +31 -3
- package/src/widgets/Dashboard/BarChartSetting.vue +5 -0
- package/src/widgets/Dashboard/DatasourceSelector.vue +7 -43
- package/src/widgets/Dashboard/Doughnut.vue +17 -3
- package/src/widgets/Dashboard/DoughnutSetting.vue +5 -0
- package/src/widgets/Dashboard/Metric.vue +10 -2
- package/src/widgets/Dashboard/MetricSetting.vue +5 -0
- package/src/widgets/Dashboard/Pie.vue +17 -15
- package/src/widgets/Dashboard/PieSetting.vue +5 -0
- package/src/widgets/Dashboard/VirtualTableSetting.vue +5 -0
- package/src/widgets/Dashboard.vue +9 -13
- package/src/widgets/WebPageBuilder4/GridSetting.vue +108 -95
- package/src/widgets/Dashboard/DatasourceCreator.vue +0 -197
package/package.json
CHANGED
package/src/components/Modal.vue
CHANGED
|
@@ -112,9 +112,10 @@ export default{
|
|
|
112
112
|
this.context = context
|
|
113
113
|
|
|
114
114
|
if(this.hash){
|
|
115
|
+
const hash = context.hash ?? this.hash
|
|
115
116
|
this.$router.push({
|
|
116
117
|
...this.$route,
|
|
117
|
-
hash: this.$route.hash.replace(
|
|
118
|
+
hash: this.$route.hash.replace(hash, '') + hash
|
|
118
119
|
})
|
|
119
120
|
}
|
|
120
121
|
else{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<thead>
|
|
7
7
|
<tr>
|
|
8
8
|
<th v-for="column in visibleColumns" :style="thStyle(column)" :class="thClass(column)"
|
|
9
|
-
v-tooltip="
|
|
9
|
+
v-tooltip="column.tooltip">
|
|
10
10
|
<slot v-if="$slots['col-' + column.key]" :name="'col-' + column.key" :column="column"></slot>
|
|
11
11
|
<div v-else :class="headerColumnClass(column)">
|
|
12
12
|
<span>{{ column.label2 ? column.label2 : (column.label ?? column.key) }}</span>
|
package/src/index.js
CHANGED
package/src/utils/dashboard.js
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
const {presetToSequelizeList} = require("./preset-selector");
|
|
2
2
|
|
|
3
3
|
const backgroundColors = [
|
|
4
|
-
|
|
4
|
+
"#FF5733", // Bright Red
|
|
5
|
+
"#33FF57", // Bright Green
|
|
6
|
+
"#3357FF", // Bright Blue
|
|
7
|
+
"#FFC300", // Bright Yellow
|
|
8
|
+
"#28B463", // Emerald Green
|
|
9
|
+
"#2874A6", // Deep Blue
|
|
10
|
+
"#F39C12", // Orange
|
|
11
|
+
"#8E44AD", // Purple
|
|
12
|
+
"#1ABC9C", // Aqua
|
|
13
|
+
"#3498DB", // Sky Blue
|
|
14
|
+
"#2ECC71", // Green
|
|
15
|
+
"#F1C40F", // Yellow
|
|
16
|
+
"#34495E", // Dark Slate
|
|
17
|
+
"#7D3C98", // Amethyst
|
|
18
|
+
"#16A085", // Teal
|
|
19
|
+
"#E67E22", // Carrot Orange
|
|
20
|
+
"#2C3E50", // Dark Blue
|
|
21
|
+
"#D35400", // Pumpkin Orange
|
|
22
|
+
"#7FB3D5", // Light Blue
|
|
23
|
+
"#B03A2E", // Rust
|
|
24
|
+
"#1F618D", // Steel Blue
|
|
25
|
+
"#A93226", // Dark Red
|
|
26
|
+
"#48C9B0", // Light Teal
|
|
27
|
+
"#E74C3C", // Red
|
|
28
|
+
"#AF7AC5", // Lavender
|
|
29
|
+
"#45B39D", // Seafoam
|
|
30
|
+
"#5D6D7E", // Gray Blue
|
|
31
|
+
"#52BE80", // Light Green
|
|
32
|
+
"#F5B041", // Saffron
|
|
33
|
+
"#BDC3C7" // Light Gray
|
|
34
|
+
|
|
35
|
+
/*'#5D9CEC',
|
|
5
36
|
'#A0D468',
|
|
6
37
|
'#FFCE54',
|
|
7
38
|
'#FC6E51',
|
|
@@ -10,7 +41,7 @@ const backgroundColors = [
|
|
|
10
41
|
'#4FC1E9',
|
|
11
42
|
'#FFCE54',
|
|
12
43
|
'#ED5565',
|
|
13
|
-
'#EC87C0'
|
|
44
|
+
'#EC87C0'*/
|
|
14
45
|
]
|
|
15
46
|
|
|
16
47
|
const getModelFromDatasource = async (datasource, opt) => {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<div v-if="yAxeMultiple" class="flex flex-row justify-center gap-1">
|
|
13
13
|
<div v-for="(yLegend, idx) in yLegends"
|
|
14
14
|
class="p-0.5 px-1 rounded-lg text-black cursor-default text-xs w-[50px] text-center text-ellipsis overflow-hidden whitespace-nowrap capitalize"
|
|
15
|
-
:style="{ backgroundColor:
|
|
16
|
-
{{ (yLegend ?? '').toString().split(' ')[0].toLowerCase() }}
|
|
15
|
+
:style="{ backgroundColor:yLegend.color }">
|
|
16
|
+
{{ (yLegend.key ?? '').toString().split(' ')[0].toLowerCase() }}
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import {Bar} from 'vue-chartjs'
|
|
26
26
|
import Chart from 'chart.js/auto'
|
|
27
|
+
import { color } from 'chart.js/helpers'
|
|
27
28
|
import {useDatasource} from "../../stores/datasource";
|
|
28
29
|
|
|
29
30
|
export default{
|
|
@@ -42,7 +43,22 @@ export default{
|
|
|
42
43
|
},
|
|
43
44
|
|
|
44
45
|
chartData(){
|
|
45
|
-
|
|
46
|
+
if(!this.value?.datasets)
|
|
47
|
+
return { labels:[], datasets:[] }
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
labels: this.value?.labels ?? [],
|
|
51
|
+
datasets: this.value.datasets.map(_ => {
|
|
52
|
+
return {
|
|
53
|
+
..._,
|
|
54
|
+
borderWidth: 1,
|
|
55
|
+
borderColor: function(context, options) {
|
|
56
|
+
const hex = options.color;
|
|
57
|
+
return color(hex).darken(0.5).rgbString()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
46
62
|
},
|
|
47
63
|
|
|
48
64
|
chartOptions(){
|
|
@@ -53,6 +69,18 @@ export default{
|
|
|
53
69
|
plugins: {
|
|
54
70
|
legend: {
|
|
55
71
|
display: false // This hides the legend
|
|
72
|
+
},
|
|
73
|
+
tooltip: {
|
|
74
|
+
callbacks: {
|
|
75
|
+
title: function(tooltipItems) {
|
|
76
|
+
return `${tooltipItems[0].label}`;
|
|
77
|
+
},
|
|
78
|
+
label: (tooltipItem) => {
|
|
79
|
+
if(this.usePercentage)
|
|
80
|
+
return `${tooltipItem.dataset.label}: ${tooltipItem.dataset.data0[tooltipItem.dataIndex]} (${tooltipItem.raw}%)`
|
|
81
|
+
return `${tooltipItem.dataset.label}: ${tooltipItem.raw}`;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
56
84
|
}
|
|
57
85
|
},
|
|
58
86
|
scales: {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-col gap-5 p-6">
|
|
3
3
|
|
|
4
|
+
<div class="flex flex-row items-center">
|
|
5
|
+
<label class="flex-1">Active</label>
|
|
6
|
+
<Switch v-model="value.props.enabled" :readonly="readonly" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
4
9
|
<div class="flex flex-col gap-1">
|
|
5
10
|
<div class="flex flex-row gap-2">
|
|
6
11
|
<label class="flex-1">Datasource</label>
|
|
@@ -15,17 +15,11 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
17
17
|
<template v-slot:foot>
|
|
18
|
-
<div
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</button>
|
|
24
|
-
|
|
25
|
-
<DatasourceCreator ref="creator"
|
|
26
|
-
:analyse-src="analyseSrc"
|
|
27
|
-
:save-src="saveSrc"
|
|
28
|
-
@save="load" />
|
|
18
|
+
<div class="p-6 flex justify-center">
|
|
19
|
+
<router-link :to="listSrc" target="_blank" class="text-primary flex flex-row items-center">
|
|
20
|
+
Datasource Manager
|
|
21
|
+
<svg class="inline ml-2 fill-primary" width="11" height="11" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M392 320c-13.25 0-24 10.75-24 24v112c0 4.406-3.594 8-8 8h-304c-4.406 0-8-3.594-8-8v-304c0-4.406 3.594-8 8-8h112C181.3 144 192 133.3 192 120S181.3 96 168 96h-112C25.13 96 0 121.1 0 152v304C0 486.9 25.13 512 56 512h304c30.88 0 56-25.12 56-56v-112C416 330.8 405.3 320 392 320zM488 0H320c-13.25 0-24 10.75-24 24S306.8 48 320 48h110.1L183 295c-9.375 9.375-9.375 24.56 0 33.94C187.7 333.7 193.8 336 200 336s12.28-2.344 16.97-7.031L464 81.94V192c0 13.25 10.75 24 24 24S512 205.3 512 192V24C512 10.75 501.3 0 488 0z"/></svg>
|
|
22
|
+
</router-link>
|
|
29
23
|
</div>
|
|
30
24
|
</template>
|
|
31
25
|
<div class="flex-1 p-6 flex">
|
|
@@ -36,24 +30,7 @@
|
|
|
36
30
|
:class="dashboardStyle.button"
|
|
37
31
|
class="flex flex-row items-start gap-2">
|
|
38
32
|
<button type="button" class="flex-1 text-left" @click="add(datasource)">{{ datasource.name }}</button>
|
|
39
|
-
<button v-if="contextMenuItems.length > 0" type="button" class="py-1" :ref="`btn${idx}`" @click="$refs.contextMenu.open($refs[`btn${idx}`][0], { datasource })">
|
|
40
|
-
<svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M128 64c0-35.39-28.62-64-64-64S0 28.61 0 64s28.62 64 64 64S128 99.39 128 64zM128 256c0-35.39-28.62-64-64-64S0 220.6 0 256s28.62 64 64 64S128 291.4 128 256zM128 448c0-35.39-28.62-64-64-64s-64 28.61-64 64s28.62 64 64 64S128 483.4 128 448z"/></svg>
|
|
41
|
-
</button>
|
|
42
33
|
</div>
|
|
43
|
-
|
|
44
|
-
<ContextMenu ref="contextMenu" position="bottom-right">
|
|
45
|
-
<template #default="{ context }">
|
|
46
|
-
<div class="flex flex-col min-w-[200px]">
|
|
47
|
-
<div v-for="item in contextMenuItems">
|
|
48
|
-
<button v-if="item.type === 'remove'" class="w-full p-3 text-left flex flex-row" :class="appStyle.menuItem"
|
|
49
|
-
@click="remove(context.datasource)">
|
|
50
|
-
{{ $t('Remove') }}
|
|
51
|
-
</button>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
</div>
|
|
55
|
-
</template>
|
|
56
|
-
</ContextMenu>
|
|
57
34
|
</div>
|
|
58
35
|
|
|
59
36
|
<div v-else class="flex-1 flex items-center justify-center">
|
|
@@ -69,12 +46,10 @@
|
|
|
69
46
|
<script>
|
|
70
47
|
|
|
71
48
|
import Modal from "../../components/Modal.vue"
|
|
72
|
-
import md5 from "md5";
|
|
73
|
-
import DatasourceCreator from "./DatasourceCreator.vue";
|
|
74
49
|
|
|
75
50
|
export default{
|
|
76
51
|
|
|
77
|
-
components: {
|
|
52
|
+
components: { Modal },
|
|
78
53
|
|
|
79
54
|
emits: [ 'add' ],
|
|
80
55
|
|
|
@@ -82,11 +57,7 @@ export default{
|
|
|
82
57
|
|
|
83
58
|
props: {
|
|
84
59
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
saveSrc: String,
|
|
88
|
-
|
|
89
|
-
removeSrc: String,
|
|
60
|
+
listSrc: String,
|
|
90
61
|
|
|
91
62
|
src: String,
|
|
92
63
|
|
|
@@ -94,13 +65,6 @@ export default{
|
|
|
94
65
|
|
|
95
66
|
computed: {
|
|
96
67
|
|
|
97
|
-
contextMenuItems(){
|
|
98
|
-
return [
|
|
99
|
-
this.removeSrc ? { type:'remove' } : null
|
|
100
|
-
]
|
|
101
|
-
.filter(_=>_)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
68
|
},
|
|
105
69
|
|
|
106
70
|
data(){
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { Doughnut } from 'vue-chartjs'
|
|
18
18
|
import Chart from 'chart.js/auto'
|
|
19
|
+
import {color} from "chart.js/helpers";
|
|
19
20
|
|
|
20
21
|
export default{
|
|
21
22
|
|
|
@@ -26,9 +27,22 @@ export default{
|
|
|
26
27
|
computed: {
|
|
27
28
|
|
|
28
29
|
chartData(){
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if(!this.value?.datasets)
|
|
31
|
+
return { labels:[], datasets:[] }
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
labels: this.value?.labels ?? [],
|
|
35
|
+
datasets: this.value.datasets.map(_ => {
|
|
36
|
+
return {
|
|
37
|
+
..._,
|
|
38
|
+
borderWidth: 1,
|
|
39
|
+
borderColor: function(context, options) {
|
|
40
|
+
const hex = options.color;
|
|
41
|
+
return color(hex).darken(0.5).rgbString()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
32
46
|
},
|
|
33
47
|
|
|
34
48
|
chartOptions(){
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-col gap-5 p-6">
|
|
3
3
|
|
|
4
|
+
<div class="flex flex-row items-center">
|
|
5
|
+
<label class="flex-1">Active</label>
|
|
6
|
+
<Switch v-model="value.props.enabled" :readonly="readonly" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
4
9
|
<div>
|
|
5
10
|
<label class="text-text-400">Datasource</label>
|
|
6
11
|
<Dropdown class="min-w-[150px]"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</h1>
|
|
8
8
|
<div class="flex flex-col" v-if="column2Enabled">
|
|
9
9
|
<div class="text-sm text-ellipsis whitespace-nowrap overflow-hidden" :class="value?.comparedPercent <= 50 ? 'text-red-600' : 'text-green-600'">{{ value?.comparedPercent }}%</div>
|
|
10
|
-
<div class="text-sm text-ellipsis whitespace-nowrap overflow-hidden">{{
|
|
10
|
+
<div class="text-sm text-ellipsis whitespace-nowrap overflow-hidden">{{ ccValue }}</div>
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
@@ -24,7 +24,15 @@ export default{
|
|
|
24
24
|
cValue(){
|
|
25
25
|
let value = parseFloat(this.value?.value)
|
|
26
26
|
if(isNaN(value)) return 'N/A'
|
|
27
|
-
return value
|
|
27
|
+
return value.toLocaleString()
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
ccValue(){
|
|
31
|
+
if(!this.column2Enabled) return
|
|
32
|
+
|
|
33
|
+
let value = parseFloat(this.value?.comparedValue)
|
|
34
|
+
if(isNaN(value)) return 'N/A'
|
|
35
|
+
return value.toLocaleString()
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
},
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-col gap-5 p-6">
|
|
3
3
|
|
|
4
|
+
<div class="flex flex-row items-center">
|
|
5
|
+
<label class="flex-1">Active</label>
|
|
6
|
+
<Switch v-model="value.props.enabled" :readonly="readonly" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
4
9
|
<div class="flex flex-col gap-1">
|
|
5
10
|
<div class="flex flex-row gap-2">
|
|
6
11
|
<label class="flex-1">Datasource</label>
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { Pie } from 'vue-chartjs'
|
|
18
18
|
import Chart from 'chart.js/auto'
|
|
19
|
+
import { color } from 'chart.js/helpers'
|
|
19
20
|
|
|
20
21
|
export default{
|
|
21
22
|
|
|
@@ -26,9 +27,22 @@ export default{
|
|
|
26
27
|
computed: {
|
|
27
28
|
|
|
28
29
|
chartData(){
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if(!this.value?.datasets)
|
|
31
|
+
return { labels:[], datasets:[] }
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
labels: this.value?.labels ?? [],
|
|
35
|
+
datasets: this.value.datasets.map(_ => {
|
|
36
|
+
return {
|
|
37
|
+
..._,
|
|
38
|
+
borderWidth: 1,
|
|
39
|
+
borderColor: function(context, options) {
|
|
40
|
+
const hex = options.color;
|
|
41
|
+
return color(hex).darken(0.5).rgbString()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
32
46
|
},
|
|
33
47
|
|
|
34
48
|
chartOptions(){
|
|
@@ -49,18 +63,6 @@ export default{
|
|
|
49
63
|
|
|
50
64
|
data(){
|
|
51
65
|
return {
|
|
52
|
-
backgroundColors: [
|
|
53
|
-
'#5D9CEC',
|
|
54
|
-
'#A0D468',
|
|
55
|
-
'#FFCE54',
|
|
56
|
-
'#FC6E51',
|
|
57
|
-
'#48CFAD',
|
|
58
|
-
'#AC92EC',
|
|
59
|
-
'#4FC1E9',
|
|
60
|
-
'#FFCE54',
|
|
61
|
-
'#ED5565',
|
|
62
|
-
'#EC87C0'
|
|
63
|
-
],
|
|
64
66
|
}
|
|
65
67
|
},
|
|
66
68
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-col gap-6 p-6">
|
|
3
3
|
|
|
4
|
+
<div class="flex flex-row items-center">
|
|
5
|
+
<label class="flex-1">Active</label>
|
|
6
|
+
<Switch v-model="value.props.enabled" :readonly="readonly" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
4
9
|
<div>
|
|
5
10
|
<label class="text-text-400">Datasource</label>
|
|
6
11
|
<Dropdown class="min-w-[150px]"
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
+
<div class="flex flex-row items-center px-5">
|
|
5
|
+
<label class="flex-1">Active</label>
|
|
6
|
+
<Switch v-model="value.props.enabled" :readonly="readonly" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
4
9
|
<div class="flex justify-center border-b-[1px] border-text-50" v-if="tabItems.length > 1">
|
|
5
10
|
<Tabs :items="tabItems" v-model="value.tabIndex" />
|
|
6
11
|
</div>
|
|
@@ -430,7 +430,8 @@
|
|
|
430
430
|
<svg v-else-if="item.type === 'Pie'" class="fill-text-200" width="14" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M559.7 288l-237.2-.0006l157.1 158c6.124 6.124 15.99 6.484 22.24 .7343c38.62-36.5 65.25-85.62 73.12-140.9C577.2 296.4 569.4 288 559.7 288zM543.1 223.2c-8.249-119.5-103.7-214.1-223.2-223.2c-9.124-.6249-16.76 7.113-16.76 16.24L304 240l223.7-.0012C536.9 240 544.6 232.4 543.1 223.2zM256 288V50.75c0-9.624-8.369-17.48-17.87-16.11C119 51.52 27.89 155.6 32.14 280.4c4.375 128.1 114.8 233.2 242.9 231.6c50.37-.6249 97-16.88 135.2-44c7.999-5.624 8.487-17.24 1.612-24.11L256 288z"/></svg>
|
|
431
431
|
<svg v-else-if="item.type === 'PolarArea'" class="fill-text-200" width="14" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M119.1 272C107.1 252.1 87.55 240 64 240c-35.25 0-64 28.75-64 64s28.75 64 64 64c23.55 0 43.96-12.97 55.08-32h60.15C177.1 325.7 176 314.1 176 304s1.127-21.66 3.229-32H119.1zM576 192c35.25 0 64-28.75 64-64s-28.75-64-64-64s-64 28.75-64 64S540.8 192 576 192zM576 384c-11.19 0-21.66 3.094-30.78 8.213l-86.1-52.2C461.6 328.5 464 316.6 464 304c0-16.77-3.436-32.68-9.301-47.36l67.3-49.36c-17.94-12.26-31.13-30.59-37.53-51.86l-67.96 49.84C394.5 187.3 366.7 176 336 176c-7.988 0-15.74 .9492-23.32 2.352L276.3 100.3C283.5 89.98 288 77.54 288 64c0-35.25-28.75-64-64-64S160 28.75 160 64c0 33.29 25.73 60.47 58.28 63.42l36.57 78.36C226.5 229.3 208 264.3 208 304c0 70.67 57.33 128 128 128c34.97 0 66.61-14.11 89.71-36.85l86.39 51.83C512.1 447.3 512 447.7 512 448c0 35.25 28.75 64 64 64S640 483.3 640 448S611.3 384 576 384zM336 352C309.5 352 288 330.5 288 304S309.5 256 336 256S384 277.5 384 304S362.5 352 336 352z"/></svg>
|
|
432
432
|
</div>
|
|
433
|
-
<div class="flex-1 text-ellipsis overflow-hidden whitespace-nowrap"
|
|
433
|
+
<div class="flex-1 text-ellipsis overflow-hidden whitespace-nowrap"
|
|
434
|
+
:class="!item.props?.enabled ? 'line-through opacity-50' : ''">
|
|
434
435
|
<strong @click="cConfig.selectedView = item.uid" class="hover:text-primary">
|
|
435
436
|
{{ item.props?.label ?? (item.name ?? item.type) }}
|
|
436
437
|
</strong>
|
|
@@ -712,9 +713,7 @@
|
|
|
712
713
|
|
|
713
714
|
<DatasourceSelector ref="chooseDatasource"
|
|
714
715
|
:src="datasourceSrc"
|
|
715
|
-
:
|
|
716
|
-
:saveSrc="saveDatasourceSrc"
|
|
717
|
-
:removeSrc="removeDatasourceSrc"
|
|
716
|
+
:list-src="datasourceListSrc"
|
|
718
717
|
@add="addDatasource" />
|
|
719
718
|
|
|
720
719
|
<ViewSelector ref="chooseView" />
|
|
@@ -722,7 +721,6 @@
|
|
|
722
721
|
<DatasourcePreview ref="datasourcePreview" :src="previewSrc" />
|
|
723
722
|
|
|
724
723
|
</div>
|
|
725
|
-
<div v-else>{{ $t('Loading...') }}</div>
|
|
726
724
|
</template>
|
|
727
725
|
|
|
728
726
|
<script>
|
|
@@ -944,7 +942,7 @@ export default{
|
|
|
944
942
|
|
|
945
943
|
previewData: null,
|
|
946
944
|
|
|
947
|
-
readyState:
|
|
945
|
+
readyState: 1,
|
|
948
946
|
|
|
949
947
|
selectedViewUid: null,
|
|
950
948
|
|
|
@@ -1213,12 +1211,15 @@ export default{
|
|
|
1213
1211
|
if(!this.viewedComponents) return
|
|
1214
1212
|
|
|
1215
1213
|
const views = this.recurseViews(this.viewedComponents, uids)
|
|
1214
|
+
if(views?.length < 1) return
|
|
1216
1215
|
|
|
1216
|
+
if(!uids) this.readyState = 0
|
|
1217
1217
|
this.socket.send(this.src, { views })
|
|
1218
1218
|
.then(_ => {
|
|
1219
1219
|
Object.assign(this.values, _)
|
|
1220
|
-
this.readyState = 1
|
|
1221
1220
|
})
|
|
1221
|
+
.catch(err => this.alert(err))
|
|
1222
|
+
.finally(_ => this.readyState = 1)
|
|
1222
1223
|
},
|
|
1223
1224
|
|
|
1224
1225
|
async loadNext(component){
|
|
@@ -1307,15 +1308,10 @@ export default{
|
|
|
1307
1308
|
|
|
1308
1309
|
config: Object,
|
|
1309
1310
|
|
|
1310
|
-
analyseDatasourceSrc: String,
|
|
1311
|
-
|
|
1312
1311
|
src: String,
|
|
1313
1312
|
|
|
1314
|
-
removeDatasourceSrc: String,
|
|
1315
|
-
|
|
1316
|
-
saveDatasourceSrc: String,
|
|
1317
|
-
|
|
1318
1313
|
datasourceSrc: String,
|
|
1314
|
+
datasourceListSrc: String,
|
|
1319
1315
|
|
|
1320
1316
|
previewSrc: String,
|
|
1321
1317
|
|
|
@@ -1,110 +1,123 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
|
-
<strong>Grid Setting</strong>
|
|
4
3
|
|
|
5
4
|
<div class="flex flex-row items-center">
|
|
6
|
-
<label class="flex-1">
|
|
5
|
+
<label class="flex-1">Active</label>
|
|
7
6
|
<Switch v-model="value.props.enabled" :readonly="readonly" />
|
|
8
7
|
</div>
|
|
9
8
|
|
|
10
|
-
<div class="flex flex-
|
|
11
|
-
<label class="flex-1">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<option v-for="i in 12" :value="`${viewType}grid-cols-${i}`">{{ i }}</option>
|
|
19
|
-
<option :value="`${viewType}grid-cols-none`">None</option>
|
|
20
|
-
</Dropdown>
|
|
9
|
+
<div class="flex flex-col gap-1">
|
|
10
|
+
<label class="flex-1">Label</label>
|
|
11
|
+
<Textbox v-model="value.props.label"
|
|
12
|
+
maxlength="30"
|
|
13
|
+
placeholder="Label"
|
|
14
|
+
:readonly="readonly"
|
|
15
|
+
@keyup.enter="$emit('change')"
|
|
16
|
+
@blur="$emit('change')" />
|
|
21
17
|
</div>
|
|
22
18
|
|
|
23
|
-
<div class="
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
<div class="grid grid-cols-3 gap-3">
|
|
20
|
+
<div>
|
|
21
|
+
<label class="flex-1">Columns</label>
|
|
22
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
23
|
+
v-show="viewType === _.value"
|
|
24
|
+
v-model="columns[idx]"
|
|
25
|
+
:readonly="readonly">
|
|
26
|
+
<option value="">Default</option>
|
|
27
|
+
<option v-for="i in 12" :value="`${viewType}grid-cols-${i}`">{{ i }}</option>
|
|
28
|
+
<option :value="`${viewType}grid-cols-none`">None</option>
|
|
29
|
+
</Dropdown>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div>
|
|
33
|
+
<label class="flex-1">Rows</label>
|
|
34
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
35
|
+
v-show="viewType === _.value"
|
|
36
|
+
v-model="rows[idx]"
|
|
37
|
+
:readonly="readonly">
|
|
38
|
+
<option value="">Default</option>
|
|
39
|
+
<option v-for="i in 12" :value="`${viewType}grid-rows-${i}`">{{ i }}</option>
|
|
40
|
+
<option :value="`${viewType}grid-rows-none`">None</option>
|
|
41
|
+
</Dropdown>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div>
|
|
45
|
+
<label class="flex-1">Gap</label>
|
|
46
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
47
|
+
v-show="viewType === _.value"
|
|
48
|
+
v-model="gap[idx]"
|
|
49
|
+
:readonly="readonly">
|
|
50
|
+
<option value="">Not Set</option>
|
|
51
|
+
<option :value="`${viewType}gap-0`">0</option>
|
|
52
|
+
<option :value="`${viewType}gap-1`">1</option>
|
|
53
|
+
<option :value="`${viewType}gap-2`">2</option>
|
|
54
|
+
<option :value="`${viewType}gap-3`">3</option>
|
|
55
|
+
<option :value="`${viewType}gap-4`">4</option>
|
|
56
|
+
<option :value="`${viewType}gap-5`">5</option>
|
|
57
|
+
<option :value="`${viewType}gap-6`">6</option>
|
|
58
|
+
<option :value="`${viewType}gap-7`">7</option>
|
|
59
|
+
<option :value="`${viewType}gap-8`">8</option>
|
|
60
|
+
</Dropdown>
|
|
61
|
+
</div>
|
|
34
62
|
</div>
|
|
35
63
|
|
|
36
|
-
<div class="
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
<div class="grid grid-cols-2 gap-3">
|
|
65
|
+
<div>
|
|
66
|
+
<label class="flex-1">Align Items</label>
|
|
67
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
68
|
+
v-show="viewType === _.value"
|
|
69
|
+
v-model="alignItems[idx]"
|
|
70
|
+
:readonly="readonly">
|
|
71
|
+
<option value="">Default</option>
|
|
72
|
+
<option :value="`${viewType}items-start`">Start</option>
|
|
73
|
+
<option :value="`${viewType}items-end`">End</option>
|
|
74
|
+
<option :value="`${viewType}items-center`">Center</option>
|
|
75
|
+
<option :value="`${viewType}items-baseline`">Baseline</option>
|
|
76
|
+
<option :value="`${viewType}items-stretch`">Stretch</option>
|
|
77
|
+
</Dropdown>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div>
|
|
81
|
+
<label class="flex-1">Justify Content</label>
|
|
82
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
83
|
+
v-show="viewType === _.value"
|
|
84
|
+
v-model="justifyContent[idx]"
|
|
85
|
+
:readonly="readonly">
|
|
86
|
+
<option value="">Default</option>
|
|
87
|
+
<option :value="`${viewType}justify-normal`">Normal</option>
|
|
88
|
+
<option :value="`${viewType}justify-start`">Start</option>
|
|
89
|
+
<option :value="`${viewType}justify-end`">End</option>
|
|
90
|
+
<option :value="`${viewType}justify-center`">Center</option>
|
|
91
|
+
<option :value="`${viewType}justify-between`">Between</option>
|
|
92
|
+
<option :value="`${viewType}justify-around`">Around</option>
|
|
93
|
+
<option :value="`${viewType}justify-evenly`">Evenly</option>
|
|
94
|
+
<option :value="`${viewType}justify-stretch`">Stretch</option>
|
|
95
|
+
</Dropdown>
|
|
96
|
+
</div>
|
|
53
97
|
</div>
|
|
54
98
|
|
|
55
|
-
<div class="
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<option :value="`${viewType}justify-normal`">Normal</option>
|
|
78
|
-
<option :value="`${viewType}justify-start`">Start</option>
|
|
79
|
-
<option :value="`${viewType}justify-end`">End</option>
|
|
80
|
-
<option :value="`${viewType}justify-center`">Center</option>
|
|
81
|
-
<option :value="`${viewType}justify-between`">Between</option>
|
|
82
|
-
<option :value="`${viewType}justify-around`">Around</option>
|
|
83
|
-
<option :value="`${viewType}justify-evenly`">Evenly</option>
|
|
84
|
-
<option :value="`${viewType}justify-stretch`">Stretch</option>
|
|
85
|
-
</Dropdown>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div class="flex flex-row items-center">
|
|
89
|
-
<label class="flex-1">Col Span</label>
|
|
90
|
-
<Dropdown v-for="(_, idx) in viewTypes"
|
|
91
|
-
v-show="viewType === _.value"
|
|
92
|
-
v-model="colSpan[idx]"
|
|
93
|
-
:readonly="readonly">
|
|
94
|
-
<option value="">Default</option>
|
|
95
|
-
<option v-for="i in 12" :value="`${viewType}col-span-${i}`">{{ i }}</option>
|
|
96
|
-
</Dropdown>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<div class="flex flex-row items-center">
|
|
100
|
-
<label class="flex-1">Row Span</label>
|
|
101
|
-
<Dropdown v-for="(_, idx) in viewTypes"
|
|
102
|
-
v-show="viewType === _.value"
|
|
103
|
-
v-model="rowSpan[idx]"
|
|
104
|
-
:readonly="readonly">
|
|
105
|
-
<option value="">Default</option>
|
|
106
|
-
<option v-for="i in 12" :value="`${viewType}row-span-${i}`">{{ i }}</option>
|
|
107
|
-
</Dropdown>
|
|
99
|
+
<div class="grid grid-cols-2 gap-3">
|
|
100
|
+
<div>
|
|
101
|
+
<label class="flex-1">Col Span</label>
|
|
102
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
103
|
+
v-show="viewType === _.value"
|
|
104
|
+
v-model="colSpan[idx]"
|
|
105
|
+
:readonly="readonly">
|
|
106
|
+
<option value="">Default</option>
|
|
107
|
+
<option v-for="i in 12" :value="`${viewType}col-span-${i}`">{{ i }}</option>
|
|
108
|
+
</Dropdown>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div>
|
|
112
|
+
<label class="flex-1">Row Span</label>
|
|
113
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
114
|
+
v-show="viewType === _.value"
|
|
115
|
+
v-model="rowSpan[idx]"
|
|
116
|
+
:readonly="readonly">
|
|
117
|
+
<option value="">Default</option>
|
|
118
|
+
<option v-for="i in 12" :value="`${viewType}row-span-${i}`">{{ i }}</option>
|
|
119
|
+
</Dropdown>
|
|
120
|
+
</div>
|
|
108
121
|
</div>
|
|
109
122
|
|
|
110
123
|
</div>
|
|
@@ -197,7 +210,7 @@ export default{
|
|
|
197
210
|
<style module>
|
|
198
211
|
|
|
199
212
|
.comp{
|
|
200
|
-
@apply flex flex-col gap-
|
|
213
|
+
@apply flex flex-col gap-6 p-6;
|
|
201
214
|
}
|
|
202
215
|
|
|
203
216
|
</style>
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Modal ref="modal"
|
|
3
|
-
:width="width"
|
|
4
|
-
:height="height">
|
|
5
|
-
<template v-slot:head>
|
|
6
|
-
<div class="relative p-6 flex flex-col gap-5">
|
|
7
|
-
<div class="absolute top-0 right-0 p-2">
|
|
8
|
-
<button type="button" class="p-2" @click="close">
|
|
9
|
-
<svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
-
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
11
|
-
</svg>
|
|
12
|
-
</button>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<h3>Create New Datasource</h3>
|
|
16
|
-
|
|
17
|
-
<div>
|
|
18
|
-
<Textbox placeholder="Name" v-model="instance.name" />
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
<template v-slot:foot>
|
|
24
|
-
<div class="p-6">
|
|
25
|
-
<Button ref="saveBtn"
|
|
26
|
-
class="w-[80px]"
|
|
27
|
-
:state="canSave ? 1 : -1"
|
|
28
|
-
@click="save">
|
|
29
|
-
Save
|
|
30
|
-
</Button>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
<div class="flex-1 px-6 flex">
|
|
34
|
-
|
|
35
|
-
<div v-if="readyState === 2" class="flex-1 flex items-center justify-center flex-col">
|
|
36
|
-
<svg class="animate-spin aspect-square" width="36" height="36" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<VirtualTable v-else-if="instance?.columns"
|
|
40
|
-
class="flex-1"
|
|
41
|
-
:columns="instance.columns"
|
|
42
|
-
:items="instance.items" />
|
|
43
|
-
|
|
44
|
-
<div v-else class="flex-1 flex items-center justify-center flex-col">
|
|
45
|
-
<button type="button" class="text-primary" @click="$refs.file.click()">
|
|
46
|
-
Import from File...
|
|
47
|
-
</button>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<input ref="file" type="file" class="hidden" accept=".csv,.xls,.xlsx" @change="analyse"/>
|
|
51
|
-
|
|
52
|
-
<Modal ref="selectSheets" width="300" height="360">
|
|
53
|
-
<template v-slot:head>
|
|
54
|
-
<div class="relative p-5">
|
|
55
|
-
<h3>Select Worksheet</h3>
|
|
56
|
-
<div class="absolute top-0 right-0 p-2">
|
|
57
|
-
<button type="button" class="p-2" @click="$refs.modal.close()">
|
|
58
|
-
<svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
59
|
-
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
60
|
-
</svg>
|
|
61
|
-
</button>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</template>
|
|
65
|
-
<div class="flex-1 p-5">
|
|
66
|
-
|
|
67
|
-
<div class="flex flex-col">
|
|
68
|
-
<div v-for="sheet in multipleSheets"
|
|
69
|
-
:class="dashboardStyle.button" @click="analyse({ sheetName:sheet })">
|
|
70
|
-
{{ sheet }}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
</div>
|
|
75
|
-
</Modal>
|
|
76
|
-
|
|
77
|
-
</div>
|
|
78
|
-
</Modal>
|
|
79
|
-
</template>
|
|
80
|
-
|
|
81
|
-
<script>
|
|
82
|
-
|
|
83
|
-
export default{
|
|
84
|
-
|
|
85
|
-
emits: [ 'save' ],
|
|
86
|
-
|
|
87
|
-
inject: [ 'alert', 'dashboardStyle', 'socket', 'toast' ],
|
|
88
|
-
|
|
89
|
-
props: {
|
|
90
|
-
|
|
91
|
-
analyseSrc: String,
|
|
92
|
-
|
|
93
|
-
saveSrc: String
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
computed: {
|
|
98
|
-
|
|
99
|
-
canSave(){
|
|
100
|
-
return this.instance &&
|
|
101
|
-
this.instance.name &&
|
|
102
|
-
this.instance.columns &&
|
|
103
|
-
this.instance.items
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
height(){
|
|
107
|
-
if(Array.isArray(this.instance?.items))
|
|
108
|
-
return 600
|
|
109
|
-
return 480
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
width(){
|
|
113
|
-
if(Array.isArray(this.instance?.items))
|
|
114
|
-
return 800
|
|
115
|
-
return 420
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
data(){
|
|
121
|
-
return {
|
|
122
|
-
instance: null,
|
|
123
|
-
readyState: 1,
|
|
124
|
-
multipleSheets: null
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
methods: {
|
|
129
|
-
|
|
130
|
-
analyse(opt = { sheetName:undefined }){
|
|
131
|
-
this.instance.name = this.$refs.file.files[0].name
|
|
132
|
-
|
|
133
|
-
this.readyState = 2
|
|
134
|
-
this.$refs.selectSheets?.close()
|
|
135
|
-
this.socket.send(this.analyseSrc, {
|
|
136
|
-
file:this.$refs.file.files[0],
|
|
137
|
-
name:this.$refs.file.files[0].name,
|
|
138
|
-
mimeType:this.$refs.file.files[0].type,
|
|
139
|
-
sheetName: opt.sheetName
|
|
140
|
-
})
|
|
141
|
-
.then(res => {
|
|
142
|
-
Object.assign(this.instance, res)
|
|
143
|
-
})
|
|
144
|
-
.catch(err => {
|
|
145
|
-
|
|
146
|
-
if(err.errors?.multipleSheets){
|
|
147
|
-
this.multipleSheets = err.errors.multipleSheets
|
|
148
|
-
this.$refs.selectSheets.open()
|
|
149
|
-
}
|
|
150
|
-
else{
|
|
151
|
-
this.alert(err)
|
|
152
|
-
}
|
|
153
|
-
})
|
|
154
|
-
.finally(_ => {
|
|
155
|
-
this.readyState = 1
|
|
156
|
-
})
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
open(){
|
|
160
|
-
this.instance = {}
|
|
161
|
-
this.$refs.modal.open()
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
close(){
|
|
165
|
-
this.$refs.modal.close()
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
save(){
|
|
169
|
-
this.$refs.saveBtn.setState(2)
|
|
170
|
-
this.socket.send(this.saveSrc, {
|
|
171
|
-
...this.instance,
|
|
172
|
-
file:this.$refs.file.files[0],
|
|
173
|
-
name:this.$refs.file.files[0].name,
|
|
174
|
-
mimeType:this.$refs.file.files[0].type
|
|
175
|
-
})
|
|
176
|
-
.then(_ => {
|
|
177
|
-
this.toast('Datasource created')
|
|
178
|
-
this.close()
|
|
179
|
-
this.$emit('save')
|
|
180
|
-
})
|
|
181
|
-
.catch(err => this.alert(err))
|
|
182
|
-
.finally(_ => this.$refs.saveBtn?.resetState())
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
</script>
|
|
190
|
-
|
|
191
|
-
<style module>
|
|
192
|
-
|
|
193
|
-
.comp{
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
</style>
|