- 新增 WindowsCredential 模型和控制器,用于管理 Windows 凭据 - 新增 RemoteAccessToken 模型,支持生成可分享的远程访问链接 - 更新 RemoteDesktopController,添加 Token 生成、验证、撤销等 API - 更新前端 RemoteDesktopModal,支持4种连接方式:快速连接、生成分享链接、手动输入、链接管理 - 新增 WindowsCredentialManager 组件用于管理 Windows 凭据 - 新增 RemoteAccessPage 用于通过 Token 访问远程桌面 - 添加 Vue Router 支持 /remote/:token 路由 - 更新数据库迁移,添加 WindowsCredentials 和 RemoteAccessTokens 表
382 lines
13 KiB
C#
382 lines
13 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using AmtScanner.Api.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace AmtScanner.Api.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
partial class AppDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.AmtCredential", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsDefault")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<string>("Password")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name");
|
|
|
|
b.ToTable("AmtCredentials");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.AmtDevice", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<bool>("AmtOnline")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("DiscoveredAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Hostname")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("varchar(50)");
|
|
|
|
b.Property<DateTime>("LastSeenAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("MajorVersion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MinorVersion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("OsOnline")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<int>("ProvisioningState")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IpAddress")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AmtDevices");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.HardwareInfo", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("DeviceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("LastUpdated")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int?>("ProcessorCores")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("ProcessorCurrentClockSpeed")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("ProcessorMaxClockSpeed")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ProcessorModel")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int?>("ProcessorThreads")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SystemManufacturer")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SystemModel")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SystemSerialNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<long?>("TotalMemoryBytes")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DeviceId");
|
|
|
|
b.HasIndex("LastUpdated");
|
|
|
|
b.ToTable("HardwareInfos");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.MemoryModule", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long?>("CapacityBytes")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("HardwareInfoId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("Manufacturer")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("MemoryType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("PartNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SerialNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SlotLocation")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int?>("SpeedMHz")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("HardwareInfoId");
|
|
|
|
b.ToTable("MemoryModules");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.RemoteAccessToken", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("DeviceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("ExpiresAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<bool>("IsUsed")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<int>("MaxUseCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Note")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<string>("Token")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<int>("UseCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UsedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long?>("WindowsCredentialId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DeviceId");
|
|
|
|
b.HasIndex("Token")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("WindowsCredentialId");
|
|
|
|
b.ToTable("RemoteAccessTokens");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.StorageDevice", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long?>("CapacityBytes")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("DeviceId")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<long>("HardwareInfoId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("InterfaceType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Model")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("HardwareInfoId");
|
|
|
|
b.ToTable("StorageDevices");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.WindowsCredential", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Domain")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<bool>("IsDefault")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.Property<string>("Note")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<string>("Password")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("varchar(500)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("varchar(200)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name");
|
|
|
|
b.ToTable("WindowsCredentials");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.HardwareInfo", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.AmtDevice", "Device")
|
|
.WithMany()
|
|
.HasForeignKey("DeviceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Device");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.MemoryModule", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.HardwareInfo", "HardwareInfo")
|
|
.WithMany("MemoryModules")
|
|
.HasForeignKey("HardwareInfoId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("HardwareInfo");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.RemoteAccessToken", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.AmtDevice", "Device")
|
|
.WithMany()
|
|
.HasForeignKey("DeviceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AmtScanner.Api.Models.WindowsCredential", "WindowsCredential")
|
|
.WithMany()
|
|
.HasForeignKey("WindowsCredentialId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("Device");
|
|
|
|
b.Navigation("WindowsCredential");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.StorageDevice", b =>
|
|
{
|
|
b.HasOne("AmtScanner.Api.Models.HardwareInfo", "HardwareInfo")
|
|
.WithMany("StorageDevices")
|
|
.HasForeignKey("HardwareInfoId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("HardwareInfo");
|
|
});
|
|
|
|
modelBuilder.Entity("AmtScanner.Api.Models.HardwareInfo", b =>
|
|
{
|
|
b.Navigation("MemoryModules");
|
|
|
|
b.Navigation("StorageDevices");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|