Leo91fr commited on
Commit
0a2ad20
·
verified ·
1 Parent(s): b91e08b

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +4 -3
index.html CHANGED
@@ -199,7 +199,8 @@
199
  <script src="data.js"></script>
200
  <script>
201
  const D = window.WORKFLOW_DATA;
202
- const BASE = location.origin + location.pathname.replace(/\/$/, "");
 
203
 
204
  function esc(s) {
205
  return (s || "").replace(/&/g, "&amp;").replace(/</g, "&lt;")
@@ -228,7 +229,7 @@ async function openModal(file) {
228
  document.getElementById("modal-pre").textContent = "Fetching…";
229
  document.getElementById("overlay").classList.add("open");
230
  try {
231
- const r = await fetch(`${BASE}/resolve/main/${file}`);
232
  if (!r.ok) throw new Error(r.status);
233
  const txt = await r.text();
234
  const pretty = JSON.stringify(JSON.parse(txt), null, 1);
@@ -307,7 +308,7 @@ function wfCard(w) {
307
  </div>
308
  <div class="actions">
309
  <button class="btn primary" onclick="openModal('${w.file}')">Preview JSON</button>
310
- <a class="btn" style="display:inline-flex;align-items:center" href="${BASE}/resolve/main/${w.file}" download="${w.file.split("/").pop()}">↓ Download</a>
311
  </div>
312
  </div>`;
313
  }
 
199
  <script src="data.js"></script>
200
  <script>
201
  const D = window.WORKFLOW_DATA;
202
+ const SPACE_ID = "Leo91fr/minimax-h3-workflows";
203
+ const STATIC_BASE = `https://${SPACE_ID.replace("/", "-").toLowerCase()}.static.hf.space/`;
204
 
205
  function esc(s) {
206
  return (s || "").replace(/&/g, "&amp;").replace(/</g, "&lt;")
 
229
  document.getElementById("modal-pre").textContent = "Fetching…";
230
  document.getElementById("overlay").classList.add("open");
231
  try {
232
+ const r = await fetch(STATIC_BASE + file);
233
  if (!r.ok) throw new Error(r.status);
234
  const txt = await r.text();
235
  const pretty = JSON.stringify(JSON.parse(txt), null, 1);
 
308
  </div>
309
  <div class="actions">
310
  <button class="btn primary" onclick="openModal('${w.file}')">Preview JSON</button>
311
+ <a class="btn" style="display:inline-flex;align-items:center" href="${STATIC_BASE}${w.file}">↓ Download</a>
312
  </div>
313
  </div>`;
314
  }