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
instances
^ self instancesCache
^ self instanceRows

View File

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