duqing2026 commited on
Commit
03cf3a8
·
1 Parent(s): 029f07c

fix: localize static assets and fix JS reference error

Browse files
static/images/demo_map.svg ADDED
static/js/html2canvas.min.js ADDED
The diff for this file is too large to render. See raw diff
 
static/js/tailwindcss.js ADDED
The diff for this file is too large to render. See raw diff
 
static/js/vue.global.js ADDED
The diff for this file is too large to render. See raw diff
 
templates/index.html CHANGED
@@ -4,10 +4,10 @@
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>[[ project.title_cn ]] - [[ project.name ]]</title>
7
- <script src="https://cdn.tailwindcss.com"></script>
8
- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
9
- <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
10
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
11
  <style>
12
  /* Custom Scrollbar */
13
  ::-webkit-scrollbar { width: 6px; height: 6px; }
@@ -234,6 +234,13 @@
234
  </div>
235
 
236
  <script>
 
 
 
 
 
 
 
237
  const { createApp, ref, reactive, onMounted } = Vue;
238
 
239
  createApp({
@@ -246,8 +253,8 @@
246
  const fileInput = ref(null);
247
  const mapContainer = ref(null);
248
 
249
- // Demo Image
250
- const DEMO_IMAGE = "https://images.unsplash.com/photo-1555400038-63f5ba517a47?q=80&w=2070&auto=format&fit=crop";
251
 
252
  const loadDemoImage = () => {
253
  // Convert URL to Base64 to ensure offline/export works cleanly without CORS issues if possible,
 
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>[[ project.title_cn ]] - [[ project.name ]]</title>
7
+ <script src="/static/js/tailwindcss.js"></script>
8
+ <script src="/static/js/vue.global.js"></script>
9
+ <script src="/static/js/html2canvas.min.js"></script>
10
+ <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
11
  <style>
12
  /* Custom Scrollbar */
13
  ::-webkit-scrollbar { width: 6px; height: 6px; }
 
234
  </div>
235
 
236
  <script>
237
+ // Pass Jinja2 variables to JavaScript
238
+ const PROJECT_INFO = {
239
+ title_cn: "[[ project.title_cn ]]",
240
+ version: "[[ project.version ]]",
241
+ name: "[[ project.name ]]"
242
+ };
243
+
244
  const { createApp, ref, reactive, onMounted } = Vue;
245
 
246
  createApp({
 
253
  const fileInput = ref(null);
254
  const mapContainer = ref(null);
255
 
256
+ // Demo Image - Local SVG for offline capability
257
+ const DEMO_IMAGE = "/static/images/demo_map.svg";
258
 
259
  const loadDemoImage = () => {
260
  // Convert URL to Base64 to ensure offline/export works cleanly without CORS issues if possible,