diff --git a/tvapp2/www/hdhomerun.html b/tvapp2/www/hdhomerun.html
index 013fa825..bd743958 100644
--- a/tvapp2/www/hdhomerun.html
+++ b/tvapp2/www/hdhomerun.html
@@ -386,6 +386,55 @@
}).responseText;
}
+ function runUptime()
+ {
+ const toastTypeClass = [];
+ toastTypeClass[ 'DEFAULT' ] = 'text-bg-primary';
+ toastTypeClass[ 'UNHEALTHY' ] = 'text-bg-warning';
+ toastTypeClass[ 'HEALTHY' ] = 'text-bg-success';
+ toastTypeClass[ 'ERROR' ] = 'text-bg-danger';
+
+ $.ajax(
+ {
+ url: 'api/health',
+ type: 'GET',
+ data: {
+ query: 'uptime',
+ silent: true
+ },
+ success: function( data )
+ {
+ const status = data.message;
+ const code = data.code;
+ const uptimeShort = data.uptimeShort;
+ const uptimeLong = data.uptimeLong;
+ if ( status )
+ {
+ $('a#uptime').text(`${ uptimeShort }`);
+
+ const tooltip = bootstrap.Tooltip.getInstance('#uptime') // Returns a Bootstrap tooltip instance
+ tooltip.setContent( { '.tooltip-inner': `HDHomeRun server started ${ uptimeLong }` } )
+ }
+ },
+ error: function( data )
+ {
+ const toastClass = toastTypeClass['ERROR'];
+ const toastElm = document.getElementById('tvapp2Toast');
+ toastElm.classList.add(toastClass);
+
+ $('.toast #toast-title').html(`Could not get uptime from api`);
+ $('.toast #toast-message').html(`Failed to communicate with the api. Try restarting the docker container to restore connection.`);
+ $('#tvapp2Toast').toast('show');
+ }
+ }).always(function()
+ {
+ setTimeout(function()
+ {
+ runUptime();
+ }, parseInt(timerUptime));
+ }).responseText;
+ }
+
/*
Action > Do Resync
*/