/** * constants.js — Centralized Default Values and Magic Numbers * * Replaces hardcoded magic strings/numbers across page modules. */ /** * Application identity — the single source of truth for the displayed version. * Bump APP_VERSION on every release and add a matching CHANGELOG.md entry. */ export const APP_NAME = 'DP World Smart Solutions'; export const APP_VERSION = 'v1.11.16'; /** * v1.7.0 — pageId → 표시명 (Pending Changes 패널·배지에서 사용). * page-dirty matrix / computeChanges 페이지 귀속과 동일 id 집합. */ export const PAGE_DISPLAY_NAMES = { home: 'Dashboard', wifi: 'Wi-Fi', 'wifi-ap': 'Wi-Fi AP', ssid: 'Wi-Fi', ethernet: 'Ethernet', io: 'Sensor / IO', 'server-setting': 'Server Setting', network: 'Server Setting', general: 'General', 'sensor-io': 'Sensor / IO', 'can-bus': 'CAN Bus', register: 'General', can: 'CAN Bus', opcua: 'OPC-UA', modbus: 'Modbus', log: 'Log', firmware: 'Firmware', 'net-apply': 'Apply & Status', }; /** * v1.7.1 Task 2 — Dashboard issue type → target page id (deep-link). * Each dashboard issue carries a `type`; home.js renders its action as a * clickable control that navigates to the page where the operator fixes it. * Values are canonical page ids from the PAGES map (app.js). Unmapped types * fall back to a non-clickable note. */ export const DASHBOARD_ISSUE_PAGES = { runtime: 'home', // dpworldapp stopped / startup failed/hung — restart/inspect on Dashboard telemetry: 'home', // 8989 telemetry unavailable — Dashboard runtime card positioning: 'home', // GNSS module health — visible on Dashboard 'gnss-drift': 'firmware', // GNSS firmware drift — firmware/maintenance interface: 'general', // equipment interface / protocol selection 'interface-can': 'can-bus', 'interface-opcua': 'opcua', 'interface-modbus': 'modbus', server: 'server-setting', // protocol server endpoint disk: 'log', // free space / rotate logs 'net-drift': 'net-apply', // OS vs runtime network drift — apply & status 'net-apply': 'net-apply', // apply watchdog critical / country pending // D7: Wi-Fi signal poor → network Wi-Fi configuration page 'wifi-signal': 'wifi', }; export const DEFAULTS = { CAN_TYPE: 'extended', CAN_BAUDRATE: 250, RS485_MODE: 'half', RS485_BAUDRATE: 9600, RS485_DATABITS: '8', RS485_STOPBITS: '1', // v1.4.6.1 B-3: io.js/state.js fallback + dha baseline 일치 WIFI_SECURITY: 'wpa/wpa2', WIFI_COUNTRY_CODE: 'AE', LOG_SAVE: 'on', LOG_MAX_SIZE: 100, LOG_MAX_DAYS: 1, LOG_AUTO_COMPRESS: 'off', LOG_COMPRESS_SIZE_MB: 50, LOG_COMPRESS_AGE_DAYS: 7, LOG_AUTO_CLEANUP: 'off', LOG_CLEANUP_MAX_FILES: 50, LOG_CLEANUP_MAX_SIZE_MB: 200, }; /** Home dashboard auto-refresh interval (ms). */ export const DASHBOARD_REFRESH_MS = 10000; export const CAN_BAUDRATES = ['NONE', 100, 250, 500, 1000]; export const CAN_BAUDRATE_LABELS = { 'NONE': 'NONE', 100: '100kb/s', 250: '250kb/s', 500: '500kb/s', 1000: '1M/s', }; export const RS485_BAUDRATES = [4800, 9600, 19200, 38400, 57600, 115200]; // v2: 'float' (idt); reader accepts (case-insensitive) float not float64. ODT_OPTIONS unchanged. export const IDT_OPTIONS = ['integer', 'float', 'boolean', 'unsignedInteger', 'short', 'unsignedShort']; export const ODT_OPTIONS = ['integer', 'float64', 'boolean', 'string'];