|
14 | 14 | rel="stylesheet"> |
15 | 15 |
|
16 | 16 | <link rel="stylesheet" href="editor.css"> |
| 17 | + <link rel="icon" href="data:,"> |
17 | 18 | </head> |
18 | 19 |
|
19 | 20 | <body> |
20 | 21 | <header class="main-header"> |
21 | 22 | <div class="main-header-title"> |
22 | 23 | <h2><span class="logo-dot"></span> ESPHome Designer</h2> |
23 | | - <span>Visual YAML Editor <small style="opacity: 0.5; margin-left: 8px;">v0.8</small> <span |
| 24 | + <span>Visual YAML Editor <small style="opacity: 0.5; margin-left: 8px;">v0.8.1</small> <span |
24 | 25 | id="currentLayoutDevice" style="margin-left:8px; color:var(--accent);"></span></span> |
25 | 26 | </div> |
26 | 27 | <div class="main-header-actions desktop-only"> |
@@ -484,7 +485,11 @@ <h2><span class="logo-dot"></span> ESPHome Designer</h2> |
484 | 485 | </div> |
485 | 486 | <strong id="currentLayoutName">Loading...</strong> |
486 | 487 | </div> |
487 | | - <button id="saveLayoutBtn" class="btn btn-secondary btn-full">Save Project</button> |
| 488 | + <div style="display: flex; gap: 4px;"> |
| 489 | + <button id="saveLayoutBtn" class="btn btn-secondary" style="flex: 1;">Save Project</button> |
| 490 | + <button id="importProjectBtn" class="btn btn-secondary" style="flex: 1;">Import Project</button> |
| 491 | + </div> |
| 492 | + <input type="file" id="loadLayoutBtn" accept=".json" style="display:none;" /> |
488 | 493 | <button id="manageLayoutsBtn" class="btn btn-secondary btn-full" style="margin-top: 4px;">📁 Layout |
489 | 494 | Manager</button> |
490 | 495 | </div> |
@@ -617,6 +622,18 @@ <h2><span class="logo-dot"></span> ESPHome Designer</h2> |
617 | 622 | <option value="dark">Always Dark</option> |
618 | 623 | </select> |
619 | 624 | </div> |
| 625 | + <div class="field"> |
| 626 | + <div class="prop-label">Layout Mode (LVGL)</div> |
| 627 | + <select id="pageSettingsLayoutMode" class="prop-input"> |
| 628 | + <option value="absolute">Absolute Positioning</option> |
| 629 | + <option value="grid">Grid Layout</option> |
| 630 | + </select> |
| 631 | + <div id="field-grid-size" style="display:none; margin-top:8px;"> |
| 632 | + <div class="prop-label">Grid Size (RxC)</div> |
| 633 | + <input id="pageSettingsGridSize" class="prop-input" type="text" placeholder="4x4" pattern="[0-9]+x[0-9]+" /> |
| 634 | + <div style="font-size:10px; color:var(--muted); margin-top:4px;">Format: rows×columns, e.g. 2x3, 4x4</div> |
| 635 | + </div> |
| 636 | + </div> |
620 | 637 | </div> |
621 | 638 | <div class="modal-actions"> |
622 | 639 | <button id="pageSettingsSave" class="btn btn-secondary">Save Changes</button> |
@@ -910,33 +927,60 @@ <h2><span class="logo-dot"></span> ESPHome Designer</h2> |
910 | 927 | <span id="editorEntityCount" style="font-size:var(--fs-xs); opacity:0.6; margin-left:8px;"></span> |
911 | 928 | </div> |
912 | 929 | <div class="field" style="border-top:1px solid var(--border-subtle); padding-top:12px; margin-top:12px;"> |
913 | | - <div class="prop-label">Keyboard Shortcuts</div> |
914 | | - <div style="font-size: var(--fs-xs); color: var(--muted); line-height: 2;"> |
915 | | - <div><kbd |
916 | | - style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+Z</kbd> |
917 | | - Undo</div> |
918 | | - <div><kbd |
919 | | - style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+Y</kbd> |
920 | | - Redo</div> |
921 | | - <div><kbd |
922 | | - style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+C</kbd> |
923 | | - Copy widget</div> |
924 | | - <div><kbd |
925 | | - style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+V</kbd> |
926 | | - Paste widget</div> |
927 | | - <div><kbd |
928 | | - style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Delete</kbd> |
929 | | - Remove selected widget</div> |
930 | | - <div><kbd |
931 | | - style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Alt |
932 | | - + Drag</kbd> Disable snap guides</div> |
| 930 | + <span>Home Assistant Connection</span> |
| 931 | + </div> |
| 932 | + <div style="font-size:10px; opacity:0.6; margin-bottom:8px;">Configure this if you are using the GitHub-hosted |
| 933 | + version or an external URL.</div> |
| 934 | + <div class="field" style="display:flex; flex-direction:column; gap:8px;"> |
| 935 | + <div id="haCorsTip" |
| 936 | + style="background: rgba(82, 199, 234, 0.1); border-left: 3px solid var(--accent); padding: 10px; border-radius: 4px; font-size: 10px; line-height: 1.4;"> |
| 937 | + <strong>💡 Connection Tip:</strong><br> |
| 938 | + If requests are blocked, you may need to add <code id="haOriginPlaceholder">http://localhost:8000</code> to |
| 939 | + <code>cors_allowed_origins</code> in your Home Assistant <code>configuration.yaml</code> and |
| 940 | + <strong>restart HA</strong>. |
| 941 | + </div> |
| 942 | + <div> |
| 943 | + <div class="prop-label" style="font-size: 10px;">Base URL</div> |
| 944 | + <input type="text" id="haManualUrl" class="prop-input" placeholder="https://your-ha.duckdns.org:8123" /> |
| 945 | + </div> |
| 946 | + <div> |
| 947 | + <div class="prop-label" style="font-size: 10px;">Long-Lived Access Token</div> |
| 948 | + <input type="password" id="haLlatToken" class="prop-input" placeholder="Paste your token here..." /> |
| 949 | + </div> |
| 950 | + <div style="display:flex; gap:8px; align-items:center;"> |
| 951 | + <button id="editorTestHaBtn" class="btn btn-secondary btn-xs" style="flex:1;">Test Connection</button> |
| 952 | + <div id="haTestResult" style="font-size:10px; line-height: 1.2;"></div> |
933 | 953 | </div> |
934 | 954 | </div> |
935 | 955 | </div> |
936 | | - <div class="modal-actions"> |
937 | | - <button id="editorSettingsDone" class="btn btn-secondary">Done</button> |
| 956 | + <div class="field" style="border-top:1px solid var(--border-subtle); padding-top:12px; margin-top:12px;"> |
| 957 | + <div class="prop-label">Keyboard Shortcuts</div> |
| 958 | + <div style="font-size: var(--fs-xs); color: var(--muted); line-height: 2;"> |
| 959 | + <div><kbd |
| 960 | + style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+Z</kbd> |
| 961 | + Undo</div> |
| 962 | + <div><kbd |
| 963 | + style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+Y</kbd> |
| 964 | + Redo</div> |
| 965 | + <div><kbd |
| 966 | + style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+C</kbd> |
| 967 | + Copy widget</div> |
| 968 | + <div><kbd |
| 969 | + style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Ctrl+V</kbd> |
| 970 | + Paste widget</div> |
| 971 | + <div><kbd |
| 972 | + style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Delete</kbd> |
| 973 | + Remove selected widget</div> |
| 974 | + <div><kbd |
| 975 | + style="background:var(--bg-input); padding:2px 6px; border-radius:3px; border:1px solid var(--border-subtle);">Alt |
| 976 | + + Drag</kbd> Disable snap guides</div> |
| 977 | + </div> |
938 | 978 | </div> |
939 | 979 | </div> |
| 980 | + <div class="modal-actions"> |
| 981 | + <button id="editorSettingsDone" class="btn btn-secondary">Done</button> |
| 982 | + </div> |
| 983 | + </div> |
940 | 984 | </div> |
941 | 985 |
|
942 | 986 | <!-- Scripts --> |
|
0 commit comments