Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Update to latest client
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed May 28, 2023
1 parent 79460f1 commit 75995c7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
<TargetFramework>net6.0</TargetFramework>
<Version>4.0.0</Version>
<Version>4.1.0</Version>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand Down Expand Up @@ -66,15 +66,15 @@
</AvaloniaXaml>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.18" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
<PackageReference Include="Octokit" Version="5.0.2" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="Avalonia" Version="0.10.21" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.21" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.21" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.21" />
<PackageReference Include="Octokit" Version="6.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="7.0.1" />
<PackageReference Include="TextCopy" Version="6.2.1" />
<PackageReference Include="Tgstation.Server.Client" Version="11.2.1" />
<PackageReference Include="Tgstation.Server.Client" Version="11.4.2" />
</ItemGroup>
<ItemGroup>
<Compile Update="Views\Pages\AddUserGroup.xaml.cs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public DreamDaemonResponse Model
this.RaisePropertyChanged(nameof(ClearSoft));
this.RaisePropertyChanged(nameof(CanSoftRestart));
this.RaisePropertyChanged(nameof(CanSoftStop));
this.RaisePropertyChanged(nameof(LogOutput));

onRunningChanged(model?.Status != WatchdogStatus.Offline);
}
Expand All @@ -76,6 +77,7 @@ public DreamDaemonResponse Model
public string StopWord => confirmingShutdown ? "Confirm?" : "Stop Server";

public string WebClient => (Model?.CurrentAllowWebclient ?? Model?.AllowWebClient)?.ToString(CultureInfo.InvariantCulture) ?? "Unknown";

public string Port => (Model?.CurrentPort ?? Model?.Port)?.ToString(CultureInfo.InvariantCulture) ?? "Unknown";
public string Graceful => Model == null || !CanRevision ? "Unknown" : Model.SoftRestart.Value ? "Restart" : Model.SoftShutdown.Value ? "Stop" : "None";

Expand Down Expand Up @@ -130,6 +132,12 @@ public bool SoftRestart
set => this.RaiseAndSetIfChanged(ref softRestart, value);
}

public bool LogOutput
{
get => softRestart;
set => this.RaiseAndSetIfChanged(ref softRestart, value);
}

public bool SoftStop
{
get => softStop;
Expand Down Expand Up @@ -217,6 +225,12 @@ public bool NewAllowWebClient
set => this.RaiseAndSetIfChanged(ref newAllowWebClient, value);
}

public bool NewLogOutput
{
get => newLogOutput;
set => this.RaiseAndSetIfChanged(ref newLogOutput, value);
}

public bool NewAutoStart
{
get => newAutoStart;
Expand All @@ -243,6 +257,7 @@ public bool NewAutoProfile
public bool CanAutoStart => rightsProvider.DreamDaemonRights.HasFlag(DreamDaemonRights.SetAutoStart);
public bool CanSecurity => rightsProvider.DreamDaemonRights.HasFlag(DreamDaemonRights.SetSecurity);
public bool CanWebClient => rightsProvider.DreamDaemonRights.HasFlag(DreamDaemonRights.SetWebClient);
public bool CanLogOutput => rightsProvider.DreamDaemonRights.HasFlag(DreamDaemonRights.SetLogOutput);
public bool CanTimeout => rightsProvider.DreamDaemonRights.HasFlag(DreamDaemonRights.SetStartupTimeout);
public bool CanTopic => rightsProvider.DreamDaemonRights.HasFlag(DreamDaemonRights.SetTopicTimeout);
public bool CanSoftRestart => rightsProvider.DreamDaemonRights.HasFlag(DreamDaemonRights.SoftRestart);
Expand Down Expand Up @@ -285,6 +300,7 @@ public bool NewAutoProfile
ushort newPrimaryPort;
bool newAutoStart;
bool newAllowWebClient;
bool newLogOutput;
bool newDumpOnHeartbeatRestart;
bool newAutoProfile;

Expand Down Expand Up @@ -329,6 +345,7 @@ public DreamDaemonViewModel(PageContextViewModel pageContext, IDreamDaemonClient
this.RaisePropertyChanged(nameof(CanAutoStart));
this.RaisePropertyChanged(nameof(CanSecurity));
this.RaisePropertyChanged(nameof(CanWebClient));
this.RaisePropertyChanged(nameof(CanLogOutput));
this.RaisePropertyChanged(nameof(CanTimeout));
this.RaisePropertyChanged(nameof(CanSoftRestart));
this.RaisePropertyChanged(nameof(CanSoftStop));
Expand Down Expand Up @@ -367,6 +384,7 @@ void LoadModel(DreamDaemonResponse model)
NewPrimaryPort = Model.Port ?? 0;
NewAutoStart = Model.AutoStart ?? false;
NewAllowWebClient = Model.AllowWebClient ?? false;
NewLogOutput = Model.LogOutput ?? false;
NewDumpOnHeartbeatRestart = Model.DumpOnHeartbeatRestart ?? false;
NewAutoProfile = Model.StartProfiler ?? false;
NewAdditionalParams = Model.AdditionalParameters ?? string.Empty;
Expand Down Expand Up @@ -473,6 +491,7 @@ async void ResetShutdown()
var newModel = new DreamDaemonRequest
{
AllowWebClient = CanWebClient && Model.AllowWebClient != NewAllowWebClient ? (bool?)NewAllowWebClient : null,
LogOutput = CanLogOutput && Model.LogOutput != NewLogOutput ? (bool)NewLogOutput : null,
AutoStart = CanAutoStart && Model.AutoStart != NewAutoStart ? (bool?)NewAutoStart : null,
Port = CanPort && NewPrimaryPort != Model.Port ? (ushort?)NewPrimaryPort : null,
SecurityLevel = CanSecurity && Model.SecurityLevel != initalSecurityLevel ? Model.SecurityLevel : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,19 @@ public bool DDAutoProfile
}
}

public bool DDLogOutput
{
get => newDreamDaemonRights.HasFlag(DreamDaemonRights.SetLogOutput);
set
{
var right = DreamDaemonRights.SetLogOutput;
if (value)
newDreamDaemonRights |= right;
else
newDreamDaemonRights &= ~right;
}
}

public bool ChatEnable
{
get => newChatBotRights.HasFlag(ChatBotRights.WriteEnabled);
Expand Down Expand Up @@ -937,6 +950,7 @@ void PostLoad()
this.RaisePropertyChanged(nameof(DDStart));
this.RaisePropertyChanged(nameof(DDTime));
this.RaisePropertyChanged(nameof(DDAutoProfile));
this.RaisePropertyChanged(nameof(DDLogOutput));

this.RaisePropertyChanged(nameof(ChatEnable));
this.RaisePropertyChanged(nameof(ChatProvider));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<DockPanel Grid.Column="0" Grid.Row="0" Margin="2">
<CheckBox Background="White" IsChecked="{Binding DDRead, Mode=TwoWay}"/>
Expand Down Expand Up @@ -301,6 +302,10 @@
<CheckBox Background="White" IsChecked="{Binding DDAutoProfile, Mode=TwoWay}"/>
<TextBlock DockPanel.Dock="Right" Text="Set Automatic Profiler" Margin="5,4,0,0" />
</DockPanel>
<DockPanel Grid.Column="0" Grid.Row="9" Margin="2">
<CheckBox Background="White" IsChecked="{Binding DDLogOutput, Mode=TwoWay}"/>
<TextBlock DockPanel.Dock="Right" Text="Set Log Output" Margin="5,4,0,0" />
</DockPanel>
</Grid>
<Rectangle HorizontalAlignment="Stretch" Fill="#A0A0A0" Height="1" Margin="0,5,0,0"/>
<Rectangle HorizontalAlignment="Stretch" Fill="#FFFFFF" Height="1" Margin="0,0,0,5"/>
Expand Down
5 changes: 5 additions & 0 deletions src/Tgstation.Server.ControlPanel/Views/Pages/Watchdog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Public Game Port:" Grid.Row="0" Grid.Column="0"/>
<NumericUpDown Minimum="1" Maximum="65535" IsEnabled="{Binding CanPort}" Value="{Binding NewPrimaryPort}" Grid.Row="0" Grid.Column="1"/>
Expand All @@ -103,6 +107,7 @@
<NumericUpDown Minimum="1" ToolTip.Tip="TGS communicates to DreamDaemon via invoking /world/Topic with forged packets. This is the timeout for all of those operations.." Value="{Binding NewTopicTimeout}" Grid.Column="1" Grid.Row="9" IsEnabled="{Binding CanTopic}" />
<TextBlock Grid.Column="0" Text="Additional Params:" Grid.Row="11"/>
<TextBox Text="{Binding NewAdditionalParams}" IsEnabled="{Binding CanAdditionalParams}" Margin="5,0,0,0" Grid.Column="1" Grid.Row="11"/>
<CheckBox Content="Write DreamDaemon Output to File" Grid.Column="0" Grid.Row="13" IsChecked="{Binding NewLogOutput}" IsEnabled="{Binding CanLogOutput}" Background="White"/>
</Grid>
<Grid Margin="0,5,0,0">
<Grid.RowDefinitions>
Expand Down

0 comments on commit 75995c7

Please sign in to comment.