Spaces:
Sleeping
Sleeping
Update settings.html
Browse files- settings.html +43 -6
settings.html
CHANGED
|
@@ -3,6 +3,49 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<title>Settings</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
</head>
|
| 7 |
<body>
|
| 8 |
<h1>Settings</h1>
|
|
@@ -34,8 +77,6 @@
|
|
| 34 |
<label for="call_api_key">call_api_key:</label>
|
| 35 |
<input type="text" id="call_api_key" name="call_api_key"><br><br>
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
<button type="button" onclick="saveSettings()">Save</button>
|
| 40 |
</form>
|
| 41 |
|
|
@@ -58,18 +99,15 @@
|
|
| 58 |
})
|
| 59 |
.catch(error => console.error('Error:', error));
|
| 60 |
}
|
| 61 |
-
|
| 62 |
function saveSettings() {
|
| 63 |
const form = document.getElementById('settingsForm');
|
| 64 |
const formData = new FormData(form);
|
| 65 |
const data = {};
|
| 66 |
-
|
| 67 |
formData.forEach((value, key) => {
|
| 68 |
if (value !== '') {
|
| 69 |
data[key] = value;
|
| 70 |
}
|
| 71 |
});
|
| 72 |
-
|
| 73 |
fetch('/settings', {
|
| 74 |
method: 'POST',
|
| 75 |
headers: {
|
|
@@ -83,7 +121,6 @@
|
|
| 83 |
})
|
| 84 |
.catch(error => console.error('Error:', error));
|
| 85 |
}
|
| 86 |
-
|
| 87 |
window.onload = loadSettings;
|
| 88 |
</script>
|
| 89 |
</body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<title>Settings</title>
|
| 6 |
+
<style>
|
| 7 |
+
body {
|
| 8 |
+
font-family: Arial, sans-serif;
|
| 9 |
+
background-color: #f4f4f4;
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
}
|
| 13 |
+
h1 {
|
| 14 |
+
color: green;
|
| 15 |
+
text-align: left;
|
| 16 |
+
padding: 20px;
|
| 17 |
+
background-color: #e0e0e0;
|
| 18 |
+
margin: 0;
|
| 19 |
+
}
|
| 20 |
+
form {
|
| 21 |
+
padding: 20px;
|
| 22 |
+
}
|
| 23 |
+
label {
|
| 24 |
+
display: block;
|
| 25 |
+
margin-top: 10px;
|
| 26 |
+
color: green;
|
| 27 |
+
text-align: left;
|
| 28 |
+
}
|
| 29 |
+
input[type="text"] {
|
| 30 |
+
width: 100%;
|
| 31 |
+
padding: 10px;
|
| 32 |
+
margin-top: 5px;
|
| 33 |
+
border: 1px solid #ccc;
|
| 34 |
+
border-radius: 4px;
|
| 35 |
+
}
|
| 36 |
+
button {
|
| 37 |
+
background-color: green;
|
| 38 |
+
color: white;
|
| 39 |
+
padding: 10px 20px;
|
| 40 |
+
border: none;
|
| 41 |
+
border-radius: 4px;
|
| 42 |
+
cursor: pointer;
|
| 43 |
+
margin-top: 20px;
|
| 44 |
+
}
|
| 45 |
+
button:hover {
|
| 46 |
+
background-color: darkgreen;
|
| 47 |
+
}
|
| 48 |
+
</style>
|
| 49 |
</head>
|
| 50 |
<body>
|
| 51 |
<h1>Settings</h1>
|
|
|
|
| 77 |
<label for="call_api_key">call_api_key:</label>
|
| 78 |
<input type="text" id="call_api_key" name="call_api_key"><br><br>
|
| 79 |
|
|
|
|
|
|
|
| 80 |
<button type="button" onclick="saveSettings()">Save</button>
|
| 81 |
</form>
|
| 82 |
|
|
|
|
| 99 |
})
|
| 100 |
.catch(error => console.error('Error:', error));
|
| 101 |
}
|
|
|
|
| 102 |
function saveSettings() {
|
| 103 |
const form = document.getElementById('settingsForm');
|
| 104 |
const formData = new FormData(form);
|
| 105 |
const data = {};
|
|
|
|
| 106 |
formData.forEach((value, key) => {
|
| 107 |
if (value !== '') {
|
| 108 |
data[key] = value;
|
| 109 |
}
|
| 110 |
});
|
|
|
|
| 111 |
fetch('/settings', {
|
| 112 |
method: 'POST',
|
| 113 |
headers: {
|
|
|
|
| 121 |
})
|
| 122 |
.catch(error => console.error('Error:', error));
|
| 123 |
}
|
|
|
|
| 124 |
window.onload = loadSettings;
|
| 125 |
</script>
|
| 126 |
</body>
|