diff --git a/frontend/package.json b/frontend/package.json index 9c7c6cf..27688e8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,6 @@ "build": "vite build" }, "dependencies": { - "js-yaml": "^4.1.1", "react": "^18.2.0", "react-dom": "^18.2.0" }, @@ -15,4 +14,4 @@ "@vitejs/plugin-react": "^4.0.0", "vite": "^5.0.0" } -} +} \ No newline at end of file diff --git a/frontend/src/tools/devtools.jsx b/frontend/src/tools/devtools.jsx index 0710b33..1bd78ba 100644 --- a/frontend/src/tools/devtools.jsx +++ b/frontend/src/tools/devtools.jsx @@ -1,330 +1,269 @@ -import { useState, useCallback } from 'react'; +import { useState } from 'react'; import { S } from '../lib.js'; -import jsyaml from 'js-yaml'; -// ── YAML Tree Node (collapsible, mit Einrück-Linien) ───────────────────────── -function YamlNode({ data, depth = 0, keyName = null, collapsed, onToggle, path }) { - const indent = depth * 18; // px pro Level - const isObj = data !== null && typeof data === 'object' && !Array.isArray(data); - const isArr = Array.isArray(data); - const isLeaf = !isObj && !isArr; +const MONTHS = ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember']; +const WEEKDAYS = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag']; - const nodeKey = path; - const isCollapsed = collapsed.has(nodeKey); - const hasChildren = isObj || isArr; +function parseField(val) { + val = String(val).trim(); + if (val==='*'||val==='?') return {type:'all'}; + if (val.startsWith('*/')) { const n=parseInt(val.slice(2)); return {type:'step',step:n}; } + if (val.includes('/')&&!val.startsWith('*/')) { const [s,st]=val.split('/'); return {type:'stepFrom',from:parseInt(s),step:parseInt(st)}; } + if (val.includes(',')) return {type:'list',vals:val.split(',').map(v=>parseInt(v))}; + if (val.includes('-')) { const [a,b]=val.split('-').map(Number); return {type:'range',from:a,to:b}; } + const n=parseInt(val); if (!isNaN(n)) return {type:'single',val:n}; + return {type:'raw',val}; +} - const keyColor = '#7ecaff'; - const strColor = '#ce9178'; - const numColor = '#b5cea8'; - const boolColor = '#569cd6'; - const nullColor = '#808080'; - const indentColor= 'rgba(255,255,255,0.08)'; - - const valueColor = (v) => { - if (v === null || v === undefined) return nullColor; - if (typeof v === 'boolean') return boolColor; - if (typeof v === 'number') return numColor; - return strColor; - }; - - const renderValue = (v) => { - if (v === null) return null; - if (v === undefined) return ~; - if (typeof v === 'boolean') return {String(v)}; - if (typeof v === 'number') return {v}; - const s = String(v); - // Quote strings that need it - const needsQuotes = /[:#\[\]{}&*!|>'"%@`]/.test(s) || s.trim()!==s || s==='' || /^(true|false|null|yes|no|on|off)$/i.test(s); - return {needsQuotes ? `"${s.replace(/"/g,'\\"')}"` : s}; - }; - - // Leaf: key: value - if (isLeaf) { - return ( -
- {formatted||'# Ergebnis erscheint hier'}
-
- ) : parsed!==null ? (
- {cron}
+
+