Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:

permissions:
contents: read
Expand All @@ -11,13 +12,13 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
cache: true
- run: dotnet publish -r win-x64 -c Release
- uses: actions/upload-artifact@v7
with:
name: blis-ng-exe
path: bin/Release/net10.0/win-x64/publish/BLIS-NG.exe
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: "10.x"
cache: true
- run: dotnet publish -r win-x64 -c Release
- uses: actions/upload-artifact@v7
with:
name: blis-ng-exe
path: bin/Release/net10.0/win-x64/publish/BLIS-NG.exe
10 changes: 5 additions & 5 deletions App.axaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BLIS_NG"
RequestedThemeVariant="Light"
x:Class="BLIS_NG.App">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BLIS_NG"
RequestedThemeVariant="Light"
x:Class="BLIS_NG.App">

<Application.Styles>
<FluentTheme/>
<FluentTheme />
</Application.Styles>
</Application>
34 changes: 13 additions & 21 deletions BLIS-NG.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>BLIS_NG</RootNamespace>

<CoreCompileDependsOn>PrepareResources;$(CompileDependsOn)</CoreCompileDependsOn>

<ApplicationManifest>app.manifest</ApplicationManifest>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -27,6 +29,17 @@
<None Remove=".gitignore" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Lang\Resources.resx">
<Generator>MSBuild:Compile</Generator>
<PublicClass>true</PublicClass>
<StronglyTypedFileName>$(IntermediateOutputPath)\Resources.Designer.cs</StronglyTypedFileName>
<StronglyTypedLanguage>CSharp</StronglyTypedLanguage>
<StronglyTypedNamespace>BLIS_NG.Lang</StronglyTypedNamespace>
<StronglyTypedClassName>Resources</StronglyTypedClassName>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<!--
This helps with theme dll-s trimming.
Expand All @@ -39,10 +52,6 @@
<TrimmableAssembly Include="Avalonia.Themes.Default" />
</ItemGroup>

<PropertyGroup>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="12.0.0" />
<PackageReference Include="Avalonia.Desktop" Version="12.0.0" />
Expand All @@ -63,21 +72,4 @@
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Lang\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Compile Update="Lang\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>


</Project>
20 changes: 11 additions & 9 deletions lang/Resources.resx → Lang/Resources.resx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
Expand Down Expand Up @@ -54,10 +55,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>

<data name="App_Title" xml:space="preserve">
Expand All @@ -66,14 +69,13 @@
<data name="App_Version_Format" xml:space="preserve">
<value>BLIS for Windows {0}</value>
</data>
<data name="App_Tagline_Line1" xml:space="preserve">
<value>A Joint Initiative of</value>
</data>
<data name="App_Tagline_Line2" xml:space="preserve">
<value>C4G at Georgia Tech, the CDC, and participating countries.</value>
<data name="App_Tagline" xml:space="preserve">
<value>A Joint Initiative of C4G at Georgia Tech,
the CDC, and participating countries.</value>
</data>
<data name="App_LicenseNotice" xml:space="preserve">
<value>C4G BLIS has been licensed under the GNU General Public License version 3. For more information, visit blis.cc.gatech.edu.</value>
<value>C4G BLIS has been licensed under the GNU General Public License version 3.
For more information, visit blis.cc.gatech.edu.</value>
</data>
<data name="Button_StartBlis" xml:space="preserve">
<value>Start BLIS</value>
Expand Down
16 changes: 13 additions & 3 deletions ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ public MainWindowViewModel(IApplicationLifetime? lifetime, ServerControlViewMode
ApplicationLifetime = lifetime;
ServerControlViewModel = serverControlViewModel;

// // Start BLIS on app start
// ServerControlViewModel.HandleStartButtonClick();
// WindowState = WindowState.Minimized;
// BLIS doesn't (yet) run on non-Windows platforms,
// so don't attempt to open it in the browser if we're not
// on Windows.
if (OperatingSystem.IsWindows())
{
// Start BLIS on app start
ServerControlViewModel.HandleStartButtonClick();

// macOS implementation note: if the application starts minimized,
// the launcher window will fail to render properly.
// So if this is ever enabled for macOS... don't start minimized.
WindowState = WindowState.Minimized;
}
}

public bool Shutdown()
Expand Down
5 changes: 3 additions & 2 deletions ViewModels/ServerControlViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void HandleStartButtonClick()

public async void HandleStopButtonClick()
{
if (StopBlisEnabled) {
if (StopBlisEnabled)
{
await mainServer.Stop();
}
}
Expand All @@ -91,7 +92,7 @@ private void HealthcheckAndUpdateStatus(MainServer.ServerStatus serverStatus)
StartBlisEnabled = true;
StopBlisEnabled = false;
ProbablyRunning = true;
}
}
else if (serverStatus.Apache2 == MainServer.State.Stopping || serverStatus.MySql == MainServer.State.Stopping)
{
Status = Resources.Status_Stopping;
Expand Down
72 changes: 36 additions & 36 deletions Views/MainWindow.axaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:BLIS_NG.ViewModels"
xmlns:lang="using:BLIS_NG.Lang"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="360"
x:CompileBindings="True"
x:DataType="vm:MainWindowViewModel"
x:Class="BLIS_NG.Views.MainWindow"
Title="{Binding WindowTitle}"
WindowState="{Binding WindowState}"
Padding="10"
Height="360"
Width="640"
CanResize="False">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:BLIS_NG.ViewModels"
xmlns:lang="using:BLIS_NG.Lang"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="360"
x:CompileBindings="True"
x:DataType="vm:MainWindowViewModel"
x:Class="BLIS_NG.Views.MainWindow"
Title="{Binding WindowTitle}"
WindowState="{Binding WindowState}"
Padding="10"
Height="360"
Width="640"
CanResize="False">

<!--We are using Compiled bindings. This is not mandatory but makes life easier. Read more about it here:-->
<!-- https://docs.avaloniaui.net/docs/basics/data/data-binding/compiled-bindings -->
<!--We
are using Compiled bindings. This is not mandatory but makes life easier. Read more about it
here:-->
<!-- https://docs.avaloniaui.net/docs/basics/data/data-binding/compiled-bindings -->

<Design.DataContext>
<vm:MainWindowViewModel/>
<Design.DataContext>
<vm:MainWindowViewModel />
</Design.DataContext>

<Grid
DataContext="{Binding ServerControlViewModel}"
<Grid
DataContext="{Binding ServerControlViewModel}"
ColumnDefinitions="*,*,*,*,*"
RowDefinitions="*,*,*,*,*"
RowDefinitions="*,*,*,Auto,*"
>
<TextBlock
TextAlignment="Left"
<TextBlock
TextAlignment="Left"
FontWeight="Normal"
FontSize="36"
VerticalAlignment="Center"
Expand All @@ -39,9 +41,9 @@
<Run Text="{x:Static lang:Resources.App_Title}" />
</TextBlock>

<TextBlock
TextAlignment="Left"
FontSize="18"
<TextBlock
TextAlignment="Left"
FontSize="18"
Text="{Binding AppVersion}"
VerticalAlignment="Top"
Grid.Row="1"
Expand All @@ -58,9 +60,7 @@
Grid.Column="0"
Grid.ColumnSpan="5"
>
<Run Text="{x:Static lang:Resources.App_Tagline_Line1}" />
<LineBreak/>
<Run Text="{x:Static lang:Resources.App_Tagline_Line2}" />
<Run Text="{x:Static lang:Resources.App_Tagline}" />
</TextBlock>

<TextBlock
Expand All @@ -83,14 +83,14 @@
>
<TextBlock Width="240" VerticalAlignment="Center" Text="{Binding Status}"></TextBlock>
<Button Width="160"
Command="{Binding StartServerCommand}"
IsEnabled="{Binding StartBlisEnabled}"
Content="{x:Static lang:Resources.Button_StartBlis}" />
Command="{Binding StartServerCommand}"
IsEnabled="{Binding StartBlisEnabled}"
Content="{x:Static lang:Resources.Button_StartBlis}" />

<Button Width="160"
Command="{Binding StopServerCommand}"
IsEnabled="{Binding StopBlisEnabled}"
Content="{x:Static lang:Resources.Button_StopBlis}" />
Command="{Binding StopServerCommand}"
IsEnabled="{Binding StopBlisEnabled}"
Content="{x:Static lang:Resources.Button_StopBlis}" />

</StackPanel>
</Grid>
Expand Down
30 changes: 0 additions & 30 deletions lang/resources.cs

This file was deleted.

Loading