feat: refs #8001 ticketExpeditionGrafana #865

Merged
robert merged 13 commits from 8001-expeditionGrafana into dev 2024-12-16 12:35:13 +00:00
1 changed files with 15 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import axios from 'axios';
import VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
import VnBtnSelect from 'src/components/common/VnBtnSelect.vue'; import VnBtnSelect from 'src/components/common/VnBtnSelect.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import useOpenURL from 'src/composables/useOpenURL';
const route = useRoute(); const route = useRoute();
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -123,6 +124,12 @@ const columns = computed(() => [
isPrimary: true, isPrimary: true,
action: (row) => showLog(row), action: (row) => showLog(row),
}, },
{
title: t('Grafana'),
icon: 'vn:grafana',
isPrimary: true,
robert marked this conversation as resolved
Review

TIP: puedes hacer ({id})=> openGrafana(id)

TIP: puedes hacer ({id})=> openGrafana(id)
action: ({ id }) => openGrafana(id),
},
], ],
}, },
]); ]);
@ -192,10 +199,16 @@ const getExpeditionState = async (expedition) => {
})); }));
}; };
const openGrafana = (expeditionFk) => {
robert marked this conversation as resolved
Review
Ahora usamos https://grafana.verdnatura.es/d/
useOpenURL(
`https://grafana.verdnatura.es/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-expeditionFk=${expeditionFk}`
);
};
onMounted(async () => { onMounted(async () => {
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
const filteredColumns = columns.value.filter((col) => col.name !== 'history'); const filteredColumns = columns.value.filter(({ name }) => name !== 'history');
robert marked this conversation as resolved Outdated

Si solo usas name puedes usar la misma sintaxis del comentario anterior

Si solo usas name puedes usar la misma sintaxis del comentario anterior
allColumnNames.value = filteredColumns.map((col) => col.name); allColumnNames.value = filteredColumns.map(({ name }) => name);
}); });
</script> </script>