@@ -3,6 +3,7 @@ class @AgentShowPage |
||
| 3 | 3 |
$(".agent-show #show-tabs a[href='#logs'], #logs .refresh").on "click", @fetchLogs
|
| 4 | 4 |
$(".agent-show #logs .clear").on "click", @clearLogs
|
| 5 | 5 |
$(".agent-show #memory .clear").on "click", @clearMemory
|
| 6 |
+ $('#toggle-memory').on "click", @toggleMemory
|
|
| 6 | 7 |
|
| 7 | 8 |
# Trigger tabs when navigated to. |
| 8 | 9 |
if tab = window.location.href.match(/tab=(\w+)\b/i)?[1] |
@@ -40,6 +41,14 @@ class @AgentShowPage |
||
| 40 | 41 |
$("#logs .spinner").stop(true, true).fadeOut ->
|
| 41 | 42 |
$("#logs .refresh, #logs .clear").show()
|
| 42 | 43 |
|
| 44 |
+ toggleMemory: -> |
|
| 45 |
+ if $('#memorypanel').hasClass('hidden')
|
|
| 46 |
+ $('#memorypanel').removeClass 'hidden'
|
|
| 47 |
+ $('#toggle-memory').text('Hide Memory')
|
|
| 48 |
+ else |
|
| 49 |
+ $('#memorypanel').addClass 'hidden'
|
|
| 50 |
+ $('#toggle-memory').text('Show Memory')
|
|
| 51 |
+ |
|
| 43 | 52 |
clearMemory: (e) -> |
| 44 | 53 |
if confirm("Are you sure you want to clear memory of this Agent?")
|
| 45 | 54 |
agentId = $(e.target).closest("[data-agent-id]").data("agent-id")
|
@@ -56,4 +65,4 @@ class @AgentShowPage |
||
| 56 | 65 |
|
| 57 | 66 |
$ -> |
| 58 | 67 |
Utils.registerPage(AgentShowPage, forPathsMatching: /^agents\/\d+/) |
| 59 |
- |
|
| 68 |
+ |
@@ -161,17 +161,20 @@ |
||
| 161 | 161 |
<b>Options:</b> |
| 162 | 162 |
<pre><%= Utils.pretty_jsonify @agent.options || {} %></pre>
|
| 163 | 163 |
</p> |
| 164 |
- |
|
| 165 |
- <p id="memory" data-agent-id="<%= @agent.id %>"> |
|
| 166 |
- <b>Memory:</b> |
|
| 167 |
- <% if @agent.memory.present? %> |
|
| 168 |
- <i class="fa fa-spinner fa-pulse spinner"></i> |
|
| 169 |
- <i class="fa fa-trash action-icon clear"></i> |
|
| 170 |
- <% end %> |
|
| 171 |
- <pre class="memory"><%= Utils.pretty_jsonify @agent.memory || {} %></pre>
|
|
| 172 |
- </p> |
|
| 164 |
+ <button type="submit" class="btn btn-default" id="toggle-memory">Show Memory</button> |
|
| 165 |
+ <div id="memorypanel" class="hidden"> |
|
| 166 |
+ <p id="memory" data-agent-id="<%= @agent.id %>"> |
|
| 167 |
+ <b>Memory:</b> |
|
| 168 |
+ <% if @agent.memory.present? %> |
|
| 169 |
+ <i class="fa fa-spinner fa-pulse spinner"></i> |
|
| 170 |
+ <i class="fa fa-trash action-icon clear"></i> |
|
| 171 |
+ <% end %> |
|
| 172 |
+ <pre class="memory"><%= Utils.pretty_jsonify @agent.memory || {} %></pre>
|
|
| 173 |
+ </p> |
|
| 174 |
+ </div> |
|
| 173 | 175 |
</div> |
| 174 | 176 |
</div> |
| 175 | 177 |
</div> |
| 176 | 178 |
</div> |
| 177 | 179 |
</div> |
| 180 |
+ |