diff --git a/src/gui/src/UI/Dashboard/TabHome.js b/src/gui/src/UI/Dashboard/TabHome.js index c488d2b83..b7819fcc5 100644 --- a/src/gui/src/UI/Dashboard/TabHome.js +++ b/src/gui/src/UI/Dashboard/TabHome.js @@ -33,15 +33,17 @@ function buildRecentAppsHTML () { // Show up to 6 recent apps const recentApps = window.launch_apps.recent.slice(0, 6); for ( const app_info of recentApps ) { - h += `
`; - h += ``; - // if title, name and uuid are the same and index_url is set, then show the hostname of index_url if ( app_info.name === app_info.title && app_info.name === app_info.uuid && app_info.index_url ) { app_info.title = new URL(app_info.index_url).hostname; + app_info.target_link = app_info.index_url; } - h += `${html_encode(app_info.title)}`; + h += `
`; + // Icon + h += ``; + // Title + h += `${html_encode(app_info.title)}`; h += '
'; } h += '
'; @@ -65,34 +67,34 @@ function buildUsageHTML () { // Storage section h += '
'; - h += '
'; - h += `

${i18n('Storage')}

`; - h += '
'; - h += '--'; - h += ' of '; - h += '--'; - h += '
'; - h += '
'; - h += '
'; - h += '--%'; - h += '
'; - h += '
'; + h += '
'; + h += `

${i18n('Storage')}

`; + h += '
'; + h += '--'; + h += ' of '; + h += '--'; + h += '
'; + h += '
'; + h += '
'; + h += '--%'; + h += '
'; + h += '
'; h += '
'; // Resources section h += '
'; - h += '
'; - h += `

${i18n('Resources')}

`; - h += '
'; - h += '--'; - h += ' of '; - h += '--'; - h += '
'; - h += '
'; - h += '
'; - h += '--%'; - h += '
'; - h += '
'; + h += '
'; + h += `

${i18n('Resources')}

`; + h += '
'; + h += '--'; + h += ' of '; + h += '--'; + h += '
'; + h += '
'; + h += '
'; + h += '--%'; + h += '
'; + h += '
'; h += '
'; h += ''; @@ -113,35 +115,35 @@ const TabHome = { // Welcome card (square) h += '
'; - h += '
'; - h += '
'; - h += `
`; - h += `${greeting},`; - h += `

${html_encode(username)}

`; - h += '

Your personal cloud computer

'; - h += '
'; - h += '
'; + h += '
'; + h += '
'; + h += `
`; + h += `${greeting},`; + h += `

${html_encode(username)}

`; + h += '

Your personal cloud computer

'; + h += '
'; + h += '
'; h += '
'; // Recent apps card (rectangle) h += '
'; - h += '
'; - h += '

Recent Apps

'; - h += '
'; - h += '
'; - h += buildRecentAppsHTML(); - h += '
'; + h += '
'; + h += '

Recent Apps

'; + h += '
'; + h += '
'; + h += buildRecentAppsHTML(); + h += '
'; h += '
'; // Usage card (spans full width on second row) h += '
'; - h += '
'; - h += `

${i18n('usage')}

`; - h += 'View details →'; - h += '
'; - h += '
'; - h += buildUsageHTML(); - h += '
'; + h += '
'; + h += `

${i18n('usage')}

`; + h += 'View details →'; + h += '
'; + h += '
'; + h += buildUsageHTML(); + h += '
'; h += '
'; h += ''; @@ -157,7 +159,11 @@ const TabHome = { e.preventDefault(); e.stopPropagation(); const appName = $(this).attr('data-app-name'); - if ( appName ) { + const targetLink = $(this).attr('data-target-link'); + if ( targetLink && targetLink !== '' ) { + window.open(targetLink, '_blank'); + } + else if ( appName ) { window.open(`/app/${appName}`, '_blank'); } });