v1.0.0
This commit is contained in:
@@ -94,7 +94,6 @@ func getManifestURL() string {
|
||||
}
|
||||
|
||||
func ProjectInitPage(w http.ResponseWriter, r *http.Request) {
|
||||
manifestURL := getManifestURL()
|
||||
body := `
|
||||
<header class="tool-header">
|
||||
<h2 class="tool-title">Initialize Project</h2>
|
||||
@@ -107,17 +106,10 @@ func ProjectInitPage(w http.ResponseWriter, r *http.Request) {
|
||||
<div style="display:flex;gap:4px;align-items:center;">
|
||||
<span id="manifestSource" class="muted" style="font-size:11px;margin-right:4px;"></span>
|
||||
<button class="secondary" style="min-height:22px;width:26px;padding:0;font-size:14px;" title="Refresh manifest" onclick="refresh()">↻</button>
|
||||
<button class="secondary" style="min-height:22px;width:26px;padding:0;font-size:14px;" title="Configure manifest URL" onclick="toggleSettings()">⚙</button>
|
||||
<button class="secondary" style="min-height:22px;width:26px;padding:0;font-size:14px;" title="Configure manifest URL" onclick="openSettingsModal('initialize-project')">⚙</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div id="settingsGroup" class="control-group" style="display:none;">
|
||||
<p class="control-label">Manifest URL</p>
|
||||
<div class="field-row">
|
||||
<input type="text" id="manifestUrlInput" value="` + htmlEscape(manifestURL) + `" style="flex:1;" placeholder="https://…" />
|
||||
<button onclick="saveManifestUrl()">Save & Refresh</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div id="fileList"></div>
|
||||
</div>
|
||||
@@ -139,29 +131,11 @@ func ProjectInitPage(w http.ResponseWriter, r *http.Request) {
|
||||
<script>
|
||||
let files = [];
|
||||
let allSelected = true;
|
||||
let settingsVisible = false;
|
||||
|
||||
function escapeHtml(s) {
|
||||
return String(s).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
}
|
||||
|
||||
function toggleSettings() {
|
||||
settingsVisible = !settingsVisible;
|
||||
document.getElementById('settingsGroup').style.display = settingsVisible ? '' : 'none';
|
||||
}
|
||||
|
||||
async function saveManifestUrl() {
|
||||
const url = document.getElementById('manifestUrlInput').value.trim();
|
||||
await fetch('/api/project-init/setManifestUrl', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ url }),
|
||||
});
|
||||
settingsVisible = false;
|
||||
document.getElementById('settingsGroup').style.display = 'none';
|
||||
refresh();
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
setStatus('', '');
|
||||
document.getElementById('fileList').innerHTML = '<p class="muted" style="margin:0;">Loading manifest…</p>';
|
||||
|
||||
Reference in New Issue
Block a user