Default view of instances for the Nitter class.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-02-04 18:54:11 -05:00
parent d6824d0c97
commit 8843a31d5d
3 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,3 @@
accessing
columnKeys
^ #('url' 'healthy' 'healthy_percentage_overall' 'rss' 'version')

View File

@ -2,5 +2,6 @@ accessing
instanceRows
^ (self instances at: 'hosts') collect: [:rawRow | | newRow |
newRow := OrderedCollection new.
newRow add: (rawRow at: 'url')
self columnKeys do: [:key | newRow add: (rawRow at: key) ].
newRow
].

View File

@ -1,10 +1,16 @@
accessing
viewInstancesFor: aView
<gtView>
| columnedList |
| columnedList columnNames |
self instances isEmptyOrNil ifTrue: [ ^ aView empty].
columnedList := aView columnedList
title: 'Instances';
items: [ self instanceRows ];
priority: 80.
priority: 1.
columnNames := #('Instance' 'Healthy' 'Uptime %' 'RSS' 'Nitter Version').
columnNames doWithIndex: [:aName :index |
columnedList
column: aName
text: [:instanceRow | (instanceRow at: index) ifNil: [''] ]
].
^ columnedList