mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 07:24:53 +09:00
Add generate slave token button
Add a generate slave token button to the web interface and modify the generateSlaveToken message and corresponding ctl command to have the slave id be optional. The random id is the desired behavior when adding a slave with the installer, as it'll ask for the token for the new slave and deduce the id from the token.
This commit is contained in:
1 parent
cc562a451e
commit
fc08438164
5 files changed
+81
-7
No files matched your search
@@ -130,7 +130,11 @@ class ControlConnection extends BaseConnection {
|
||||
}
|
||||
|
||||
async generateSlaveTokenRequestHandler(message) {
|
||||
return { token: this.generateSlaveToken(message.data.slave_id) };
|
||||
let slaveId = message.data.slave_id;
|
||||
if (slaveId === null) {
|
||||
slaveId = Math.random() * 2**31 | 0;
|
||||
}
|
||||
return { token: this.generateSlaveToken(slaveId) };
|
||||
}
|
||||
|
||||
async createSlaveConfigRequestHandler(message) {
|
||||
|
||||
Reference in new issue
Block a user