@opengis/admin 0.3.84 → 0.3.86
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/dist/{add-page-D5h1nd44.js → add-page-CByeQYi1.js} +1 -1
- package/dist/{admin-interface-BL78T_tI.js → admin-interface-CFij1RI4.js} +1 -1
- package/dist/{admin-view-BdzII4mV.js → admin-view-BhZTNW31.js} +1 -1
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +1 -1
- package/dist/{card-view-CMZ6FcPZ.js → card-view-RhrOyyhe.js} +1 -1
- package/dist/{edit-page-BiCqun6l.js → edit-page-BZu_3g4o.js} +1 -1
- package/dist/{import-file-DoXCXa-Q.js → import-file-CrENtq-3.js} +188 -188
- package/dist/{profile-page-BvH-kg6j.js → profile-page-BJ0Mf6C2.js} +1 -1
- package/package.json +1 -1
- package/server/routes/widget/controllers/widget.get.js +15 -9
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as n, g as m } from "./import-file-
|
1
|
+
import { _ as n, g as m } from "./import-file-CrENtq-3.js";
|
2
2
|
import { u as p } from "./user-B_2kh6ic.js";
|
3
3
|
import { resolveComponent as d, openBlock as u, createElementBlock as f, createElementVNode as o, createBlock as h, createCommentVNode as b } from "vue";
|
4
4
|
const x = {
|
package/package.json
CHANGED
@@ -88,35 +88,41 @@ export default async function widgetGet({
|
|
88
88
|
|
89
89
|
};
|
90
90
|
|
91
|
-
const
|
91
|
+
const q = sqls[params.type];
|
92
92
|
|
93
|
-
if (!
|
93
|
+
if (!q) {
|
94
94
|
return reply.status(400).send('invalid widget type');
|
95
95
|
}
|
96
96
|
|
97
97
|
|
98
98
|
/* data */
|
99
99
|
const time = [Date.now()];
|
100
|
-
const { rows = [] } = await pg.query(
|
100
|
+
const { rows = [] } = await pg.query(q, [objectid, params.type === 'gallery' ? galleryExtList : null].filter((el) => el));
|
101
101
|
rows.forEach(row => Object.assign(row, { username: row.username?.trim?.() || row.login }));
|
102
102
|
time.push(Date.now());
|
103
103
|
|
104
104
|
/* Object info */
|
105
|
-
const { tableName } = pg.pk['log.table_changes'] ? await pg.query(
|
106
|
-
|
105
|
+
const { tableName } = pg.pk['log.table_changes'] ? await pg.query(
|
106
|
+
'select entity_type as "tableName" from log.table_changes where entity_id=$1 limit 1',
|
107
|
+
[objectid]
|
108
|
+
).then(el => el.rows?.[0] || {}) : {};
|
109
|
+
|
110
|
+
const { pk, columns = [] } = await getMeta({ pg, table: tableName });
|
111
|
+
|
112
|
+
const authorIdColumn = columns.find(col => ['uid', 'created_by'].includes(col.name))?.name;
|
107
113
|
|
108
114
|
if (!pk && params.type === 'history' && !unittest) {
|
109
115
|
return reply.status(404).send('log table not found');
|
110
116
|
}
|
111
117
|
|
112
|
-
const
|
113
|
-
left join admin.users u on a
|
118
|
+
const q1 = `select ${username} as author, u.login, a.cdate, a.editor_date from ${tableName} a
|
119
|
+
left join admin.users u on a.${authorIdColumn}=u.uid where a.${pk}=$1 limit 1`;
|
114
120
|
|
115
|
-
const data = pk &&
|
121
|
+
const data = pg.pk['admin.users'] && pk && tableName ? await pg.query(q, [objectid]).then(el => el.rows?.[0] || {}) : {};
|
116
122
|
|
117
123
|
if (query.debug && user?.user_type === 'admin') {
|
118
124
|
return {
|
119
|
-
|
125
|
+
q, type: params.type, q1, id: objectid, data,
|
120
126
|
};
|
121
127
|
}
|
122
128
|
|