feat(assets): add dimension analysis and authorized user previews
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
Refactor asset drilldowns with combined dimension filters, parent summaries and progressive loading. Add the hidden /who read-only permission preview with scoped authorization, identity mapping and audit logging. Refine inventory counts and AI问数 presentation.
This commit is contained in:
@@ -58,13 +58,15 @@ export const gapStore = {
|
||||
[userId, fingerprint, demand, reason],
|
||||
);
|
||||
},
|
||||
async list(userId: string | null): Promise<DemandGap[]> {
|
||||
await ensure();
|
||||
await purge();
|
||||
async list(userId: string | null, options: { readOnly?: boolean } = {}): Promise<DemandGap[]> {
|
||||
if (!options.readOnly) {
|
||||
await ensure();
|
||||
await purge();
|
||||
}
|
||||
const [rows] = await pool.query<RowDataPacket[]>(
|
||||
`SELECT id,demand,reason,status,occurrences,
|
||||
DATE_FORMAT(first_seen,'%Y-%m-%dT%H:%i:%sZ') firstSeen, DATE_FORMAT(last_seen,'%Y-%m-%dT%H:%i:%sZ') lastSeen
|
||||
FROM bi_asset_ai_gaps ${userId ? "WHERE user_id = ?" : ""} ORDER BY last_seen DESC LIMIT 200`,
|
||||
FROM bi_asset_ai_gaps WHERE ${userId ? "user_id = ? AND " : ""}last_seen >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 90 DAY) ORDER BY last_seen DESC LIMIT 200`,
|
||||
userId ? [userId] : [],
|
||||
);
|
||||
return rows as DemandGap[];
|
||||
|
||||
Reference in New Issue
Block a user