Logo in UI title bar on AWS server


I am trying to implement my own personal logo and clock in the title bar of my UI dashboard. I have node-red running an AWS EC2 server on ubuntu.

I have been reading this thread Set a logo in the title bar?. The code for my template node is below.

The clock works a treat but the but the logo image does not display (see screen shot below). I suspect this is because I haven't set the correct path for the httpStatic setting in the settings.js file. The full path of the directory where my logo sits is /home/ubuntu/.node-red/logo directory

In the settings file I have:
httpStatic: '/logo'

Do I have the correct path name set?

<script id="clockScript1" type="text/javascript">
    var clockInterval;
    $(function () {
        if (clockInterval) return;

        //add logo
        var div1 = $('<div/>');
        var logo = new Image();

        logo.src = 'dashboardlogo.png'
        logo.height = 45;
        div1[0].style.margin = '10px auto';


        //add clock
        var div2 = $('<div/>');
        var p = $('<p/>');

        div2[0].style.margin = '5px';

        function displayTime() {
            p.text(new Date().toLocaleString());
        clockInterval = setInterval(displayTime, 1000);

        //add to toolbar when it's available
        var addToToolbarTimer;
        function addToToolbar() {
            var toolbar = $('.md-toolbar-tools');
            if(!toolbar.length) return;
        addToToolbarTimer = setInterval(addToToolbar, 100);

That should be set to the directory containing the static content: /home/ubuntu/.node-red/logo

And you'll have to make sure the url used in the code is correct - you are currently just setting it to dashboardlogo.png so it will get loaded relative to the url the dashboard is on - depending on how you've set things up, that would be /ui/dashboard.logo.png. That is not the path httpStatic will be served from. You'd need to set the image url to /dashboardlogo.png - again, depending on what other path customisations you may have made.

Thank you!

I found a better solution without webserver or a static site.

Convert the picture to base64 on this site https://www.base64-image.de/ and paste the code in quotes after logo.src =

Hello, I am using code in this page.

This is running very well, until I opened it on my TV where my graph will appear. The time is correct on computers and other devices, but on TV it doesn't work. There would be a way for me to set the time directly from my raspbarry pi.

What browser is your TV using ? maybe it doesn't support the required level of Javascript ?

Also what do you mean by 'it doesn't work'. Exactly what doesn't work?

My friends, in the browser on the computer or raspian the application works very well. But on TV the time is 12/31/1969 10:58 PM. My TV is samsung with samsung browser. The TV date is correct.

Please don't ask the same question in two threads. Since you have opened a new thread and this thread was originally opened two years ago, I'll close this thread.