tdfs4ds.serve.home¶
tdfs4ds.serve.home
¶
The Home page and the header search of the admin app (0.3.7.5).
home(profile) answers GET /ui/home: three or four cards per profile, each one
computed on its own and fail-open -- a card that cannot be read says
unavailable: <reason> and never raises. It reuses what the app already holds (the feature
catalog model, the workflow model, the configuration checks, the health snapshot, the
follow-up facts) and adds no heavy read of its own. A card that reads the store reports the
"not connected" reason when there is no session; the configuration cards keep working.
search_objects(q) answers GET /ui/search: features, processes and datasets whose name
matches, ranked exact > prefix > word > substring (> detail). It reads an in-memory index
built from the feature catalog model when that is cached, else from three catalog reads (one
under the feature-catalog lock); the index is cached for INDEX_TTL_S seconds.
Card shape: {id, title, state: 'ok'|'unavailable', reason, summary, items: [{label, detail,
kind, key, chip, ask}], actions: [{label, target, disabled, reason}], search, hint}.
kind/key make an item an object (opened through openObject in the browser).
PROFILE_CARDS
module-attribute
¶
PROFILE_CARDS = {'analyst': (('suggestions', 'Questions to ask', _card_suggestions, True), ('search', 'Find a feature', _card_search, False), ('recent_documented', 'Recently documented features', _card_recent_documented, True)), 'scientist': (('undocumented', 'Features without documentation', _card_undocumented, True), ('datasets', 'Datasets', _card_datasets, True), ('shortcuts', 'Build and measure', _card_shortcuts, False), ('search', 'Find a feature', _card_search, False)), 'engineer': (('runs', 'Runs needing attention', _card_runs, True), ('health_check', 'Health check', _card_health_check, False), ('store_map', 'Store map', _card_store_map, True)), 'admin': (('config', 'Configuration', _card_config, False), ('database', 'Database', _card_database, False), ('maintenance', 'Maintenance', _card_maintenance, False), ('store_map', 'Store map', _card_store_map, True))}
when
¶
A raw ISO time as the status bar shows it: '11:25' today, else '8 Nov 11:25'. Anything unparseable is returned as it is.
_safe
¶
Run one card; an exception becomes an 'unavailable' card, never a failure.
_catalog_model
¶
The feature-catalog model: the cached one, else built once (under the lock).
_followup_facts
¶
Latest status per process, from the follow-up (cached CARD_TTL_S per store).
home
¶
The Home cards of one profile. frame=True returns only ids and titles (instant);
card=<id> builds that one card (the page fetches the cards in parallel); neither
builds them all. as_of is accepted for symmetry: Home shows the current state only.
_entries_from_catalogs
¶
Three cheap catalog reads, for when the feature-catalog model is not cached.
_index
¶
The search entries: from memory while fresh, else the cached model, else catalog reads.
search_objects
¶
{"results": [{kind, key, label, detail}]} ranked exact > prefix > word > substring
(> detail). An empty query returns nothing and reads nothing.