diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/group-settings.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/group-settings.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js index 0f8ccdd..4d67348 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js @@ -399,6 +399,7 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, mnpRoots, enabledApps, onEnabledApps, scanSettings, onScanSettings, + searchListed, entries, nodeDirs, appSettings, onAppDirectories, onRefreshIndex, @@ -652,6 +653,27 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, } }, [transportRef, onScanSettings, reconcileMinutes, debounceSeconds]); + // Whether members' cross-group Search lists this group. The switch follows + // the node's answer: the ack is broadcast and replayed to the requester + // (transport.js BROADCAST_ACK_TYPES), which is what moves `searchListed`. + const [listedBusy, setListedBusy] = useState(false); + const [listedMsg, setListedMsg] = useState(''); + const toggleSearchListed = useCallback(async (next) => { + const transport = transportRef && transportRef.current; + setListedMsg(''); + setListedBusy(true); + try { + if (!transport || !transport.connected) { + throw new Error('Not connected to the node'); + } + await transport.setSearchListed(next, adminSignFn); + } catch (err) { + setListedMsg(err.message); + } finally { + setListedBusy(false); + } + }, [transportRef, adminSignFn]); + // ── Per-app settings ──────────────────────────────────────────────── // // What every app's settings pane is given, and the one operation the page @@ -936,6 +958,23 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, ${appsMsg && html`<p class="error-msg">${appsMsg}</p>`} + ${/* Whether this group shows up in members' cross-group Search. A + listing preference, not a permission: the hint says so, because a + switch next to "members" and "devices" reads as access control. */ + isNodeAdmin && connected && html` + <${CollapsibleSection} titleKey="settings_node.search_listed_title" + defaultOpen=${false}> + <div class="settings-row"> + <${ToggleSwitch} checked=${searchListed !== false} + disabled=${listedBusy} + onChange=${toggleSearchListed} + label=${t('settings_node.search_listed_label')} /> + </div> + <p class="settings-hint">${t('settings_node.search_listed_hint')}</p> + ${listedMsg && html`<p class="error-msg">${listedMsg}</p>`} + </${CollapsibleSection}> + `} + ${/* How hard the node works watching its own disk — indexer.py DirectoryIndexer. A performance knob, not a permission: it changes nothing about who can see or do what. */ |