Commit 39837303c1418d7bf9c45e45a75b8a2f16412d05

Authored by Alexis Koralewski
1 parent 0ddc9733
Exists in dev

change color cmd_error & try fix error AgentCmd doesn't have attribute 'exists()'

src/core/pyros_django/dashboard/templates/dashboard/agent_detail.html
... ... @@ -25,7 +25,7 @@
25 25 background-color : lightblue;
26 26 }
27 27 .red{
28   - background-color : red;
  28 + color : red;
29 29 }
30 30 .table{
31 31 width:auto;
... ... @@ -155,13 +155,13 @@
155 155 <tbody>
156 156  
157 157  
158   - <tr v-for="command in commands" v-bind:class="['{{agent_name}}' == command.sender ? 'blue' : 'green',['CMD_EXECUTED','CMD_PENDING','CMD_RUNNING'].includes(command.state) ? '' : 'red']" >
  158 + <tr v-for="command in commands" v-bind:class="'{{agent_name}}' == command.sender ? 'blue' : 'green'" >
159 159 <td> [[ command.full_name ]] </td>
160 160  
161 161 <td v-if="command.sender.includes('@') || command.sender == 'System'">[[ command.sender]]</td>
162 162 <td v-else> <a v-bind:href="`/dashboard/agent_detail/${command.sender}`">[[ command.sender]]</a></td>
163 163 <td> <a v-bind:href="`/dashboard/agent_detail/${command.recipient}`">[[ command.recipient ]]</a></td>
164   - <td> [[ command.state ]] </td>
  164 + <td v-bind:class="['CMD_EXECUTED','CMD_PENDING','CMD_RUNNING'].includes(command.state) ? '' : 'red'"> [[ command.state ]] </td>
165 165 <td> [[ command.s_deposit_time]] </td>
166 166 <td> [[ command.r_read_time]]</td>
167 167 <td> [[ command.validity_duration]] </td>
... ...
src/core/pyros_django/dashboard/views.py
... ... @@ -199,7 +199,7 @@ def get_last_specific_cmds(agent_name):
199 199 time.sleep(0.5)
200 200 return AgentCmd.objects.get(id=last_agent_specific_cmds.id)
201 201 except AgentCmd.DoesNotExist:
202   - if (last_do_stop_cmd == None or not last_do_stop_cmd.exists()) and last_agent_specific_cmds != None:
  202 + if last_do_stop_cmd == None and last_agent_specific_cmds != None:
203 203 return last_agent_specific_cmds
204 204 last_agent_specific_cmds = AgentCmd.send_cmd_from_to("System",agent_name,"get_specific_cmds")
205 205 while not AgentCmd.objects.get(id=last_agent_specific_cmds.id).is_executed() and not AgentCmd.objects.get(id=last_agent_specific_cmds.id).is_exec_error():
... ...