Improving Nitter instances view.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-02-10 13:05:47 -05:00
parent abc2752292
commit ac5061e40d
8 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,3 @@
accessing accessing
instances instances
^ self instancesCache ^ self instanceRows

View File

@ -1,16 +1,21 @@
accessing accessing
viewInstancesFor: aView viewInstancesFor: aView
<gtView> <gtView>
| columnedList columnNames | | columnedList columnNamesMap |
self instances isEmptyOrNil ifTrue: [ ^ aView empty]. self instances isEmptyOrNil ifTrue: [ ^ aView empty].
columnedList := aView columnedList columnedList := aView columnedList
title: 'Instances'; title: 'Instances';
items: [ self instanceRows ]; items: [ self instanceRows ];
priority: 1. priority: 1.
columnNames := #('Instance' 'Healthy' 'Uptime %' 'RSS' 'Nitter Version'). columnNamesMap := {
columnNames doWithIndex: [:aName :index | 'Instance' -> 'url'.
'Healthy' -> 'healthy'.
'Uptime %' -> 'uptime'.
'RSS' -> 'rss'.
'Nitter Version' -> 'version'} asOrderedDictionary.
columnNamesMap keysAndValuesDo: [:aName :value |
columnedList columnedList
column: aName column: aName
text: [:instanceRow | (instanceRow slots at: index) ifNil: [''] ] text: [:instanceRow | (instanceRow readSlotNamed: value) ifNil: [''] ]
]. ].
^ columnedList ^ columnedList

View File

@ -0,0 +1,7 @@
I model a Nitter instance uptime & health tracker as described in https://status.d420.de/about.
Taken from the official documentation, in the previous linkm the fields we are modelling are:
- healthy: stands for hosts which are reachable and pass a content check.
- rss: whether the host has RSS feeds enabled.
- version: which nitter version the host reports.

View File

@ -0,0 +1,3 @@
accessing
hasRSS
^ self rss

View File

@ -0,0 +1,3 @@
accessing
healthy
^ healthy

View File

@ -0,0 +1,3 @@
accessing
isHealthy
^ self healthy

View File

@ -0,0 +1,3 @@
accessing
rss
^ rss

View File

@ -1,5 +1,5 @@
{ {
"commentStamp" : "", "commentStamp" : "<historical>",
"super" : "Object", "super" : "Object",
"category" : "Socialmetrica", "category" : "Socialmetrica",
"classinstvars" : [ ], "classinstvars" : [ ],