Skip to content

Commit

Permalink
add button to request node info to node dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Nov 17, 2024
1 parent f3dbbde commit b913469
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/components/nodes/NodesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</DropDownMenuItem>
</RouterLink>

<!-- send message button -->
<!-- direct message button -->
<RouterLink :to="{ name: 'node.messages', params: { nodeId: node.num }}">
<DropDownMenuItem>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-5">
Expand All @@ -77,6 +77,14 @@
</DropDownMenuItem>
</RouterLink>

<!-- exchange node info button -->
<DropDownMenuItem @click="onRequestNodeInfo(node)">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-5">
<path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" />
</svg>
<span>Request Node Info</span>
</DropDownMenuItem>

<!-- forget node button -->
<DropDownMenuItem @click="onDeleteNode(node)" class="border-t">
<svg class="size-5 text-red-500" viewBox="0 0 20 20" fill="currentColor">
Expand Down Expand Up @@ -131,6 +139,15 @@ export default {
formatUnixSecondsAgo(unixSeconds) {
return moment.unix(unixSeconds).fromNow();
},
onRequestNodeInfo(node) {
// request node info
NodeAPI.requestNodeInfo(node.num);
// show alert
alert("A request has been sent to the node to send its info back to us.");
},
async onDeleteNode(node) {
// confirm user wants to remove this node
Expand Down

0 comments on commit b913469

Please sign in to comment.