57 lines
2.3 KiB
Haskell
57 lines
2.3 KiB
Haskell
|
|
module Web.View.AgentRegistrations.New where
|
||
|
|
|
||
|
|
import Web.View.Prelude
|
||
|
|
|
||
|
|
data NewView = NewView
|
||
|
|
{ agent :: !AgentRegistration
|
||
|
|
, hubs :: ![Hub]
|
||
|
|
}
|
||
|
|
|
||
|
|
instance View NewView where
|
||
|
|
html NewView { .. } = [hsx|
|
||
|
|
<div class="p-6 max-w-2xl">
|
||
|
|
<h1 class="text-2xl font-bold text-gray-900 mb-6">Register Agent</h1>
|
||
|
|
{renderForm agent hubs}
|
||
|
|
</div>
|
||
|
|
|]
|
||
|
|
|
||
|
|
renderForm :: AgentRegistration -> [Hub] -> Html
|
||
|
|
renderForm agent hubs = formFor agent [hsx|
|
||
|
|
<div class="space-y-4">
|
||
|
|
<div>
|
||
|
|
{(textField #hubId) { label = "Hub", fieldClass = "block w-full border-gray-300 rounded-md shadow-sm" }}
|
||
|
|
</div>
|
||
|
|
<div class="grid grid-cols-2 gap-4">
|
||
|
|
<div>{(textField #name) { label = "Name" }}</div>
|
||
|
|
<div>{(textField #slug) { label = "Slug (unique identifier)" }}</div>
|
||
|
|
</div>
|
||
|
|
<div>{(textareaField #description) { label = "Description" }}</div>
|
||
|
|
<div class="grid grid-cols-2 gap-4">
|
||
|
|
<div>
|
||
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Provider</label>
|
||
|
|
<select name="provider" class="block w-full border-gray-300 rounded-md shadow-sm">
|
||
|
|
<option value="openrouter">openrouter</option>
|
||
|
|
<option value="gemini">gemini</option>
|
||
|
|
<option value="openai">openai</option>
|
||
|
|
<option value="claude-code">claude-code</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div>{(textField #modelName) { label = "Model Name" }}</div>
|
||
|
|
</div>
|
||
|
|
<div>
|
||
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Trust Level</label>
|
||
|
|
<select name="trustLevel" class="block w-full border-gray-300 rounded-md shadow-sm">
|
||
|
|
<option value="advisory">advisory (default)</option>
|
||
|
|
<option value="elevated">elevated</option>
|
||
|
|
<option value="autonomous">autonomous</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div>{(textareaField #systemPrompt) { label = "System Prompt (optional)" }}</div>
|
||
|
|
<div class="flex gap-3 pt-2">
|
||
|
|
{submitButton { label = "Register Agent" }}
|
||
|
|
<a href={AgentRegistrationsAction}
|
||
|
|
class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-md text-sm">Cancel</a>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|]
|