Skip to content

Commit

Permalink
ADD: Copy button for MachineName (#2183)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoPlays authored Feb 10, 2025
1 parent 5792143 commit 63a22d4
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"
@mouseleave="footerStore.cursorLocation = ''"
>
<span class="col-start-2 col-end-8 text-xs text-left text-gray-100 overflow-hidden whitespace-pre ml-[5px]">Mach</span>
<span class="col-start-8 col-span-full text-md text-yellow-500 overflow-hidden whitespace-pre">{{ controlStore.ServerName }}</span>
<span class="col-start-2 col-end-22 text-md text-yellow-500 overflow-hidden whitespace-pre">{{ controlStore.ServerName }}</span>

<img
class="w-7 col-start-23 col-span-full cursor-pointer hover:scale-110 active:scale-95 transition-all duration-200 ease-in-out"
src="/img/icon/service-modals-icons/copy.png"
alt="icon"
@click="toClipboard(controlStore.ServerName)"
/>
</div>
<div
v-if="controlStore.ipAddress"
Expand All @@ -25,14 +31,13 @@
"
@mouseleave="footerStore.cursorLocation = ''"
>
<span class="col-start-2 col-end-7 text-xs text-left text-gray-100 overflow-hidden whitespace-pre ml-[5px]">IP </span>
<span class="col-start-8 col-end-22 text-sm text-yellow-500 overflow-hidden whitespace-pre">{{ controlStore.ipAddress }}</span>
<span class="col-start-2 col-end-22 text-md text-yellow-500 overflow-hidden whitespace-pre">{{ controlStore.ipAddress }}</span>

<img
class="w-7 col-start-23 col-span-full cursor-pointer hover:scale-110 active:scale-95 transition-all duration-200 ease-in-out"
src="/img/icon/service-modals-icons/copy.png"
alt="icon"
@click="copyServerIp"
@click="toClipboard(controlStore.ipAddress)"
/>
</div>
</div>
Expand All @@ -53,10 +58,9 @@ onMounted(() => {
updateConnectionStats();
});
const copyServerIp = () => {
let ipToCopy = controlStore.ipAddress;
const toClipboard = (stringToCopy) => {
navigator.clipboard
.writeText(ipToCopy)
.writeText(stringToCopy.trim())
.then(() => {
console.log("copied!");
})
Expand Down

0 comments on commit 63a22d4

Please sign in to comment.