mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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: '/' }));
|
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 });
|
defineExpose({ enterEditMode });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1390,7 +1407,9 @@ defineExpose({ enterEditMode });
|
||||||
:class="$style.parentExecutionInfo"
|
:class="$style.parentExecutionInfo"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
@click.stop="openExecutionInNewTab(subWorkflowData.executionId, subWorkflowData.workflowId)"
|
@click.stop="
|
||||||
|
onOpenRelatedExecution(subWorkflowData.executionId, subWorkflowData.workflowId)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<N8nIcon icon="external-link-alt" size="xsmall" />
|
<N8nIcon icon="external-link-alt" size="xsmall" />
|
||||||
{{
|
{{
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { computed } from 'vue';
|
||||||
import NodeIcon from '@/components/NodeIcon.vue';
|
import NodeIcon from '@/components/NodeIcon.vue';
|
||||||
import AiRunContentBlock from './AiRunContentBlock.vue';
|
import AiRunContentBlock from './AiRunContentBlock.vue';
|
||||||
import { useExecutionHelpers } from '@/composables/useExecutionHelpers';
|
import { useExecutionHelpers } from '@/composables/useExecutionHelpers';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
|
||||||
interface RunMeta {
|
interface RunMeta {
|
||||||
startTimeMs: number;
|
startTimeMs: number;
|
||||||
|
@ -29,6 +30,8 @@ const props = defineProps<{
|
||||||
const nodeTypesStore = useNodeTypesStore();
|
const nodeTypesStore = useNodeTypesStore();
|
||||||
const workflowsStore = useWorkflowsStore();
|
const workflowsStore = useWorkflowsStore();
|
||||||
|
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
|
||||||
const { openExecutionInNewTab } = useExecutionHelpers();
|
const { openExecutionInNewTab } = useExecutionHelpers();
|
||||||
|
|
||||||
type TokenUsageData = {
|
type TokenUsageData = {
|
||||||
|
@ -105,6 +108,20 @@ const outputError = computed(() => {
|
||||||
| NodeError
|
| NodeError
|
||||||
| undefined;
|
| 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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -137,7 +154,7 @@ const outputError = computed(() => {
|
||||||
</n8n-tooltip>
|
</n8n-tooltip>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="runMeta?.executionId">
|
<li v-if="runMeta?.executionId">
|
||||||
<a @click.stop="openExecutionInNewTab(runMeta?.executionId)">
|
<a @click.stop="openExecution(runMeta)">
|
||||||
<N8nIcon icon="external-link-alt" size="xsmall" />
|
<N8nIcon icon="external-link-alt" size="xsmall" />
|
||||||
{{ $locale.baseText('runData.openSubExecution') }}
|
{{ $locale.baseText('runData.openSubExecution') }}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -412,6 +412,10 @@ function switchToJsonView() {
|
||||||
|
|
||||||
function openExecution({ executionId, workflowId }: SubworkflowExecutionInfo) {
|
function openExecution({ executionId, workflowId }: SubworkflowExecutionInfo) {
|
||||||
openExecutionInNewTab(executionId, workflowId);
|
openExecutionInNewTab(executionId, workflowId);
|
||||||
|
|
||||||
|
telemetry.track('User clicked inspect sub-workflow', {
|
||||||
|
view: 'table',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(focusedMappableInput, (curr) => {
|
watch(focusedMappableInput, (curr) => {
|
||||||
|
|
Loading…
Reference in a new issue