Skip to content

Commit

Permalink
给Desktop的目录中房间列表增加录制中数量显示
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Dec 14, 2024
1 parent ea5f700 commit 19dd3af
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 23 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/DDTV_Dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ jobs:
run: cp -r Static Server/build_output/Static


- name: Copy ffmpeg.exe (Windows)
- name: Download ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Server/build_output/Plugins/Plugins/ffmpeg
copy Server/Plugins/ffmpeg/ffmpeg.exe Server/build_output/Plugins/Plugins/ffmpeg/ffmpeg.exe
mkdir Server/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=2 -C Server/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Linux or macOS)
if: runner.os != 'Windows'
Expand Down Expand Up @@ -349,11 +350,12 @@ jobs:
- name: Copy Static folder to build_output
run: cp -r Static Desktop/build_output/Static

- name: Copy ffmpeg.exe (Windows)
- name: Download ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Desktop\\build_output\\Plugins\\ffmpeg
copy Desktop\\Plugins\\ffmpeg\\ffmpeg.exe Desktop\\build_output\\Plugins\\ffmpeg\\ffmpeg.exe
mkdir Desktop/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=2 -C Desktop/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Copy VLC (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -497,11 +499,12 @@ jobs:
- name: Copy Static folder to build_output
run: cp -r Static Client/build_output/Static

- name: Copy ffmpeg.exe (Windows)
- name: Download ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Client\\build_output\\Plugins\\ffmpeg
copy Client\\Plugins\\ffmpeg\\ffmpeg.exe Client\\build_output\\Plugins\\ffmpeg\\ffmpeg.exe
mkdir Client/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=2 -C Client/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Windows)
if: runner.os == 'Windows'
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/DDTV_Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ jobs:
- name: Copy Static folder to build_output
run: cp -r Static Server/build_output/Static

- name: Copy ffmpeg.exe (Windows)
- name: Download ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Server/build_output/Plugins/Plugins/ffmpeg
copy Server/Plugins/ffmpeg/ffmpeg.exe Server/build_output/Plugins/Plugins/ffmpeg/ffmpeg.exe
mkdir Server/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=2 -C Server/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Linux or macOS)
if: runner.os != 'Windows'
Expand Down Expand Up @@ -331,11 +332,12 @@ jobs:
- name: Copy Static folder to build_output
run: cp -r Static Desktop/build_output/Static

- name: Copy ffmpeg.exe (Windows)
- name: Download ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Desktop\\build_output\\Plugins\\ffmpeg
copy Desktop\\Plugins\\ffmpeg\\ffmpeg.exe Desktop\\build_output\\Plugins\\ffmpeg\\ffmpeg.exe
mkdir Desktop/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=2 -C Desktop/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Copy VLC (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -468,11 +470,12 @@ jobs:
- name: Copy Static folder to build_output
run: cp -r Static Client/build_output/Static

- name: Copy ffmpeg.exe (Windows)
- name: Download ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Client\\build_output\\Plugins\\ffmpeg
copy Client\\Plugins\\ffmpeg\\ffmpeg.exe Client\\build_output\\Plugins\\ffmpeg\\ffmpeg.exe
mkdir Client/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=2 -C Client/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Windows)
if: runner.os == 'Windows'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/DDTV_Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
run: |
mkdir Server/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=1 -C Server/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
tar -xf ffmpeg.zip --strip-components=2 -C Server/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Linux or macOS)
if: runner.os != 'Windows'
Expand Down Expand Up @@ -356,7 +356,7 @@ jobs:
run: |
mkdir Desktop/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=1 -C Desktop/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
tar -xf ffmpeg.zip --strip-components=2 -C Desktop/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Copy VLC (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -505,7 +505,7 @@ jobs:
run: |
mkdir Client/build_output/Plugins/ffmpeg
curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip --strip-components=1 -C Client/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
tar -xf ffmpeg.zip --strip-components=2 -C Client/build_output/Plugins/ffmpeg ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Windows)
Expand Down
10 changes: 9 additions & 1 deletion Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,19 @@ internal class RoomListDiscard
public class RunConfig : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (macOS-latest, osx-arm64)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-musl-arm64)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-musl-x64)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-musl-arm)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-x64)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-arm64)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-arm)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Desktop (windows-latest, win-x64)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 427 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Client (windows-latest, win-x64)

Nullability of reference types in type of 'event PropertyChangedEventHandler RunConfig.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.
protected virtual void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
public virtual void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-musl-arm64)

Cannot convert null literal to non-nullable reference type.

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-musl-x64)

Cannot convert null literal to non-nullable reference type.

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-musl-arm)

Cannot convert null literal to non-nullable reference type.

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-x64)

Cannot convert null literal to non-nullable reference type.

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-arm64)

Cannot convert null literal to non-nullable reference type.

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Server (ubuntu-latest, linux-arm)

Cannot convert null literal to non-nullable reference type.

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Desktop (windows-latest, win-x64)

Cannot convert null literal to non-nullable reference type.

Check warning on line 428 in Core/Config.cs

View workflow job for this annotation

GitHub Actions / Client (windows-latest, win-x64)

Cannot convert null literal to non-nullable reference type.
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

public string DefaultPageTitle { get; set; } = "首页";
public string DataPageTitle { get; set; } = "房间列表";
public string HistoryPageTitle { get; set; } = "录制历史";
public string ToolsPageTitle { get; set; } = "更多工具";
public string LogPageTitle { get; set; } = "日志";
public string AboutPageTitle { get; set; } = "关于";
public string SettingsPageTitle { get; set; } = "设置";

private static string ValidAccount = "-1";
/// <summary>
/// 生效的账号配置文件
Expand Down
2 changes: 1 addition & 1 deletion Desktop/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<ui:SymbolIcon Symbol="Home24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="房间列表页" NavigationCacheMode="Enabled" TargetPageType="{x:Type pages:DataPage}">
<ui:NavigationViewItem Content="{Binding DataPageTitle,Mode=OneWay}" NavigationCacheMode="Enabled" TargetPageType="{x:Type pages:DataPage}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="DataHistogram24" />
</ui:NavigationViewItem.Icon>
Expand Down
26 changes: 26 additions & 0 deletions Desktop/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Core;
using Core.LogModule;
using Core.RuntimeObject;
using Desktop.Models;
using Desktop.Views.Pages;
using Desktop.Views.Windows;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -44,6 +45,10 @@ public partial class MainWindow : FluentWindow
/// 是否连接远程服务器
/// </summary>
public static bool ToConnectToRemoteServer = false;
/// <summary>
/// 更新目录房间列表录制中数量定时器
/// </summary>
private Timer IpvDetectionTimer;

public static Config.RunConfig configViewModel { get; set; } = new();

Expand Down Expand Up @@ -109,6 +114,8 @@ public void Init()
{
WindowsAPI.OpenWindowsHibernation();
}
//更新目录房间列表录制中数量
IpvDetectionTimer = new Timer(UpdateNumberRecordedRoomsInDirectoryRoomList, null, 1, 5000);
}

private void InitializeTitleMode()
Expand Down Expand Up @@ -340,5 +347,24 @@ private void FluentWindow_Closing(object sender, System.ComponentModel.CancelEve
}
}
}


/// <summary>
/// 更新目录房间列表录制中数量
/// </summary>
/// <param name="state"></param>
public static void UpdateNumberRecordedRoomsInDirectoryRoomList(object state)
{
try
{
(int MonitoringCount, int LiveCount, int RecCount) count = NetWork.Post.PostBody<(int MonitoringCount, int LiveCount, int RecCount)>($"{Config.Core_RunConfig._DesktopIP}:{Config.Core_RunConfig._DesktopPort}/api/get_rooms/room_statistics").Result;
configViewModel.DataPageTitle = $"房间列表 ({count.RecCount})";
configViewModel.OnPropertyChanged("DataPageTitle");
}
catch (Exception ex)
{
Log.Warn(nameof(UpdateNumberRecordedRoomsInDirectoryRoomList), "更新房间统计出现错误,错误堆栈已写文本记录文件", ex, false);
}
}
}
}

0 comments on commit 19dd3af

Please sign in to comment.