101 Commits

Author SHA1 Message Date
pnoker df35851f3b feat(auth): page mcp tool catalog and audit queries
Replace limit-truncated listing with real server-side paging
(LIMIT/OFFSET plus a shared count query) behind Page envelopes:
tool/list accepts a nested Pages block and audit/list takes
current/size params, both keeping the legacy limit as a compatibility
page size. The frontend configs forward pager state and consume
{records, total} instead of faking a single page; the assignment
drawer keeps its full-catalog semantics with one 500-row page (the
service cap). Adds a mapper XML grammar gate and audit page/count
symmetry tests.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-28 00:25:10 +08:00
pnoker 2085bd17d7 chore(web): ignore local claude settings
Keep .claude/settings.local.json out of version control inside the
frontend workspace.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-27 09:41:18 +08:00
pnoker fe9384864a feat(web): add theme and language preferences to console and login
Extract the header language switch into a reusable AppPreferences
component and add a light/system/dark theme toggle beside it, backed by
the persisted app store theme mode. Use the component in both the
console header (compact) and the login page (surface variant) so the
public page obeys the same theme contract as the workspace.

Tokenize the login page palette in theme.scss with dark-mode twins,
switch the login validation rules to computed form rules so messages
follow locale changes, and extend the layout component test and the
login/responsive e2e specs for the new controls.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-27 09:40:59 +08:00
pnoker 691f6c8798 build(web): refresh frontend dependencies
Bump pnpm to 11.24.0 and refresh element-plus, axios, dayjs, dompurify,
marked, pinia, vue-i18n, playwright, typescript-eslint, eslint, sass,
vite and vitest within their minor lines, and widen the pnpm-workspace
onlyBuiltDependencies ranges accordingly.

Keep typescript on ~6.0.3, vue on ^3.5.40 and happy-dom on ^20.11.0:
typescript 7 drops the ./lib/tsc subpath vue-tsc still resolves, vue
3.5.41 makes compiler-sfc require filesystem access for imported prop
types under the vitest environment, and happy-dom 20.11.6 changes the
execCommand clipboard behaviour the utils suites assert on.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-27 09:40:41 +08:00
pnoker 01ff3a0b38 fix(web): initialize mock before router navigation 2026-08-26 09:44:06 +08:00
pnoker ec2310fa9b feat(web): unify responsive console experience 2026-08-26 09:43:45 +08:00
pnoker a7ca489b9b style(repo): reformat java, xml, yaml, markdown and frontend sources 2026-08-25 21:27:49 +08:00
pnoker 0727708f25 test(web): extend three-terminal gate and add breakpoint guardrail 2026-08-25 21:02:02 +08:00
pnoker a1d9e2a86b feat(web): fit dialogs to viewport below mobile breakpoint 2026-08-25 21:02:02 +08:00
pnoker c581d6aa44 fix(web): replace hand-rolled media breakpoints with token contract 2026-08-25 21:01:59 +08:00
pnoker 769d1cb977 style: apply repository-wide formatting
- expand single-line Javadocs to multi-line blocks, rewrap Markdown prose, and reflow POM, YAML, and TypeScript formatting
- formatting only: no Java code lines changed, no build-file semantics changed
- verified: backend compile and check_documentation.py pass, pnpm check and pnpm lint:check pass, and the dc3 YAML files parse
2026-08-25 13:35:00 +08:00
pnoker f5fc826824 docs(web): document composables, stores, and utils exports
- add JSDoc to useEntityListPage, useEntityNames, usePagedList, and the four Pinia stores
- add JSDoc to 39 utils exports across thingModelFormat, formRule, validation, date, json, pointFormat, and searchParam utilities
- verified: pnpm check and pnpm lint:check pass
2026-08-25 13:29:17 +08:00
pnoker 9e30b79659 docs(web): drop the stale JSONBigInt claim from the web readme
The backend emits 64-bit identifiers as JSON strings on the HTTP contract, so standard JSON parsing is sufficient.
2026-08-25 12:06:23 +08:00
pnoker 6ee8974403 test(web): add three-viewport e2e gate and align playwright 2026-08-24 19:39:30 +08:00
pnoker 3c3c33a0c9 refactor(web): decouple entity configs from vue-i18n via Translator 2026-08-24 19:39:24 +08:00
pnoker c128efa860 feat(web): adapt app shell to desktop, tablet, and mobile 2026-08-24 19:39:17 +08:00
pnoker ca2cb780c0 feat(web): add persisted theme and density preferences 2026-08-24 19:39:11 +08:00
pnoker 802f538794 feat(web): add design tokens and reactive breakpoint system 2026-08-24 19:39:05 +08:00
pnoker 6133a7c5db perf(web): drop dead dependencies and split agentic vendor
Remove the unused highlight.js plugin and four dead dependencies, switch Element Plus styles to per-component imports, split marked/dompurify/vue-element-plus-x into a lazy agentic-vendor chunk, and restore the 500 kB chunk warning limit.
2026-08-24 17:50:30 +08:00
pnoker 03492ab5e9 refactor(web): polish naming, storage and date utilities
Fix calcDate second remainder, drop dead storage helpers, follow the i18n locale for numeric formatting, rename order to sortAsc and expand abbreviated identifiers, and remove the unused English dashboard empty default.
2026-08-24 17:50:20 +08:00
pnoker 2b727bca12 chore(web): drop dead stores, seeds and centralize constants
Remove the unused interval store and its test, the duplicate agentic session/message seed block, and consolidate AUTO_REFRESH_INTERVAL plus PRINCIPAL_TYPE_OPTIONS into shared constants.
2026-08-24 17:50:18 +08:00
pnoker fd11add2d4 fix(web): localize interceptor, agentic store and route titles
Route meta titles become i18n keys resolved in the guard, the axios interceptor and agentic store reuse locale messages instead of hardcoded English, leftover labels and copy hints switch to t(), and the route/sidebar aliases merge into one source.
2026-08-24 17:50:07 +08:00
pnoker b27efd2c9d fix(web): scope stream 401 handling to auth keys
Clear only the auth storage keys instead of wiping localStorage and sessionStorage when an SSE request returns 401, matching the axios interceptor contract.
2026-08-24 17:48:43 +08:00
pnoker 40ed14593d refactor(web): enforce typed response envelopes and domain unions
Default the R envelope to unknown so bare wrappers surface their data shape, remove the | string tail that voided alarm/attribute unions, add explicit generics to every dashboard/point/info wrapper, and move the alert row types plus RangeKey to a single dashboard source. Also fix mock seeds to match backend enums (PENDING, DINGTALK_BOT).
2026-08-24 17:48:41 +08:00
pnoker 0c288789dd fix(web): reset dialog submitting on agentic save failure
Call done(false) in the catch branch so a failed model/provider save releases the submit button instead of leaving the dialog stuck loading.
2026-08-24 17:48:28 +08:00
pnoker 5555b26515 fix(web): repair device import upload and detail timestamps
Upload the import file as a real multipart FormData part (the backend contract is @RequestPart), render operateTime on the operation-time detail rows, and stop double success toasts for add/import flows.
2026-08-24 17:48:25 +08:00
pnoker 76ae89370b feat(db): add the mysql seed — dual-engine initdb, row-level revision triggers
R2b of docs/design/storage-abstraction.md §3:

- PostgreSQL seed: the three driver-lease sequences retire. The fencing
  token and assignment version default to 1 and advance row-locally —
  per-device / per-driver monotonicity is the property the checks rely
  on, which the global sequences only delivered incidentally, and MySQL
  has no sequence objects. The three statement-level revision triggers
  (transition tables + INSERT .. ON CONFLICT, none of which MySQL can
  express) collapse into one row-level function with row-local +1 upserts
  — a shape both engines share.

- MySQL seed under dc3/dependencies/mysql/initdb/ (00-06), derived by
  dc3/dependencies/mysql/pg2mysql_seed.py: schemas become databases,
  TIMESTAMPTZ becomes DATETIME(6), TEXT/JSON literal defaults become
  expression defaults (MySQL 8 refuses literal defaults on BLOB/TEXT/
  JSON), operate-time plpgsql triggers become the ON UPDATE column
  attribute (explicit SETs keep winning), the revision family becomes
  row-level DELIMITER triggers, keyed TEXT columns widen to VARCHAR(191),
  partial indexes drop, and the embedded-JSON seed values load under
  NO_BACKSLASH_ESCAPES (MySQL string literals eat the backslashes the
  escaped-JSON content values depend on; PostgreSQL does not). 05 is
  hand-maintained: only the dc3_point_latest projection — a MySQL core
  requires an external time-series store, so the hypertable and cagg DDL
  have no counterpart by design.

- Compose: the optional stack gains a mysql:8.4 service (utf8mb4, seed
  mounted at docker-entrypoint-initdb.d, healthcheck); the app stack
  passes DC3_DB_TYPE through.

Verified by loading all seven files into a fresh mysql:8.4 container —
zero errors, five databases, table counts aligned with the PostgreSQL
seed (manager 24 incl. common, auth 24, data 12, agentic 6, history 1),
and the revision trigger proven live: insert bumps the owning driver's
revision to 1, an enable_flag flip bumps it again to 2.
2026-08-24 17:17:45 +08:00
pnoker 90a7db4d6b merge: integrate upstream deployment docs and validation targets 2026-08-19 14:30:34 +08:00
pnoker 003686240c build(web): align package metadata with build image 2026-08-19 00:06:20 +08:00
pnoker 51f0efd2d9 style(javadoc): document non-override public methods 2026-08-19 00:05:58 +08:00
pnoker dddf2e8690 test: enforce truthful coverage and behavioral quality 2026-08-18 23:24:58 +08:00
pnoker aec6ebfc76 refactor(logging): standardize application logging 2026-08-18 08:14:52 +08:00
pnoker 8f6520dd79 chore: refresh dependencies and project documentation 2026-08-18 08:14:26 +08:00
pnoker b02d8f81fc refactor!(web): parse identifiers as strings and drop json-bigint
BREAKING CHANGE: frontend identifier types converge to string and the json-bigint dependency is removed; the backend now emits string ids.
2026-08-17 21:37:49 +08:00
pnoker 044eafa2fa fix(dc3-web): override nanoid to 3.3.18 to resolve high severity advisory 2026-08-17 20:23:56 +08:00
dependabot[bot] 33ee1a728c build(deps): bump dompurify from 3.4.12 to 3.4.13 in /dc3-web (#206)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.12 to 3.4.13.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.4.12...3.4.13)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.13
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-17 20:18:22 +08:00
pnoker 9596334fc6 docs(slogan): converge remaining industrial-ai-iot wording to canonical slogan 2026-08-14 16:54:51 +08:00
pnoker a7a1650be5 docs(slogan): unify positioning across readme languages and web meta 2026-08-14 16:54:10 +08:00
pnoker 75a5571e2d fix(web): prefill the mock login password 2026-08-12 01:14:35 +08:00
pnoker 6c9149f9b2 feat(web): enrich the localized Industrial AI mock experience 2026-08-12 01:04:47 +08:00
hongyuan.zhang 6b37cb5ccd docs(readme): refresh module documentation 2026-08-11 22:58:30 +08:00
hongyuan.zhang 9099ad093d docs(agents): consolidate repository guidance 2026-08-11 22:58:07 +08:00
pnoker 437d7bec42 style(web): reformat menu seed and index meta tags
Prettier pass: expand the mock menuTree mk() calls to one property per
line and wrap the index.html CSP meta attribute across lines.
2026-08-10 00:53:48 +08:00
pnoker b0aa033167 feat(web): align mock menu and user seed with SQL init script
The static demo's menu/user data diverged from the backend seed
(dc3/dependencies/postgres/initdb/02-iot-dc3-auth.sql):

- menuTree: switch each node from the legacy content.title i18n key to
  the authoritative content.titles {zh,en} map, and pull icon/menuName/
  url for all 48 nodes from the dc3_menu seed (resolveMenuTitle already
  prefers content.titles). Leaf nodes now carry icons too.
- auth seed: align the dc3 principal/user with the seed (displayName/
  nickName "DC3", phone, email); demo users ops/guest retained.

Verified: type-check, eslint, and 158 unit tests green.
2026-08-10 00:46:05 +08:00
pnoker e17c2e8789 style(web): resize header logo and add brand title
header_logo was 60px — the full header height — so the logo dominated the
bar. Shrink it to 40px and add an "IoT DC3" brand title next to it in the
theme color (var(--el-color-primary)).
2026-08-10 00:46:02 +08:00
pnoker 50c6de9438 docs: rewrap project guides and README files
Prose rewrapping and table reflow from a project-wide markdown pass;
no content changes. Also reverts two formatter mistakes: restores
MD5(password) in dc3-web/AGENTS.md and drops spurious spaces after
CJK punctuation in README.zh.md / README.ja.md.

Covers root guides (AGENTS/CONTRIBUTING/SECURITY/README.*), module
READMEs across dc3-api/center/common/driver/e2e/gateway, the nginx
guide, dc3/doc/{README,TITLE}.md, and dc3-web docs.
2026-08-09 18:44:55 +08:00
pnoker 2da8b2aa2b style(web): reformat mock seed, views and components
Pure formatting from a project-wide prettier/eslint pass: object
expansion, Vue attribute ordering, .catch() block expansion, import
ordering and type-import placement. No logic or behavior change.

- src/mock/**: seed object expansion, db import sort, crud/dispatch/
  query/response/timeseries type spacing, fetch dataset expansion
- src/views/**: Device/Point/Profile .catch() expansion, import sort
- src/components/**: AgenticAssistant/CardShell/Layout attr ordering
- src/api, src/config, src/main, index.html: spacing/meta ordering

Verified: vue-tsc type-check, eslint, and 158 unit tests green.
2026-08-09 18:44:17 +08:00
pnoker a73ba1267a refactor(web,auth): httpOnly cookie auth + CSP + dedup + type debt
- token: httpOnly+Secure+SameSite cookie (backend Set/Clear + filter Cookie-first read), frontend axios drops X-Auth-Token, auth store uses sessionStorage flag, router guard checks flag
- security: CSP + nosniff + Referrer-Policy in index.html; delete dead getCookies/setCookies/removeCookies; remove Base64 obfuscation from storageUtil
- fix: 24 double-notification .catch failMessage removed (interceptor handles); storageUtil boolean get/set asymmetry fixed
- types: DeviceDetail/profile-detail/device-edit {} as any -> Partial<DeviceRecord>/DriverRecord/ProfileRecord
- dedup: API CRUD factory (11 modules), i18n confirmDelete interpolation (54 lines removed), CardShell unified + shared form-width mixin

Verification: vue-tsc green / 158 unit tests pass / mvn compile green
2026-08-08 18:40:58 +08:00
Henry Zhang 11fbf1d4bd feat(web): enable AI assistant with charted chat + enrich dashboard and entity data (#203)
AI assistant (was hidden in mock mode):
- Intercept /api/v3/agentic/chat/completions via a fetch mock (src/mock/fetch.ts); the assistant streams over raw fetch, not the axios adapter
- Keyword-aware scripted replies (temperature/energy/driver/point) emitting reasoning traces, text deltas and visualizations (line/area/column/bar/donut/stat/scatter)
- Show the assistant in mock builds (drop the isMock gate in Layout)
- Seed 4 multi-turn sessions (12 messages) with chart-bearing assistant replies + reasoning

Dashboard enrichment (home cards were sparse):
- Register the 8 insight endpoints the cards call (stream/device-stats/driver-stats/top/alert-aging/silent-sources/latency/activity) with realistic seed data so LiveDataFeed/AnalyticsTabs/SlaBadge/LatencyChart/ActivityHeatmap render content

Entity data (was thin):
- Drivers 8 -> 17, profiles 6 -> 14, points 18 -> 59, devices ~15 -> 65

Verification: vue-tsc green / 158 unit tests pass / build:mock succeeds
2026-08-08 00:39:41 +08:00
Henry Zhang 84110719ee feat(web): realistic mock demo + login-page entry and header icon fixes (#201)
Realistic mock:
- Generic CRUD registrar (crud.ts) + mutable in-memory db: full create/update/delete persistence for all entities
- Four structured seeds (auth/manager/data/agentic): real business data for 27 modules replacing the generic fallback stubs, with consistent relations
- Point-value 24h history curve (timeseries) + alarm/event/command history
- settings/business/agentic handlers covering all settings modules and special endpoints (tree/join queries)

Login page + header icons:
- Drop mock-mode pre-seeded token in main.ts and mock/index.ts so the demo starts at the login page (previously landed straight on home)
- Add Setting icon to the settings top-level menu (menuTree) and render icons on Layout dropdown sub-items (previously text-only)

Types: add [key:string]:unknown index signatures on entity interfaces in agentic.ts/common.ts (matches the existing DriverRecord convention)
Verification: vue-tsc green / 158 unit tests pass / build:mock succeeds / no internal address leaked in dist
2026-08-07 22:48:09 +08:00