new version

This commit is contained in:
UrloMythus
2026-01-11 14:29:22 +01:00
parent b8a40b5afc
commit 7785e8c604
45 changed files with 5463 additions and 832 deletions

View File

@@ -1,11 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>App Status</title>
</head>
<body>
<h1>Your App is running</h1>
</body>
</html>

View File

@@ -11,6 +11,7 @@
h2 { color: #2c5aa0; border-bottom: 2px solid #2c5aa0; padding-bottom: 5px; text-align: left; margin-top: 30px; }
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
.proxy-label { display: inline-block; margin-left: 5px; font-weight: normal; }
input[type="text"], input[type="url"] { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.btn { display: inline-block; padding: 10px 20px; background: #2c5aa0; color: white; text-decoration: none; border-radius: 5px; margin: 5px; cursor: pointer; border: none; font-size: 16px; }
.btn:hover { background: #1e3d6f; }
@@ -60,6 +61,14 @@
<label>M3U Playlist URL</label>
<input type="url" class="playlist-url" placeholder="Ex: http://provider.com/playlist.m3u">
</div>
<div class="form-group">
<input type="checkbox" class="proxy-playlist" checked>
<label class="proxy-label">Proxy this playlist</label>
</div>
<div class="form-group">
<input type="checkbox" class="sort-playlist">
<label class="proxy-label">Sort this playlist</label>
</div>
</div>
</template>
@@ -94,8 +103,14 @@
for (const entry of entries) {
const playlistUrl = entry.querySelector('.playlist-url').value.trim();
if (playlistUrl) {
const shouldProxy = entry.querySelector('.proxy-playlist').checked;
const shouldSort = entry.querySelector('.sort-playlist').checked;
let definition = (shouldSort ? 'sort:' : '') + (shouldProxy ? '' : 'no_proxy:') + playlistUrl;
if (playlistUrl.startsWith('http://') || playlistUrl.startsWith('https://')) {
definitions.push(playlistUrl);
// Se l'URL non ha proxy, ma ha sort, il prefisso sarà 'sort:no_proxy:'
definitions.push(definition);
} else {
alert('Invalid URL: ' + playlistUrl + '. URLs must start with http:// or https://');
return;

View File

@@ -425,12 +425,14 @@ class MediaFlowSpeedTest {
'Content-Type': 'application/json',
};
// Add current API password to headers if provided
// Build URL with api_password as query parameter if provided
// This is more reliable than headers when behind reverse proxies
let configUrl = '/speedtest/config';
if (currentApiPassword) {
headers['api_password'] = currentApiPassword;
configUrl += `?api_password=${encodeURIComponent(currentApiPassword)}`;
}
const response = await fetch('/speedtest/config', {
const response = await fetch(configUrl, {
method: 'POST',
headers: headers,
body: JSON.stringify(requestBody)