diff --git a/CHANGELOG.md b/CHANGELOG.md index 49caaf7..8a724c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,22 @@ ADR-007 and ADR-002. ### Changed +- Equipment -> machines rename (backend). The equipment plugin is now the + machines plugin: `/api/equipment` -> `/api/machines`, tables + `equipment`/`equipmenttypes` -> `machines`/`machinetypes` (columns + `equipmentid` -> `machineid`, `equipmenttypeid` -> `machinetypeid`, + `equipmenttype` -> `machinetype`), permissions `equipment.*` -> + `machines.*`, assettype value `equipment` -> `machine`. The legacy core + `machinetypes` lookup (it types the vendor MODELS catalog, not machine + instances) is renamed to `modeltypes` (`/api/machinetypes` -> + `/api/modeltypes`, `models.machinetypeid` -> `models.modeltypeid`) to + free the name. Data flips migrate assettypes, auditlog entitytype, + settings keys (`identifier_*_equipment_enabled` -> + `identifier_*_machine_enabled`, `search_equipment_enabled` -> + `search_machine_enabled`), and permission rows in place; plugins.json + registry entries carry over automatically. Upgrade: run + `flask db upgrade` then `flask plugin upgrade-all`. + - Inter (variable) replaces Roboto, bundled locally - no Google Fonts fetch, so air-gapped installs render correctly. Tables use tabular numerals. diff --git a/CLAUDE.md b/CLAUDE.md index e16f076..4fe0147 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -38,7 +38,7 @@ Refactor phases 0-5 landed; phase 6 (multi-site distribution readiness) in progr - 340 tests passing, naming/style check green, Gitea Actions CI (backend + naming + frontend build) - `__contract_version__` at 0.6.0 (product `__version__` 0.5.0 - distinct series, ADR-007) -- 11 bundled plugins all satisfy contract: computers, employees, equipment, knowledgebase, measuringtools, network, notifications, printers, slides, usb, warranty +- 11 bundled plugins all satisfy contract: computers, employees, knowledgebase, machines, measuringtools, network, notifications, printers, slides, usb, warranty - Single core Alembic chain: baseline `68b3947ae14f` -> head `7d16_directoryemployees` (23 migrations). A fresh site runs `flask db upgrade` from empty; it is reproducible and idempotent. - Pre-1.0 framework; sister sites should pin tight `core_version` ranges until contract reaches 1.0 diff --git a/README.md b/README.md index bc0e1eb..5224e1e 100644 --- a/README.md +++ b/README.md @@ -1,233 +1,233 @@ -# ShopDB Flask - -A modern rewrite of the classic ASP/VBScript ShopDB application using Flask (Python) and Vue 3. This application manages shop floor machines, PCs, printers, applications, and related infrastructure for manufacturing environments. - -## Overview - -ShopDB tracks and manages: -- **Machines** - CNC equipment, CMMs, inspection systems, etc. -- **PCs** - Shopfloor computers, engineering workstations -- **Printers** - Network printers with Zabbix integration -- **Applications** - Software deployed across the shop floor -- **Knowledge Base** - Documentation and troubleshooting guides - -## Tech Stack - -**Backend:** -- Python 3.x with Flask -- SQLAlchemy ORM -- MySQL 5.6+ database -- JWT authentication -- Plugin architecture for extensibility - -**Frontend:** -- Vue 3 with Composition API -- Vue Router for navigation -- Pinia for state management -- Vite build system - -## Project Structure - -``` -shopdb-flask/ -├── shopdb/ # Flask application -│ ├── core/ -│ │ ├── api/ # REST API endpoints -│ │ ├── models/ # SQLAlchemy models -│ │ ├── schemas/ # Validation schemas -│ │ └── services/ # Business logic -│ ├── plugins/ # Plugin system -│ └── utils/ # Shared utilities -├── frontend/ # Vue 3 application -│ ├── src/ -│ │ ├── api/ # API client -│ │ ├── components/ # Reusable components -│ │ ├── views/ # Page components -│ │ ├── router/ # Route definitions -│ │ └── stores/ # Pinia stores -│ └── public/ # Static assets -├── plugins/ # Bundled and external plugins -├── migrations/ # Alembic migration chain (flask db upgrade) -├── scripts/ # Import and utility scripts -└── tests/ # Test suite -``` - -## Naming Conventions - -To maintain consistency with the legacy ShopDB database and codebase, the following naming standards apply: - -### Database - -- **Table names:** Lowercase, single word, no underscores or dashes - - Examples: `machines`, `pctypes`, `machinetypes`, `businessunits` -- **Column names:** Lowercase, single word, no underscores or dashes - - Examples: `machineid`, `machinenumber`, `pctypeid`, `isactive`, `createddate` -- **Foreign keys:** Referenced table name + `id` - - Examples: `locationid`, `vendorid`, `modelnumberid`, `pctypeid` -- **Boolean columns:** Prefixed with `is` or `has` - - Examples: `isactive`, `isshopfloor`, `isvnc`, `iswinrm`, `islicenced` - -### Code - -- **Python variables:** Follow database naming where applicable (lowercase, no underscores for model fields) -- **JavaScript variables:** camelCase for local variables, but match API field names from backend -- **Vue components:** PascalCase for component names -- **CSS classes:** Lowercase with dashes for multi-word classes - -### API - -- **Endpoints:** Lowercase, plural nouns - - Examples: `/api/machines`, `/api/pctypes`, `/api/locations` -- **Query parameters:** Lowercase, single word - - Examples: `?type=pc`, `?locationid=5`, `?isactive=true` - -## Style Guidelines - -- No emojis in code, comments, documentation, or UI -- Keep UI functional and professional -- Dark theme is the default -- Consistent table layouts across all list views - -## Setup - -### Prerequisites - -- Python 3.8+ -- Node.js 18+ -- MySQL 5.7+ (5.6 works with extra utf8mb4 config; see docs/DEPLOY.md) - -ShopDB Flask uses MySQL as the canonical database. SQLite is used only for the -test suite (`TestingConfig` in `shopdb/config.py` points at an in-memory -SQLite). Do not run dev or production against SQLite. - -### Distribution - -The application is distributed internally through the GE Aerospace Gitea. Clone -it from there; there is no public package or image registry. - -### Fast path (Docker) - -The Docker image builds the Vue frontend and serves it from the API container, -so a container deploy needs no separate Node build step. - -```bash -cp .env.example .env -# Edit .env: set SECRET_KEY, JWT_SECRET_KEY, DATABASE_URL, CORS_ORIGINS, -# and the MYSQL_* passwords (see docs/CONFIG.md for every variable). - -docker compose up -d --build - -# Create the schema and seed the platform data (idempotent, safe to re-run): -docker compose exec api flask db upgrade -docker compose exec api flask seed permissions -docker compose exec api flask seed settings -docker compose exec api flask seed reference-data -``` - -Then browse to the site and complete the first-run setup wizard at `/setup` -(it creates the first admin account and captures site identity). To create the -admin headlessly instead of using the wizard: - -```bash -docker compose exec api flask seed admin --username admin --email admin@facility.example.com -``` - -### Manual path (venv + Node) - -```bash -# Backend -python -m venv venv -source venv/bin/activate -pip install -r requirements.txt -cp .env.example .env -# Edit .env with your database credentials and secrets. - -flask db upgrade -flask seed permissions -flask seed settings -flask seed reference-data -flask run - -# Frontend (separate terminal) -cd frontend -npm install -npm run dev # dev server on :5173 -npm run build # production build into frontend/dist (served by Flask) -``` - -Complete first-run setup at `/setup`, or run `flask seed admin` for a headless -admin account. - -To import data from the legacy ShopDB MySQL database (one-time, see -`migrations/DATA_MIGRATION_GUIDE.md`): - -```bash -python scripts/import_from_mysql.py -``` - -For the full per-site deployment runbook see [docs/DEPLOY.md](docs/DEPLOY.md); -for every environment variable and Setting key see [docs/CONFIG.md](docs/CONFIG.md). - -## Configuration - -Environment variables (`.env`): - -| Variable | Description | -|----------|-------------| -| `DATABASE_URL` | MySQL connection string | -| `SECRET_KEY` | Flask secret key | -| `JWT_SECRET_KEY` | JWT signing key | -| `JWT_ACCESS_TOKEN_EXPIRES` | Access token TTL (seconds) | -| `LOG_LEVEL` | Logging verbosity | - -## API Documentation - -The REST API follows standard conventions: - -| Method | Endpoint | Description | -|--------|----------|-------------| -| GET | `/api/machines` | List machines (filterable by type) | -| GET | `/api/machines/:id` | Get machine details | -| POST | `/api/machines` | Create machine | -| PUT | `/api/machines/:id` | Update machine | -| DELETE | `/api/machines/:id` | Soft delete machine | - -Query parameters for list endpoints: -- `page` - Page number (default: 1) -- `per_page` - Items per page (default: 25) -- `sort` - Sort field -- `order` - Sort direction (asc/desc) -- `search` - Search term -- `type` - Filter by machine type (pc, printer, equipment) - -## Plugin System - -ShopDB supports plugins for extending functionality. See `CONTRIBUTING.md` for plugin development guidelines. - -The image bundles ten plugins; only the ones a site installs are loaded: - -- **computers** - Shopfloor PCs and workstations -- **employees** - Employee directory -- **equipment** - CNC, CMM, and inspection equipment -- **knowledgebase** - Documentation and troubleshooting guides -- **network** - Network devices -- **notifications** - Shopfloor notifications and recognition feed -- **printers** - Extended printer management with Zabbix integration -- **slides** - TV/kiosk slideshows -- **usb** - CMMC USB check-in/out tracking -- **warranty** - Dell warranty lookups - -## Legacy Migration - -This project replicates functionality from the classic ASP/VBScript ShopDB site. Key mappings: - -| Legacy | Modern | -|--------|--------| -| ASP/VBScript | Flask/Python | -| Classic ADO | SQLAlchemy | -| Server-side HTML | Vue 3 SPA | -| Session auth | JWT tokens | - -## License - -Internal use only. +# ShopDB Flask + +A modern rewrite of the classic ASP/VBScript ShopDB application using Flask (Python) and Vue 3. This application manages shop floor machines, PCs, printers, applications, and related infrastructure for manufacturing environments. + +## Overview + +ShopDB tracks and manages: +- **Machines** - CNC equipment, CMMs, inspection systems, etc. +- **PCs** - Shopfloor computers, engineering workstations +- **Printers** - Network printers with Zabbix integration +- **Applications** - Software deployed across the shop floor +- **Knowledge Base** - Documentation and troubleshooting guides + +## Tech Stack + +**Backend:** +- Python 3.x with Flask +- SQLAlchemy ORM +- MySQL 5.6+ database +- JWT authentication +- Plugin architecture for extensibility + +**Frontend:** +- Vue 3 with Composition API +- Vue Router for navigation +- Pinia for state management +- Vite build system + +## Project Structure + +``` +shopdb-flask/ +├── shopdb/ # Flask application +│ ├── core/ +│ │ ├── api/ # REST API endpoints +│ │ ├── models/ # SQLAlchemy models +│ │ ├── schemas/ # Validation schemas +│ │ └── services/ # Business logic +│ ├── plugins/ # Plugin system +│ └── utils/ # Shared utilities +├── frontend/ # Vue 3 application +│ ├── src/ +│ │ ├── api/ # API client +│ │ ├── components/ # Reusable components +│ │ ├── views/ # Page components +│ │ ├── router/ # Route definitions +│ │ └── stores/ # Pinia stores +│ └── public/ # Static assets +├── plugins/ # Bundled and external plugins +├── migrations/ # Alembic migration chain (flask db upgrade) +├── scripts/ # Import and utility scripts +└── tests/ # Test suite +``` + +## Naming Conventions + +To maintain consistency with the legacy ShopDB database and codebase, the following naming standards apply: + +### Database + +- **Table names:** Lowercase, single word, no underscores or dashes + - Examples: `machines`, `pctypes`, `machinetypes`, `businessunits` +- **Column names:** Lowercase, single word, no underscores or dashes + - Examples: `machineid`, `machinenumber`, `pctypeid`, `isactive`, `createddate` +- **Foreign keys:** Referenced table name + `id` + - Examples: `locationid`, `vendorid`, `modelnumberid`, `pctypeid` +- **Boolean columns:** Prefixed with `is` or `has` + - Examples: `isactive`, `isshopfloor`, `isvnc`, `iswinrm`, `islicenced` + +### Code + +- **Python variables:** Follow database naming where applicable (lowercase, no underscores for model fields) +- **JavaScript variables:** camelCase for local variables, but match API field names from backend +- **Vue components:** PascalCase for component names +- **CSS classes:** Lowercase with dashes for multi-word classes + +### API + +- **Endpoints:** Lowercase, plural nouns + - Examples: `/api/machines`, `/api/pctypes`, `/api/locations` +- **Query parameters:** Lowercase, single word + - Examples: `?type=pc`, `?locationid=5`, `?isactive=true` + +## Style Guidelines + +- No emojis in code, comments, documentation, or UI +- Keep UI functional and professional +- Dark theme is the default +- Consistent table layouts across all list views + +## Setup + +### Prerequisites + +- Python 3.8+ +- Node.js 18+ +- MySQL 5.7+ (5.6 works with extra utf8mb4 config; see docs/DEPLOY.md) + +ShopDB Flask uses MySQL as the canonical database. SQLite is used only for the +test suite (`TestingConfig` in `shopdb/config.py` points at an in-memory +SQLite). Do not run dev or production against SQLite. + +### Distribution + +The application is distributed internally through the GE Aerospace Gitea. Clone +it from there; there is no public package or image registry. + +### Fast path (Docker) + +The Docker image builds the Vue frontend and serves it from the API container, +so a container deploy needs no separate Node build step. + +```bash +cp .env.example .env +# Edit .env: set SECRET_KEY, JWT_SECRET_KEY, DATABASE_URL, CORS_ORIGINS, +# and the MYSQL_* passwords (see docs/CONFIG.md for every variable). + +docker compose up -d --build + +# Create the schema and seed the platform data (idempotent, safe to re-run): +docker compose exec api flask db upgrade +docker compose exec api flask seed permissions +docker compose exec api flask seed settings +docker compose exec api flask seed reference-data +``` + +Then browse to the site and complete the first-run setup wizard at `/setup` +(it creates the first admin account and captures site identity). To create the +admin headlessly instead of using the wizard: + +```bash +docker compose exec api flask seed admin --username admin --email admin@facility.example.com +``` + +### Manual path (venv + Node) + +```bash +# Backend +python -m venv venv +source venv/bin/activate +pip install -r requirements.txt +cp .env.example .env +# Edit .env with your database credentials and secrets. + +flask db upgrade +flask seed permissions +flask seed settings +flask seed reference-data +flask run + +# Frontend (separate terminal) +cd frontend +npm install +npm run dev # dev server on :5173 +npm run build # production build into frontend/dist (served by Flask) +``` + +Complete first-run setup at `/setup`, or run `flask seed admin` for a headless +admin account. + +To import data from the legacy ShopDB MySQL database (one-time, see +`migrations/DATA_MIGRATION_GUIDE.md`): + +```bash +python scripts/import_from_mysql.py +``` + +For the full per-site deployment runbook see [docs/DEPLOY.md](docs/DEPLOY.md); +for every environment variable and Setting key see [docs/CONFIG.md](docs/CONFIG.md). + +## Configuration + +Environment variables (`.env`): + +| Variable | Description | +|----------|-------------| +| `DATABASE_URL` | MySQL connection string | +| `SECRET_KEY` | Flask secret key | +| `JWT_SECRET_KEY` | JWT signing key | +| `JWT_ACCESS_TOKEN_EXPIRES` | Access token TTL (seconds) | +| `LOG_LEVEL` | Logging verbosity | + +## API Documentation + +The REST API follows standard conventions: + +| Method | Endpoint | Description | +|--------|----------|-------------| +| GET | `/api/machines` | List machines (filterable by type) | +| GET | `/api/machines/:id` | Get machine details | +| POST | `/api/machines` | Create machine | +| PUT | `/api/machines/:id` | Update machine | +| DELETE | `/api/machines/:id` | Soft delete machine | + +Query parameters for list endpoints: +- `page` - Page number (default: 1) +- `per_page` - Items per page (default: 25) +- `sort` - Sort field +- `order` - Sort direction (asc/desc) +- `search` - Search term +- `type` - Filter by asset type (computer, printer, machine, network_device) + +## Plugin System + +ShopDB supports plugins for extending functionality. See `CONTRIBUTING.md` for plugin development guidelines. + +The image bundles ten plugins; only the ones a site installs are loaded: + +- **computers** - Shopfloor PCs and workstations +- **employees** - Employee directory +- **machine** - CNC, CMM, and other shop-floor machines +- **knowledgebase** - Documentation and troubleshooting guides +- **network** - Network devices +- **notifications** - Shopfloor notifications and recognition feed +- **printers** - Extended printer management with Zabbix integration +- **slides** - TV/kiosk slideshows +- **usb** - CMMC USB check-in/out tracking +- **warranty** - Dell warranty lookups + +## Legacy Migration + +This project replicates functionality from the classic ASP/VBScript ShopDB site. Key mappings: + +| Legacy | Modern | +|--------|--------| +| ASP/VBScript | Flask/Python | +| Classic ADO | SQLAlchemy | +| Server-side HTML | Vue 3 SPA | +| Session auth | JWT tokens | + +## License + +Internal use only. diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 7c3f3f8..4503c8f 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -146,7 +146,7 @@ them under `instance/branding/`. |-----|---------|-------| | `site_logo` | `/ge-aerospace-logo.svg` | Header and login-page logo. | | `qr_logo` | `/ge-monogram.svg` | Logo composited in printer QR labels. Blank = no overlay. | -| `badge_logo` | `/ge-aerospace-logo.svg` | Logo on the equipment badge print page. | +| `badge_logo` | `/ge-aerospace-logo.svg` | Logo on the machine badge print page. | | `site_favicon` | (empty) | Browser tab favicon. Blank = shipped `/favicon.svg`. | | `brand_primary_color` | (empty) | Primary brand color as a CSS color value (maps to `--primary`). Blank = built-in theme color. | | `brand_primary_dark_color` | (empty) | Primary hover/active color (maps to `--primary-dark`). Blank = auto-derived by darkening the primary color ~15%. | diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md index ff80013..f80ee47 100644 --- a/docs/DEPLOY.md +++ b/docs/DEPLOY.md @@ -104,12 +104,12 @@ docker compose exec api flask seed reference-data ## Step 5: Pick plugins to enable -The image bundles ten plugins (computers, employees, equipment, knowledgebase, network, notifications, printers, slides, usb, warranty). Only enabled plugins are loaded. +The image bundles eleven plugins (computers, employees, knowledgebase, machines, measuringtools, network, notifications, printers, slides, usb, warranty). Only enabled plugins are loaded. ```bash docker compose exec api flask plugin list docker compose exec api flask plugin install computers -docker compose exec api flask plugin install equipment +docker compose exec api flask plugin install machines # ... repeat for each plugin the site tracks ``` diff --git a/docs/PLUGIN-GUIDE.md b/docs/PLUGIN-GUIDE.md index 95d4d11..01683a9 100644 --- a/docs/PLUGIN-GUIDE.md +++ b/docs/PLUGIN-GUIDE.md @@ -109,7 +109,7 @@ def meta(self) -> PluginMeta: The plugin owns two tables (`plugins/measuringtools/models/measuringtool.py`): - `measuringtooltypes` - the site-managed lookup (Caliper, Micrometer, ...) with a - display color, the same shape as `equipmenttypes` / `computertypes`. + display color, the same shape as `machinetypes` / `computertypes`. - `measuringtools` - the one-to-one extension of a core `Asset`, carrying only the metrology domain fields. @@ -523,7 +523,7 @@ form is `requiresAuth`; the settings subtype page is `requiresAuth + requiresAdm **API client, addition only.** `frontend/src/api/index.js` gets a `measuringtoolsApi` object appended after `warrantyApi` (`list`, `get`, `create`, `update`, `remove`, `calibrationReport`, and a nested `types` CRUD). Do not -reorganize the file; just add the block, mirroring `equipmentApi`. +reorganize the file; just add the block, mirroring `machinesApi`. **Views mirror the master templates.** The frontend has master templates the frontend CLAUDE.md points to (`PrintersList.vue` for lists, `PrinterDetail.vue` diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md index 6508aaa..75d5fcd 100644 --- a/docs/PLUGINS.md +++ b/docs/PLUGINS.md @@ -8,7 +8,7 @@ These plugins are in `plugins/` in this repo. Enable per site with `flask plugin | Plugin | Tracks | Notes | |--------|--------|-------| -| `equipment` | Manufacturing machinery: 5-axis mills, lathes, broachers, heat treatment ovens | Manually entered. See [ADR-005](adr/ADR-005-equipment-vs-measuringtools.md). Subtype tables for FOCAS / CLM / MTConnect controller protocols (planned). | +| `machines` | Manufacturing machinery: 5-axis mills, lathes, broachers, heat treatment ovens | Manually entered. See [ADR-005](adr/ADR-005-equipment-vs-measuringtools.md). Subtype tables for FOCAS / CLM / MTConnect controller protocols (planned). | | `computers` | Shop-floor PCs and engineering workstations | Fed by the PXE pipeline collector per [ADR-006](adr/ADR-006-collector-contract.md). | | `printers` | Network and shop-floor printers | Optional Zabbix integration for supply tracking. Legacy `PrinterData` retiring per ADR-001. | | `network` | Switches, routers, access points, IDFs as locations | Asset-only; cleanest of the bundled set. | diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 89ae0fa..6a5a08f 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -33,7 +33,7 @@ shopdb-flask is at `__contract_version__ = '0.5.0'` (pre-1.0). This document cap - Frontend scaffolding skill (the backend has `flask plugin new`; the frontend stub is currently manual copy-paste). - Marketplace listing site (PLUGINS.md is a one-pager; a proper listing with links to sister-site plugins becomes useful when there are more than three external plugins). - Plugin contract surface diff tooling. Today version bumps are manual judgment; a CI check that diffs the contract surface against the previous tag would catch missed bumps. See ADR-002. -- Calibration cycles, maintenance windows, downtime tracking (domain extensions; would likely live in the `equipment` and `measuringtools` plugins). +- Calibration cycles, maintenance windows, downtime tracking (domain extensions; would likely live in the `machines` and `measuringtools` plugins). ### Deferred (out of scope for 1.0) diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js index 6c34eee..82f0e41 100644 --- a/frontend/src/api/index.js +++ b/frontend/src/api/index.js @@ -58,45 +58,45 @@ export const authApi = { } } -// Equipment API (plugin) -export const equipmentApi = { +// Machines API (plugin) +export const machinesApi = { list(params = {}) { - return api.get('/equipment', { params }) + return api.get('/machines', { params }) }, get(id) { - return api.get(`/equipment/${id}`) + return api.get(`/machines/${id}`) }, getByAsset(assetId) { - return api.get(`/equipment/by-asset/${assetId}`) + return api.get(`/machines/by-asset/${assetId}`) }, create(data) { - return api.post('/equipment', data) + return api.post('/machines', data) }, update(id, data) { - return api.put(`/equipment/${id}`, data) + return api.put(`/machines/${id}`, data) }, delete(id) { - return api.delete(`/equipment/${id}`) + return api.delete(`/machines/${id}`) }, dashboardSummary() { - return api.get('/equipment/dashboard/summary') + return api.get('/machines/dashboard/summary') }, - // Equipment types + // Machine types types: { list(params = {}) { - return api.get('/equipment/types', { params }) + return api.get('/machines/types', { params }) }, get(id) { - return api.get(`/equipment/types/${id}`) + return api.get(`/machines/types/${id}`) }, create(data) { - return api.post('/equipment/types', data) + return api.post('/machines/types', data) }, update(id, data) { - return api.put(`/equipment/types/${id}`, data) + return api.put(`/machines/types/${id}`, data) }, remove(id) { - return api.delete(`/equipment/types/${id}`) + return api.delete(`/machines/types/${id}`) } } } @@ -178,19 +178,19 @@ export const relationshipTypesApi = { } } -// Machine Types API -export const machinetypesApi = { +// Model Types API (the vendor models catalog: modeltypeid) +export const modeltypesApi = { list(params = {}) { - return api.get('/machinetypes', { params }) + return api.get('/modeltypes', { params }) }, create(data) { - return api.post('/machinetypes', data) + return api.post('/modeltypes', data) }, update(id, data) { - return api.put(`/machinetypes/${id}`, data) + return api.put(`/modeltypes/${id}`, data) }, delete(id) { - return api.delete(`/machinetypes/${id}`) + return api.delete(`/modeltypes/${id}`) } } @@ -667,8 +667,8 @@ export const reportsApi = { list() { return api.get('/reports') }, - equipmentByType(params = {}) { - return api.get('/reports/equipment-by-type', { params }) + machinesByType(params = {}) { + return api.get('/reports/machines-by-type', { params }) }, assetsByStatus(params = {}) { return api.get('/reports/assets-by-status', { params }) diff --git a/frontend/src/assets/style.css b/frontend/src/assets/style.css index c41b18a..906345e 100644 --- a/frontend/src/assets/style.css +++ b/frontend/src/assets/style.css @@ -976,7 +976,7 @@ td.actions { width: 180px; height: 180px; object-fit: contain; - background: rgba(0, 0, 0, 0.3); + background: var(--bg); border-radius: 0.25rem; padding: 1rem; } @@ -1208,15 +1208,16 @@ td.actions { align-items: center; justify-content: space-between; padding: 0.75rem; - background: rgba(0, 0, 0, 0.3); + background: var(--bg); + border: 1px solid var(--border); border-radius: 0.25rem; text-decoration: none; color: inherit; - transition: background 0.15s; + transition: border-color 0.15s; } .equipment-item:hover { - background: rgba(255, 255, 255, 0.1); + border-color: var(--primary); } .equipment-info { @@ -1251,7 +1252,8 @@ td.actions { .network-item { padding: 0.75rem; - background: rgba(0, 0, 0, 0.3); + background: var(--bg); + border: 1px solid var(--border); border-radius: 0.25rem; } diff --git a/frontend/src/components/AssetRelationships.vue b/frontend/src/components/AssetRelationships.vue index c01a1bb..a8e19c2 100644 --- a/frontend/src/components/AssetRelationships.vue +++ b/frontend/src/components/AssetRelationships.vue @@ -27,14 +27,14 @@ :key="rel.relationshipid" class="relationship-item" > -
+