mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 23:24:52 +09:00
allow to revoke host tokens from web ui (#511)
* allow to revoke / restore host access from web ui * refector to what is expected * remove core.admin check on HostViewPage.tsx * update core.host.revoke_token description
This commit is contained in:
1 parent
838170a9ff
commit
e2dea35e02
11 files changed
+120
-10
No files matched your search
@@ -15,6 +15,7 @@ export interface HostInfo {
|
||||
version: string;
|
||||
plugins: [number, any][];
|
||||
public_address: string | undefined;
|
||||
token_valid_after?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,6 +46,8 @@ export default class HostConnection extends BaseConnection {
|
||||
this.plugins = new Map(Object.entries(registerData.plugins));
|
||||
this._checkPluginVersions();
|
||||
|
||||
let currentHostInfo = this._controller.hosts!.get(this._id)
|
||||
|
||||
this._controller.hosts!.set(this._id, {
|
||||
agent: this._agent,
|
||||
id: this._id,
|
||||
@@ -52,6 +55,7 @@ export default class HostConnection extends BaseConnection {
|
||||
version: this._version,
|
||||
public_address: registerData.publicAddress,
|
||||
plugins: registerData.plugins,
|
||||
token_valid_after: currentHostInfo?.token_valid_after,
|
||||
});
|
||||
|
||||
for (let event of ["connect", "drop", "resume", "close"] as const) {
|
||||
|
||||
Reference in new issue
Block a user