Deduplicate integrations: settings tab links to standalone page
- Replace inline integrations tab with link to /settings/integrations - Remove ~1500 lines of duplicated integration UI from settings - Remove duplicated integration event handlers from settings_live - Standalone IntegrationsLive page remains the single source of truth - Settings page down from ~2400 to ~900 lines
This commit is contained in:
parent
b0d645148a
commit
88323a2290
2 changed files with 20 additions and 1529 deletions
|
|
@ -20,123 +20,6 @@ defmodule ToweropsWeb.Org.SettingsLive do
|
|||
|
||||
@billing_provider_ids ~w(gaiia sonar splynx visp)
|
||||
|
||||
@providers [
|
||||
# Billing providers (mutually exclusive — grouped first)
|
||||
%{
|
||||
id: "gaiia",
|
||||
name: "Gaiia",
|
||||
description:
|
||||
"Billing and subscriber management. Enables outage impact analysis, inventory reconciliation, and subscriber-aware monitoring.",
|
||||
icon: "hero-user-group",
|
||||
setup_help: %{
|
||||
url_pattern: "https://app.gaiia.com/{your-org}/admin/apiKeys",
|
||||
steps: [
|
||||
"Log into Gaiia and go to **Admin** → **API Keys**",
|
||||
"Click **Create API Key**",
|
||||
"Give it a descriptive name (e.g. \"TowerOps\")",
|
||||
"Copy the generated API key and paste it below"
|
||||
],
|
||||
permissions:
|
||||
"Read-only access. The key only needs permission to read accounts, subscriptions, and inventory data."
|
||||
}
|
||||
},
|
||||
%{
|
||||
id: "sonar",
|
||||
name: "Sonar",
|
||||
description:
|
||||
"Billing and subscriber management. Sync accounts, network sites, and inventory from your Sonar instance.",
|
||||
icon: "hero-currency-dollar",
|
||||
setup_help: %{
|
||||
url_pattern: "https://{your-instance}.sonar.software/admin/users/{your-user-id}",
|
||||
steps: [
|
||||
"Log into Sonar and go to **Settings** → **Security** → **API Tokens** (or your user profile → API Tokens)",
|
||||
"Click **Create Token**",
|
||||
"Name it (e.g. \"TowerOps\") and copy the generated token"
|
||||
],
|
||||
permissions:
|
||||
"Requires a **read-only** personal access token. The token needs access to: Accounts, Network Sites, Inventory Items, and Address data."
|
||||
}
|
||||
},
|
||||
%{
|
||||
id: "splynx",
|
||||
name: "Splynx",
|
||||
description:
|
||||
"ISP billing and management platform. Sync customers, internet services, and network routers from Splynx.",
|
||||
icon: "hero-banknotes",
|
||||
setup_help: %{
|
||||
url_pattern: "https://{your-instance}.splynx.app/admin/administration/api-keys",
|
||||
steps: [
|
||||
"Log into Splynx and go to **Administration** → **API Keys**",
|
||||
"Click **Add** to create a new API key",
|
||||
"Copy both the **API Key** and **API Secret**"
|
||||
],
|
||||
permissions:
|
||||
"Requires read access to **Customers**, **Internet Services**, and **Routers**. No write permissions needed."
|
||||
}
|
||||
},
|
||||
%{
|
||||
id: "visp",
|
||||
name: "VISP",
|
||||
description: "Cloud-based ISP management. Sync subscribers, sites, equipment, and MRR data from VISP.",
|
||||
icon: "hero-cloud",
|
||||
setup_help: %{
|
||||
url_pattern: "https://app.visp.net/settings/api",
|
||||
steps: [
|
||||
"Log into VISP and go to **Settings** → **API**",
|
||||
"Click **Generate New Key**",
|
||||
"Name it (e.g. \"TowerOps\") and copy the generated API key"
|
||||
],
|
||||
permissions: "Requires read-only API access to **Subscribers**, **Sites**, **Equipment**, and **Billing** data."
|
||||
}
|
||||
},
|
||||
# Quality of Experience
|
||||
%{
|
||||
id: "preseem",
|
||||
name: "Preseem",
|
||||
description: "QoE monitoring and subscriber experience analytics for wireless ISPs.",
|
||||
icon: "hero-signal",
|
||||
category: "Quality of Experience",
|
||||
setup_help: %{
|
||||
url_pattern: "https://app.preseem.com/settings/api",
|
||||
steps: [
|
||||
"Log into Preseem and go to **Settings** → **API**",
|
||||
"Click **Generate API Key**",
|
||||
"Copy the generated key and paste it below"
|
||||
],
|
||||
permissions: "Read-only access. The key needs permission to read subscriber QoE metrics and access point data."
|
||||
}
|
||||
},
|
||||
# Incident Management
|
||||
%{
|
||||
id: "pagerduty",
|
||||
name: "PagerDuty",
|
||||
description:
|
||||
"Incident management and on-call alerting. Automatically triggers, acknowledges, and resolves PagerDuty incidents from TowerOps alerts.",
|
||||
icon: "hero-bell-alert",
|
||||
category: "Incident Management"
|
||||
},
|
||||
# Infrastructure & IPAM
|
||||
%{
|
||||
id: "netbox",
|
||||
name: "NetBox",
|
||||
description:
|
||||
"Infrastructure source of truth. Sync devices, sites, IP addresses, and interfaces between TowerOps and your NetBox instance.",
|
||||
icon: "hero-server-stack",
|
||||
category: "Infrastructure & IPAM",
|
||||
setup_help: %{
|
||||
url_pattern: "https://{your-netbox-instance}/user/api-tokens/",
|
||||
steps: [
|
||||
"Log into NetBox and go to your **profile** (top right) → **API Tokens**",
|
||||
"Click **Add a token**",
|
||||
"Optionally set an expiry date and description (e.g. \"TowerOps\")",
|
||||
"Copy the generated token"
|
||||
],
|
||||
permissions:
|
||||
"Requires **read** permission at minimum. If you want to push data to NetBox (bidirectional sync), the token also needs **write** permission."
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@impl true
|
||||
def mount(_params, _session, socket) do
|
||||
organization = socket.assigns.current_scope.organization
|
||||
|
|
@ -173,15 +56,7 @@ defmodule ToweropsWeb.Org.SettingsLive do
|
|||
|> assign(:pending_invitations, [])
|
||||
|> assign(:invite_form, to_form(%{"email" => "", "role" => "technician"}))
|
||||
# Integration assigns - loaded lazily when tab is selected
|
||||
|> assign(:providers, @providers)
|
||||
|> assign(:billing_provider_ids, @billing_provider_ids)
|
||||
|> assign(:integrations, %{})
|
||||
|> assign(:active_billing_provider, nil)
|
||||
|> assign(:configuring, nil)
|
||||
|> assign(:integration_form, nil)
|
||||
|> assign(:test_result, nil)
|
||||
|> assign(:netbox_config, default_netbox_config())
|
||||
|> assign(:integration_credentials, %{})
|
||||
|> assign(:timezone, socket.assigns.current_scope.timezone)}
|
||||
end
|
||||
|
||||
|
|
@ -210,14 +85,6 @@ defmodule ToweropsWeb.Org.SettingsLive do
|
|||
|> assign(:pending_invitations, Organizations.list_pending_invitations(org_id))
|
||||
end
|
||||
|
||||
defp maybe_load_integrations(socket, "integrations") do
|
||||
integrations = load_integrations(socket.assigns.organization.id)
|
||||
|
||||
socket
|
||||
|> assign(:integrations, integrations)
|
||||
|> assign(:active_billing_provider, active_billing_provider(integrations))
|
||||
end
|
||||
|
||||
defp maybe_load_integrations(socket, _tab), do: socket
|
||||
|
||||
# === Org settings events ===
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue