Preview link
This commit is contained in:
@ -92,6 +92,18 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
});
|
||||
}
|
||||
|
||||
// Preview Site button
|
||||
const previewBtn = document.getElementById("preview-site-btn");
|
||||
if (previewBtn) {
|
||||
const previewPort = previewBtn.getAttribute("data-preview-port") || "3000";
|
||||
previewBtn.onclick = () => {
|
||||
const host = window.location.hostname;
|
||||
const protocol = window.location.protocol;
|
||||
const url = `${protocol}//${host}:${previewPort}/`;
|
||||
window.open(url, "_blank");
|
||||
};
|
||||
}
|
||||
|
||||
// Modal close logic
|
||||
if (buildModal && buildModalClose) {
|
||||
buildModalClose.onclick = () => {
|
||||
|
@ -416,6 +416,14 @@ h2 {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.modal-actions-row {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center; /* Center horizontally */
|
||||
align-items: center; /* Center vertically */
|
||||
}
|
||||
|
||||
.flex-column {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
@ -48,7 +48,10 @@
|
||||
<span id="build-success-modal-close" class="modal-close">×</span>
|
||||
<h3>✅ Build completed!</h3>
|
||||
<p>Your files are available in the output folder.</p>
|
||||
<button id="download-zip-btn" class="modal-btn">Download ZIP</button>
|
||||
<div class="modal-actions-row">
|
||||
<button id="preview-site-btn" class="modal-btn" data-preview-port="{{ preview_port }}">🔎 Preview Site</button>
|
||||
<button id="download-zip-btn" class="modal-btn">📦 Download ZIP</button>
|
||||
</div>
|
||||
<div id="zip-loader" style="display:none;">Creating ZIP...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user