Skip to content

Commit

Permalink
#54: [WIP] Created modal for individual agents
Browse files Browse the repository at this point in the history
  • Loading branch information
njbrunner committed Nov 28, 2023
1 parent c5736d7 commit 965e954
Show file tree
Hide file tree
Showing 2 changed files with 198 additions and 123 deletions.
82 changes: 82 additions & 0 deletions anms-ui/public/app/components/management/agents/AgentModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<template>
<div>
<b-modal id="agentModal"
ref="agentModal"
title="Agent Details"
size="lg"
ok-only
@hide="closeModal">
<div v-if="agentInfo">
<div>Registered Agents ID = {{ agentInfo.registered_agents_id }}</div>
<div>Agent ID String: {{ agentInfo.agent_id_string }}</div>
<div>First Registered: {{ agentInfo.first_registered }}</div>
<div>Last Registered: {{ agentInfo.last_registered }}</div>

<reports :agentName="agentInfo.agent_id_string"
:rptts="rptt" />

<crud :agentId="agentInfo.registered_agents_id"
:Operations="operations">
</crud>
</div>
</b-modal>
</div>
</template>
<script>
import { mapActions, mapGetters } from "vuex";
import Crud from './crud.vue';
import reports from './reports.vue';
export default {
name: "AgentModal",
components: {
Crud, reports
},
data() {
return {
currADM: "",
currReport: "",
reportOptions: "",
selected: {},
rptList: {},
}
},
props: {
showModal: {
type: Boolean,
default: false,
},
agentInfo: {
type: Object,
default: null,
}
},
watch: {
showModal(newValue, _) {
if (newValue === true) {
this.show();
}
}
},
computed: {
...mapGetters("agents", {
rptt: "rptt",
operations: "operations",
}),
},
methods: {
...mapActions("agents", {
reloadAgent: "reloadAgent",
setAgentId: "setAgentId"
}),
show() {
this.$refs['agentModal'].show();
},
closeModal() {
this.$emit("close");
}
},
}
</script>
<style>
</style>
Loading

0 comments on commit 965e954

Please sign in to comment.