Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operations select dead agent bug in add potential link menu #2344

Merged
merged 4 commits into from
Nov 9, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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