Compare commits
No commits in common. "e872f2493680a4f624f18df99bd43f794efb8e89" and "422aaa89d5cbab335ed4424553141a0342a0e283" have entirely different histories.
e872f24936
...
422aaa89d5
|
@ -35,4 +35,3 @@ DebuggerCmd.md
|
||||||
|
|
||||||
# Generated Files
|
# Generated Files
|
||||||
*.sqlite
|
*.sqlite
|
||||||
components.d.ts
|
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
/* eslint-disable */
|
||||||
|
// @ts-nocheck
|
||||||
|
// Generated by unplugin-vue-components
|
||||||
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
|
// biome-ignore lint: disable
|
||||||
|
export {}
|
||||||
|
|
||||||
|
/* prettier-ignore */
|
||||||
|
declare module 'vue' {
|
||||||
|
export interface GlobalComponents {
|
||||||
|
Alert: typeof import('./src/components/Alert/Alert.vue')['default']
|
||||||
|
BaseBoard: typeof import('./src/components/equipments/BaseBoard.vue')['default']
|
||||||
|
BaseInputField: typeof import('./src/components/InputField/BaseInputField.vue')['default']
|
||||||
|
CollapsibleSection: typeof import('./src/components/CollapsibleSection.vue')['default']
|
||||||
|
ComponentSelector: typeof import('./src/components/LabCanvas/ComponentSelector.vue')['default']
|
||||||
|
DDR: typeof import('./src/components/equipments/DDR.vue')['default']
|
||||||
|
DDS: typeof import('./src/components/equipments/DDS.vue')['default']
|
||||||
|
DDSPropertyEditor: typeof import('./src/components/equipments/DDSPropertyEditor.vue')['default']
|
||||||
|
DiagramCanvas: typeof import('./src/components/LabCanvas/DiagramCanvas.vue')['default']
|
||||||
|
Dialog: typeof import('./src/components/Dialog.vue')['default']
|
||||||
|
ETH: typeof import('./src/components/equipments/ETH.vue')['default']
|
||||||
|
HDMI: typeof import('./src/components/equipments/HDMI.vue')['default']
|
||||||
|
IpInputField: typeof import('./src/components/InputField/IpInputField.vue')['default']
|
||||||
|
ItemList: typeof import('./src/components/LabCanvas/ItemList.vue')['default']
|
||||||
|
LogicalWaveFormDisplay: typeof import('./src/components/LogicAnalyzer/LogicalWaveFormDisplay.vue')['default']
|
||||||
|
MarkdownRenderer: typeof import('./src/components/MarkdownRenderer.vue')['default']
|
||||||
|
MechanicalButton: typeof import('./src/components/equipments/MechanicalButton.vue')['default']
|
||||||
|
MotherBoard: typeof import('./src/components/equipments/MotherBoard.vue')['default']
|
||||||
|
MotherBoardCaps: typeof import('./src/components/equipments/MotherBoardCaps.vue')['default']
|
||||||
|
Navbar: typeof import('./src/components/Navbar.vue')['default']
|
||||||
|
OscilloscopeWaveformDisplay: typeof import('./src/components/Oscilloscope/OscilloscopeWaveformDisplay.vue')['default']
|
||||||
|
PG2L100H_FBG676: typeof import('./src/components/equipments/PG2L100H_FBG676.vue')['default']
|
||||||
|
Pin: typeof import('./src/components/equipments/Pin.vue')['default']
|
||||||
|
PopButton: typeof import('./src/components/PopButton.vue')['default']
|
||||||
|
PortInputField: typeof import('./src/components/InputField/PortInputField.vue')['default']
|
||||||
|
PropertyEditor: typeof import('./src/components/PropertyEditor.vue')['default']
|
||||||
|
PropertyPanel: typeof import('./src/components/PropertyPanel.vue')['default']
|
||||||
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
SD: typeof import('./src/components/equipments/SD.vue')['default']
|
||||||
|
SevenSegmentDisplay: typeof import('./src/components/equipments/SevenSegmentDisplay.vue')['default']
|
||||||
|
SFP: typeof import('./src/components/equipments/SFP.vue')['default']
|
||||||
|
Sidebar: typeof import('./src/components/Sidebar.vue')['default']
|
||||||
|
SMA: typeof import('./src/components/equipments/SMA.vue')['default']
|
||||||
|
SMT_LED: typeof import('./src/components/equipments/SMT_LED.vue')['default']
|
||||||
|
Switch: typeof import('./src/components/equipments/Switch.vue')['default']
|
||||||
|
ThemeControlButton: typeof import('./src/components/ThemeControlButton.vue')['default']
|
||||||
|
ThemeControlToggle: typeof import('./src/components/ThemeControlToggle.vue')['default']
|
||||||
|
TriggerSettings: typeof import('./src/components/LogicAnalyzer/TriggerSettings.vue')['default']
|
||||||
|
TutorialCarousel: typeof import('./src/components/TutorialCarousel.vue')['default']
|
||||||
|
UploadCard: typeof import('./src/components/UploadCard.vue')['default']
|
||||||
|
WaveformDisplay: typeof import('./src/components/WaveformDisplay/WaveformDisplay.vue')['default']
|
||||||
|
Wire: typeof import('./src/components/equipments/Wire.vue')['default']
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,8 +26,6 @@
|
||||||
<PackageReference Include="NLog" Version="5.4.0" />
|
<PackageReference Include="NLog" Version="5.4.0" />
|
||||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.4.0" />
|
<PackageReference Include="NLog.Web.AspNetCore" Version="5.4.0" />
|
||||||
<PackageReference Include="NSwag.AspNetCore" Version="14.3.0" />
|
<PackageReference Include="NSwag.AspNetCore" Version="14.3.0" />
|
||||||
<PackageReference Include="OpenCvSharp4" Version="4.11.0.20250507" />
|
|
||||||
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.11.0.20250507" />
|
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" />
|
||||||
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
|
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -13,45 +13,6 @@ public class VideoStreamController : ControllerBase
|
||||||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||||
private readonly server.Services.HttpVideoStreamService _videoStreamService;
|
private readonly server.Services.HttpVideoStreamService _videoStreamService;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 视频流信息结构体
|
|
||||||
/// </summary>
|
|
||||||
public class StreamInfoResult
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public int FrameRate { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public int FrameWidth { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public int FrameHeight { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public string Format { get; set; } = "MJPEG";
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public string HtmlUrl { get; set; } = "";
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public string MjpegUrl { get; set; } = "";
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public string SnapshotUrl { get; set; } = "";
|
|
||||||
/// <summary>
|
|
||||||
/// TODO:
|
|
||||||
/// </summary>
|
|
||||||
public string UsbCameraUrl { get; set; } = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 摄像头配置请求模型
|
/// 摄像头配置请求模型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -135,25 +96,23 @@ public class VideoStreamController : ControllerBase
|
||||||
/// <returns>流信息</returns>
|
/// <returns>流信息</returns>
|
||||||
[HttpGet("StreamInfo")]
|
[HttpGet("StreamInfo")]
|
||||||
[EnableCors("Users")]
|
[EnableCors("Users")]
|
||||||
[ProducesResponseType(typeof(StreamInfoResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(object), StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(typeof(Exception), StatusCodes.Status500InternalServerError)]
|
[ProducesResponseType(typeof(Exception), StatusCodes.Status500InternalServerError)]
|
||||||
public IResult GetStreamInfo()
|
public IResult GetStreamInfo()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
logger.Info("获取 HTTP 视频流信息");
|
logger.Info("获取 HTTP 视频流信息");
|
||||||
var result = new StreamInfoResult
|
return TypedResults.Ok(new
|
||||||
{
|
{
|
||||||
FrameRate = _videoStreamService.FrameRate,
|
frameRate = _videoStreamService.FrameRate,
|
||||||
FrameWidth = _videoStreamService.FrameWidth,
|
frameWidth = _videoStreamService.FrameWidth,
|
||||||
FrameHeight = _videoStreamService.FrameHeight,
|
frameHeight = _videoStreamService.FrameHeight,
|
||||||
Format = "MJPEG",
|
format = "MJPEG",
|
||||||
HtmlUrl = $"http://localhost:{_videoStreamService.ServerPort}/video-feed.html",
|
htmlUrl = $"http://localhost:{_videoStreamService.ServerPort}/video-feed.html",
|
||||||
MjpegUrl = $"http://localhost:{_videoStreamService.ServerPort}/video-stream",
|
mjpegUrl = $"http://localhost:{_videoStreamService.ServerPort}/video-stream",
|
||||||
SnapshotUrl = $"http://localhost:{_videoStreamService.ServerPort}/snapshot",
|
snapshotUrl = $"http://localhost:{_videoStreamService.ServerPort}/snapshot",
|
||||||
UsbCameraUrl = $"http://localhost:{_videoStreamService.ServerPort}/usb-camera"
|
});
|
||||||
};
|
|
||||||
return TypedResults.Ok(result);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
#define USB_CAMERA
|
|
||||||
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Peripherals.CameraClient; // 添加摄像头客户端引用
|
using Peripherals.CameraClient; // 添加摄像头客户端引用
|
||||||
|
|
||||||
#if USB_CAMERA
|
|
||||||
using OpenCvSharp;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace server.Services;
|
namespace server.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -101,13 +95,6 @@ public class HttpVideoStreamService : BackgroundService
|
||||||
private int _cameraPort = 8888; // 默认端口
|
private int _cameraPort = 8888; // 默认端口
|
||||||
private readonly object _cameraLock = new object();
|
private readonly object _cameraLock = new object();
|
||||||
|
|
||||||
// USB Camera 相关
|
|
||||||
#if USB_CAMERA
|
|
||||||
private VideoCapture? _usbCamera;
|
|
||||||
private bool _usbCameraEnable = false;
|
|
||||||
private readonly object _usbCameraLock = new object();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// 模拟 FPGA 图像数据
|
// 模拟 FPGA 图像数据
|
||||||
private int _frameCounter = 0;
|
private int _frameCounter = 0;
|
||||||
private readonly List<HttpListenerResponse> _activeClients = new List<HttpListenerResponse>();
|
private readonly List<HttpListenerResponse> _activeClients = new List<HttpListenerResponse>();
|
||||||
|
@ -359,16 +346,9 @@ public class HttpVideoStreamService : BackgroundService
|
||||||
|
|
||||||
if (requestPath == "/video-stream")
|
if (requestPath == "/video-stream")
|
||||||
{
|
{
|
||||||
// MJPEG 流请求(FPGA)
|
// MJPEG 流请求
|
||||||
_ = Task.Run(() => HandleMjpegStreamAsync(response, cancellationToken), cancellationToken);
|
_ = Task.Run(() => HandleMjpegStreamAsync(response, cancellationToken), cancellationToken);
|
||||||
}
|
}
|
||||||
#if USB_CAMERA
|
|
||||||
else if (requestPath == "/usb-camera")
|
|
||||||
{
|
|
||||||
// USB Camera MJPEG流请求
|
|
||||||
_ = Task.Run(() => HandleUsbCameraStreamAsync(response, cancellationToken), cancellationToken);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (requestPath == "/snapshot")
|
else if (requestPath == "/snapshot")
|
||||||
{
|
{
|
||||||
// 单帧图像请求
|
// 单帧图像请求
|
||||||
|
@ -402,87 +382,6 @@ public class HttpVideoStreamService : BackgroundService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// USB Camera MJPEG流处理
|
|
||||||
#if USB_CAMERA
|
|
||||||
private async Task HandleUsbCameraStreamAsync(HttpListenerResponse response, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
lock (_usbCameraLock)
|
|
||||||
{
|
|
||||||
if (_usbCamera == null)
|
|
||||||
{
|
|
||||||
_usbCamera = new VideoCapture(0);
|
|
||||||
_usbCamera.Fps = _frameRate;
|
|
||||||
_usbCamera.FrameWidth = _frameWidth;
|
|
||||||
_usbCamera.FrameHeight = _frameHeight;
|
|
||||||
_usbCameraEnable = _usbCamera.IsOpened();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!_usbCameraEnable || _usbCamera == null || !_usbCamera.IsOpened())
|
|
||||||
{
|
|
||||||
response.StatusCode = 500;
|
|
||||||
await response.OutputStream.FlushAsync(cancellationToken);
|
|
||||||
response.Close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
response.ContentType = "multipart/x-mixed-replace; boundary=--boundary";
|
|
||||||
response.Headers.Add("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
||||||
response.Headers.Add("Pragma", "no-cache");
|
|
||||||
response.Headers.Add("Expires", "0");
|
|
||||||
|
|
||||||
using (var mat = new Mat())
|
|
||||||
{
|
|
||||||
while (!cancellationToken.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
bool grabbed;
|
|
||||||
lock (_usbCameraLock)
|
|
||||||
{
|
|
||||||
grabbed = _usbCamera.Read(mat);
|
|
||||||
}
|
|
||||||
if (!grabbed || mat.Empty())
|
|
||||||
{
|
|
||||||
await Task.Delay(50, cancellationToken);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编码为JPEG
|
|
||||||
byte[]? jpegData = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
jpegData = mat.ToBytes(".jpg", new int[] { (int)ImwriteFlags.JpegQuality, 80 });
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
logger.Error(ex, "USB Camera帧编码JPEG失败");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (jpegData == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// MJPEG帧头
|
|
||||||
var header = Encoding.ASCII.GetBytes("--boundary\r\nContent-Type: image/jpeg\r\nContent-Length: " + jpegData.Length + "\r\n\r\n");
|
|
||||||
await response.OutputStream.WriteAsync(header, 0, header.Length, cancellationToken);
|
|
||||||
await response.OutputStream.WriteAsync(jpegData, 0, jpegData.Length, cancellationToken);
|
|
||||||
await response.OutputStream.WriteAsync(new byte[] { 0x0D, 0x0A }, 0, 2, cancellationToken); // \r\n
|
|
||||||
await response.OutputStream.FlushAsync(cancellationToken);
|
|
||||||
|
|
||||||
await Task.Delay(1000 / _frameRate, cancellationToken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
logger.Error(ex, "USB Camera MJPEG流处理异常");
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
try { response.Close(); } catch { }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private async Task HandleMjpegStreamAsync(HttpListenerResponse response, CancellationToken cancellationToken)
|
private async Task HandleMjpegStreamAsync(HttpListenerResponse response, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -68,7 +68,7 @@ export class VideoStreamClient {
|
||||||
* 获取 HTTP 视频流信息
|
* 获取 HTTP 视频流信息
|
||||||
* @return 流信息
|
* @return 流信息
|
||||||
*/
|
*/
|
||||||
getStreamInfo(): Promise<StreamInfoResult> {
|
getStreamInfo(): Promise<any> {
|
||||||
let url_ = this.baseUrl + "/api/VideoStream/StreamInfo";
|
let url_ = this.baseUrl + "/api/VideoStream/StreamInfo";
|
||||||
url_ = url_.replace(/[?&]$/, "");
|
url_ = url_.replace(/[?&]$/, "");
|
||||||
|
|
||||||
|
@ -84,14 +84,15 @@ export class VideoStreamClient {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected processGetStreamInfo(response: Response): Promise<StreamInfoResult> {
|
protected processGetStreamInfo(response: Response): Promise<any> {
|
||||||
const status = response.status;
|
const status = response.status;
|
||||||
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
||||||
if (status === 200) {
|
if (status === 200) {
|
||||||
return response.text().then((_responseText) => {
|
return response.text().then((_responseText) => {
|
||||||
let result200: any = null;
|
let result200: any = null;
|
||||||
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
||||||
result200 = StreamInfoResult.fromJS(resultData200);
|
result200 = resultData200 !== undefined ? resultData200 : <any>null;
|
||||||
|
|
||||||
return result200;
|
return result200;
|
||||||
});
|
});
|
||||||
} else if (status === 500) {
|
} else if (status === 500) {
|
||||||
|
@ -106,7 +107,7 @@ export class VideoStreamClient {
|
||||||
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return Promise.resolve<StreamInfoResult>(null as any);
|
return Promise.resolve<any>(null as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4672,88 +4673,6 @@ export interface IException {
|
||||||
stackTrace?: string | undefined;
|
stackTrace?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 视频流信息结构体 */
|
|
||||||
export class StreamInfoResult implements IStreamInfoResult {
|
|
||||||
/** TODO: */
|
|
||||||
frameRate!: number;
|
|
||||||
/** TODO: */
|
|
||||||
frameWidth!: number;
|
|
||||||
/** TODO: */
|
|
||||||
frameHeight!: number;
|
|
||||||
/** TODO: */
|
|
||||||
format!: string;
|
|
||||||
/** TODO: */
|
|
||||||
htmlUrl!: string;
|
|
||||||
/** TODO: */
|
|
||||||
mjpegUrl!: string;
|
|
||||||
/** TODO: */
|
|
||||||
snapshotUrl!: string;
|
|
||||||
/** TODO: */
|
|
||||||
usbCameraUrl!: string;
|
|
||||||
|
|
||||||
constructor(data?: IStreamInfoResult) {
|
|
||||||
if (data) {
|
|
||||||
for (var property in data) {
|
|
||||||
if (data.hasOwnProperty(property))
|
|
||||||
(<any>this)[property] = (<any>data)[property];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
init(_data?: any) {
|
|
||||||
if (_data) {
|
|
||||||
this.frameRate = _data["frameRate"];
|
|
||||||
this.frameWidth = _data["frameWidth"];
|
|
||||||
this.frameHeight = _data["frameHeight"];
|
|
||||||
this.format = _data["format"];
|
|
||||||
this.htmlUrl = _data["htmlUrl"];
|
|
||||||
this.mjpegUrl = _data["mjpegUrl"];
|
|
||||||
this.snapshotUrl = _data["snapshotUrl"];
|
|
||||||
this.usbCameraUrl = _data["usbCameraUrl"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static fromJS(data: any): StreamInfoResult {
|
|
||||||
data = typeof data === 'object' ? data : {};
|
|
||||||
let result = new StreamInfoResult();
|
|
||||||
result.init(data);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
toJSON(data?: any) {
|
|
||||||
data = typeof data === 'object' ? data : {};
|
|
||||||
data["frameRate"] = this.frameRate;
|
|
||||||
data["frameWidth"] = this.frameWidth;
|
|
||||||
data["frameHeight"] = this.frameHeight;
|
|
||||||
data["format"] = this.format;
|
|
||||||
data["htmlUrl"] = this.htmlUrl;
|
|
||||||
data["mjpegUrl"] = this.mjpegUrl;
|
|
||||||
data["snapshotUrl"] = this.snapshotUrl;
|
|
||||||
data["usbCameraUrl"] = this.usbCameraUrl;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 视频流信息结构体 */
|
|
||||||
export interface IStreamInfoResult {
|
|
||||||
/** TODO: */
|
|
||||||
frameRate: number;
|
|
||||||
/** TODO: */
|
|
||||||
frameWidth: number;
|
|
||||||
/** TODO: */
|
|
||||||
frameHeight: number;
|
|
||||||
/** TODO: */
|
|
||||||
format: string;
|
|
||||||
/** TODO: */
|
|
||||||
htmlUrl: string;
|
|
||||||
/** TODO: */
|
|
||||||
mjpegUrl: string;
|
|
||||||
/** TODO: */
|
|
||||||
snapshotUrl: string;
|
|
||||||
/** TODO: */
|
|
||||||
usbCameraUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 摄像头配置请求模型 */
|
/** 摄像头配置请求模型 */
|
||||||
export class CameraConfigRequest implements ICameraConfigRequest {
|
export class CameraConfigRequest implements ICameraConfigRequest {
|
||||||
/** 摄像头地址 */
|
/** 摄像头地址 */
|
||||||
|
|
|
@ -8,14 +8,17 @@
|
||||||
控制面板
|
控制面板
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 gap-4"
|
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||||
:class="{ 'md:grid-cols-3': streamType === 'usbCamera', 'md:grid-cols-4': streamType === 'videoStream' }">
|
|
||||||
<!-- 服务状态 -->
|
<!-- 服务状态 -->
|
||||||
<div class="stats shadow">
|
<div class="stats shadow">
|
||||||
<div class="stat bg-base-100">
|
<div class="stat bg-base-100">
|
||||||
<div class="stat-figure text-primary">
|
<div class="stat-figure text-primary">
|
||||||
<div class="badge" :class="statusInfo.isRunning ? 'badge-success' : 'badge-error'
|
<div
|
||||||
">
|
class="badge"
|
||||||
|
:class="
|
||||||
|
statusInfo.isRunning ? 'badge-success' : 'badge-error'
|
||||||
|
"
|
||||||
|
>
|
||||||
{{ statusInfo.isRunning ? "运行中" : "已停止" }}
|
{{ statusInfo.isRunning ? "运行中" : "已停止" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,23 +43,30 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 分辨率控制 -->
|
<!-- 分辨率控制 -->
|
||||||
<div v-show="streamType === 'videoStream'" class="stats shadow">
|
<div class="stats shadow">
|
||||||
<div class="stat bg-base-100">
|
<div class="stat bg-base-100">
|
||||||
<div class="stat-figure text-info">
|
<div class="stat-figure text-info">
|
||||||
<Settings class="w-8 h-8" />
|
<Settings class="w-8 h-8" />
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-title">分辨率设置</div>
|
<div class="stat-title">分辨率设置</div>
|
||||||
<div class="stat-value text-sm">
|
<div class="stat-value text-sm">
|
||||||
<select class="select select-sm select-bordered max-w-xs" v-model="selectedResolution"
|
<select
|
||||||
@change="changeResolution" :disabled="changingResolution">
|
class="select select-sm select-bordered max-w-xs"
|
||||||
|
v-model="selectedResolution"
|
||||||
|
@change="changeResolution"
|
||||||
|
:disabled="changingResolution"
|
||||||
|
>
|
||||||
<option v-for="res in supportedResolutions" :key="`${res.width}x${res.height}`" :value="res">
|
<option v-for="res in supportedResolutions" :key="`${res.width}x${res.height}`" :value="res">
|
||||||
{{ res.width }}×{{ res.height }}
|
{{ res.width }}×{{ res.height }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-desc">
|
<div class="stat-desc">
|
||||||
<button class="btn btn-xs btn-outline btn-info mt-1" @click="refreshResolutions"
|
<button
|
||||||
:disabled="loadingResolutions">
|
class="btn btn-xs btn-outline btn-info mt-1"
|
||||||
|
@click="refreshResolutions"
|
||||||
|
:disabled="loadingResolutions"
|
||||||
|
>
|
||||||
<RefreshCw v-if="loadingResolutions" class="animate-spin h-3 w-3" />
|
<RefreshCw v-if="loadingResolutions" class="animate-spin h-3 w-3" />
|
||||||
{{ loadingResolutions ? "刷新中..." : "刷新" }}
|
{{ loadingResolutions ? "刷新中..." : "刷新" }}
|
||||||
</button>
|
</button>
|
||||||
|
@ -76,18 +86,30 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-desc">
|
<div class="stat-desc">
|
||||||
<div class="dropdown dropdown-hover dropdown-top">
|
<div class="dropdown dropdown-hover dropdown-top">
|
||||||
<div tabindex="0" role="button" class="text-xs underline cursor-help">
|
<div
|
||||||
|
tabindex="0"
|
||||||
|
role="button"
|
||||||
|
class="text-xs underline cursor-help"
|
||||||
|
>
|
||||||
查看客户端
|
查看客户端
|
||||||
</div>
|
</div>
|
||||||
<ul tabindex="0"
|
<ul
|
||||||
class="dropdown-content z-20 menu p-2 shadow bg-base-200 rounded-box w-64 max-h-48 overflow-y-auto">
|
tabindex="0"
|
||||||
<li v-for="(client, index) in statusInfo.clientEndpoints" :key="index" class="text-xs">
|
class="dropdown-content z-20 menu p-2 shadow bg-base-200 rounded-box w-64 max-h-48 overflow-y-auto"
|
||||||
|
>
|
||||||
|
<li
|
||||||
|
v-for="(client, index) in statusInfo.clientEndpoints"
|
||||||
|
:key="index"
|
||||||
|
class="text-xs"
|
||||||
|
>
|
||||||
<a class="break-all">{{ client }}</a>
|
<a class="break-all">{{ client }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="
|
<li
|
||||||
!statusInfo.clientEndpoints ||
|
v-if="
|
||||||
statusInfo.clientEndpoints.length === 0
|
!statusInfo.clientEndpoints ||
|
||||||
">
|
statusInfo.clientEndpoints.length === 0
|
||||||
|
"
|
||||||
|
>
|
||||||
<a class="text-xs opacity-50">无活跃连接</a>
|
<a class="text-xs opacity-50">无活跃连接</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -99,21 +121,29 @@
|
||||||
|
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<div class="card-actions justify-end mt-4">
|
<div class="card-actions justify-end mt-4">
|
||||||
<button class="btn btn-outline btn-warning mr-2" @click="toggleStreamType" :disabled="isSwitchingStreamType">
|
<button
|
||||||
<SwitchCamera class="h-4 w-4 mr-2" />
|
class="btn btn-outline btn-primary"
|
||||||
{{ streamType === 'usbCamera' ? '切换到视频流' : '切换到USB摄像头' }}
|
@click="configCamera"
|
||||||
</button>
|
:dsiabled="configing"
|
||||||
<button v-show="streamType === 'videoStream'" class="btn btn-outline btn-primary" @click="configCamera" :disabled="configing">
|
>
|
||||||
<RefreshCw v-if="configing" class="animate-spin h-4 w-4 mr-2" />
|
<RefreshCw v-if="configing" class="animate-spin h-4 w-4 mr-2" />
|
||||||
<CogIcon v-else class="h-4 w-4 mr-2" />
|
<CogIcon v-else class="h-4 w-4 mr-2" />
|
||||||
{{ configing ? "配置中..." : "配置摄像头" }}
|
{{ configing ? "配置中..." : "配置摄像头" }}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-outline btn-primary" @click="refreshStatus" :disabled="loading">
|
<button
|
||||||
|
class="btn btn-outline btn-primary"
|
||||||
|
@click="refreshStatus"
|
||||||
|
:disabled="loading"
|
||||||
|
>
|
||||||
<RefreshCw v-if="loading" class="animate-spin h-4 w-4 mr-2" />
|
<RefreshCw v-if="loading" class="animate-spin h-4 w-4 mr-2" />
|
||||||
<RefreshCw v-else class="h-4 w-4 mr-2" />
|
<RefreshCw v-else class="h-4 w-4 mr-2" />
|
||||||
{{ loading ? "刷新中..." : "刷新状态" }}
|
{{ loading ? "刷新中..." : "刷新状态" }}
|
||||||
</button>
|
</button>
|
||||||
<button v-show="streamType === 'videoStream'" class="btn btn-primary" @click="testConnection" :disabled="testing">
|
<button
|
||||||
|
class="btn btn-primary"
|
||||||
|
@click="testConnection"
|
||||||
|
:disabled="testing"
|
||||||
|
>
|
||||||
<RefreshCw v-if="testing" class="animate-spin h-4 w-4 mr-2" />
|
<RefreshCw v-if="testing" class="animate-spin h-4 w-4 mr-2" />
|
||||||
<TestTube v-else class="h-4 w-4 mr-2" />
|
<TestTube v-else class="h-4 w-4 mr-2" />
|
||||||
{{ testing ? "测试中..." : "测试连接" }}
|
{{ testing ? "测试中..." : "测试连接" }}
|
||||||
|
@ -130,24 +160,42 @@
|
||||||
视频预览
|
视频预览
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div class="relative bg-black rounded-lg overflow-hidden cursor-pointer" :class="[
|
<div
|
||||||
focusAnimationClass,
|
class="relative bg-black rounded-lg overflow-hidden cursor-pointer"
|
||||||
{ 'cursor-not-allowed': !isPlaying || hasVideoError }
|
:class="[
|
||||||
]" style="aspect-ratio: 4/3" @click="handleVideoClick">
|
focusAnimationClass,
|
||||||
|
{ 'cursor-not-allowed': !isPlaying || hasVideoError }
|
||||||
|
]"
|
||||||
|
style="aspect-ratio: 4/3"
|
||||||
|
@click="handleVideoClick"
|
||||||
|
>
|
||||||
<!-- 视频播放器 - 使用img标签直接显示MJPEG流 -->
|
<!-- 视频播放器 - 使用img标签直接显示MJPEG流 -->
|
||||||
<div v-show="isPlaying" class="w-full h-full flex items-center justify-center">
|
<div
|
||||||
<img :src="currentVideoSource" alt="视频流" class="max-w-full max-h-full object-contain"
|
v-show="isPlaying"
|
||||||
@error="handleVideoError" @load="handleVideoLoad" />
|
class="w-full h-full flex items-center justify-center"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:src="currentVideoSource"
|
||||||
|
alt="视频流"
|
||||||
|
class="max-w-full max-h-full object-contain"
|
||||||
|
@error="handleVideoError"
|
||||||
|
@load="handleVideoLoad"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 对焦提示 -->
|
<!-- 对焦提示 -->
|
||||||
<div v-if="isPlaying && !hasVideoError"
|
<div
|
||||||
class="absolute top-4 right-4 text-white text-sm bg-black bg-opacity-50 px-2 py-1 rounded">
|
v-if="isPlaying && !hasVideoError"
|
||||||
|
class="absolute top-4 right-4 text-white text-sm bg-black bg-opacity-50 px-2 py-1 rounded"
|
||||||
|
>
|
||||||
{{ isFocusing ? '对焦中...' : '点击画面对焦' }}
|
{{ isFocusing ? '对焦中...' : '点击画面对焦' }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 错误信息显示 -->
|
<!-- 错误信息显示 -->
|
||||||
<div v-if="hasVideoError" class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-70">
|
<div
|
||||||
|
v-if="hasVideoError"
|
||||||
|
class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-70"
|
||||||
|
>
|
||||||
<div class="card bg-error text-white shadow-lg w-full max-w-lg">
|
<div class="card bg-error text-white shadow-lg w-full max-w-lg">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 class="card-title flex items-center gap-2">
|
<h3 class="card-title flex items-center gap-2">
|
||||||
|
@ -161,7 +209,10 @@
|
||||||
<li>端口 {{ statusInfo.serverPort }} 是否可访问</li>
|
<li>端口 {{ statusInfo.serverPort }} 是否可访问</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="card-actions justify-end mt-2">
|
<div class="card-actions justify-end mt-2">
|
||||||
<button class="btn btn-sm btn-outline btn-primary" @click="tryReconnect">
|
<button
|
||||||
|
class="btn btn-sm btn-outline btn-primary"
|
||||||
|
@click="tryReconnect"
|
||||||
|
>
|
||||||
重试连接
|
重试连接
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -170,8 +221,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 占位符 -->
|
<!-- 占位符 -->
|
||||||
<div v-show="!isPlaying && !hasVideoError"
|
<div
|
||||||
class="absolute inset-0 flex items-center justify-center text-white">
|
v-show="!isPlaying && !hasVideoError"
|
||||||
|
class="absolute inset-0 flex items-center justify-center text-white"
|
||||||
|
>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<Video class="w-16 h-16 mx-auto mb-4 opacity-50" />
|
<Video class="w-16 h-16 mx-auto mb-4 opacity-50" />
|
||||||
<p class="text-lg opacity-75">{{ videoStatus }}</p>
|
<p class="text-lg opacity-75">{{ videoStatus }}</p>
|
||||||
|
@ -192,11 +245,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="space-x-2">
|
<div class="space-x-2">
|
||||||
<div class="dropdown dropdown-hover dropdown-top dropdown-end">
|
<div class="dropdown dropdown-hover dropdown-top dropdown-end">
|
||||||
<div tabindex="0" role="button" class="btn btn-sm btn-outline btn-accent">
|
<div
|
||||||
|
tabindex="0"
|
||||||
|
role="button"
|
||||||
|
class="btn btn-sm btn-outline btn-accent"
|
||||||
|
>
|
||||||
<MoreHorizontal class="w-4 h-4 mr-1" />
|
<MoreHorizontal class="w-4 h-4 mr-1" />
|
||||||
更多功能
|
更多功能
|
||||||
</div>
|
</div>
|
||||||
<ul tabindex="0" class="dropdown-content z-[1] menu p-2 shadow bg-base-200 rounded-box w-52">
|
<ul
|
||||||
|
tabindex="0"
|
||||||
|
class="dropdown-content z-[1] menu p-2 shadow bg-base-200 rounded-box w-52"
|
||||||
|
>
|
||||||
<li>
|
<li>
|
||||||
<a @click="openInNewTab(streamInfo.htmlUrl)">
|
<a @click="openInNewTab(streamInfo.htmlUrl)">
|
||||||
<ExternalLink class="w-4 h-4" />
|
<ExternalLink class="w-4 h-4" />
|
||||||
|
@ -217,11 +277,19 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-success btn-sm" @click="startStream" :disabled="isPlaying">
|
<button
|
||||||
|
class="btn btn-success btn-sm"
|
||||||
|
@click="startStream"
|
||||||
|
:disabled="isPlaying"
|
||||||
|
>
|
||||||
<Play class="w-4 h-4 mr-1" />
|
<Play class="w-4 h-4 mr-1" />
|
||||||
播放视频流
|
播放视频流
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-error btn-sm" @click="stopStream" :disabled="!isPlaying">
|
<button
|
||||||
|
class="btn btn-error btn-sm"
|
||||||
|
@click="stopStream"
|
||||||
|
:disabled="!isPlaying"
|
||||||
|
>
|
||||||
<Square class="w-4 h-4 mr-1" />
|
<Square class="w-4 h-4 mr-1" />
|
||||||
停止视频流
|
停止视频流
|
||||||
</button>
|
</button>
|
||||||
|
@ -239,11 +307,20 @@
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div class="bg-base-300 rounded-lg p-4 h-48 overflow-y-auto">
|
<div class="bg-base-300 rounded-lg p-4 h-48 overflow-y-auto">
|
||||||
<div v-for="(log, index) in logs" :key="index" class="text-sm font-mono mb-1">
|
<div
|
||||||
<span class="text-base-content/50">[{{ formatTime(log.time) }}]</span>
|
v-for="(log, index) in logs"
|
||||||
|
:key="index"
|
||||||
|
class="text-sm font-mono mb-1"
|
||||||
|
>
|
||||||
|
<span class="text-base-content/50"
|
||||||
|
>[{{ formatTime(log.time) }}]</span
|
||||||
|
>
|
||||||
<span :class="getLogClass(log.level)">{{ log.message }}</span>
|
<span :class="getLogClass(log.level)">{{ log.message }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="logs.length === 0" class="text-base-content/50 text-center py-8">
|
<div
|
||||||
|
v-if="logs.length === 0"
|
||||||
|
class="text-base-content/50 text-center py-8"
|
||||||
|
>
|
||||||
暂无日志记录
|
暂无日志记录
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -275,9 +352,8 @@ import {
|
||||||
FileText,
|
FileText,
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
MoreHorizontal,
|
MoreHorizontal,
|
||||||
SwitchCamera,
|
|
||||||
} from "lucide-vue-next";
|
} from "lucide-vue-next";
|
||||||
import { VideoStreamClient, CameraConfigRequest, ResolutionConfigRequest, StreamInfoResult } from "@/APIClient";
|
import { VideoStreamClient, CameraConfigRequest, ResolutionConfigRequest } from "@/APIClient";
|
||||||
import { useEquipments } from "@/stores/equipments";
|
import { useEquipments } from "@/stores/equipments";
|
||||||
|
|
||||||
const eqps = useEquipments();
|
const eqps = useEquipments();
|
||||||
|
@ -290,10 +366,6 @@ const isPlaying = ref(false);
|
||||||
const hasVideoError = ref(false);
|
const hasVideoError = ref(false);
|
||||||
const videoStatus = ref('点击"播放视频流"按钮开始查看实时视频');
|
const videoStatus = ref('点击"播放视频流"按钮开始查看实时视频');
|
||||||
|
|
||||||
// 视频流类型切换相关
|
|
||||||
const streamType = ref<'usbCamera' | 'videoStream'>('videoStream');
|
|
||||||
const isSwitchingStreamType = ref(false);
|
|
||||||
|
|
||||||
// 对焦相关状态
|
// 对焦相关状态
|
||||||
const isFocusing = ref(false);
|
const isFocusing = ref(false);
|
||||||
const focusAnimationClass = ref('');
|
const focusAnimationClass = ref('');
|
||||||
|
@ -318,7 +390,7 @@ const statusInfo = ref({
|
||||||
clientEndpoints: [] as string[],
|
clientEndpoints: [] as string[],
|
||||||
});
|
});
|
||||||
|
|
||||||
const streamInfo = ref<StreamInfoResult>(new StreamInfoResult({
|
const streamInfo = ref({
|
||||||
frameRate: 30,
|
frameRate: 30,
|
||||||
frameWidth: 640,
|
frameWidth: 640,
|
||||||
frameHeight: 480,
|
frameHeight: 480,
|
||||||
|
@ -326,8 +398,7 @@ const streamInfo = ref<StreamInfoResult>(new StreamInfoResult({
|
||||||
htmlUrl: "",
|
htmlUrl: "",
|
||||||
mjpegUrl: "",
|
mjpegUrl: "",
|
||||||
snapshotUrl: "",
|
snapshotUrl: "",
|
||||||
usbCameraUrl: "",
|
});
|
||||||
}));
|
|
||||||
|
|
||||||
const currentVideoSource = ref("");
|
const currentVideoSource = ref("");
|
||||||
const logs = ref<Array<{ time: Date; level: string; message: string }>>([]);
|
const logs = ref<Array<{ time: Date; level: string; message: string }>>([]);
|
||||||
|
@ -391,27 +462,6 @@ const openInNewTab = (url: string) => {
|
||||||
addLog("info", `已在新标签打开视频页面: ${url}`);
|
addLog("info", `已在新标签打开视频页面: ${url}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 切换视频流类型
|
|
||||||
const toggleStreamType = async () => {
|
|
||||||
if (isSwitchingStreamType.value) return;
|
|
||||||
isSwitchingStreamType.value = true;
|
|
||||||
try {
|
|
||||||
// 这里假设后端有API: setStreamType(type: string)
|
|
||||||
addLog('info', `正在切换视频流类型到${streamType.value === 'usbCamera' ? '视频流' : 'USB摄像头'}...`);
|
|
||||||
refreshStatus();
|
|
||||||
|
|
||||||
// 设置视频源
|
|
||||||
streamType.value = streamType.value === 'usbCamera' ? 'videoStream' : 'usbCamera';
|
|
||||||
addLog('success', `已切换到${streamType.value === 'usbCamera' ? 'USB摄像头' : '视频流'}`);
|
|
||||||
stopStream();
|
|
||||||
} catch (error) {
|
|
||||||
addLog('error', `切换视频流类型失败: ${error}`);
|
|
||||||
console.error('切换视频流类型失败:', error);
|
|
||||||
} finally {
|
|
||||||
isSwitchingStreamType.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取并下载快照
|
// 获取并下载快照
|
||||||
const takeSnapshot = async () => {
|
const takeSnapshot = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -604,7 +654,7 @@ const startStream = async () => {
|
||||||
await refreshStatus();
|
await refreshStatus();
|
||||||
|
|
||||||
// 设置视频源
|
// 设置视频源
|
||||||
currentVideoSource.value = streamType.value === 'usbCamera' ? streamInfo.value.usbCameraUrl : streamInfo.value.mjpegUrl;
|
currentVideoSource.value = streamInfo.value.mjpegUrl;
|
||||||
|
|
||||||
// 设置播放状态
|
// 设置播放状态
|
||||||
isPlaying.value = true;
|
isPlaying.value = true;
|
||||||
|
@ -760,27 +810,21 @@ img {
|
||||||
0% {
|
0% {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
border-color: #fbbf24;
|
border-color: #fbbf24; /* 黄色 */
|
||||||
/* 黄色 */
|
|
||||||
box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
|
box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes focus-success-animation {
|
@keyframes focus-success-animation {
|
||||||
0% {
|
0% {
|
||||||
border-color: #fbbf24;
|
border-color: #fbbf24; /* 黄色 */
|
||||||
/* 黄色 */
|
|
||||||
box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
|
box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
border-color: #10b981;
|
border-color: #10b981; /* 绿色 */
|
||||||
/* 绿色 */
|
|
||||||
box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
|
box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
@ -789,17 +833,13 @@ img {
|
||||||
|
|
||||||
@keyframes focus-error-animation {
|
@keyframes focus-error-animation {
|
||||||
0% {
|
0% {
|
||||||
border-color: #fbbf24;
|
border-color: #fbbf24; /* 黄色 */
|
||||||
/* 黄色 */
|
|
||||||
box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
|
box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
border-color: #ef4444;
|
border-color: #ef4444; /* 红色 */
|
||||||
/* 红色 */
|
|
||||||
box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
|
box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|
Loading…
Reference in New Issue