mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 15:40:56 +01:00
Add API bindings for heartbeat seconds
This commit is contained in:
@@ -132,6 +132,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
result.SoftRestart = rstate == RebootState.Restart;
|
||||
result.SoftShutdown = rstate == RebootState.Shutdown;
|
||||
result.StartupTimeout = settings.StartupTimeout;
|
||||
result.HeartbeatSeconds = settings.HeartbeatSeconds;
|
||||
}
|
||||
|
||||
if (revision)
|
||||
@@ -170,7 +171,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
/// <response code="200">Settings applied successfully.</response>
|
||||
/// <response code="410">Instance no longer available.</response>
|
||||
[HttpPost]
|
||||
[TgsAuthorize(DreamDaemonRights.SetAutoStart | DreamDaemonRights.SetPorts | DreamDaemonRights.SetSecurity | DreamDaemonRights.SetWebClient | DreamDaemonRights.SoftRestart | DreamDaemonRights.SoftShutdown | DreamDaemonRights.Start | DreamDaemonRights.SetStartupTimeout)]
|
||||
[TgsAuthorize(DreamDaemonRights.SetAutoStart | DreamDaemonRights.SetPorts | DreamDaemonRights.SetSecurity | DreamDaemonRights.SetWebClient | DreamDaemonRights.SoftRestart | DreamDaemonRights.SoftShutdown | DreamDaemonRights.Start | DreamDaemonRights.SetStartupTimeout | DreamDaemonRights.SetHeartbeatInterval)]
|
||||
[ProducesResponseType(typeof(DreamDaemon), 200)]
|
||||
[ProducesResponseType(410)]
|
||||
#pragma warning disable CA1502 // TODO: Decomplexify
|
||||
@@ -219,7 +220,8 @@ namespace Tgstation.Server.Host.Controllers
|
||||
|| CheckModified(x => x.SecurityLevel, DreamDaemonRights.SetSecurity)
|
||||
|| CheckModified(x => x.SoftRestart, DreamDaemonRights.SoftRestart)
|
||||
|| CheckModified(x => x.SoftShutdown, DreamDaemonRights.SoftShutdown)
|
||||
|| CheckModified(x => x.StartupTimeout, DreamDaemonRights.SetStartupTimeout))
|
||||
|| CheckModified(x => x.StartupTimeout, DreamDaemonRights.SetStartupTimeout)
|
||||
|| CheckModified(x => x.HeartbeatSeconds, DreamDaemonRights.SetHeartbeatInterval))
|
||||
return Forbid();
|
||||
|
||||
if (current.PrimaryPort == current.SecondaryPort)
|
||||
|
||||
@@ -237,7 +237,8 @@ namespace Tgstation.Server.Host.Controllers
|
||||
SecurityLevel = DreamDaemonSecurity.Safe,
|
||||
SoftRestart = false,
|
||||
SoftShutdown = false,
|
||||
StartupTimeout = 20
|
||||
StartupTimeout = 20,
|
||||
HeartbeatSeconds = 60
|
||||
},
|
||||
DreamMakerSettings = new DreamMakerSettings
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user