User login info in toolbar/header

Felix
Wed, 20 Aug 2025 09:37:06 +0000
Dashboard

Hi all,

in my labour, I’m not able to find answer for my question.

How is possible to add in toolbar/heade of dashboard(v1) logged user f.e. -
Logged user : Jack_Sparrow

At this moment I have only time and date in the toolbar, as was described in many forums.



$(function() {
    if($('.md-toolbar-tools').length != 0){
        loadClock();
    }else setTimeout(loadClock, 500)
});

function loadClock(){
    $('#clock').remove();
    var toolbar = $('.md-toolbar-tools');

var div = $(' ');
    var p = $('<p/ id="clock">');

    div.append(p);
    div[0].style.margin = '5px 5px 5px auto';
    toolbar.append(div);


    function upTime() {
        var d = new Date();
        p.text(d.toLocaleString('sk-SK', { timeZone: 'Europe/Bratislava' }));
    }

    if(document.clockInterval){
            clearInterval(document.clockInterval);
            document.clockInterval = null;
    }

    document.clockInterval = setInterval(upTime,1000);
}



Thanks for help. Bobo

8 posts - 4 participants