Closes #325. A zone gains an "Import devices by subnet" action: type a CIDR, and every free device whose IP falls in that range moves into the zone, laid out on a grid in its free space. The CIDR is an argument to a one-shot action, never a property of the zone — it is not submitted with the form, not persisted, and cleared after each run. So there is no schema change, no migration, and it works in standalone mode. The trade-off is that a device scanned later does not join the zone by itself; the user re-runs the import. Deliberate rules: - additive — running it twice with two subnets leaves both sets inside, and a device whose IP stops matching is never ejected - only unparented devices move. A node nested in a group, a container host or another zone keeps the parent the user gave it - canvas furniture (groupRect / group / text) is skipped, and a zone never swallows another zone - one history entry per import, so a single Undo reverses the whole thing Edit mode gets an Import button; add mode has none, since the zone does not exist yet and a button would look broken — there the CIDR is applied right after the zone is created. IPv4 only: the modal rejects an IPv6 CIDR with a message rather than silently matching nothing. ha-relevant: yes
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])