Created
March 29, 2024 12:57
-
-
Save drskullster/141a178c4947a28e2c5d6df30e12f5ac to your computer and use it in GitHub Desktop.
Open any balenaCloud device UUID found in the currently selected text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (() => { | |
const selectedText = getSelection().toString(); | |
if (selectedText) { | |
const UUIDs = selectedText | |
.split(/[\s,]+/) | |
.filter((UUID) => UUID.match(/[a-zA-Z0-9]{32}/)); | |
if (UUIDs.length) { | |
UUIDs.map((UUID) => open(`https://dashboard.balena-cloud.com/devices/${UUID}`, '_blank')); | |
} else { | |
alert('No device UUID found'); | |
} | |
} else { | |
alert('Select at least one device UUID'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment