Update "Launch SFTP" button to a plain hyperlink (#5356)
* Update "Launch SFTP" button to use a hyperlink instead of a button * fix: use computed ref to construct url
This commit is contained in:
@@ -8,14 +8,15 @@
|
|||||||
<span> SFTP allows you to access your server's files from outside of Modrinth. </span>
|
<span> SFTP allows you to access your server's files from outside of Modrinth. </span>
|
||||||
</label>
|
</label>
|
||||||
<ButtonStyled>
|
<ButtonStyled>
|
||||||
<button
|
<a
|
||||||
v-tooltip="'This button only works with compatible SFTP clients (e.g. WinSCP)'"
|
v-tooltip="'This button only works with compatible SFTP clients (e.g. WinSCP)'"
|
||||||
class="!w-full sm:!w-auto"
|
class="!w-full sm:!w-auto"
|
||||||
@click="openSftp"
|
:href="sftpUrl"
|
||||||
|
target="_blank"
|
||||||
>
|
>
|
||||||
<ExternalIcon class="h-5 w-5" />
|
<ExternalIcon class="h-5 w-5" />
|
||||||
Launch SFTP
|
Launch SFTP
|
||||||
</button>
|
</a>
|
||||||
</ButtonStyled>
|
</ButtonStyled>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -130,10 +131,7 @@ const props = defineProps<{
|
|||||||
const data = computed(() => props.server.general)
|
const data = computed(() => props.server.general)
|
||||||
const showPassword = ref(false)
|
const showPassword = ref(false)
|
||||||
|
|
||||||
const openSftp = () => {
|
const sftpUrl = computed(() => `sftp://${data.value?.sftp_username}@${data.value?.sftp_host}`)
|
||||||
const sftpUrl = `sftp://${data.value?.sftp_username}@${data.value?.sftp_host}`
|
|
||||||
window.open(sftpUrl, '_blank')
|
|
||||||
}
|
|
||||||
|
|
||||||
const togglePassword = () => {
|
const togglePassword = () => {
|
||||||
showPassword.value = !showPassword.value
|
showPassword.value = !showPassword.value
|
||||||
|
|||||||
Reference in New Issue
Block a user