Add git version control panel and LAN hosting support
- Git modal (⎇ Git button): commit all diagrams as JSON to diagrams/ folder,
push to remote, view history, restore any diagram from any past commit
- Diagrams exported to diagrams/{id}_{name}.json on each commit so diffs are
human-readable and individual diagrams can be restored independently
- backend/run.py: changed host to 0.0.0.0 for LAN access
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
<button id="btn-git" title="Git version control">⎇ Git</button>
|
||||
<button id="btn-drc" title="Run design-rule check">⚠ DRC</button>
|
||||
<div id="saved-indicator">✓ Saved</div>
|
||||
<div class="export-wrap">
|
||||
@@ -419,6 +420,42 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="git-modal" style="display:none">
|
||||
<div class="modal-box" style="min-width:520px;max-width:700px">
|
||||
<div class="modal-header">
|
||||
<h3>⎇ Git Version Control</h3>
|
||||
<span id="git-status-badge" class="git-badge"></span>
|
||||
</div>
|
||||
<div class="modal-body" style="padding:12px;gap:10px;display:flex;flex-direction:column">
|
||||
|
||||
<!-- Commit section -->
|
||||
<div class="git-section">
|
||||
<label class="git-section-title">Commit all diagrams</label>
|
||||
<div style="display:flex;gap:6px;align-items:flex-start">
|
||||
<textarea id="git-commit-msg" placeholder="Describe what changed…" rows="2"
|
||||
style="flex:1;resize:vertical;font-size:12px;padding:5px;background:#0d0d20;color:#ccd;border:1px solid #2a2a44;border-radius:4px"></textarea>
|
||||
<div style="display:flex;flex-direction:column;gap:4px">
|
||||
<button id="btn-git-commit" class="btn-primary" style="white-space:nowrap">⊕ Commit</button>
|
||||
<button id="btn-git-push" style="white-space:nowrap">⇧ Push</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="git-op-status" style="font-size:11px;color:#88cc88;min-height:16px"></div>
|
||||
</div>
|
||||
|
||||
<!-- History section -->
|
||||
<div class="git-section" style="flex:1">
|
||||
<label class="git-section-title">Commit history</label>
|
||||
<div id="git-log-list" style="max-height:320px;overflow-y:auto;font-size:11px;display:flex;flex-direction:column;gap:1px"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div style="flex:1"></div>
|
||||
<button id="git-close">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://unpkg.com/konva@9/konva.min.js"></script>
|
||||
<script src="/js/api.js"></script>
|
||||
<script src="/js/deviceTypes.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user