From a9dd8556a357076fdff06ee6edf88aa09533499b Mon Sep 17 00:00:00 2001 From: lovelace545 <66050096+lovelace545@users.noreply.github.com> Date: Mon, 16 Sep 2024 01:55:11 +0800 Subject: [PATCH 1/8] Create dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 115 +++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/dotnet-desktop.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml new file mode 100644 index 0000000..e718dd9 --- /dev/null +++ b/.github/workflows/dotnet-desktop.yml @@ -0,0 +1,115 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow will build, test, sign and package a WPF or Windows Forms desktop application +# built on .NET Core. +# To learn how to migrate your existing application to .NET Core, +# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework +# +# To configure this workflow: +# +# 1. Configure environment variables +# GitHub sets default environment variables for every workflow run. +# Replace the variables relative to your project in the "env" section below. +# +# 2. Signing +# Generate a signing certificate in the Windows Application +# Packaging Project or add an existing signing certificate to the project. +# Next, use PowerShell to encode the .pfx file using Base64 encoding +# by running the following Powershell script to generate the output string: +# +# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte +# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' +# +# Open the output file, SigningCertificate_Encoded.txt, and copy the +# string inside. Then, add the string to the repo as a GitHub secret +# and name it "Base64_Encoded_Pfx." +# For more information on how to configure your signing certificate for +# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing +# +# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". +# See "Build the Windows Application Packaging project" below to see how the secret is used. +# +# For more information on GitHub Actions, refer to https://github.com/features/actions +# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, +# refer to https://github.com/microsoft/github-actions-for-desktop-apps + +name: .NET Core Desktop + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + strategy: + matrix: + configuration: [Debug, Release] + + runs-on: windows-latest # For a list of available runner types, refer to + # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + + env: + Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln. + Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. + Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. + Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Install the .NET Core workload + - name: Install .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v2 + + # Execute all unit tests in the solution + - name: Execute unit tests + run: dotnet test + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + env: + Configuration: ${{ matrix.configuration }} + + # Decode the base 64 encoded pfx and save the Signing_Certificate + - name: Decode the pfx + run: | + $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") + $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx + [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) + + # Create the app package by building and packaging the Windows Application Packaging project + - name: Create the app package + run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} + env: + Appx_Bundle: Always + Appx_Bundle_Platforms: x86|x64 + Appx_Package_Build_Mode: StoreUpload + Configuration: ${{ matrix.configuration }} + + # Remove the pfx + - name: Remove the pfx + run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx + + # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: MSIX Package + path: ${{ env.Wap_Project_Directory }}\AppPackages From 6af5b23c2ca0f5bfcd2616605d58ae60c8cf540a Mon Sep 17 00:00:00 2001 From: lovelace545 <66050096+lovelace545@users.noreply.github.com> Date: Mon, 16 Sep 2024 02:07:25 +0800 Subject: [PATCH 2/8] Update dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index e718dd9..0703d70 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -56,8 +56,8 @@ jobs: # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on env: - Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. + Solution_Name: IPAM-NOTE.sln # Replace with your solution name, i.e. MyWpfApp.sln. + Test_Project_Path: IPAM-NOTE.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. From 08d684a2f3a88c9cf46198687e0170ef93ecf41c Mon Sep 17 00:00:00 2001 From: lovelace545 <66050096+lovelace545@users.noreply.github.com> Date: Mon, 16 Sep 2024 02:14:13 +0800 Subject: [PATCH 3/8] Create dotnet.yml --- .github/workflows/dotnet.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..c62b908 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,28 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal From 81bf47203d74da1245c643f0633d216c2f243516 Mon Sep 17 00:00:00 2001 From: lovelace545 <66050096+lovelace545@users.noreply.github.com> Date: Mon, 16 Sep 2024 02:15:29 +0800 Subject: [PATCH 4/8] Delete .github/workflows directory --- .github/workflows/dotnet-desktop.yml | 115 --------------------------- .github/workflows/dotnet.yml | 28 ------- 2 files changed, 143 deletions(-) delete mode 100644 .github/workflows/dotnet-desktop.yml delete mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml deleted file mode 100644 index 0703d70..0000000 --- a/.github/workflows/dotnet-desktop.yml +++ /dev/null @@ -1,115 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will build, test, sign and package a WPF or Windows Forms desktop application -# built on .NET Core. -# To learn how to migrate your existing application to .NET Core, -# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework -# -# To configure this workflow: -# -# 1. Configure environment variables -# GitHub sets default environment variables for every workflow run. -# Replace the variables relative to your project in the "env" section below. -# -# 2. Signing -# Generate a signing certificate in the Windows Application -# Packaging Project or add an existing signing certificate to the project. -# Next, use PowerShell to encode the .pfx file using Base64 encoding -# by running the following Powershell script to generate the output string: -# -# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte -# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' -# -# Open the output file, SigningCertificate_Encoded.txt, and copy the -# string inside. Then, add the string to the repo as a GitHub secret -# and name it "Base64_Encoded_Pfx." -# For more information on how to configure your signing certificate for -# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing -# -# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". -# See "Build the Windows Application Packaging project" below to see how the secret is used. -# -# For more information on GitHub Actions, refer to https://github.com/features/actions -# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, -# refer to https://github.com/microsoft/github-actions-for-desktop-apps - -name: .NET Core Desktop - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - - build: - - strategy: - matrix: - configuration: [Debug, Release] - - runs-on: windows-latest # For a list of available runner types, refer to - # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on - - env: - Solution_Name: IPAM-NOTE.sln # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: IPAM-NOTE.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. - Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. - Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # Install the .NET Core workload - - name: Install .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v2 - - # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test - - # Restore the application to populate the obj folder with RuntimeIdentifiers - - name: Restore the application - run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration - env: - Configuration: ${{ matrix.configuration }} - - # Decode the base 64 encoded pfx and save the Signing_Certificate - - name: Decode the pfx - run: | - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") - $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx - [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) - - # Create the app package by building and packaging the Windows Application Packaging project - - name: Create the app package - run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} - env: - Appx_Bundle: Always - Appx_Bundle_Platforms: x86|x64 - Appx_Package_Build_Mode: StoreUpload - Configuration: ${{ matrix.configuration }} - - # Remove the pfx - - name: Remove the pfx - run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx - - # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact - - name: Upload build artifacts - uses: actions/upload-artifact@v3 - with: - name: MSIX Package - path: ${{ env.Wap_Project_Directory }}\AppPackages diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml deleted file mode 100644 index c62b908..0000000 --- a/.github/workflows/dotnet.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This workflow will build a .NET project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net - -name: .NET - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet test --no-build --verbosity normal From dc61be2c0ec73325c168f93dfd5a49fb2f8320bb Mon Sep 17 00:00:00 2001 From: staff <250550774@qq.com> Date: Mon, 16 Sep 2024 04:48:22 +0800 Subject: [PATCH 5/8] update --- MainWindow.xaml | 37 +++++++++++++++++++------------------ MainWindow.xaml.cs | 38 +++++++++++++++++++------------------- UserPages/About.xaml | 18 +++++++++++++++--- 3 files changed, 53 insertions(+), 40 deletions(-) diff --git a/MainWindow.xaml b/MainWindow.xaml index 4ce613f..1091156 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -127,7 +127,7 @@ - @@ -139,9 +139,9 @@ Height="28" HorizontalAlignment="Center" Kind="ViewQuilt" /> - + Text="设备端口" />--> + Text="地址收藏" />--> - - + Text="地址收藏" />--> @@ -203,7 +204,7 @@ SelectionChanged="BottomControl_OnSelectionChanged" Style="{StaticResource MaterialDesignNavigationRailTabControl}"> - @@ -218,12 +219,12 @@ HorizontalAlignment="Center" ToolTip="数据预设" Kind="Devices" /> - + Text="获取帮助" />--> - + - @@ -335,7 +336,7 @@ - + --> diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index e78df59..efe5b8b 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -344,19 +344,19 @@ private void BottomControl_OnSelectionChanged(object sender, SelectionChangedEve switch (index) { - case 0: + //case 0: - DataPreset dataPreset = new DataPreset(); + // DataPreset dataPreset = new DataPreset(); - dataPreset.Style = (Style)FindResource("DataPresetStyle"); + // dataPreset.Style = (Style)FindResource("DataPresetStyle"); - FunctionPanel.Children.Add(dataPreset); + // FunctionPanel.Children.Add(dataPreset); - break; + // break; - case 1: + case 0: DatabaseBackup databaseBackup = new DatabaseBackup(); @@ -365,7 +365,7 @@ private void BottomControl_OnSelectionChanged(object sender, SelectionChangedEve FunctionPanel.Children.Add(databaseBackup); break; - case 2: + case 1: @@ -378,17 +378,17 @@ private void BottomControl_OnSelectionChanged(object sender, SelectionChangedEve break; - case 3: - DonationPage donationPage = new DonationPage(); + //case 3: + // DonationPage donationPage = new DonationPage(); - donationPage.Style = (Style)FindResource("DonationStyle"); + // donationPage.Style = (Style)FindResource("DonationStyle"); - FunctionPanel.Children.Add(donationPage); + // FunctionPanel.Children.Add(donationPage); - break; + // break; - case 4: + case 2: @@ -402,18 +402,18 @@ private void BottomControl_OnSelectionChanged(object sender, SelectionChangedEve break; - case 5: + //case 5: - HumanGreeting humanGreeting = new HumanGreeting(); + // HumanGreeting humanGreeting = new HumanGreeting(); - humanGreeting.Style = (Style)FindResource("HumanGreetingStyle"); + // humanGreeting.Style = (Style)FindResource("HumanGreetingStyle"); - FunctionPanel.Children.Add(humanGreeting); + // FunctionPanel.Children.Add(humanGreeting); - break; + // break; } } @@ -426,7 +426,7 @@ private void BottomControl_OnSelectionChanged(object sender, SelectionChangedEve private void AboutButton_OnClick(object sender, RoutedEventArgs e) { FunctionPanel.Children.Clear(); - BottomControl.SelectedIndex = 4; + BottomControl.SelectedIndex = 2; BottomControl_OnSelectionChanged(null,null); //About aboutPage = new About(); diff --git a/UserPages/About.xaml b/UserPages/About.xaml index 665d8df..a05cfde 100644 --- a/UserPages/About.xaml +++ b/UserPages/About.xaml @@ -86,6 +86,11 @@ + + Text="原作者Github主页:https://github.com/yaobus/IPAM-NOTE.git" /> - + Text="BUG反馈QQ群:957648723" />--> + From 54aeb0603847b44ea698622646287bb3c1fd6370 Mon Sep 17 00:00:00 2001 From: staff <250550774@qq.com> Date: Mon, 16 Sep 2024 05:08:40 +0800 Subject: [PATCH 6/8] 11111 --- UserPages/About.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UserPages/About.xaml b/UserPages/About.xaml index a05cfde..4268f11 100644 --- a/UserPages/About.xaml +++ b/UserPages/About.xaml @@ -191,7 +191,7 @@ + Text="特别鸣谢1" /> Date: Mon, 16 Sep 2024 05:09:55 +0800 Subject: [PATCH 7/8] update --- UserPages/About.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UserPages/About.xaml b/UserPages/About.xaml index 4268f11..3a24954 100644 --- a/UserPages/About.xaml +++ b/UserPages/About.xaml @@ -191,7 +191,7 @@ + Text="特别鸣谢!" /> Date: Mon, 16 Sep 2024 05:11:44 +0800 Subject: [PATCH 8/8] update --- AddDeviceWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AddDeviceWindow.xaml.cs b/AddDeviceWindow.xaml.cs index c8c3e36..1cb2e55 100644 --- a/AddDeviceWindow.xaml.cs +++ b/AddDeviceWindow.xaml.cs @@ -17,7 +17,7 @@ namespace IPAM_NOTE { /// - /// AddDeviceWindow.xaml 的交互逻辑 + /// AddDeviceWindow.xaml 的交互逻辑11 /// public partial class AddDeviceWindow : Window {