diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js index f8dee53d50..8b2e2ab913 100644 --- a/dashboard-ui/scripts/dashboardpage.js +++ b/dashboard-ui/scripts/dashboardpage.js @@ -123,9 +123,7 @@ html += ''; html += ''; - if (connection.UserId) { - html += '' + connection.UserName + ''; - } + html += DashboardPage.getUsersHtml(connection); html += ''; var nowPlayingItem = connection.NowPlayingItem; @@ -147,15 +145,27 @@ $('.deadSession', table).remove(); }, + getUsersHtml: function (session) { + + var html = ''; + + if (session.UserId) { + html += '
' + session.UserName + '
'; + } + + html += session.AdditionalUsers.map(function (currentSession) { + + return '
' + currentSession.UserName + '
'; + }); + + return html; + }, + updateSession: function (row, session) { row.removeClass('deadSession'); - if (session.UserId) { - $('.username', row).html('' + session.UserName + '').trigger('create'); - } else { - $('.username', row).html(''); - } + $('.username', row).html(DashboardPage.getUsersHtml(session)).trigger('create'); var nowPlayingItem = session.NowPlayingItem;