Skip to content

Commit

Permalink
change default sort on agents (#189)
Browse files Browse the repository at this point in the history
* change default sort on agents

* Update src/components/agents/AgentTerminal.vue
  • Loading branch information
vinnybod authored Feb 22, 2024
1 parent fd94090 commit 54347a3
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Run ESLint
run: yarn lint
- name: Run Prettier
run: yarn format --check
run: yarn format:check
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Removed extra space being added in front of Task Input and Output by append/prepend new line
- Changed default sort on agents page to be "first seen" instead of "last seen"

## [2.7.2] - 2024-01-31

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "vite build",
"serve": "vite preview",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
"format": "prettier . --write"
"format": "prettier . --write",
"format:check": "prettier . --check"
},
"main": "background.js",
"dependencies": {
Expand Down
9 changes: 2 additions & 7 deletions src/components/ClickToEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
<span class="text--bold">{{ label }}</span>
<v-tooltip v-if="infoText" bottom>
<template #activator="{ on, attrs }">
<v-icon
small
class="ml-2"
v-bind="attrs"
v-on="on"
>
<v-icon small class="ml-2" v-bind="attrs" v-on="on">
mdi-information-outline
</v-icon>
</template>
Expand Down Expand Up @@ -131,7 +126,7 @@ export default {
},
infoText: {
type: String,
default: ""
default: "",
},
dataType: {
type: String,
Expand Down
14 changes: 7 additions & 7 deletions src/components/agents/AgentTasksTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@
"
>
{{
addBlankLines(item.expandedInput
?
expandedTasks[item.uniqueId].full_input : item.input)
addBlankLines(
item.expandedInput
? expandedTasks[item.uniqueId].full_input
: item.input,
)
}}
</p>
<p><b>Task Output:</b></p>
Expand Down Expand Up @@ -109,9 +111,7 @@
v-html="expandedTasks[item.uniqueId].htmlOutput"
/>
<div v-else>
{{
addBlankLines(item.output)
}}
{{ addBlankLines(item.output) }}
</div>
</div>
</div>
Expand Down Expand Up @@ -389,7 +389,7 @@ export default {
.catch((err) => this.$snack.error(`Error: ${err}`));
},
addBlankLines(text) {
return `\n${ text }\n`;
return `\n${text}\n`;
},
addTag(task, tag) {
agentTaskApi
Expand Down
4 changes: 3 additions & 1 deletion src/components/agents/AgentTerminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ export default {
config = { print: true, attempts: 30, delay: 5000 },
) {
if (!config.attempts) config.attempts = 30;
if (!config.delay) config.delay = this.agent.delay != null ? this.agent.delay * 1000 : 5000;
if (!config.delay)
config.delay =
this.agent.delay != null ? this.agent.delay * 1000 : 5000;
let res = null;
let hasPrintedJobStarted = false;
Expand Down
6 changes: 4 additions & 2 deletions src/components/agents/AgentsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export default {
},
sortedAgents() {
let sorted = this.agents.slice();
sorted.sort((a, b) => -a.lastseen_time.localeCompare(b.lastseen_time));
sorted.sort((a, b) => a.checkin_time.localeCompare(b.checkin_time));
if (this.hideStaleAgents) {
sorted = sorted.filter((agent) => !agent.stale);
}
Expand Down Expand Up @@ -401,7 +401,9 @@ export default {
await agentTaskApi.sysinfo(agent.session_id);
this.$snack.success(`SysInfo reload queued for ${agent.name}`);
} catch (error) {
this.$snack.error(`Error reloading SysInfo for ${agent.name}: ${error.message}`);
this.$snack.error(
`Error reloading SysInfo for ${agent.name}: ${error.message}`,
);
}
},
async killAgent(item) {
Expand Down
14 changes: 7 additions & 7 deletions src/components/plugins/PluginTasksTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@
"
>
{{
addBlankLines(item.expandedInput
?
expandedTasks[item.uniqueId].full_input : item.input)
addBlankLines(
item.expandedInput
? expandedTasks[item.uniqueId].full_input
: item.input,
)
}}
</p>
<p><b>Task Output:</b></p>
Expand Down Expand Up @@ -108,9 +110,7 @@
v-if="expandedTasks[item.uniqueId].htmlOutput"
v-html="expandedTasks[item.uniqueId].htmlOutput"
/>
<div v-else>
addBlankLines(item.output)
</div>
<div v-else>addBlankLines(item.output)</div>
</div>
</div>
</td>
Expand Down Expand Up @@ -350,7 +350,7 @@ export default {
return new AnsiUp().ansi_to_html(output);
},
addBlankLines(text) {
return `\n${ text }\n`;
return `\n${text}\n`;
},
deleteTag(task, tag) {
pluginApi
Expand Down
4 changes: 3 additions & 1 deletion src/views/AgentEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ export default {
await agentTaskApi.sysinfo(this.agent.session_id);
this.$snack.success(`SysInfo reload queued for ${this.agent.name}`);
} catch (error) {
this.$snack.error(`Error reloading SysInfo for ${this.agent.name}: ${error.message}`);
this.$snack.error(
`Error reloading SysInfo for ${this.agent.name}: ${error.message}`,
);
}
},
toggleCollapsePane() {
Expand Down

0 comments on commit 54347a3

Please sign in to comment.