mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 05:35:41 -04:00
feat: add re-sync functionality / button to header
This commit is contained in:
@@ -104,6 +104,7 @@ const USERAGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
|
||||
http://127.0.0.1:4124/channel
|
||||
*/
|
||||
|
||||
const subdomainRestart = [ 'restart', 'sync', 'resync' ];
|
||||
const subdomainGZ = [ 'gzip', 'gz' ];
|
||||
const subdomainM3U = [ 'playlist', 'm3u', 'm3u8' ];
|
||||
const subdomainEPG = [ 'guide', 'epg', 'xml' ];
|
||||
@@ -1045,7 +1046,7 @@ const server = http.createServer( ( request, response ) =>
|
||||
|
||||
const loadFile = reqUrl.replace( /^\/+/, '' );
|
||||
|
||||
Log.debug( `www`, chalk.blueBright( `[GET]` ), chalk.white( `→` ), chalk.grey( `Requesting asset` ), chalk.blueBright( `${ loadFile }` ) );
|
||||
Log.debug( `www`, chalk.blueBright( `[REQUEST]` ), chalk.white( `→` ), chalk.grey( `asset>` ), chalk.greenBright( `${ loadFile }` ), chalk.grey( `<method>` ), chalk.greenBright( `${ method }` ) );
|
||||
|
||||
const handleRequest = async() =>
|
||||
{
|
||||
@@ -1057,6 +1058,23 @@ const server = http.createServer( ( request, response ) =>
|
||||
loadFile channel?url=https%3A%2F%2Ftvpass.org%2Fchannel%2Fabc-wabc-new-york-ny%2F
|
||||
*/
|
||||
|
||||
if ( subdomainRestart.some( ( urlKeyword ) => loadFile.startsWith( urlKeyword ) ) )
|
||||
{
|
||||
Log.info( `Toggled restart`, chalk.white( `→` ), chalk.grey( `${ loadFile }` ) );
|
||||
|
||||
const envWebIP = process.env.WEB_IP || '0.0.0.0';
|
||||
const envWebPort = process.env.WEB_PORT || `4124`;
|
||||
|
||||
Log.debug( `env`, chalk.blueBright( `[SET]` ), chalk.white( `→` ), chalk.grey( `FILE_URL` ), chalk.blueBright( `${ FILE_URL }` ) );
|
||||
Log.debug( `env`, chalk.blueBright( `[SET]` ), chalk.white( `→` ), chalk.grey( `FILE_M3U` ), chalk.blueBright( `${ FILE_M3U }` ) );
|
||||
Log.debug( `env`, chalk.blueBright( `[SET]` ), chalk.white( `→` ), chalk.grey( `FILE_XML` ), chalk.blueBright( `${ FILE_XML }` ) );
|
||||
Log.debug( `env`, chalk.blueBright( `[SET]` ), chalk.white( `→` ), chalk.grey( `FILE_TAR` ), chalk.blueBright( `${ FILE_TAR }` ) );
|
||||
|
||||
await initialize();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( subdomainM3U.some( ( urlKeyword ) => loadFile.startsWith( urlKeyword ) ) && method === 'GET' )
|
||||
{
|
||||
Log.info( `Received request for m3u playlist data`, chalk.white( `→` ), chalk.grey( `${ loadFile }` ) );
|
||||
@@ -1089,7 +1107,6 @@ const server = http.createServer( ( request, response ) =>
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( subdomainGZ.some( ( urlKeyword ) => loadFile.startsWith( urlKeyword ) ) && method === 'GET' )
|
||||
{
|
||||
Log.info( `Received request for compressed EPG data`, chalk.white( `→` ), chalk.grey( `${ loadFile }` ) );
|
||||
|
||||
24
tvapp2/www/css/tvapp2.min.css
vendored
24
tvapp2/www/css/tvapp2.min.css
vendored
@@ -42,6 +42,16 @@ body
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin
|
||||
{
|
||||
from {
|
||||
transform:rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform:rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.container
|
||||
{
|
||||
text-align: left;
|
||||
@@ -117,6 +127,18 @@ p
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.header .restart
|
||||
{
|
||||
animation-name: fade-in, scale-in;
|
||||
animation-duration: 1s, 0.5s;
|
||||
animation-timing-function: ease-in, linear;
|
||||
animation-direction: alternate, alternate;
|
||||
animation-iteration-count: infinite, 1;
|
||||
transition: all 0.3s;
|
||||
opacity: 0.5;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.footer
|
||||
{
|
||||
position: absolute;
|
||||
@@ -277,7 +299,7 @@ p
|
||||
{
|
||||
font-size: clamp(0.7em, 2vw, 1.1em);
|
||||
padding-top: 2px;
|
||||
padding-left: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.navbar-social svg:hover
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<a class="header-name" href="<%= appUrlGithub %>">TVApp2 for Docker</a>
|
||||
</div>
|
||||
<div class="navbar-social">
|
||||
<a href="javascript:toggleRestart();"><i class="restart fa-solid fa-rotate" style="--fa-primary-color: rgb(255, 255, 255); --fa-secondary-color: rgb(255, 255, 255);" aria-hidden="true"></i></a>
|
||||
<a href="<%= appUrlDocs %>"><i class="logo fa-duotone fa-solid fa-book-open-cover" style="--fa-primary-color: rgb(255, 255, 255); --fa-secondary-color: rgb(255, 255, 255);" aria-hidden="true"></i></a>
|
||||
<a href="<%= appUrlGithub %>"><i class="logo fa-logos fa-github" style="--fa-primary-color: rgb(255, 255, 255); --fa-secondary-color: rgb(255, 255, 255);" aria-hidden="true"></i></a>
|
||||
<a href="<%= appUrlDiscord %>"><i class="logo fa-logos fa-discord" style="--fa-primary-color: rgb(255, 255, 255); --fa-secondary-color: rgb(255, 255, 255);" aria-hidden="true"></i></a>
|
||||
@@ -177,7 +178,20 @@
|
||||
|
||||
document.getElementById("warning-firewall").innerHTML = warningMessage;
|
||||
});
|
||||
|
||||
function toggleRestart()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
url: 'restart',
|
||||
type: 'POST',
|
||||
data: {
|
||||
x: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
||||
<script src="js/tvapp2.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user