Package com.mcawful
Class CustomPanelManifestCollector
java.lang.Object
com.mcawful.CustomPanelManifestCollector
Discovers
manifest.json files under web/panel/custom/<moduleId>/ (bot install
and, in Docker, the data volume) and merges nav and cards entries for the panel.
Panel HTML/JS should continue to live under web/panel/pages/<folder>/ using the same
URLs as stock $.loadPage; manifests register sidebar links (nav) and cards on
existing single-page panels (cards). folder must begin with custom/ so
paths stay namespaced.
- Author:
- mcawful
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]filterManifestBytesForPanelUser(byte[] mergedUtf8, PanelUser user) Returns merged manifest bytes filtered for the logged-inPanelUser: entries whosenav.section/cards.sectionfailPanelUserHandler.checkPanelUserSectionAccess(tv.phantombot.panel.PanelUser.PanelUser, java.lang.String, boolean)with read access are omitted.Returns a memoizedCustomPanelManifestCache.CachedResponsefor the merged manifest JSON.
-
Method Details
-
getCachedResponse
Returns a memoizedCustomPanelManifestCache.CachedResponsefor the merged manifest JSON. Delegates toCustomPanelManifestCache.getOrRefresh(java.util.function.Supplier<java.lang.String>, java.util.function.Supplier<byte[]>); this method supplies the manifest-domain callbacks (filesystem-signature recipe and JSON-bytes builder) while the cache layer owns the TTL/ETag/concurrency policy.- Returns:
- current cached response, recomputed on demand when the underlying manifests change
-
filterManifestBytesForPanelUser
Returns merged manifest bytes filtered for the logged-inPanelUser: entries whosenav.section/cards.sectionfailPanelUserHandler.checkPanelUserSectionAccess(tv.phantombot.panel.PanelUser.PanelUser, java.lang.String, boolean)with read access are omitted. Config users andnull(legacy panel login) receive the unfiltered merge. On filter failure for a non-config user, returns an emptynav/cardspayload (fail-closed) rather than the unfiltered merge.- Parameters:
mergedUtf8- full merged JSON fromgetCachedResponse()user- authenticated panel user, ornullfor unfiltered output- Returns:
- UTF-8 JSON bytes, never
null
-