2727 .method-post { background-color : # 49cc90 ; color : white; }
2828 .example-link { color : # 007cba ; text-decoration : none; font-size : 13px ; }
2929 .example-link : hover { text-decoration : underline; }
30+ .blob-ids { margin-top : 5px ; }
31+ .blob-ids-preview { display : inline; }
32+ .blob-ids-full { display : none; max-height : 200px ; overflow-y : auto; margin-top : 5px ; padding : 5px ; background : # fafafa ; border-radius : 3px ; }
33+ .blob-ids-full .expanded { display : block; }
34+ .blob-toggle { background : none; border : 1px solid # 007cba ; color : # 007cba ; padding : 2px 8px ; border-radius : 3px ; cursor : pointer; font-size : 11px ; margin-left : 5px ; }
35+ .blob-toggle : hover { background : # 007cba ; color : white; }
3036 </ style >
3137</ head >
3238< body >
@@ -177,12 +183,27 @@ <h2>Recent Submissions</h2>
177183 < td >
178184 {{.NumBlobs}}
179185 {{if .BlobIDs}}
186+ {{$namespace := .Namespace}}
187+ {{$numBlobs := len .BlobIDs}}
188+ {{if le $numBlobs 5}}
180189 < div class ="blob-ids ">
181- {{$namespace := .Namespace}}
182190 {{range .BlobIDs}}
183191 < a href ="/da/blob?id={{.}}&namespace={{$namespace}} " class ="blob-link blob-id " title ="Click to view blob details "> {{slice . 0 8}}...</ a >
184192 {{end}}
185193 </ div >
194+ {{else}}
195+ < div class ="blob-ids ">
196+ < span class ="blob-ids-preview ">
197+ {{range $i, $id := .BlobIDs}}{{if lt $i 3}}< a href ="/da/blob?id={{$id}}&namespace={{$namespace}} " class ="blob-link blob-id " title ="Click to view blob details "> {{slice $id 0 8}}...</ a > {{end}}{{end}}
198+ </ span >
199+ < button class ="blob-toggle " onclick ="toggleBlobs(this) "> +{{subtract $numBlobs 3}} more</ button >
200+ < div class ="blob-ids-full ">
201+ {{range .BlobIDs}}
202+ < a href ="/da/blob?id={{.}}&namespace={{$namespace}} " class ="blob-link blob-id " title ="Click to view blob details "> {{slice . 0 8}}...</ a >
203+ {{end}}
204+ </ div >
205+ </ div >
206+ {{end}}
186207 {{end}}
187208 </ td >
188209 < td > {{.BlobSize}}</ td >
@@ -215,6 +236,25 @@ <h2>Node Information</h2>
215236 location . reload ( ) ;
216237 }
217238 } , 1000 ) ;
239+
240+ // Toggle blob list expansion
241+ function toggleBlobs ( btn ) {
242+ const container = btn . parentElement ;
243+ const fullList = container . querySelector ( '.blob-ids-full' ) ;
244+ const preview = container . querySelector ( '.blob-ids-preview' ) ;
245+ const isExpanded = fullList . classList . contains ( 'expanded' ) ;
246+
247+ if ( isExpanded ) {
248+ fullList . classList . remove ( 'expanded' ) ;
249+ preview . style . display = 'inline' ;
250+ btn . textContent = btn . dataset . expandText ;
251+ } else {
252+ fullList . classList . add ( 'expanded' ) ;
253+ preview . style . display = 'none' ;
254+ btn . dataset . expandText = btn . textContent ;
255+ btn . textContent = 'Show less' ;
256+ }
257+ }
218258 </ script >
219259</ body >
220260</ html >
0 commit comments