Merge pull request #3977 from thelounge/xpaw/allow-private-lock-name

Allow changing network name in private mode with lockNetwork
This commit is contained in:
Pavel Djundik 2020-07-09 11:17:31 +03:00 committed by GitHub
commit d0d3a205b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 2 deletions

View File

@ -11,7 +11,9 @@
</template>
<template v-else>
Connect
<template v-if="config.lockNetwork">to {{ defaults.name }}</template>
<template v-if="config.lockNetwork && $store.state.serverConfiguration.public">
to {{ defaults.name }}
</template>
</template>
</h1>
<template v-if="!config.lockNetwork">
@ -97,6 +99,36 @@
</div>
</div>
</template>
<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>
<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>
</template>
<h2>User preferences</h2>
<div class="connect-row">

View File

@ -120,7 +120,12 @@ Network.prototype.validate = function (client) {
return false;
}
if (Helper.config.public) {
this.name = Helper.config.defaults.name;
// Sync lobby channel name
this.channels[0].name = Helper.config.defaults.name;
}
this.host = Helper.config.defaults.host;
this.port = Helper.config.defaults.port;
this.tls = Helper.config.defaults.tls;