@opengis/bi 1.0.14 → 1.0.15
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/README.md +50 -50
- package/config.js +12 -12
- package/dist/bi.js +1 -1
- package/dist/bi.umd.cjs +63 -63
- package/dist/{import-file-DUp3rsNI.js → import-file-CRC0sYYT.js} +8055 -7987
- package/dist/{map-component-mixin-CGM0P5ub.js → map-component-mixin-BCtWEvzv.js} +3795 -2116
- package/dist/style.css +1 -1
- package/dist/{vs-calendar-cOoinEwc.js → vs-calendar-5ot79n0N.js} +20 -9
- package/dist/{vs-funnel-bar-kLkPoIhJ.js → vs-funnel-bar-CLo6gXI_.js} +2 -2
- package/dist/{vs-heatmap-3XAVGTSo.js → vs-heatmap-DHGA8dRk.js} +3 -4
- package/dist/{vs-map-cluster-BWJPx7wE.js → vs-map-cluster-CNgX6JVF.js} +2 -2
- package/dist/{vs-map-B1tr6V5_.js → vs-map-pIn5wS4G.js} +2 -2
- package/dist/{vs-number-CrU7LmkV.js → vs-number-DYfok8VU.js} +19 -12
- package/dist/{vs-text-DRPx3aID.js → vs-text-Dckykz09.js} +19 -14
- package/package.json +107 -97
- package/plugin.js +14 -13
- package/server/migrations/bi.dataset.sql +26 -0
- package/server/migrations/bi.sql +93 -93
- package/server/plugins/docs.js +48 -48
- package/server/plugins/hook.js +89 -89
- package/server/plugins/vite.js +69 -69
- package/server/routes/dashboard/controllers/dashboard.delete.js +38 -37
- package/server/routes/dashboard/controllers/dashboard.js +118 -114
- package/server/routes/dashboard/controllers/dashboard.list.js +30 -36
- package/server/routes/dashboard/controllers/utils/yaml.js +11 -11
- package/server/routes/dashboard/index.mjs +25 -25
- package/server/routes/data/controllers/data.js +167 -156
- package/server/routes/data/controllers/util/chartSQL.js +42 -39
- package/server/routes/data/controllers/util/normalizeData.js +59 -56
- package/server/routes/data/index.mjs +29 -24
- package/server/routes/dataset/controllers/bi.dataset.demo.add.js +97 -0
- package/server/routes/dataset/controllers/bi.dataset.import.js +67 -0
- package/server/routes/dataset/controllers/util/create.table.js +22 -0
- package/server/routes/dataset/controllers/util/prepare.data.js +49 -0
- package/server/routes/dataset/index.mjs +19 -0
- package/server/routes/db/controllers/dbTablePreview.js +63 -63
- package/server/routes/db/controllers/dbTables.js +36 -36
- package/server/routes/db/index.mjs +17 -17
- package/server/routes/edit/controllers/dashboard.add.js +26 -24
- package/server/routes/edit/controllers/dashboard.edit.js +46 -44
- package/server/routes/edit/controllers/widget.add.js +75 -73
- package/server/routes/edit/controllers/widget.del.js +69 -70
- package/server/routes/edit/controllers/widget.edit.js +52 -103
- package/server/routes/edit/index.mjs +31 -31
- package/server/routes/map/controllers/cluster.js +109 -104
- package/server/routes/map/controllers/clusterVtile.js +166 -213
- package/server/routes/map/controllers/geojson.js +127 -127
- package/server/routes/map/controllers/map.js +60 -57
- package/server/routes/map/controllers/utils/downloadClusterData.js +43 -0
- package/server/routes/map/controllers/vtile.js +183 -182
- package/server/routes/map/index.mjs +25 -25
- package/server/utils/getWidget.js +85 -83
- package/utils.js +12 -12
|
@@ -1,73 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
// )
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
data?.metrics
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
import { dataInsert, dataUpdate } from "@opengis/fastify-table/utils.js";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/extensions */
|
|
4
|
+
import { yamlSafe } from '../../../../utils.js';
|
|
5
|
+
|
|
6
|
+
function generateUniqueName(prefix = 'bar') {
|
|
7
|
+
const randomPart = Math.floor(Math.random() * 10000);
|
|
8
|
+
const timestamp = Date.now();
|
|
9
|
+
return `${prefix}_${randomPart}_${timestamp}`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default async function widgetAdd({ pg, funcs, params = {}, body = {} }) {
|
|
13
|
+
const { name: dashboardName } = params;
|
|
14
|
+
if (!dashboardName) {
|
|
15
|
+
return { message: 'not enough params: id', status: 400 };
|
|
16
|
+
}
|
|
17
|
+
const data = body.yml ? yamlSafe.load(body.yml) : body;
|
|
18
|
+
try {
|
|
19
|
+
const row = await pg
|
|
20
|
+
.query(
|
|
21
|
+
'select dashboard_id, widgets, panels, table_name from bi.dashboard where $1 in (dashboard_id,name)',
|
|
22
|
+
[dashboardName]
|
|
23
|
+
)
|
|
24
|
+
.then((res) => res.rows?.[0] || {});
|
|
25
|
+
|
|
26
|
+
const tableName =
|
|
27
|
+
data.data?.table || data?.table || data.table_name || row.table_name;
|
|
28
|
+
|
|
29
|
+
// const checkTable = await pg.query(
|
|
30
|
+
// 'select * from bi.widget where $1 in (table_name)',
|
|
31
|
+
// [tableName]
|
|
32
|
+
// );
|
|
33
|
+
// if (!checkTable.rows.length) {
|
|
34
|
+
// return { message: 'bad params', status: 400 };
|
|
35
|
+
// }
|
|
36
|
+
if (!tableName || !pg.pk?.[tableName]) {
|
|
37
|
+
return { message: 'bad params: table', status: 400 };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { dashboard_id: dashboardId } = row;
|
|
41
|
+
|
|
42
|
+
Object.assign(data, {
|
|
43
|
+
name: generateUniqueName(data.type),
|
|
44
|
+
table_name: tableName,
|
|
45
|
+
metrics:
|
|
46
|
+
(data.data?.metrics || data?.metrics)?.[0] ||
|
|
47
|
+
data.data?.metrics ||
|
|
48
|
+
data?.metrics,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const res = await dataUpdate({
|
|
52
|
+
table: 'bi.dashboard',
|
|
53
|
+
id: dashboardId,
|
|
54
|
+
data: {
|
|
55
|
+
widgets: [data].concat(row.widgets || []),
|
|
56
|
+
panels: [{ widget: data.name, col: data.col || 3 }].concat(
|
|
57
|
+
row.panels || []
|
|
58
|
+
),
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
const widgetData = { ...data, data, dashboard_id: dashboardId };
|
|
62
|
+
if (body?.yml) Object.assign(widgetData, { yml: body.yml });
|
|
63
|
+
await dataInsert({
|
|
64
|
+
table: 'bi.widget',
|
|
65
|
+
data: widgetData,
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
message: `Added widget to ${dashboardName}`,
|
|
69
|
+
status: 200,
|
|
70
|
+
rows: res,
|
|
71
|
+
};
|
|
72
|
+
} catch (err) {
|
|
73
|
+
return { error: err.toString(), status: 500 };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1,70 +1,69 @@
|
|
|
1
|
-
import dataDelete from '@opengis/fastify-table/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
1
|
+
import { dataDelete, dataUpdate } from '@opengis/fastify-table/utils.js';
|
|
2
|
+
|
|
3
|
+
export default async function widgetDel({ pg = {}, params = {} }) {
|
|
4
|
+
const { widget: widgetName, name: dashboardName } = params;
|
|
5
|
+
|
|
6
|
+
if (!widgetName || !dashboardName) {
|
|
7
|
+
return {
|
|
8
|
+
message: 'not enough params: dashboard and widget name',
|
|
9
|
+
status: 400,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const row = await pg
|
|
15
|
+
.query(
|
|
16
|
+
`select a.widget_id, b.dashboard_id from bi.widget a, bi.dashboard b
|
|
17
|
+
where $2 in (a.widget_id, a.name) and $1 in (b.dashboard_id, b.name) order by 1,2`,
|
|
18
|
+
[dashboardName, widgetName]
|
|
19
|
+
)
|
|
20
|
+
.then((res1) => res1.rows?.[0] || {});
|
|
21
|
+
|
|
22
|
+
const { widget_id: widgetId, dashboard_id: dashboardId } = row || {};
|
|
23
|
+
|
|
24
|
+
if (!widgetId) {
|
|
25
|
+
return { message: `widget not found ${widgetName}`, status: 404 };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const res = await dataDelete({
|
|
29
|
+
table: 'bi.widget',
|
|
30
|
+
id: widgetId,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const currentDashboard = await pg
|
|
34
|
+
.query(
|
|
35
|
+
`select * from bi.dashboard
|
|
36
|
+
where $1 in (dashboard_id, name)`,
|
|
37
|
+
[dashboardName]
|
|
38
|
+
)
|
|
39
|
+
.then((res1) => res1.rows?.[0] || {});
|
|
40
|
+
|
|
41
|
+
const body = currentDashboard;
|
|
42
|
+
|
|
43
|
+
if (!currentDashboard) {
|
|
44
|
+
return { message: `dashboard not found ${dashboardName}`, status: 404 };
|
|
45
|
+
}
|
|
46
|
+
body.panels =
|
|
47
|
+
Array.isArray(body.panels) && body.panels?.length
|
|
48
|
+
? body.panels?.filter((panel) => panel.widget !== widgetName)
|
|
49
|
+
: undefined;
|
|
50
|
+
body.widgets =
|
|
51
|
+
Array.isArray(body.widgets) && body?.widgets?.length
|
|
52
|
+
? body.widgets?.filter((widget) => widget.name !== widgetName)
|
|
53
|
+
: undefined;
|
|
54
|
+
|
|
55
|
+
const res1 = await dataUpdate({
|
|
56
|
+
table: 'bi.dashboard',
|
|
57
|
+
id: dashboardId,
|
|
58
|
+
data: body,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
message: `Deleted widget ${widgetName}`,
|
|
63
|
+
status: 200,
|
|
64
|
+
rows: res1,
|
|
65
|
+
};
|
|
66
|
+
} catch (err) {
|
|
67
|
+
return { error: err.toString(), status: 500 };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -1,103 +1,52 @@
|
|
|
1
|
-
import { dataUpdate } from '@opengis/fastify-table/utils.js';
|
|
2
|
-
|
|
3
|
-
import { yamlSafe } from '../../../../utils.js';
|
|
4
|
-
|
|
5
|
-
export default async function widgetEdit({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
id: widgetId,
|
|
54
|
-
data: widgetData,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// \====================
|
|
58
|
-
const currentDashboard = await pg
|
|
59
|
-
.query(
|
|
60
|
-
`select * from bi.dashboard
|
|
61
|
-
where $1 in (dashboard_id, name)`,
|
|
62
|
-
[dashboardName]
|
|
63
|
-
)
|
|
64
|
-
.then((res1) => res1.rows?.[0] || {});
|
|
65
|
-
const bodyDashboard = currentDashboard;
|
|
66
|
-
|
|
67
|
-
if (!currentDashboard) {
|
|
68
|
-
return { message: `dashboard not found ${dashboardName}`, status: 404 };
|
|
69
|
-
}
|
|
70
|
-
bodyDashboard.panels =
|
|
71
|
-
Array.isArray(bodyDashboard.panels) && bodyDashboard.panels?.length
|
|
72
|
-
? bodyDashboard.panels?.map((panel) => {
|
|
73
|
-
if (panel.widget === widgetName) {
|
|
74
|
-
panel.col = body.col;
|
|
75
|
-
}
|
|
76
|
-
return panel;
|
|
77
|
-
})
|
|
78
|
-
: undefined;
|
|
79
|
-
bodyDashboard.widgets =
|
|
80
|
-
Array.isArray(bodyDashboard.widgets) && bodyDashboard?.widgets?.length
|
|
81
|
-
? bodyDashboard.widgets?.map((widget) => {
|
|
82
|
-
if (widget.name === widgetName) {
|
|
83
|
-
return body;
|
|
84
|
-
}
|
|
85
|
-
return widget;
|
|
86
|
-
})
|
|
87
|
-
: undefined;
|
|
88
|
-
|
|
89
|
-
const res1 = await dataUpdate({
|
|
90
|
-
table: 'bi.dashboard',
|
|
91
|
-
id: dashboardId,
|
|
92
|
-
data: bodyDashboard,
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
message: `Edited widget ${widgetName}`,
|
|
97
|
-
status: 200,
|
|
98
|
-
rows: res1,
|
|
99
|
-
};
|
|
100
|
-
} catch (err) {
|
|
101
|
-
return { error: err.toString(), status: 500 };
|
|
102
|
-
}
|
|
103
|
-
}
|
|
1
|
+
import { dataUpdate } from '@opengis/fastify-table/utils.js';
|
|
2
|
+
|
|
3
|
+
import { yamlSafe } from '../../../../utils.js';
|
|
4
|
+
|
|
5
|
+
export default async function widgetEdit({ pg, body, params, }) {
|
|
6
|
+
const { widget: widgetName, name: dashboardName } = params;
|
|
7
|
+
const data = body.yml && !body.style ? yamlSafe.load(body.yml) : body;
|
|
8
|
+
|
|
9
|
+
const tableName =
|
|
10
|
+
data.data?.table || data?.table || data.table_name || body.table_name;
|
|
11
|
+
|
|
12
|
+
if (!widgetName || !dashboardName) {
|
|
13
|
+
return {
|
|
14
|
+
message: 'not enough params: dashboard and widget name',
|
|
15
|
+
status: 400,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const { widget_id: widgetId } = await pg.query(
|
|
21
|
+
`select a.widget_id , b.dashboard_id from bi.widget a, bi.dashboard b
|
|
22
|
+
where $2 in (a.widget_id, a.name) and $1 in (b.dashboard_id, b.name) order by 1,2`,
|
|
23
|
+
[dashboardName, widgetName]
|
|
24
|
+
).then((res1) => res1.rows?.[0] || {});
|
|
25
|
+
|
|
26
|
+
if (!widgetId) {
|
|
27
|
+
return { message: `widget not found ${widgetName}`, status: 404 };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (!tableName || !pg.pk?.[tableName]) {
|
|
31
|
+
return { message: 'bad params: table', status: 400 };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// const widgetData = { ...data, data };
|
|
37
|
+
const widgetData = body.yml && !body.style ? data : { style: data.style, data: { x: data.x, metrics: data.metrics }, controls: data.controls, type: data.type, title: data.title, table_name: data.table_name };
|
|
38
|
+
// console.log(widgetId, widgetData)
|
|
39
|
+
if (body?.yml) Object.assign(widgetData, { yml: body.yml });
|
|
40
|
+
const rows = await dataUpdate({
|
|
41
|
+
table: 'bi.widget',
|
|
42
|
+
id: widgetId,
|
|
43
|
+
data: widgetData,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
message: rows,
|
|
48
|
+
status: 200,
|
|
49
|
+
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/* eslint-disable import/extensions */
|
|
2
|
-
import widgetAdd from './controllers/widget.add.js';
|
|
3
|
-
import widgetEdit from './controllers/widget.edit.js';
|
|
4
|
-
import widgetDel from './controllers/widget.del.js';
|
|
5
|
-
import dashboardEdit from './controllers/dashboard.edit.js';
|
|
6
|
-
import dashboardAdd from './controllers/dashboard.add.js';
|
|
7
|
-
|
|
8
|
-
const biSchema = {
|
|
9
|
-
querystring: {
|
|
10
|
-
widget: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
11
|
-
dashboard: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
12
|
-
list: { type: 'string', pattern: '^([\\d])$' },
|
|
13
|
-
sql: { type: 'string', pattern: '^([\\d])$' },
|
|
14
|
-
},
|
|
15
|
-
params: {
|
|
16
|
-
name: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
17
|
-
widget: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default async function route(fastify) {
|
|
22
|
-
fastify.post(`/bi-dashboard/:name`, { schema: biSchema }, widgetAdd);
|
|
23
|
-
fastify.put(`/bi-dashboard/:name/:widget`, { schema: biSchema }, widgetEdit);
|
|
24
|
-
fastify.delete(
|
|
25
|
-
`/bi-dashboard/:name/:widget`,
|
|
26
|
-
{ schema: biSchema },
|
|
27
|
-
widgetDel
|
|
28
|
-
);
|
|
29
|
-
fastify.post(`/bi-dashboard`, { schema: biSchema }, dashboardAdd);
|
|
30
|
-
fastify.put(`/bi-dashboard/:name`, { schema: biSchema }, dashboardEdit);
|
|
31
|
-
}
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import widgetAdd from './controllers/widget.add.js';
|
|
3
|
+
import widgetEdit from './controllers/widget.edit.js';
|
|
4
|
+
import widgetDel from './controllers/widget.del.js';
|
|
5
|
+
import dashboardEdit from './controllers/dashboard.edit.js';
|
|
6
|
+
import dashboardAdd from './controllers/dashboard.add.js';
|
|
7
|
+
|
|
8
|
+
const biSchema = {
|
|
9
|
+
querystring: {
|
|
10
|
+
widget: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
11
|
+
dashboard: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
12
|
+
list: { type: 'string', pattern: '^([\\d])$' },
|
|
13
|
+
sql: { type: 'string', pattern: '^([\\d])$' },
|
|
14
|
+
},
|
|
15
|
+
params: {
|
|
16
|
+
name: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
17
|
+
widget: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default async function route(fastify) {
|
|
22
|
+
fastify.post(`/bi-dashboard/:name`, { schema: biSchema }, widgetAdd);
|
|
23
|
+
fastify.put(`/bi-dashboard/:name/:widget`, { schema: biSchema }, widgetEdit);
|
|
24
|
+
fastify.delete(
|
|
25
|
+
`/bi-dashboard/:name/:widget`,
|
|
26
|
+
{ schema: biSchema },
|
|
27
|
+
widgetDel
|
|
28
|
+
);
|
|
29
|
+
fastify.post(`/bi-dashboard`, { schema: biSchema }, dashboardAdd);
|
|
30
|
+
fastify.put(`/bi-dashboard/:name`, { schema: biSchema }, dashboardEdit);
|
|
31
|
+
}
|