Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -441,40 +441,31 @@ def show_details_html(choice, previous_output, initial_state):
|
|
441 |
def main():
|
442 |
with gr.Blocks(css=get_css_styles()) as iface:
|
443 |
|
444 |
-
# Header HTML
|
445 |
gr.HTML("""
|
|
|
446 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
447 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
448 |
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
449 |
-
<meta name="
|
450 |
-
<link rel="manifest" href="manifest.json">
|
451 |
-
<link rel="apple-touch-icon" href="assets/icon-192.png">
|
452 |
-
|
453 |
<script>
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
// 如果發生錯誤,記錄詳細資訊
|
466 |
-
console.error('Service Worker 註冊失敗:', error);
|
467 |
-
// 顯示更多診斷資訊
|
468 |
-
console.log('當前網址:', window.location.href);
|
469 |
-
console.log('Service Worker 支援狀態:', 'serviceWorker' in navigator);
|
470 |
-
}
|
471 |
-
})();
|
472 |
-
} else {
|
473 |
-
console.log('此瀏覽器不支援 Service Worker');
|
474 |
-
}
|
475 |
-
});
|
476 |
</script>
|
477 |
-
|
|
|
|
|
|
|
478 |
<header style='text-align: center; padding: 20px; margin-bottom: 20px;'>
|
479 |
<h1 style='font-size: 2.5em; margin-bottom: 10px; color: #2D3748;'>
|
480 |
🐾 PawMatch AI
|
|
|
441 |
def main():
|
442 |
with gr.Blocks(css=get_css_styles()) as iface:
|
443 |
|
|
|
444 |
gr.HTML("""
|
445 |
+
<meta charset="UTF-8">
|
446 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
447 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
448 |
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
449 |
+
<meta name="theme-color" content="#4299e1">
|
450 |
+
<link rel="manifest" href="/manifest.json">
|
451 |
+
<link rel="apple-touch-icon" href="/assets/icon-192.png">
|
|
|
452 |
<script>
|
453 |
+
if ('serviceWorker' in navigator) {
|
454 |
+
window.addEventListener('load', () => {
|
455 |
+
navigator.serviceWorker.register('/service-worker.js')
|
456 |
+
.then((registration) => {
|
457 |
+
console.log('ServiceWorker 註冊成功');
|
458 |
+
})
|
459 |
+
.catch((error) => {
|
460 |
+
console.error('ServiceWorker 註冊失敗:', error);
|
461 |
+
});
|
462 |
+
});
|
463 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
</script>
|
465 |
+
""")
|
466 |
+
|
467 |
+
# Header HTML
|
468 |
+
gr.HTML("""
|
469 |
<header style='text-align: center; padding: 20px; margin-bottom: 20px;'>
|
470 |
<h1 style='font-size: 2.5em; margin-bottom: 10px; color: #2D3748;'>
|
471 |
🐾 PawMatch AI
|