<template>
  <v-text-field
    dense
    v-bind="$attrs"
    type="url"
    prepend-icon="$sockiTerminal"
    :readonly="readonly"
    :disabled="disabled"
    :label="label"
    :rules="rules"
    :value="value"
    :error-messages="errorMessages"
    v-on="$listeners"
    @click:prepend="openUrl"
  ></v-text-field>
</template>
<script>
export default {
  props: {
    label: { type: String, default: null },
    value: { type: String, default: null },
    rules: { type: Array, default: undefined },
    readonly: { type: Boolean, default: false },
    disabled: { type: Boolean, default: false },
    errorMessages: { type: Array, default: null }
  },
  methods: {
    openUrl() {
      if (this.value) {
        window.open(`ssh:${this.value}`, "ssh");
      }
    }
  }
};
/*
TO USE THIS: 
Must have a SSH URI handler set in registry on windows to open putty like this:

----------------
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
@="%%ProgramFiles%%\\PuTTY\\putty.exe"

[HKEY_CLASSES_ROOT\ssh\shell]

[HKEY_CLASSES_ROOT\ssh\shell\open]

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -Command \"$val='%l'; $val = $val.TrimEnd('/');if ($val.StartsWith('ssh://')) { $val = $val.SubString(6) }; & 'C:\\Program Files\\PuTTY\\putty.exe' \"$val\"\""


----------------

Also in putty need to set default to use pagent agent and then open the keys in KeePass so relies on a lot specific to us but it works great
https://documentation.help/PuTTY/config-saving.html#S4.1.2


*/
</script>
