Socialmetrica/Socialmetrica.package/Nitter.class/class/viewInstancesFor..st

21 lines
588 B
Smalltalk
Raw Normal View History

2024-02-04 23:15:29 +00:00
accessing
viewInstancesFor: aView
<gtView>
2024-02-10 18:05:47 +00:00
| columnedList columnNamesMap |
2024-02-04 23:15:29 +00:00
self instances isEmptyOrNil ifTrue: [ ^ aView empty].
columnedList := aView columnedList
title: 'Instances';
items: [ self instanceRows ];
priority: 1.
2024-02-10 18:05:47 +00:00
columnNamesMap := {
'Instance' -> 'url'.
'Healthy' -> 'healthy'.
'Uptime %' -> 'uptime'.
'RSS' -> 'rss'.
'Nitter Version' -> 'version'} asOrderedDictionary.
columnNamesMap keysAndValuesDo: [:aName :value |
columnedList
column: aName
2024-02-10 18:05:47 +00:00
text: [:instanceRow | (instanceRow readSlotNamed: value) ifNil: [''] ]
].
2024-02-04 23:15:29 +00:00
^ columnedList