Spaces:
Sleeping
Sleeping
Xianbao QIAN commited on
Commit ·
6daa7df
1
Parent(s): 287c10d
all content working now after typo fixed and add debug mode
Browse files- debug.py +3 -0
- modules/app.py +3 -1
debug.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import subprocess
|
| 2 |
+
|
| 3 |
+
subprocess.run("uvicorn modules.app:app --host 0.0.0.0 --port 7860 --reload", shell=True)
|
modules/app.py
CHANGED
|
@@ -81,14 +81,16 @@ async def get_form():
|
|
| 81 |
document.getElementById('urlInput').addEventListener('input', function() {
|
| 82 |
const url = this.value;
|
| 83 |
const defaultFilename = url.split('/').pop() || '';
|
| 84 |
-
if (filenameInput.value !
|
| 85 |
filenameInput.value = defaultFilename;
|
| 86 |
}
|
| 87 |
});
|
| 88 |
|
| 89 |
const form = document.getElementById('urlForm');
|
| 90 |
form.addEventListener('submit', async function(event) {
|
|
|
|
| 91 |
event.preventDefault();
|
|
|
|
| 92 |
const formData = new FormData(form);
|
| 93 |
const response = await fetch('/submit', {
|
| 94 |
method: 'POST',
|
|
|
|
| 81 |
document.getElementById('urlInput').addEventListener('input', function() {
|
| 82 |
const url = this.value;
|
| 83 |
const defaultFilename = url.split('/').pop() || '';
|
| 84 |
+
if (filenameInput.value !== defaultFilename) {
|
| 85 |
filenameInput.value = defaultFilename;
|
| 86 |
}
|
| 87 |
});
|
| 88 |
|
| 89 |
const form = document.getElementById('urlForm');
|
| 90 |
form.addEventListener('submit', async function(event) {
|
| 91 |
+
console.log('before');
|
| 92 |
event.preventDefault();
|
| 93 |
+
console.log('after');
|
| 94 |
const formData = new FormData(form);
|
| 95 |
const response = await fetch('/submit', {
|
| 96 |
method: 'POST',
|