2019-03-01 13:29:00 +00:00
|
|
|
<template>
|
2019-08-03 19:03:45 +00:00
|
|
|
<div id="connect" class="window" role="tabpanel" aria-label="Connect">
|
2019-03-01 13:29:00 +00:00
|
|
|
<div class="header">
|
2019-04-13 20:44:04 +00:00
|
|
|
<SidebarToggle />
|
2019-03-01 13:29:00 +00:00
|
|
|
</div>
|
2019-08-03 19:03:45 +00:00
|
|
|
<form class="container" method="post" action="" @submit.prevent="onSubmit">
|
2019-12-12 11:20:07 +00:00
|
|
|
<h1 class="title">
|
|
|
|
<template v-if="defaults.uuid">
|
2020-04-06 08:42:10 +00:00
|
|
|
<input v-model="defaults.uuid" type="hidden" name="uuid" />
|
2019-12-12 11:20:07 +00:00
|
|
|
Edit {{ defaults.name }}
|
2019-03-01 13:29:00 +00:00
|
|
|
</template>
|
2019-12-12 11:20:07 +00:00
|
|
|
<template v-else>
|
|
|
|
Connect
|
2020-07-08 11:32:45 +00:00
|
|
|
<template v-if="config.lockNetwork && $store.state.serverConfiguration.public">
|
|
|
|
to {{ defaults.name }}
|
|
|
|
</template>
|
2019-12-12 11:20:07 +00:00
|
|
|
</template>
|
|
|
|
</h1>
|
2020-03-31 17:03:40 +00:00
|
|
|
<template v-if="!config.lockNetwork">
|
2019-12-12 11:20:07 +00:00
|
|
|
<h2>Network settings</h2>
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:name">Name</label>
|
2019-03-01 13:29:00 +00:00
|
|
|
<input
|
2019-12-12 11:20:07 +00:00
|
|
|
id="connect:name"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.name"
|
2019-12-12 11:20:07 +00:00
|
|
|
class="input"
|
|
|
|
name="name"
|
2019-03-01 13:29:00 +00:00
|
|
|
maxlength="100"
|
2019-08-03 19:03:45 +00:00
|
|
|
/>
|
2019-03-01 13:29:00 +00:00
|
|
|
</div>
|
2019-12-12 11:20:07 +00:00
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:host">Server</label>
|
|
|
|
<div class="input-wrap">
|
2019-03-01 13:29:00 +00:00
|
|
|
<input
|
2019-12-12 11:20:07 +00:00
|
|
|
id="connect:host"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.host"
|
2019-12-12 11:20:07 +00:00
|
|
|
class="input"
|
|
|
|
name="host"
|
|
|
|
aria-label="Server address"
|
|
|
|
maxlength="255"
|
|
|
|
required
|
2019-08-03 19:03:45 +00:00
|
|
|
/>
|
2019-12-12 11:20:07 +00:00
|
|
|
<span id="connect:portseparator">:</span>
|
2019-03-01 13:29:00 +00:00
|
|
|
<input
|
2019-12-12 11:20:07 +00:00
|
|
|
id="connect:port"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.port"
|
2019-03-01 13:29:00 +00:00
|
|
|
class="input"
|
2019-12-12 11:20:07 +00:00
|
|
|
type="number"
|
|
|
|
min="1"
|
|
|
|
max="65535"
|
|
|
|
name="port"
|
|
|
|
aria-label="Server port"
|
2019-08-03 19:03:45 +00:00
|
|
|
/>
|
2019-12-12 11:20:07 +00:00
|
|
|
</div>
|
2019-03-01 13:29:00 +00:00
|
|
|
</div>
|
2020-03-31 08:02:18 +00:00
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:password">Password</label>
|
|
|
|
<RevealPassword
|
|
|
|
v-slot:default="slotProps"
|
|
|
|
class="input-wrap password-container"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
id="connect:password"
|
|
|
|
v-model="defaults.password"
|
|
|
|
class="input"
|
|
|
|
:type="slotProps.isVisible ? 'text' : 'password'"
|
|
|
|
placeholder="Server password (optional)"
|
|
|
|
name="password"
|
|
|
|
maxlength="300"
|
|
|
|
/>
|
|
|
|
</RevealPassword>
|
|
|
|
</div>
|
2019-12-12 11:20:07 +00:00
|
|
|
<div class="connect-row">
|
|
|
|
<label></label>
|
|
|
|
<div class="input-wrap">
|
|
|
|
<label class="tls">
|
|
|
|
<input
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.tls"
|
2019-12-12 11:20:07 +00:00
|
|
|
type="checkbox"
|
|
|
|
name="tls"
|
2020-04-06 08:42:10 +00:00
|
|
|
:disabled="defaults.hasSTSPolicy"
|
2019-12-12 11:20:07 +00:00
|
|
|
/>
|
|
|
|
Use secure connection (TLS)
|
2020-02-19 11:26:43 +00:00
|
|
|
<span
|
|
|
|
v-if="defaults.hasSTSPolicy"
|
|
|
|
class="tooltipped tooltipped-n tooltipped-no-delay"
|
|
|
|
aria-label="This network has a strict transport security policy, you will be unable to disable TLS"
|
|
|
|
>🔒 STS</span
|
|
|
|
>
|
2019-12-12 11:20:07 +00:00
|
|
|
</label>
|
|
|
|
<label class="tls">
|
|
|
|
<input
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.rejectUnauthorized"
|
2019-12-12 11:20:07 +00:00
|
|
|
type="checkbox"
|
|
|
|
name="rejectUnauthorized"
|
|
|
|
/>
|
|
|
|
Only allow trusted certificates
|
|
|
|
</label>
|
|
|
|
</div>
|
2019-03-01 13:29:00 +00:00
|
|
|
</div>
|
2021-05-06 00:06:00 +00:00
|
|
|
|
|
|
|
<h2>Proxy Settings</h2>
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:proxyHost">SOCKS Address</label>
|
|
|
|
<div class="input-wrap">
|
|
|
|
<input
|
|
|
|
id="connect:proxyHost"
|
|
|
|
v-model="defaults.proxyHost"
|
|
|
|
class="input"
|
|
|
|
name="proxyHost"
|
|
|
|
aria-label="Proxy host"
|
|
|
|
maxlength="255"
|
|
|
|
/>
|
|
|
|
<span id="connect:proxyPortSeparator">:</span>
|
|
|
|
<input
|
|
|
|
id="connect:proxyPort"
|
|
|
|
v-model="defaults.proxyPort"
|
|
|
|
class="input"
|
|
|
|
type="number"
|
|
|
|
min="1"
|
|
|
|
max="65535"
|
|
|
|
name="proxyPort"
|
|
|
|
aria-label="SOCKS port"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:proxyUsername">Proxy username</label>
|
|
|
|
<input
|
|
|
|
id="connect:proxyUsername"
|
|
|
|
ref="proxyUsernameInput"
|
|
|
|
v-model="defaults.proxyUsername"
|
|
|
|
class="input username"
|
|
|
|
name="proxyUsername"
|
|
|
|
maxlength="100"
|
|
|
|
placeholder="Proxy username"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:proxyPassword">Proxy password</label>
|
|
|
|
<RevealPassword
|
|
|
|
v-slot:default="slotProps"
|
|
|
|
class="input-wrap password-container"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
id="connect:proxyPassword"
|
|
|
|
ref="proxyPassword"
|
|
|
|
v-model="defaults.proxyPassword"
|
|
|
|
class="input"
|
|
|
|
:type="slotProps.isVisible ? 'text' : 'password'"
|
|
|
|
placeholder="Proxy password"
|
|
|
|
name="password"
|
|
|
|
maxlength="300"
|
|
|
|
/>
|
|
|
|
</RevealPassword>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="connect-row">
|
|
|
|
<label></label>
|
|
|
|
<div class="input-wrap">
|
|
|
|
<label for="connect:proxyEnabled">
|
|
|
|
<input
|
|
|
|
v-model="defaults.proxyEnabled"
|
|
|
|
type="checkbox"
|
|
|
|
name="proxyEnabled"
|
|
|
|
/>
|
|
|
|
Enable Proxy
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-12 11:20:07 +00:00
|
|
|
</template>
|
2020-07-08 11:32:45 +00:00
|
|
|
<template v-else-if="config.lockNetwork && !$store.state.serverConfiguration.public">
|
|
|
|
<h2>Network settings</h2>
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:name">Name</label>
|
|
|
|
<input
|
|
|
|
id="connect:name"
|
|
|
|
v-model="defaults.name"
|
|
|
|
class="input"
|
|
|
|
name="name"
|
|
|
|
maxlength="100"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-07-08 11:48:01 +00:00
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:password">Password</label>
|
|
|
|
<RevealPassword
|
|
|
|
v-slot:default="slotProps"
|
|
|
|
class="input-wrap password-container"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
id="connect:password"
|
|
|
|
v-model="defaults.password"
|
|
|
|
class="input"
|
|
|
|
:type="slotProps.isVisible ? 'text' : 'password'"
|
|
|
|
placeholder="Server password (optional)"
|
|
|
|
name="password"
|
|
|
|
maxlength="300"
|
|
|
|
/>
|
|
|
|
</RevealPassword>
|
|
|
|
</div>
|
2020-07-08 11:32:45 +00:00
|
|
|
</template>
|
2019-12-12 11:20:07 +00:00
|
|
|
|
|
|
|
<h2>User preferences</h2>
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:nick">Nick</label>
|
|
|
|
<input
|
|
|
|
id="connect:nick"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.nick"
|
2019-12-12 11:20:07 +00:00
|
|
|
class="input nick"
|
|
|
|
name="nick"
|
2020-01-21 13:39:08 +00:00
|
|
|
pattern="[^\s:!@]+"
|
2019-12-12 11:20:07 +00:00
|
|
|
maxlength="100"
|
|
|
|
required
|
|
|
|
@input="onNickChanged"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<template v-if="!config.useHexIp">
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:username">Username</label>
|
2019-03-01 13:29:00 +00:00
|
|
|
<input
|
2019-12-12 11:20:07 +00:00
|
|
|
id="connect:username"
|
|
|
|
ref="usernameInput"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.username"
|
2019-12-12 11:20:07 +00:00
|
|
|
class="input username"
|
|
|
|
name="username"
|
2020-01-21 13:39:08 +00:00
|
|
|
maxlength="100"
|
2019-08-03 19:03:45 +00:00
|
|
|
/>
|
2019-03-01 13:29:00 +00:00
|
|
|
</div>
|
2019-12-12 11:20:07 +00:00
|
|
|
</template>
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:realname">Real name</label>
|
|
|
|
<input
|
|
|
|
id="connect:realname"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.realname"
|
2019-12-12 11:20:07 +00:00
|
|
|
class="input"
|
|
|
|
name="realname"
|
2020-01-21 13:39:08 +00:00
|
|
|
maxlength="300"
|
2019-12-12 11:20:07 +00:00
|
|
|
/>
|
2019-03-01 13:29:00 +00:00
|
|
|
</div>
|
2020-11-25 23:37:46 +00:00
|
|
|
<div class="connect-row">
|
2021-04-05 17:19:36 +00:00
|
|
|
<label for="connect:leaveMessage">Leave message</label>
|
2020-11-25 23:37:46 +00:00
|
|
|
<input
|
|
|
|
id="connect:leaveMessage"
|
|
|
|
v-model="defaults.leaveMessage"
|
2021-04-04 01:28:13 +00:00
|
|
|
autocomplete="off"
|
2020-11-25 23:37:46 +00:00
|
|
|
class="input"
|
|
|
|
name="leaveMessage"
|
2021-02-12 22:07:48 +00:00
|
|
|
placeholder="The Lounge - https://thelounge.chat"
|
2020-11-25 23:37:46 +00:00
|
|
|
/>
|
|
|
|
</div>
|
2020-04-06 08:42:10 +00:00
|
|
|
<template v-if="defaults.uuid && !$store.state.serverConfiguration.public">
|
2019-12-12 11:20:07 +00:00
|
|
|
<div class="connect-row">
|
2020-04-06 08:42:10 +00:00
|
|
|
<label for="connect:commands">
|
|
|
|
Commands
|
|
|
|
<span
|
|
|
|
class="tooltipped tooltipped-ne tooltipped-no-delay"
|
|
|
|
aria-label="One /command per line.
|
|
|
|
Each command will be executed in
|
|
|
|
the server tab on new connection"
|
|
|
|
>
|
|
|
|
<button class="extra-help" />
|
|
|
|
</span>
|
|
|
|
</label>
|
2019-12-12 11:20:07 +00:00
|
|
|
<textarea
|
|
|
|
id="connect:commands"
|
2020-04-06 08:42:10 +00:00
|
|
|
ref="commandsInput"
|
2021-04-04 01:28:13 +00:00
|
|
|
autocomplete="off"
|
2020-04-06 08:42:10 +00:00
|
|
|
:value="defaults.commands ? defaults.commands.join('\n') : ''"
|
2019-12-12 11:20:07 +00:00
|
|
|
class="input"
|
|
|
|
name="commands"
|
2020-04-06 08:42:10 +00:00
|
|
|
@input="resizeCommandsInput"
|
2019-12-12 11:20:07 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</template>
|
2020-04-06 08:42:10 +00:00
|
|
|
<template v-else-if="!defaults.uuid">
|
2019-12-12 11:20:07 +00:00
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:channels">Channels</label>
|
2020-04-06 08:42:10 +00:00
|
|
|
<input
|
|
|
|
id="connect:channels"
|
|
|
|
v-model="defaults.join"
|
|
|
|
class="input"
|
|
|
|
name="join"
|
|
|
|
/>
|
2019-12-12 11:20:07 +00:00
|
|
|
</div>
|
2020-03-31 08:02:18 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-if="$store.state.serverConfiguration.public">
|
2020-03-31 17:03:40 +00:00
|
|
|
<template v-if="config.lockNetwork">
|
2020-03-31 08:02:18 +00:00
|
|
|
<div class="connect-row">
|
|
|
|
<label></label>
|
|
|
|
<div class="input-wrap">
|
|
|
|
<label class="tls">
|
|
|
|
<input v-model="displayPasswordField" type="checkbox" />
|
|
|
|
I have a password
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="displayPasswordField" class="connect-row">
|
|
|
|
<label for="connect:password">Password</label>
|
|
|
|
<RevealPassword
|
|
|
|
v-slot:default="slotProps"
|
|
|
|
class="input-wrap password-container"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
id="connect:password"
|
2020-04-06 08:42:10 +00:00
|
|
|
ref="publicPassword"
|
2020-03-31 08:02:18 +00:00
|
|
|
v-model="defaults.password"
|
|
|
|
class="input"
|
|
|
|
:type="slotProps.isVisible ? 'text' : 'password'"
|
|
|
|
placeholder="Server password (optional)"
|
|
|
|
name="password"
|
|
|
|
maxlength="300"
|
|
|
|
/>
|
|
|
|
</RevealPassword>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<h2 id="label-auth">Authentication</h2>
|
|
|
|
<div class="connect-row connect-auth" role="group" aria-labelledby="label-auth">
|
|
|
|
<label class="opt">
|
|
|
|
<input
|
|
|
|
:checked="!defaults.sasl"
|
|
|
|
type="radio"
|
|
|
|
name="sasl"
|
|
|
|
value=""
|
|
|
|
@change="setSaslAuth('')"
|
|
|
|
/>
|
|
|
|
No authentication
|
|
|
|
</label>
|
|
|
|
<label class="opt">
|
|
|
|
<input
|
|
|
|
:checked="defaults.sasl === 'plain'"
|
|
|
|
type="radio"
|
|
|
|
name="sasl"
|
|
|
|
value="plain"
|
|
|
|
@change="setSaslAuth('plain')"
|
|
|
|
/>
|
|
|
|
Username + password (SASL PLAIN)
|
|
|
|
</label>
|
|
|
|
<label
|
|
|
|
v-if="!$store.state.serverConfiguration.public && defaults.tls"
|
|
|
|
class="opt"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
:checked="defaults.sasl === 'external'"
|
|
|
|
type="radio"
|
|
|
|
name="sasl"
|
|
|
|
value="external"
|
|
|
|
@change="setSaslAuth('external')"
|
|
|
|
/>
|
|
|
|
Client certificate (SASL EXTERNAL)
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<template v-if="defaults.sasl === 'plain'">
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:username">Account</label>
|
|
|
|
<input
|
|
|
|
id="connect:saslAccount"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.saslAccount"
|
2020-03-31 08:02:18 +00:00
|
|
|
class="input"
|
|
|
|
name="saslAccount"
|
|
|
|
maxlength="100"
|
|
|
|
required
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="connect-row">
|
|
|
|
<label for="connect:password">Password</label>
|
|
|
|
<RevealPassword
|
|
|
|
v-slot:default="slotProps"
|
|
|
|
class="input-wrap password-container"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
id="connect:saslPassword"
|
2020-04-06 08:42:10 +00:00
|
|
|
v-model="defaults.saslPassword"
|
2020-03-31 08:02:18 +00:00
|
|
|
class="input"
|
|
|
|
:type="slotProps.isVisible ? 'text' : 'password'"
|
|
|
|
name="saslPassword"
|
|
|
|
maxlength="300"
|
|
|
|
required
|
|
|
|
/>
|
|
|
|
</RevealPassword>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<div v-else-if="defaults.sasl === 'external'" class="connect-sasl-external">
|
2020-08-25 09:49:53 +00:00
|
|
|
<p>The Lounge automatically generates and manages the client certificate.</p>
|
2020-03-31 08:02:18 +00:00
|
|
|
<p>
|
|
|
|
On the IRC server, you will need to tell the services to attach the
|
|
|
|
certificate fingerprint (certfp) to your account, for example:
|
|
|
|
</p>
|
|
|
|
<pre><code>/msg NickServ CERT ADD</code></pre>
|
2019-12-12 11:20:07 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
2020-03-31 08:02:18 +00:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<button type="submit" class="btn" :disabled="disabled ? true : false">
|
|
|
|
<template v-if="defaults.uuid">Save network</template>
|
|
|
|
<template v-else>Connect</template>
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-03-01 13:29:00 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2020-03-31 08:02:18 +00:00
|
|
|
<style>
|
|
|
|
#connect .connect-auth {
|
|
|
|
display: block;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#connect .connect-auth .opt {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
#connect .connect-auth input {
|
|
|
|
margin: 3px 10px 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#connect .connect-sasl-external {
|
|
|
|
padding: 10px;
|
|
|
|
border-radius: 2px;
|
|
|
|
background-color: #d9edf7;
|
|
|
|
color: #31708f;
|
|
|
|
}
|
|
|
|
|
|
|
|
#connect .connect-sasl-external pre {
|
|
|
|
margin: 0;
|
|
|
|
user-select: text;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2019-03-01 13:29:00 +00:00
|
|
|
<script>
|
|
|
|
import RevealPassword from "./RevealPassword.vue";
|
2019-04-13 20:44:04 +00:00
|
|
|
import SidebarToggle from "./SidebarToggle.vue";
|
2019-03-01 13:29:00 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "NetworkForm",
|
|
|
|
components: {
|
|
|
|
RevealPassword,
|
2019-04-13 20:44:04 +00:00
|
|
|
SidebarToggle,
|
2019-03-01 13:29:00 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
handleSubmit: Function,
|
|
|
|
defaults: Object,
|
|
|
|
disabled: Boolean,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2019-11-02 19:40:59 +00:00
|
|
|
config: this.$store.state.serverConfiguration,
|
2019-11-08 19:41:27 +00:00
|
|
|
previousUsername: this.defaults.username,
|
2020-03-31 08:02:18 +00:00
|
|
|
displayPasswordField: false,
|
2019-03-01 13:29:00 +00:00
|
|
|
};
|
|
|
|
},
|
2020-04-06 08:42:10 +00:00
|
|
|
watch: {
|
|
|
|
displayPasswordField(value) {
|
|
|
|
if (value) {
|
|
|
|
this.$nextTick(() => this.$refs.publicPassword.focus());
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"defaults.commands"() {
|
|
|
|
this.$nextTick(this.resizeCommandsInput);
|
|
|
|
},
|
|
|
|
"defaults.tls"(isSecureChecked) {
|
|
|
|
const ports = [6667, 6697];
|
|
|
|
const newPort = isSecureChecked ? 0 : 1;
|
|
|
|
|
|
|
|
// If you disable TLS and current port is 6697,
|
|
|
|
// set it to 6667, and vice versa
|
|
|
|
if (this.defaults.port === ports[newPort]) {
|
|
|
|
this.defaults.port = ports[1 - newPort];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2019-03-01 13:29:00 +00:00
|
|
|
methods: {
|
2020-03-31 08:02:18 +00:00
|
|
|
setSaslAuth(type) {
|
|
|
|
this.defaults.sasl = type;
|
|
|
|
},
|
2019-11-08 19:41:27 +00:00
|
|
|
onNickChanged(event) {
|
2020-01-03 17:51:38 +00:00
|
|
|
// Username input is not available when useHexIp is set
|
|
|
|
if (!this.$refs.usernameInput) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-11-08 19:41:27 +00:00
|
|
|
if (
|
|
|
|
!this.$refs.usernameInput.value ||
|
|
|
|
this.$refs.usernameInput.value === this.previousUsername
|
|
|
|
) {
|
|
|
|
this.$refs.usernameInput.value = event.target.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.previousUsername = event.target.value;
|
|
|
|
},
|
2019-03-01 13:29:00 +00:00
|
|
|
onSubmit(event) {
|
|
|
|
const formData = new FormData(event.target);
|
|
|
|
const data = {};
|
|
|
|
|
|
|
|
for (const item of formData.entries()) {
|
|
|
|
data[item[0]] = item[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
this.handleSubmit(data);
|
|
|
|
},
|
2020-04-06 08:42:10 +00:00
|
|
|
resizeCommandsInput() {
|
|
|
|
if (!this.$refs.commandsInput) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reset height first so it can down size
|
|
|
|
this.$refs.commandsInput.style.height = "";
|
|
|
|
|
|
|
|
// 2 pixels to account for the border
|
|
|
|
this.$refs.commandsInput.style.height =
|
|
|
|
Math.ceil(this.$refs.commandsInput.scrollHeight + 2) + "px";
|
|
|
|
},
|
2019-03-01 13:29:00 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|