Skip to content

Commit

Permalink
Merge pull request #2299 from s-ff/issue/2236
Browse files Browse the repository at this point in the history
web: add copy rule name and description to VT to right click menu
  • Loading branch information
mr-tz authored Aug 16, 2024
2 parents 076bb13 + 03e2195 commit 348e0b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/explorer/src/components/RuleMatchesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
<span v-if="item.icon !== 'vt-icon'" :class="item.icon" />
<VTIcon v-else-if="item.icon === 'vt-icon'" />
<span>{{ item.label }}</span>
<i v-if="item.description" class="pi pi-info-circle text-xs" v-tooltip.right="item.description" />
</a>
</template>
</ContextMenu>
Expand Down Expand Up @@ -215,6 +216,13 @@ const expandedKeys = ref({});
const menu = ref();
const selectedNode = ref({});
const contextMenuItems = computed(() => [
{
label: "Copy rule name",
icon: "pi pi-copy",
command: () => {
navigator.clipboard.writeText(selectedNode.value.data?.name);
}
},
{
label: "View source",
icon: "pi pi-eye",
Expand All @@ -232,6 +240,7 @@ const contextMenuItems = computed(() => [
label: "Lookup rule in VirusTotal",
icon: "vt-icon",
target: "_blank",
description: "Requires VirusTotal Premium account",
url: createVirusTotalUrl(selectedNode.value.data?.name)
}
]);
Expand Down

0 comments on commit 348e0b3

Please sign in to comment.