mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
feat: add telemetry
This commit is contained in:
parent
cc97c6c026
commit
80ae58f2af
|
@ -1210,6 +1210,23 @@ function onSearchClear() {
|
|||
document.dispatchEvent(new KeyboardEvent('keyup', { key: '/' }));
|
||||
}
|
||||
|
||||
function onOpenRelatedExecution(executionId: string, workflowId?: string) {
|
||||
if (!nodeType.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
openExecutionInNewTab(executionId, workflowId);
|
||||
|
||||
// todo better distinguish these two
|
||||
const isTrigger = nodeType.value.group.includes('trigger');
|
||||
telemetry.track(
|
||||
isTrigger ? 'User clicked parent execution button' : 'User clicked inspect sub-workflow',
|
||||
{
|
||||
view: displayMode.value,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
defineExpose({ enterEditMode });
|
||||
</script>
|
||||
|
||||
|
@ -1390,7 +1407,9 @@ defineExpose({ enterEditMode });
|
|||
:class="$style.parentExecutionInfo"
|
||||
>
|
||||
<a
|
||||
@click.stop="openExecutionInNewTab(subWorkflowData.executionId, subWorkflowData.workflowId)"
|
||||
@click.stop="
|
||||
onOpenRelatedExecution(subWorkflowData.executionId, subWorkflowData.workflowId)
|
||||
"
|
||||
>
|
||||
<N8nIcon icon="external-link-alt" size="xsmall" />
|
||||
{{
|
||||
|
|
|
@ -12,6 +12,7 @@ import { computed } from 'vue';
|
|||
import NodeIcon from '@/components/NodeIcon.vue';
|
||||
import AiRunContentBlock from './AiRunContentBlock.vue';
|
||||
import { useExecutionHelpers } from '@/composables/useExecutionHelpers';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
|
||||
interface RunMeta {
|
||||
startTimeMs: number;
|
||||
|
@ -29,6 +30,8 @@ const props = defineProps<{
|
|||
const nodeTypesStore = useNodeTypesStore();
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
|
||||
const telemetry = useTelemetry();
|
||||
|
||||
const { openExecutionInNewTab } = useExecutionHelpers();
|
||||
|
||||
type TokenUsageData = {
|
||||
|
@ -105,6 +108,20 @@ const outputError = computed(() => {
|
|||
| NodeError
|
||||
| undefined;
|
||||
});
|
||||
|
||||
// todo unify function across components
|
||||
function openExecution({ executionId }: RunMeta) {
|
||||
if (!executionId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// todo add workflow id
|
||||
openExecutionInNewTab(executionId);
|
||||
|
||||
telemetry.track('User clicked inspect sub-workflow', {
|
||||
view: 'ai',
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -137,7 +154,7 @@ const outputError = computed(() => {
|
|||
</n8n-tooltip>
|
||||
</li>
|
||||
<li v-if="runMeta?.executionId">
|
||||
<a @click.stop="openExecutionInNewTab(runMeta?.executionId)">
|
||||
<a @click.stop="openExecution(runMeta)">
|
||||
<N8nIcon icon="external-link-alt" size="xsmall" />
|
||||
{{ $locale.baseText('runData.openSubExecution') }}
|
||||
</a>
|
||||
|
|
|
@ -412,6 +412,10 @@ function switchToJsonView() {
|
|||
|
||||
function openExecution({ executionId, workflowId }: SubworkflowExecutionInfo) {
|
||||
openExecutionInNewTab(executionId, workflowId);
|
||||
|
||||
telemetry.track('User clicked inspect sub-workflow', {
|
||||
view: 'table',
|
||||
});
|
||||
}
|
||||
|
||||
watch(focusedMappableInput, (curr) => {
|
||||
|
|
Loading…
Reference in a new issue