diff --git a/src/components/agents/SummaryTab.vue b/src/components/agents/SummaryTab.vue
index 039b043..dcbc1b2 100644
--- a/src/components/agents/SummaryTab.vue
+++ b/src/components/agents/SummaryTab.vue
@@ -158,6 +158,20 @@
>
No checks
+
+
+ Custom Fields
+
+
+
+
+
+
+ {{ field.name }}: {{ field.value }}
+
+
+
+
@@ -193,6 +207,7 @@ import {
openAgentWindow,
} from "@/api/agents";
import { notifySuccess } from "@/utils/notify";
+import { fetchCustomFields } from "@/api/core";
// ui imports
import AgentActionMenu from "@/components/agents/AgentActionMenu.vue";
@@ -210,6 +225,7 @@ export default {
// summary tab logic
const summary = ref(null);
+ const customFieldsDefinitions = ref(null);
const loading = ref(false);
function diskBarColor(percent) {
@@ -236,8 +252,30 @@ export default {
return ret;
});
+ const customFields = computed(() => {
+ if (!summary.value.custom_fields) {
+ return [];
+ }
+ if (!customFieldsDefinitions.value) {
+ return [];
+ }
+ const ret = [];
+ for (const customField of summary.value.custom_fields) {
+ const definition = customFieldsDefinitions.value.find((def) => def.id === customField.field)
+ if (definition) {
+ ret.push({
+ name: definition.name,
+ value: customField.value,
+ })
+ }
+ }
+
+ return ret;
+ });
+
async function getSummary() {
loading.value = true;
+ customFieldsDefinitions.value = await fetchCustomFields();
summary.value = await fetchAgent(selectedAgent.value);
store.commit("setRefreshSummaryTab", false);
store.commit("setAgentPlatform", summary.value.plat);
@@ -277,6 +315,7 @@ export default {
return {
// reactive data
summary,
+ customFields,
loading,
selectedAgent,
disks,