Allow changing network name in private mode with lockNetwork

This commit is contained in:
Pavel Djundik 2020-07-08 14:32:45 +03:00
parent 5fcfcf4f23
commit c21ccad823
2 changed files with 22 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,19 @@
</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>
</template>
<h2>User preferences</h2>
<div class="connect-row">

View file

@ -120,7 +120,12 @@ Network.prototype.validate = function (client) {
return false;
}
this.name = Helper.config.defaults.name;
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;