@@ -832,7 +832,6 @@ async function renderOverview() {
832832 ` ;
833833 }
834834
835- renderActivity ( ) ;
836835 } catch ( err ) {
837836 $ ( '#recent-servers-list' ) . innerHTML = html `
838837 < div style ="text-align:center;padding:32px;color:var(--accent-red) "> Failed to load: ${ err . message } </ div >
@@ -944,63 +943,6 @@ async function renderLog(pageNum) {
944943 }
945944}
946945
947- async function renderActivity ( ) {
948- const el = $ ( '#page-overview' ) ;
949- let activitySection = $ ( '#activity-section' ) ;
950-
951- if ( ! activitySection ) {
952- const card = el . querySelector ( '.card:last-child' ) ;
953- const section = document . createElement ( 'div' ) ;
954- section . id = 'activity-section' ;
955- section . className = 'card' ;
956- section . style . marginTop = '20px' ;
957- section . innerHTML = html `
958- < div class ="card-header ">
959- < h2 class ="card-title "> Recent Activity</ h2 >
960- </ div >
961- < div id ="activity-list "> < div style ="text-align:center;padding:24px;color:var(--text-secondary) "> < span class ="spinner "> </ span > Loading...</ div > </ div >
962- ` ;
963- card . parentNode . insertBefore ( section , card . nextSibling ) ;
964- activitySection = section ;
965- }
966-
967- try {
968- const data = await api ( '/activity?limit=5' ) ;
969- const list = $ ( '#activity-list' ) ;
970-
971- if ( data . activities . length === 0 ) {
972- list . innerHTML = '<div class="activity-empty">No activity yet. Create a server to get started.</div>' ;
973- return ;
974- }
975-
976- const showCount = Math . min ( 4 , data . activities . length ) ;
977- const hasMore = data . total > 4 ;
978-
979- list . innerHTML = html `
980- < div class ="activity-list ${ hasMore ? ' activity-list-truncated' : '' } ">
981- ${ data . activities . slice ( 0 , showCount ) . map ( a => html `
982- < div class ="activity-item ">
983- < div class ="activity-icon activity-icon- ${ a . action } "> ${ activityIcons [ a . action ] || '' } </ div >
984- < div class ="activity-content ">
985- < div class ="activity-action "> ${ getActionLabel ( a . action ) } </ div >
986- < div class ="activity-details "> ${ a . details || '' } </ div >
987- </ div >
988- < div class ="activity-time "> ${ formatRelativeTime ( a . created_at ) } </ div >
989- </ div >
990- ` ) . join ( '' ) }
991- ${ hasMore ? html `
992- < div class ="activity-more-overlay ">
993- < a class ="btn btn-primary btn-sm " onclick ="navigateTo('logs') " style ="width:auto "> View all logs</ a >
994- </ div >
995- ` : '' }
996- </ div >
997- ` ;
998- } catch ( err ) {
999- const list = $ ( '#activity-list' ) ;
1000- if ( list ) list . innerHTML = '<div class="activity-empty">Could not load activity.</div>' ;
1001- }
1002- }
1003-
1004946function formatDate ( d ) {
1005947 if ( ! d ) return 'N/A' ;
1006948 const date = new Date ( d ) ;
0 commit comments