File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 {
5353 <FluentGridItem lg =" 3" md =" 4" sm =" 6" xs =" 12" Class =" agent-tile" @onclick =" () => ViewAgentDetails(agent.Id)" >
5454 <div class =" agent-content" >
55- <button class =" remove-btn" @onclick =" () => RemoveAgent(agent.Id)" >
55+ <button class =" remove-btn" @onclick:stopPropagation = " true " @onclick =" () => RemoveAgent(agent.Id)" >
5656 <i class =" fas fa-trash-alt" ></i >
5757 </button >
5858 <div class =" badge-agent-model" >@agent.Model </div >
102102 <label for =" configuration" >Configuration </label >
103103 <InputTextArea id =" configuration" @bind-Value =" newAgent.Context.Instruction" class =" form-control" />
104104 </div >
105- <button type =" submit" class =" create-button" >Create </button >
105+ @if (! _loading )
106+ {
107+ <button type =" submit" class =" create-button" >Create </button >
108+ }
109+ else
110+ {
111+ <FluentProgressRing Visible =" _loading" ></FluentProgressRing >
112+ }
106113 </EditForm >
107114 </div >
108115 </FluentGridItem >
188195 private async Task RemoveAgent (string agentId )
189196 {
190197 await Http .DeleteAsync ($" {ExtensionMethods .GetApiUrl ()}/api/agents/{agentId }" );
198+ await LoadAgentsAsync ();
191199 }
192200
193201 private async Task Cleanup (string selectedAgentId )
214222
215223 private async Task CreateAgent ()
216224 {
225+ _loading = true ;
217226 newAgent .Context .Steps = [" START" ];
218227 newAgent .Id = Guid .NewGuid ().ToString ();
219228 var response = await Http .PostAsJsonAsync ($" {ExtensionMethods .GetApiUrl ()}/api/agents" , newAgent );
220229 if (response .IsSuccessStatusCode )
221230 {
222231 newAgent = new (); // Reset the form
223232 await LoadAgentsAsync (); // Refresh the agents list
233+ _loading = false ;
224234 _mode = AgentsPageMode .List ; // Switch back to list mode
225235 }
226236 }
Original file line number Diff line number Diff line change @@ -141,6 +141,18 @@ body {
141141 color : # ffffff ;
142142}
143143
144+ .create-form-container input : focus ,
145+ .create-form-container textarea : focus {
146+ width : 100% ;
147+ padding : 10px ;
148+ margin-top : 5px ;
149+ border : 1px solid # af6bff ;
150+ border-radius : 4px ;
151+ background-color : # 121212 ;
152+ color : # ffffff ;
153+ }
154+
155+
144156.create-button {
145157 background-color : # 7aeda3 ;
146158 color : # 3a3232 ;
You can’t perform that action at this time.
0 commit comments