Skip to content

Commit 6fe0c2f

Browse files
committed
Update app.js
1 parent bf0e582 commit 6fe0c2f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

static/js/app.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,30 @@ function updateUI(input) {
127127
* 4. Unlocks Configuration if successful.
128128
*/
129129
async function performAnalysisSequence() {
130+
// Environment Guard: Check for Static Demo (GitHub Pages)
131+
// Since GitHub Pages only hosts static files, the backend API is unreachable
132+
if (CONFIG.env.isGithubPages) {
133+
Swal.fire({
134+
icon: 'info',
135+
title: 'Static Demo Mode',
136+
html: `
137+
<div class="text-left text-sm">
138+
<p class="mb-2">Backend processing is <strong>unavailable</strong> in this live preview.</p>
139+
<p>To run the full document generation engine:</p>
140+
<ul class="list-disc pl-5 mt-1 text-gray-400">
141+
<li>Clone the repository</li>
142+
<li>Run via Docker Compose</li>
143+
</ul>
144+
</div>
145+
`,
146+
background: '#1e293b',
147+
color: '#fff',
148+
confirmButtonColor: '#3b82f6',
149+
confirmButtonText: 'Understood'
150+
});
151+
return; // Halt execution immediately
152+
}
153+
130154
const fileExcel = document.getElementById('fileExcel').files[0];
131155
const fileTemplates = document.getElementById('fileTemplates').files;
132156

@@ -376,30 +400,6 @@ async function generateSample() {
376400
* Permanently locks the Sample button during execution.
377401
*/
378402
function startProcessing() {
379-
// Environment Guard: Check for Static Demo (GitHub Pages)
380-
// Since GitHub Pages only hosts static files, the backend API is unreachable
381-
if (CONFIG.env.isGithubPages) {
382-
Swal.fire({
383-
icon: 'info',
384-
title: 'Static Demo Mode',
385-
html: `
386-
<div class="text-left text-sm">
387-
<p class="mb-2">Backend processing is <strong>unavailable</strong> in this live preview.</p>
388-
<p>To run the full document generation engine:</p>
389-
<ul class="list-disc pl-5 mt-1 text-gray-400">
390-
<li>Clone the repository</li>
391-
<li>Run via Docker Compose</li>
392-
</ul>
393-
</div>
394-
`,
395-
background: '#1e293b',
396-
color: '#fff',
397-
confirmButtonColor: '#3b82f6',
398-
confirmButtonText: 'Understood'
399-
});
400-
return; // Halt execution immediately
401-
}
402-
403403
const params = validateInputs();
404404
if (!params) return;
405405

0 commit comments

Comments
 (0)