mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-15 14:22:43 +00:00
simplify(desktop): hardcode the Hermes Cloud setup link
Drop the portalBaseUrl→IPC→useState plumbing I added for the "create an agent" link. HERMES_PORTAL_BASE_URL is a dev/staging-only override; threading it through cloud.status() into React state just to build one link isn't worth it — in prod it's always portal.nousresearch.com. Module-level constant instead.
This commit is contained in:
parent
703487d7a6
commit
1c7f31a577
1 changed files with 5 additions and 10 deletions
|
|
@ -31,6 +31,10 @@ interface GatewaySettingsState {
|
|||
cloudOrg: string
|
||||
}
|
||||
|
||||
// Where the "no agents found" empty state sends you to create one — the Hermes
|
||||
// Cloud instance-setup flow (?setup=instance deep-links into the create form).
|
||||
const HERMES_CLOUD_SETUP_URL = 'https://portal.nousresearch.com/cloud?setup=instance'
|
||||
|
||||
const EMPTY_STATE: GatewaySettingsState = {
|
||||
envOverride: false,
|
||||
mode: 'local',
|
||||
|
|
@ -119,9 +123,6 @@ export function GatewaySettings() {
|
|||
const [cloudAgents, setCloudAgents] = useState<DesktopCloudAgent[]>([])
|
||||
const [cloudDiscover, setCloudDiscover] = useState<CloudDiscoverStatus>('idle')
|
||||
const [cloudConnectingId, setCloudConnectingId] = useState<null | string>(null)
|
||||
// Portal base URL echoed by cloud.status() — used to build the "create an
|
||||
// agent" link so it honors HERMES_PORTAL_BASE_URL instead of a hardcoded host.
|
||||
const [cloudPortalUrl, setCloudPortalUrl] = useState('')
|
||||
// Multi-org users: when discovery returns needsOrgSelection, we hold the org
|
||||
// list here and show a picker. `cloudOrg` is the chosen org slug/id (null =
|
||||
// not yet chosen / single-org user).
|
||||
|
|
@ -213,11 +214,6 @@ export function GatewaySettings() {
|
|||
const isConnectedAgent = (agent: DesktopCloudAgent) =>
|
||||
Boolean(connectedCloudUrl && agent.dashboardUrl && normalizeCloudUrl(agent.dashboardUrl) === connectedCloudUrl)
|
||||
|
||||
// "Create an agent" target: the Hermes Cloud instance-setup page, derived from
|
||||
// the portal base URL (cloud.status echoes it) so it honors
|
||||
// HERMES_PORTAL_BASE_URL; falls back to the canonical host before status lands.
|
||||
const createCloudAgentUrl = `${(cloudPortalUrl || 'https://portal.nousresearch.com').replace(/\/+$/, '')}/cloud?setup=instance`
|
||||
|
||||
useEffect(() => {
|
||||
if (state.mode !== 'remote' || !trimmedUrl || !/^https?:\/\//i.test(trimmedUrl)) {
|
||||
setProbeStatus('idle')
|
||||
|
|
@ -534,7 +530,6 @@ export function GatewaySettings() {
|
|||
return
|
||||
}
|
||||
|
||||
setCloudPortalUrl(status.portalBaseUrl)
|
||||
setCloudSignedIn(status.signedIn)
|
||||
|
||||
if (status.signedIn) {
|
||||
|
|
@ -873,7 +868,7 @@ export function GatewaySettings() {
|
|||
<AlertCircle className="mt-0.5 size-4 shrink-0" />
|
||||
<span>
|
||||
{g.cloudNoAgents.before}
|
||||
<ExternalLink href={createCloudAgentUrl} showExternalIcon={false}>
|
||||
<ExternalLink href={HERMES_CLOUD_SETUP_URL} showExternalIcon={false}>
|
||||
{g.cloudNoAgents.linkText}
|
||||
</ExternalLink>
|
||||
{g.cloudNoAgents.after}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue