Skip to content
Snippets Groups Projects
Commit 4fe188f6 authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Valentin Rigal
Browse files

Sort agents by hostname

parent eb1500fa
No related branches found
No related tags found
1 merge request!1515Sort agents by hostname
......@@ -9,8 +9,10 @@
<script>
import { mapState, mapActions, mapMutations } from 'vuex'
import { sortBy } from 'lodash'
import { errorParser } from '@/helpers'
import InLineAgent from '@/components/Process/Agents/InLineAgent.vue'
export default {
components: {
InLineAgent
......@@ -21,10 +23,7 @@ export default {
computed: {
...mapState('ponos', ['agents']),
orderedAgents () {
// Sort agents to display active ones first
return Object.values(this.agents).sort(
(a, b) => new Date(b.last_ping) - new Date(a.last_ping)
)
return sortBy(Object.values(this.agents), agent => agent.hostname.toLowerCase())
}
},
methods: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment