Skip to content

Commit

Permalink
Operations select dead agent bug in add potential link menu (#2344)
Browse files Browse the repository at this point in the history
* Fix opacity for view command buttons in operation links; Fixed bug where if first agent is dead, does not let user select a different agent when creating a command

* Update templates/operations.html

Remove unnecessary assignment

Co-authored-by: Jordan Hanna <4370241+cyber-arsenull@users.noreply.github.com>

Co-authored-by: Adam Gaudreau <argaudreau@users.noreply.github.com>
Co-authored-by: Jordan Hanna <4370241+cyber-arsenull@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 9, 2021
1 parent 0ba7e82 commit 514c144
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions templates/operations.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ <h2 class="is-size-7 has-text-weight-normal mb-5 mt-0">Decisions</h2>
<template x-if="!isLinkEditable">
<div class="is-flex is-justify-content-center is-flex-direction-column">
<button class="button is-primary is-small"
x-bind:class="{'hover-opacity':selectedLink !== link}"
x-on:click="getLink(link); openModal='showCommand'"
title="view output">View Command
</button>
Expand Down Expand Up @@ -1244,11 +1243,11 @@ <h2 class="is-size-7 has-text-weight-normal mb-5 mt-0">Decisions</h2>
getAgent(agentPaw) {
apiV2('GET', `api/v2/agents/${agentPaw}`)
.then((res) => {
this.selectedAgentIndex = 0;
this.potentialLink.agent = res;
// Check if agent has been seen in the last hour
if ((new Date() - new Date(res.last_seen)) > 3600000) {
toast(`Command might not run. Is Agent #${res.paw} still alive?`);
} else {
this.potentialLink.agent = res;
}
})
.catch(() => {
Expand Down Expand Up @@ -1704,14 +1703,6 @@ <h2 class="is-size-7 has-text-weight-normal mb-5 mt-0">Decisions</h2>
margin-bottom: 1em;
}

#operationsPage .hover-opacity {
opacity: 0.5;
}

#operationsPage .hover-opacity:hover {
opacity: 1;
}

#operationsPage .controls-container button {
margin: 0 2rem;
padding: 0;
Expand Down

0 comments on commit 514c144

Please sign in to comment.