diff --git a/tvapp2/index.js b/tvapp2/index.js index bc39c58a..3fd6f4d2 100755 --- a/tvapp2/index.js +++ b/tvapp2/index.js @@ -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( `` ), 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 }` ) ); diff --git a/tvapp2/www/css/tvapp2.min.css b/tvapp2/www/css/tvapp2.min.css index 4c86d76c..293aea17 100644 --- a/tvapp2/www/css/tvapp2.min.css +++ b/tvapp2/www/css/tvapp2.min.css @@ -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 diff --git a/tvapp2/www/index.html b/tvapp2/www/index.html index c6fef052..0e506d8f 100644 --- a/tvapp2/www/index.html +++ b/tvapp2/www/index.html @@ -17,6 +17,7 @@ TVApp2 for Docker