towerops/lib/towerops_web/live/agent_live/edit.html.heex

88 lines
3 KiB
Text

<Layouts.app flash={@flash} timezone={@timezone}>
<div class="max-w-2xl mx-auto">
<div class="mb-6">
<.link
navigate={~p"/agents/#{@agent_token.id}"}
class="text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
>
<span class="hero-arrow-left h-4 w-4 inline"></span> Back to agent
</.link>
</div>
<div class="bg-white dark:bg-gray-800/50 shadow rounded-lg">
<div class="px-6 py-5 border-b border-gray-200 dark:border-white/10">
<h3 class="text-lg font-medium text-gray-900 dark:text-white">
Edit Agent
</h3>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
Update the agent name. The authentication token cannot be changed.
</p>
</div>
<.form
for={@form}
id="edit-agent-form"
phx-change="validate"
phx-submit="save"
class="px-6 py-5"
>
<div class="space-y-6">
<div>
<.input
field={@form[:name]}
type="text"
label="Agent Name"
placeholder="e.g., Datacenter Agent"
required
/>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
A descriptive name to identify this agent in your organization.
</p>
</div>
<div>
<.input
field={@form[:allow_remote_debug]}
type="checkbox"
label="Allow Remote Debugging"
/>
<div
:if={@form[:allow_remote_debug].value}
class="rounded-md bg-amber-50 dark:bg-amber-900/20 p-3 mt-2"
>
<div class="flex items-start gap-2 text-amber-800 dark:text-amber-200">
<.icon name="hero-exclamation-triangle" class="h-5 w-5 flex-shrink-0 mt-0.5" />
<div class="text-sm">
<p class="font-medium">Performance Impact</p>
<p class="mt-1">
When enabled, the server logs all SNMP data and messages for this agent.
This generates significant log volume and should only be enabled temporarily
for troubleshooting.
</p>
</div>
</div>
</div>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
Enable verbose logging for troubleshooting SNMP discovery and polling issues.
Only organization members can toggle this setting.
</p>
</div>
</div>
<div class="mt-6 flex items-center justify-end gap-x-4">
<.link
navigate={~p"/agents/#{@agent_token.id}"}
class="text-sm font-semibold text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white"
>
Cancel
</.link>
<.button type="submit" phx-disable-with="Saving...">
Save Changes
</.button>
</div>
</.form>
</div>
</div>
</Layouts.app>