From 5fd8484b3b049cdf28b91b031d198c2384fc2c57 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 27 Apr 2025 12:41:33 +0100 Subject: [PATCH] Add possible missing files (I don't trust git move). --- Aaru.Server.Old/Aaru.Server.Old.csproj | 185 ++ .../Areas/Admin/Controllers/AtasController.cs | 501 ++++ .../Controllers/BlockDescriptorsController.cs | 18 + .../Areas/Admin/Controllers/ChsController.cs | 91 + .../Admin/Controllers/CommandsController.cs | 15 + .../CompactDiscOffsetsController.cs | 94 + .../Controllers/DeviceStatsController.cs | 89 + .../Admin/Controllers/DevicesController.cs | 389 +++ .../Controllers/FilesystemsController.cs | 15 + .../Admin/Controllers/FiltersController.cs | 15 + .../Admin/Controllers/FireWiresController.cs | 172 ++ .../GdRomSwapDiscCapabilitiesController.cs | 361 +++ .../Areas/Admin/Controllers/HomeController.cs | 40 + .../Controllers/MediaFormatsController.cs | 41 + .../Admin/Controllers/MediasController.cs | 56 + .../Areas/Admin/Controllers/MmcController.cs | 81 + .../Controllers/MmcFeaturesController.cs | 28 + .../Admin/Controllers/MmcSdsController.cs | 53 + .../Controllers/OperatingSystemsController.cs | 16 + .../Admin/Controllers/PartitionsController.cs | 15 + .../Admin/Controllers/PcmciasController.cs | 41 + .../Admin/Controllers/ReportsController.cs | 292 +++ .../Admin/Controllers/ScsiModesController.cs | 41 + .../Admin/Controllers/ScsiPagesController.cs | 41 + .../Admin/Controllers/ScsisController.cs | 355 +++ .../Areas/Admin/Controllers/SscsController.cs | 115 + .../SupportedDensitiesController.cs | 53 + .../Controllers/TestedMediasController.cs | 695 +++++ .../TestedSequentialMediasController.cs | 90 + .../Controllers/UsbProductsController.cs | 27 + .../Admin/Controllers/UsbVendorsController.cs | 42 + .../Areas/Admin/Controllers/UsbsController.cs | 142 ++ .../Admin/Controllers/VersionsController.cs | 15 + .../Admin/Views/Atas/CheckPrivate.cshtml | 138 + .../Areas/Admin/Views/Atas/Compare.cshtml | 86 + .../Areas/Admin/Views/Atas/Consolidate.cshtml | 32 + .../Areas/Admin/Views/Atas/Delete.cshtml | 50 + .../Areas/Admin/Views/Atas/Details.cshtml | 51 + .../Areas/Admin/Views/Atas/Index.cshtml | 77 + .../Admin/Views/BlockDescriptors/Index.cshtml | 68 + .../Areas/Admin/Views/Chs/Consolidate.cshtml | 32 + .../Areas/Admin/Views/Chs/Index.cshtml | 70 + .../Areas/Admin/Views/Commands/Index.cshtml | 63 + .../Views/CompactDiscOffsets/Delete.cshtml | 89 + .../Views/CompactDiscOffsets/Edit.cshtml | 74 + .../Views/CompactDiscOffsets/Index.cshtml | 107 + .../Admin/Views/DeviceStats/Delete.cshtml | 71 + .../Areas/Admin/Views/DeviceStats/Edit.cshtml | 69 + .../Admin/Views/DeviceStats/Index.cshtml | 94 + .../Areas/Admin/Views/Devices/Delete.cshtml | 101 + .../Areas/Admin/Views/Devices/Details.cshtml | 490 ++++ .../Areas/Admin/Views/Devices/Edit.cshtml | 85 + .../Areas/Admin/Views/Devices/Find.cshtml | 120 + .../Areas/Admin/Views/Devices/Index.cshtml | 98 + .../Admin/Views/Filesystems/Index.cshtml | 62 + .../Areas/Admin/Views/Filters/Index.cshtml | 62 + .../Admin/Views/FireWires/Consolidate.cshtml | 62 + .../Areas/Admin/Views/FireWires/Delete.cshtml | 77 + .../Areas/Admin/Views/FireWires/Edit.cshtml | 74 + .../Areas/Admin/Views/FireWires/Index.cshtml | 86 + .../GdRomSwapDiscCapabilities/Delete.cshtml | 1151 +++++++++ .../GdRomSwapDiscCapabilities/Details.cshtml | 1146 +++++++++ .../GdRomSwapDiscCapabilities/ViewData.cshtml | 27 + .../Areas/Admin/Views/Home/Index.cshtml | 97 + .../Admin/Views/MediaFormats/Delete.cshtml | 59 + .../Admin/Views/MediaFormats/Index.cshtml | 66 + .../Areas/Admin/Views/Medias/Delete.cshtml | 65 + .../Areas/Admin/Views/Medias/Index.cshtml | 78 + .../Areas/Admin/Views/Mmc/Delete.cshtml | 48 + .../Areas/Admin/Views/Mmc/Details.cshtml | 45 + .../Areas/Admin/Views/Mmc/Index.cshtml | 81 + .../Admin/Views/MmcFeatures/Details.cshtml | 782 ++++++ .../Admin/Views/MmcFeatures/Index.cshtml | 792 ++++++ .../Areas/Admin/Views/MmcSds/Delete.cshtml | 130 + .../Areas/Admin/Views/MmcSds/Details.cshtml | 127 + .../Areas/Admin/Views/MmcSds/Index.cshtml | 61 + .../Admin/Views/OperatingSystems/Index.cshtml | 68 + .../Areas/Admin/Views/Partitions/Index.cshtml | 62 + .../Areas/Admin/Views/Pcmcias/Delete.cshtml | 83 + .../Areas/Admin/Views/Pcmcias/Index.cshtml | 90 + .../Areas/Admin/Views/Reports/Delete.cshtml | 53 + .../Areas/Admin/Views/Reports/Details.cshtml | 315 +++ .../Areas/Admin/Views/Reports/Edit.cshtml | 45 + .../Areas/Admin/Views/Reports/Index.cshtml | 56 + .../Areas/Admin/Views/ScsiModes/Delete.cshtml | 83 + .../Areas/Admin/Views/ScsiModes/Index.cshtml | 90 + .../Areas/Admin/Views/ScsiPages/Delete.cshtml | 65 + .../Areas/Admin/Views/ScsiPages/Index.cshtml | 66 + .../Areas/Admin/Views/Scsis/Compare.cshtml | 86 + .../Admin/Views/Scsis/Consolidate.cshtml | 32 + .../Areas/Admin/Views/Scsis/Delete.cshtml | 48 + .../Areas/Admin/Views/Scsis/Details.cshtml | 51 + .../Areas/Admin/Views/Scsis/Index.cshtml | 101 + .../Areas/Admin/Views/Shared/_Layout.cshtml | 140 ++ .../Admin/Views/Shared/_LoginPartial.cshtml | 25 + .../Areas/Admin/Views/Sscs/Consolidate.cshtml | 50 + .../Areas/Admin/Views/Sscs/Delete.cshtml | 65 + .../Areas/Admin/Views/Sscs/Index.cshtml | 75 + .../Views/SupportedDensities/Delete.cshtml | 119 + .../Views/SupportedDensities/Index.cshtml | 126 + .../Admin/Views/TestedMedias/Delete.cshtml | 1507 +++++++++++ .../Admin/Views/TestedMedias/Details.cshtml | 1505 +++++++++++ .../Admin/Views/TestedMedias/Edit.cshtml | 79 + .../Admin/Views/TestedMedias/Index.cshtml | 98 + .../Admin/Views/TestedMedias/ViewData.cshtml | 27 + .../TestedSequentialMedias/Delete.cshtml | 89 + .../Views/TestedSequentialMedias/Edit.cshtml | 64 + .../Views/TestedSequentialMedias/Index.cshtml | 97 + .../Admin/Views/UsbProducts/Index.cshtml | 77 + .../Admin/Views/UsbVendors/Details.cshtml | 94 + .../Areas/Admin/Views/UsbVendors/Index.cshtml | 75 + .../Areas/Admin/Views/Usbs/Consolidate.cshtml | 56 + .../Areas/Admin/Views/Usbs/Delete.cshtml | 83 + .../Areas/Admin/Views/Usbs/Details.cshtml | 74 + .../Areas/Admin/Views/Usbs/Index.cshtml | 88 + .../Areas/Admin/Views/Versions/Index.cshtml | 66 + .../Areas/Admin/Views/_ViewImports.cshtml | 4 + .../Areas/Admin/Views/_ViewStart.cshtml | 3 + .../Identity/Pages/Account/Register.cshtml | 7 + .../Identity/Pages/Account/Register.cshtml.cs | 11 + .../Pages/Account/_ViewImports.cshtml | 1 + .../Pages/_ValidationScriptsPartial.cshtml | 10 + .../Areas/Identity/Pages/_ViewImports.cshtml | 4 + .../Areas/Identity/Pages/_ViewStart.cshtml | 3 + Aaru.Server.Old/BasicAuthMiddleware.cs | 73 + .../Controllers/ReportController.cs | 551 ++++ .../Controllers/StatsController.cs | 657 +++++ .../Controllers/UpdateController.cs | 139 + .../Controllers/UploadReportController.cs | 375 +++ .../Controllers/UploadStatsController.cs | 386 +++ Aaru.Server.Old/Core/Ata.cs | 1938 ++++++++++++++ Aaru.Server.Old/Core/Hash.cs | 35 + Aaru.Server.Old/Core/HtmlHelpers.cs | 28 + Aaru.Server.Old/Core/ScsiEvpd.cs | 110 + Aaru.Server.Old/Core/ScsiInquiry.cs | 2238 +++++++++++++++++ Aaru.Server.Old/Core/ScsiMmcFeatures.cs | 413 +++ Aaru.Server.Old/Core/ScsiMmcMode.cs | 199 ++ Aaru.Server.Old/Core/ScsiModeSense.cs | 451 ++++ Aaru.Server.Old/Core/SscTestedMedia.cs | 71 + Aaru.Server.Old/Core/StatsConverter.cs | 586 +++++ Aaru.Server.Old/Core/TestedMedia.cs | 412 +++ Aaru.Server.Old/Globals.cs | 7 + Aaru.Server.Old/Program.cs | 192 ++ .../Properties/launchSettings.json | 27 + Aaru.Server.Old/SecurityHeadersMiddleware.cs | 67 + Aaru.Server.Old/Seeder.cs | 35 + Aaru.Server.Old/Views/Report/View.cshtml | 323 +++ Aaru.Server.Old/Views/Shared/Error.cshtml | 27 + .../Views/Shared/_CookieConsentPartial.cshtml | 25 + Aaru.Server.Old/Views/Shared/_Layout.cshtml | 65 + .../Shared/_ValidationScriptsPartial.cshtml | 2 + Aaru.Server.Old/Views/Stats/Index.cshtml | 643 +++++ Aaru.Server.Old/Views/_ViewImports.cshtml | 4 + Aaru.Server.Old/Views/_ViewStart.cshtml | 3 + Aaru.Server.Old/aaru-server.service | 16 + Aaru.Server.Old/appsettings.Development.json | 16 + Aaru.Server.Old/appsettings.json | 12 + Aaru.Server.Old/docs/CODE_OF_CONDUCT.md | 60 + Aaru.Server.Old/docs/CONTRIBUTING.md | 300 +++ Aaru.Server.Old/docs/Changelog.md | 1820 ++++++++++++++ Aaru.Server.Old/docs/ISSUE_TEMPLATE.md | 53 + Aaru.Server.Old/docs/NEEDED.md | 141 ++ Aaru.Server.Old/docs/NEEDINFO.md | 11 + Aaru.Server.Old/docs/PULL_REQUEST_TEMPLATE.md | 16 + Aaru.Server.Old/docs/README.md | 274 ++ Aaru.Server.Old/package-lock.json | 36 + Aaru.Server.Old/package.json | 13 + 167 files changed, 30433 insertions(+) create mode 100644 Aaru.Server.Old/Aaru.Server.Old.csproj create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/AtasController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/BlockDescriptorsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/ChsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/CommandsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/CompactDiscOffsetsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/DeviceStatsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/DevicesController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/FilesystemsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/FiltersController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/FireWiresController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/GdRomSwapDiscCapabilitiesController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/HomeController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/MediaFormatsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/MediasController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/MmcController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/MmcFeaturesController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/MmcSdsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/OperatingSystemsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/PartitionsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/PcmciasController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/ReportsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/ScsiModesController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/ScsiPagesController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/ScsisController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/SscsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/SupportedDensitiesController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/TestedMediasController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/TestedSequentialMediasController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/UsbProductsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/UsbVendorsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/UsbsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Controllers/VersionsController.cs create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Atas/CheckPrivate.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Atas/Compare.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Atas/Consolidate.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Atas/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Atas/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Atas/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/BlockDescriptors/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Chs/Consolidate.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Chs/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Commands/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Edit.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Edit.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Devices/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Devices/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Devices/Edit.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Devices/Find.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Devices/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Filesystems/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Filters/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/FireWires/Consolidate.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/FireWires/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/FireWires/Edit.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/FireWires/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/ViewData.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Home/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Medias/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Medias/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Mmc/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Mmc/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Mmc/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/MmcSds/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/MmcSds/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/MmcSds/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/OperatingSystems/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Partitions/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Reports/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Reports/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Reports/Edit.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Reports/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Scsis/Compare.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Scsis/Consolidate.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Scsis/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Scsis/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Scsis/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Shared/_Layout.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Shared/_LoginPartial.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Sscs/Consolidate.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Sscs/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Sscs/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Edit.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedMedias/ViewData.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Edit.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/UsbProducts/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Usbs/Consolidate.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Usbs/Delete.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Usbs/Details.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Usbs/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/Versions/Index.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/_ViewImports.cshtml create mode 100644 Aaru.Server.Old/Areas/Admin/Views/_ViewStart.cshtml create mode 100644 Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml create mode 100644 Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml.cs create mode 100644 Aaru.Server.Old/Areas/Identity/Pages/Account/_ViewImports.cshtml create mode 100644 Aaru.Server.Old/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml create mode 100644 Aaru.Server.Old/Areas/Identity/Pages/_ViewImports.cshtml create mode 100644 Aaru.Server.Old/Areas/Identity/Pages/_ViewStart.cshtml create mode 100644 Aaru.Server.Old/BasicAuthMiddleware.cs create mode 100644 Aaru.Server.Old/Controllers/ReportController.cs create mode 100644 Aaru.Server.Old/Controllers/StatsController.cs create mode 100644 Aaru.Server.Old/Controllers/UpdateController.cs create mode 100644 Aaru.Server.Old/Controllers/UploadReportController.cs create mode 100644 Aaru.Server.Old/Controllers/UploadStatsController.cs create mode 100644 Aaru.Server.Old/Core/Ata.cs create mode 100644 Aaru.Server.Old/Core/Hash.cs create mode 100644 Aaru.Server.Old/Core/HtmlHelpers.cs create mode 100644 Aaru.Server.Old/Core/ScsiEvpd.cs create mode 100644 Aaru.Server.Old/Core/ScsiInquiry.cs create mode 100644 Aaru.Server.Old/Core/ScsiMmcFeatures.cs create mode 100644 Aaru.Server.Old/Core/ScsiMmcMode.cs create mode 100644 Aaru.Server.Old/Core/ScsiModeSense.cs create mode 100644 Aaru.Server.Old/Core/SscTestedMedia.cs create mode 100644 Aaru.Server.Old/Core/StatsConverter.cs create mode 100644 Aaru.Server.Old/Core/TestedMedia.cs create mode 100644 Aaru.Server.Old/Globals.cs create mode 100644 Aaru.Server.Old/Program.cs create mode 100644 Aaru.Server.Old/Properties/launchSettings.json create mode 100644 Aaru.Server.Old/SecurityHeadersMiddleware.cs create mode 100644 Aaru.Server.Old/Seeder.cs create mode 100644 Aaru.Server.Old/Views/Report/View.cshtml create mode 100644 Aaru.Server.Old/Views/Shared/Error.cshtml create mode 100644 Aaru.Server.Old/Views/Shared/_CookieConsentPartial.cshtml create mode 100644 Aaru.Server.Old/Views/Shared/_Layout.cshtml create mode 100644 Aaru.Server.Old/Views/Shared/_ValidationScriptsPartial.cshtml create mode 100644 Aaru.Server.Old/Views/Stats/Index.cshtml create mode 100644 Aaru.Server.Old/Views/_ViewImports.cshtml create mode 100644 Aaru.Server.Old/Views/_ViewStart.cshtml create mode 100644 Aaru.Server.Old/aaru-server.service create mode 100644 Aaru.Server.Old/appsettings.Development.json create mode 100644 Aaru.Server.Old/appsettings.json create mode 100644 Aaru.Server.Old/docs/CODE_OF_CONDUCT.md create mode 100644 Aaru.Server.Old/docs/CONTRIBUTING.md create mode 100644 Aaru.Server.Old/docs/Changelog.md create mode 100644 Aaru.Server.Old/docs/ISSUE_TEMPLATE.md create mode 100644 Aaru.Server.Old/docs/NEEDED.md create mode 100644 Aaru.Server.Old/docs/NEEDINFO.md create mode 100644 Aaru.Server.Old/docs/PULL_REQUEST_TEMPLATE.md create mode 100644 Aaru.Server.Old/docs/README.md create mode 100644 Aaru.Server.Old/package-lock.json create mode 100644 Aaru.Server.Old/package.json diff --git a/Aaru.Server.Old/Aaru.Server.Old.csproj b/Aaru.Server.Old/Aaru.Server.Old.csproj new file mode 100644 index 00000000..e1985ffd --- /dev/null +++ b/Aaru.Server.Old/Aaru.Server.Old.csproj @@ -0,0 +1,185 @@ + + + + net6.0 + latest + + + + $(Version) + true + 5.2.99.306 + Claunia.com + Copyright © 2011-2024 Natalia Portillo + Aaru Data Preservation Suite + Aaru.Server + $(Version) + linux-x64 + + + + $(Version)-{chash:8} built by {mname} in $(Configuration){!:, modified} + true + true + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ContentIncludedByDefault Remove="wwwroot\js\site.js"/> + <_ContentIncludedByDefault Remove="wwwroot\css\js\colors\dos.js"/> + <_ContentIncludedByDefault Remove="wwwroot\css\js\colors\mac.js"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Shared\Error.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Shared\_CookieConsentPartial.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Shared\_Layout.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Shared\_LoginPartial.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Shared\_ValidationScriptsPartial.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\Device\Create.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\Device\Delete.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\Device\Details.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\Device\Edit.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\Device\Index.cshtml"/> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\Atas\EditorTemplates\IdHashModel.cshtml"/> + <_ContentIncludedByDefault Remove="Views\Home\Changelog.cshtml"/> + <_ContentIncludedByDefault Remove="Views\Home\CODE_OF_CONDUCT.cshtml"/> + <_ContentIncludedByDefault Remove="Views\Home\CONTRIBUTING.cshtml"/> + <_ContentIncludedByDefault Remove="Views\Home\ISSUE_TEMPLATE.cshtml"/> + <_ContentIncludedByDefault Remove="Views\Home\NEEDED.cshtml"/> + <_ContentIncludedByDefault Remove="Views\Home\NEEDINFO.cshtml"/> + <_ContentIncludedByDefault Remove="Views\Home\PULL_REQUEST_TEMPLATE.cshtml"/> + + + + + + + + + + + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + + + + + + diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/AtasController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/AtasController.cs new file mode 100644 index 00000000..644151cc --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/AtasController.cs @@ -0,0 +1,501 @@ +using System.Reflection; +using Aaru.CommonTypes.Structs.Devices.ATA; +using Aaru.Server.Old.Database.Models; +using Aaru.Server.Old.Core; +using Newtonsoft.Json; +using Ata = Aaru.CommonTypes.Metadata.Ata; +using DbContext = Aaru.Server.Old.Database.DbContext; +using TestedMedia = Aaru.CommonTypes.Metadata.TestedMedia; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class AtasController : Controller +{ + readonly DbContext _context; + + public AtasController(DbContext context) => _context = context; + + // GET: Admin/Atas + public IActionResult Index() => View(_context.Ata.AsEnumerable() + .OrderBy(m => m.IdentifyDevice?.Model) + .ThenBy(m => m.IdentifyDevice?.FirmwareRevision)); + + // GET: Admin/Atas/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + Ata ata = await _context.Ata.FirstOrDefaultAsync(m => m.Id == id); + + if(ata == null) return NotFound(); + + return View(ata); + } + + // GET: Admin/Atas/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Ata ata = await _context.Ata.FirstOrDefaultAsync(m => m.Id == id); + + if(ata == null) return NotFound(); + + return View(ata); + } + + // POST: Admin/Atas/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Ata ata = await _context.Ata.FindAsync(id); + _context.Ata.Remove(ata); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Consolidate() + { + var hashes = _context.Ata.Select(m => new IdHashModel(m.Id, Hash.Sha512(m.Identify))).ToList(); + + var dups = hashes.GroupBy(x => x.Hash) + .Where(g => g.Count() > 1) + .Select(x => hashes.FirstOrDefault(y => y.Hash == x.Key)) + .ToList(); + + for(var i = 0; i < dups.Count; i++) + { + Ata unique = _context.Ata.First(a => a.Id == dups[i].Id); + + dups[i].Description = unique.IdentifyDevice?.Model; + dups[i].Duplicates = hashes.Where(h => h.Hash == dups[i].Hash).Skip(1).Select(x => x.Id).ToArray(); + } + + return View(new IdHashModelForView + { + List = dups, + Json = JsonConvert.SerializeObject(dups) + }); + } + + [HttpPost] + [ActionName("Consolidate")] + [ValidateAntiForgeryToken] + public IActionResult ConsolidateConfirmed(string models) + { + IdHashModel[] duplicates; + + try + { + duplicates = JsonConvert.DeserializeObject(models); + } + catch(JsonSerializationException) + { + return BadRequest(); + } + + if(duplicates is null) return BadRequest(); + + foreach(IdHashModel duplicate in duplicates) + { + Ata master = _context.Ata.FirstOrDefault(m => m.Id == duplicate.Id); + + if(master is null) continue; + + foreach(int duplicateId in duplicate.Duplicates) + { + Ata slave = _context.Ata.FirstOrDefault(m => m.Id == duplicateId); + + if(slave is null) continue; + + foreach(Device ataDevice in _context.Devices.Where(d => d.ATA.Id == duplicateId)) + ataDevice.ATA = master; + + foreach(Device atapiDevice in _context.Devices.Where(d => d.ATAPI.Id == duplicateId)) + atapiDevice.ATAPI = master; + + foreach(UploadedReport ataReport in _context.Reports.Where(d => d.ATA.Id == duplicateId)) + ataReport.ATA = master; + + foreach(UploadedReport atapiReport in _context.Reports.Where(d => d.ATAPI.Id == duplicateId)) + atapiReport.ATAPI = master; + + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == duplicateId)) + { + testedMedia.AtaId = duplicate.Id; + _context.Update(testedMedia); + } + + if(master.ReadCapabilities is null && slave.ReadCapabilities != null) + master.ReadCapabilities = slave.ReadCapabilities; + + _context.Ata.Remove(slave); + } + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult ConsolidateWithIds(int masterId, int slaveId) + { + Ata master = _context.Ata.FirstOrDefault(m => m.Id == masterId); + + if(master is null) + { + return RedirectToAction(nameof(Compare), + new + { + id = masterId, + rightId = slaveId + }); + } + + Ata slave = _context.Ata.FirstOrDefault(m => m.Id == slaveId); + + if(slave is null) + { + return RedirectToAction(nameof(Compare), + new + { + id = masterId, + rightId = slaveId + }); + } + + foreach(Device ataDevice in _context.Devices.Where(d => d.ATA.Id == slaveId)) ataDevice.ATA = master; + + foreach(Device atapiDevice in _context.Devices.Where(d => d.ATAPI.Id == slaveId)) atapiDevice.ATAPI = master; + + foreach(UploadedReport ataReport in _context.Reports.Where(d => d.ATA.Id == slaveId)) ataReport.ATA = master; + + foreach(UploadedReport atapiReport in _context.Reports.Where(d => d.ATAPI.Id == slaveId)) + atapiReport.ATAPI = master; + + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == slaveId)) + { + testedMedia.AtaId = masterId; + _context.Update(testedMedia); + } + + if(master.ReadCapabilities is null && slave.ReadCapabilities != null) + master.ReadCapabilities = slave.ReadCapabilities; + + _context.Ata.Remove(slave); + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Compare(int id, int rightId) + { + var model = new CompareModel + { + LeftId = id, + RightId = rightId + }; + + Ata left = _context.Ata.FirstOrDefault(l => l.Id == id); + Ata right = _context.Ata.FirstOrDefault(r => r.Id == rightId); + + if(left is null) + { + model.ErrorMessage = $"ATA with id {id} has not been found"; + model.HasError = true; + + return View(model); + } + + if(right is null) + { + model.ErrorMessage = $"ATA with id {rightId} has not been found"; + model.HasError = true; + + return View(model); + } + + Identify.IdentifyDevice? leftNullable = left.IdentifyDevice; + Identify.IdentifyDevice? rightNullable = right.IdentifyDevice; + model.ValueNames = new List(); + model.LeftValues = new List(); + model.RightValues = new List(); + + if(!leftNullable.HasValue && !rightNullable.HasValue) + { + model.AreEqual = true; + + return View(model); + } + + if(leftNullable.HasValue && !rightNullable.HasValue) + { + model.ValueNames.Add("Decoded"); + model.LeftValues.Add("decoded"); + model.RightValues.Add("null"); + + return View(model); + } + + if(!leftNullable.HasValue) + { + model.ValueNames.Add("Decoded"); + model.LeftValues.Add("null"); + model.RightValues.Add("decoded"); + + return View(model); + } + + Identify.IdentifyDevice leftValue = left.IdentifyDevice.Value; + Identify.IdentifyDevice rightValue = right.IdentifyDevice.Value; + + foreach(FieldInfo fieldInfo in leftValue.GetType().GetFields()) + { + object lv = fieldInfo.GetValue(leftValue); + object rv = fieldInfo.GetValue(rightValue); + + if(fieldInfo.FieldType.IsArray) + { + var la = lv as Array; + var ra = rv as Array; + + switch(la) + { + case null when ra is null: + continue; + case null: + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("null"); + model.RightValues.Add("[]"); + + continue; + } + + if(ra is null) + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("[]"); + model.RightValues.Add("null"); + + continue; + } + + var ll = la.Cast().ToList(); + var rl = ra.Cast().ToList(); + + for(var i = 0; i < ll.Count; i++) + { + if(ll[i].Equals(rl[i])) continue; + + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("[]"); + model.RightValues.Add("[]"); + + break; + } + } + else if(lv == null && rv == null) {} + else if(lv != null && rv == null) + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add($"{lv}"); + model.RightValues.Add("null"); + } + else if(lv == null) + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("null"); + model.RightValues.Add($"{rv}"); + } + else if(!lv.Equals(rv)) + + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add($"{lv}"); + model.RightValues.Add($"{rv}"); + } + } + + model.AreEqual = model.LeftValues.Count == 0 && model.RightValues.Count == 0; + + return View(model); + } + + public IActionResult CheckPrivate() + { + List havePrivacy = new(); + byte[] tmp; + + foreach(Ata ata in _context.Ata) + { + Identify.IdentifyDevice? id = ata.IdentifyDevice; + + if(id is null) continue; + + if(!string.IsNullOrWhiteSpace(id.Value.SerialNumber) || + id.Value.WWN != 0 || + id.Value.WWNExtension != 0 || + !string.IsNullOrWhiteSpace(id.Value.MediaSerial)) + { + havePrivacy.Add(ata); + + continue; + } + + tmp = new byte[10]; + Array.Copy(ata.Identify, 121 * 2, tmp, 0, 10); + + if(tmp.All(b => b > 0x20) && tmp.All(b => b <= 0x5F)) + { + havePrivacy.Add(ata); + + continue; + } + + tmp = new byte[62]; + Array.Copy(ata.Identify, 129 * 2, tmp, 0, 62); + + if(tmp.All(b => b > 0x20) && tmp.All(b => b <= 0x5F)) + { + havePrivacy.Add(ata); + + continue; + } + + tmp = new byte[14]; + Array.Copy(ata.Identify, 161 * 2, tmp, 0, 14); + + if(tmp.All(b => b > 0x20) && tmp.All(b => b <= 0x5F)) + { + havePrivacy.Add(ata); + + continue; + } + + tmp = new byte[12]; + Array.Copy(ata.Identify, 224 * 2, tmp, 0, 12); + + if(tmp.All(b => b > 0x20) && tmp.All(b => b <= 0x5F)) + { + havePrivacy.Add(ata); + + continue; + } + + tmp = new byte[38]; + Array.Copy(ata.Identify, 236 * 2, tmp, 0, 38); + + if(tmp.All(b => b > 0x20) && tmp.All(b => b <= 0x5F)) havePrivacy.Add(ata); + } + + return View(havePrivacy); + } + + public IActionResult ClearPrivate(int id) + { + Ata ata = _context.Ata.FirstOrDefault(a => a.Id == id); + + if(ata is null) return RedirectToAction(nameof(CheckPrivate)); + + // Serial number + for(var i = 0; i < 20; i++) ata.Identify[10 * 2 + i] = 0x20; + + // Media serial number + for(var i = 0; i < 40; i++) ata.Identify[176 * 2 + i] = 0x20; + + // WWN and WWN Extension + for(var i = 0; i < 16; i++) ata.Identify[108 * 2 + i] = 0; + + // We need to tell EFCore the entity has changed + _context.Update(ata); + _context.SaveChanges(); + + return RedirectToAction(nameof(CheckPrivate)); + } + + public IActionResult ClearReserved(int id) + { + Ata ata = _context.Ata.FirstOrDefault(a => a.Id == id); + + if(ata is null) return RedirectToAction(nameof(CheckPrivate)); + + // ReservedWords121 + for(var i = 0; i < 10; i++) ata.Identify[121 * 2 + i] = 0; + + // ReservedWords129 + for(var i = 0; i < 40; i++) ata.Identify[129 * 2 + i] = 0; + + // ReservedCFA + for(var i = 0; i < 14; i++) ata.Identify[161 * 2 + i] = 0; + + // ReservedCEATA224 + for(var i = 0; i < 12; i++) ata.Identify[224 * 2 + i] = 0; + + // ReservedWords + for(var i = 0; i < 14; i++) ata.Identify[161 * 2 + i] = 0; + + // We need to tell EFCore the entity has changed + _context.Update(ata); + _context.SaveChanges(); + + return RedirectToAction(nameof(CheckPrivate)); + } + + public IActionResult ClearPrivateAll() + { + foreach(Ata ata in _context.Ata) + { + if(ata is null) return RedirectToAction(nameof(CheckPrivate)); + + // Serial number + for(var i = 0; i < 20; i++) ata.Identify[10 * 2 + i] = 0x20; + + // Media serial number + for(var i = 0; i < 40; i++) ata.Identify[176 * 2 + i] = 0x20; + + // WWN and WWN Extension + for(var i = 0; i < 16; i++) ata.Identify[108 * 2 + i] = 0; + + // We need to tell EFCore the entity has changed + _context.Update(ata); + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(CheckPrivate)); + } + + public IActionResult ClearReservedAll() + { + foreach(Ata ata in _context.Ata) + { + // ReservedWords121 + for(var i = 0; i < 10; i++) ata.Identify[121 * 2 + i] = 0; + + // ReservedWords129 + for(var i = 0; i < 40; i++) ata.Identify[129 * 2 + i] = 0; + + // ReservedCFA + for(var i = 0; i < 14; i++) ata.Identify[161 * 2 + i] = 0; + + // ReservedCEATA224 + for(var i = 0; i < 12; i++) ata.Identify[224 * 2 + i] = 0; + + // ReservedWords + for(var i = 0; i < 14; i++) ata.Identify[161 * 2 + i] = 0; + + // We need to tell EFCore the entity has changed + _context.Update(ata); + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(CheckPrivate)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/BlockDescriptorsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/BlockDescriptorsController.cs new file mode 100644 index 00000000..fc942cec --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/BlockDescriptorsController.cs @@ -0,0 +1,18 @@ +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class BlockDescriptorsController : Controller +{ + readonly DbContext _context; + + public BlockDescriptorsController(DbContext context) => _context = context; + + // GET: Admin/BlockDescriptors + public async Task Index() => View(await _context.BlockDescriptor.OrderBy(b => b.BlockLength) + .ThenBy(b => b.Blocks) + .ThenBy(b => b.Density) + .ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/ChsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/ChsController.cs new file mode 100644 index 00000000..bcb5539c --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/ChsController.cs @@ -0,0 +1,91 @@ +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class ChsController : Controller +{ + readonly DbContext _context; + + public ChsController(DbContext context) => _context = context; + + // GET: Admin/Chs + public async Task Index() => View(await _context.Chs.OrderBy(c => c.Cylinders) + .ThenBy(c => c.Heads) + .ThenBy(c => c.Sectors) + .ToListAsync()); + + public IActionResult Consolidate() + { + var dups = _context.Chs.GroupBy(x => new + { + x.Cylinders, + x.Heads, + x.Sectors + }) + .Where(x => x.Count() > 1) + .Select(x => new ChsModel + { + Cylinders = x.Key.Cylinders, + Heads = x.Key.Heads, + Sectors = x.Key.Sectors + }) + .ToList(); + + return View(new ChsModelForView + { + List = dups, + Json = JsonConvert.SerializeObject(dups) + }); + } + + [HttpPost] + [ActionName("Consolidate")] + [ValidateAntiForgeryToken] + public IActionResult ConsolidateConfirmed(string models) + { + ChsModel[] duplicates; + + try + { + duplicates = JsonConvert.DeserializeObject(models); + } + catch(JsonSerializationException) + { + return BadRequest(); + } + + if(duplicates is null) return BadRequest(); + + foreach(ChsModel duplicate in duplicates) + { + Chs master = _context.Chs.FirstOrDefault(m => m.Cylinders == duplicate.Cylinders && + m.Heads == duplicate.Heads && + m.Sectors == duplicate.Sectors); + + if(master is null) continue; + + foreach(Chs chs in _context.Chs.Where(m => m.Cylinders == duplicate.Cylinders && + m.Heads == duplicate.Heads && + m.Sectors == duplicate.Sectors) + .Skip(1) + .ToArray()) + { + foreach(TestedMedia media in _context.TestedMedia.Where(d => d.CHS.Id == chs.Id)) media.CHS = master; + + foreach(TestedMedia media in _context.TestedMedia.Where(d => d.CurrentCHS.Id == chs.Id)) + media.CurrentCHS = master; + + _context.Chs.Remove(chs); + } + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/CommandsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/CommandsController.cs new file mode 100644 index 00000000..fdc3c091 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/CommandsController.cs @@ -0,0 +1,15 @@ +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class CommandsController : Controller +{ + readonly DbContext _context; + + public CommandsController(DbContext context) => _context = context; + + // GET: Admin/Commands + public async Task Index() => View(await _context.Commands.OrderBy(c => c.Name).ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/CompactDiscOffsetsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/CompactDiscOffsetsController.cs new file mode 100644 index 00000000..8cc25fc8 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/CompactDiscOffsetsController.cs @@ -0,0 +1,94 @@ +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class CompactDiscOffsetsController : Controller +{ + readonly DbContext _context; + + public CompactDiscOffsetsController(DbContext context) => _context = context; + + // GET: Admin/CompactDiscOffsets + public async Task Index() => View(await _context.CdOffsets.OrderBy(o => o.Manufacturer) + .ThenBy(o => o.Model) + .ThenBy(o => o.Offset) + .ToListAsync()); + + // GET: Admin/CompactDiscOffsets/Edit/5 + public async Task Edit(int? id) + { + if(id == null) return NotFound(); + + CompactDiscOffset compactDiscOffset = await _context.CdOffsets.FindAsync(id); + + if(compactDiscOffset == null) return NotFound(); + + return View(compactDiscOffset); + } + + // POST: Admin/CompactDiscOffsets/Edit/5 + // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit( + int id, [Bind("Id,Manufacturer,Model,Offset,Submissions,Agreement")] CompactDiscOffset changedModel) + { + if(id != changedModel.Id) return NotFound(); + + if(!ModelState.IsValid) return View(changedModel); + + CompactDiscOffset model = await _context.CdOffsets.FirstOrDefaultAsync(m => m.Id == id); + + if(model is null) return NotFound(); + + model.Manufacturer = changedModel.Manufacturer; + model.Model = changedModel.Model; + model.Offset = changedModel.Offset; + model.Submissions = changedModel.Submissions; + model.Agreement = changedModel.Agreement; + model.ModifiedWhen = DateTime.UtcNow; + + try + { + _context.Update(model); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + ModelState.AddModelError("Concurrency", "Concurrency error, please report to the administrator."); + } + + return RedirectToAction(nameof(Index)); + } + + // GET: Admin/CompactDiscOffsets/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + CompactDiscOffset compactDiscOffset = await _context.CdOffsets.FirstOrDefaultAsync(m => m.Id == id); + + if(compactDiscOffset == null) return NotFound(); + + return View(compactDiscOffset); + } + + // POST: Admin/CompactDiscOffsets/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + CompactDiscOffset compactDiscOffset = await _context.CdOffsets.FindAsync(id); + _context.CdOffsets.Remove(compactDiscOffset); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Update() => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/DeviceStatsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/DeviceStatsController.cs new file mode 100644 index 00000000..41d39975 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/DeviceStatsController.cs @@ -0,0 +1,89 @@ +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class DeviceStatsController : Controller +{ + readonly DbContext _context; + + public DeviceStatsController(DbContext context) => _context = context; + + // GET: Admin/DeviceStats + public async Task Index() => View(await _context.DeviceStats.OrderBy(d => d.Manufacturer) + .ThenBy(d => d.Model) + .ThenBy(d => d.Bus) + .ToListAsync()); + + // GET: Admin/DeviceStats/Edit/5 + public async Task Edit(int? id) + { + if(id == null) return NotFound(); + + DeviceStat deviceStat = await _context.DeviceStats.FindAsync(id); + + if(deviceStat == null) return NotFound(); + + return View(deviceStat); + } + + // POST: Admin/DeviceStats/Edit/5 + // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit(int id, [Bind("Id,Manufacturer,Model,Revision,Bus")] DeviceStat changedModel) + { + if(id != changedModel.Id) return NotFound(); + + if(!ModelState.IsValid) return View(changedModel); + + DeviceStat model = await _context.DeviceStats.FirstOrDefaultAsync(m => m.Id == id); + + if(model is null) return NotFound(); + + model.Manufacturer = changedModel.Manufacturer; + model.Model = changedModel.Model; + model.Revision = changedModel.Revision; + model.Bus = changedModel.Bus; + + try + { + _context.Update(model); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + ModelState.AddModelError("Concurrency", "Concurrency error, please report to the administrator."); + } + + return RedirectToAction(nameof(Index)); + } + + // GET: Admin/DeviceStats/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + DeviceStat deviceStat = await _context.DeviceStats.FirstOrDefaultAsync(m => m.Id == id); + + if(deviceStat == null) return NotFound(); + + return View(deviceStat); + } + + // POST: Admin/DeviceStats/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + DeviceStat deviceStat = await _context.DeviceStats.FindAsync(id); + _context.DeviceStats.Remove(deviceStat); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/DevicesController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/DevicesController.cs new file mode 100644 index 00000000..d880f797 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/DevicesController.cs @@ -0,0 +1,389 @@ +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class DevicesController : Controller +{ + readonly DbContext _context; + + public DevicesController(DbContext context) => _context = context; + + // GET: Admin/Devices + public async Task Index() => View(await _context.Devices.OrderBy(d => d.Manufacturer) + .ThenBy(d => d.Model) + .ThenBy(d => d.Revision) + .ThenBy(d => d.CompactFlash) + .ThenBy(d => d.Type) + .ToListAsync()); + + // GET: Admin/Devices/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + var model = new DeviceDetails + { + Report = await _context.Devices.FirstOrDefaultAsync(m => m.Id == id) + }; + + if(model.Report is null) return NotFound(); + + model.ReportAll = _context.Reports + .Where(d => d.Manufacturer == model.Report.Manufacturer && + d.Model == model.Report.Model && + d.Revision == model.Report.Revision) + .Select(d => d.Id) + .ToList(); + + model.ReportButManufacturer = _context.Reports + .Where(d => d.Model == model.Report.Model && + d.Revision == model.Report.Revision) + .Select(d => d.Id) + .Where(d => model.ReportAll.All(r => r != d)) + .ToList(); + + model.SameAll = _context.Devices + .Where(d => d.Manufacturer == model.Report.Manufacturer && + d.Model == model.Report.Model && + d.Revision == model.Report.Revision && + d.Id != id) + .Select(d => d.Id) + .ToList(); + + model.SameButManufacturer = _context.Devices + .Where(d => d.Model == model.Report.Model && + d.Revision == model.Report.Revision && + d.Id != id) + .Select(d => d.Id) + .Where(d => model.SameAll.All(r => r != d)) + .ToList(); + + model.StatsAll = _context.DeviceStats + .Where(d => d.Manufacturer == model.Report.Manufacturer && + d.Model == model.Report.Model && + d.Revision == model.Report.Revision && + d.Report.Id != model.Report.Id) + .ToList(); + + model.StatsButManufacturer = _context.DeviceStats + .Where(d => d.Model == model.Report.Model && + d.Revision == model.Report.Revision && + d.Report.Id != model.Report.Id) + .AsEnumerable() + .Where(d => model.StatsAll.All(s => s.Id != d.Id)) + .ToList(); + + model.ReadCapabilitiesId = + model.Report.ATA?.ReadCapabilities?.Id ?? model.Report.SCSI?.ReadCapabilities?.Id ?? 0; + + // So we can check, as we know IDs with 0 will never exist, and EFCore does not allow null propagation in the LINQ + int ataId = model.Report.ATA?.Id ?? 0; + int atapiId = model.Report.ATAPI?.Id ?? 0; + int scsiId = model.Report.SCSI?.Id ?? 0; + int mmcId = model.Report.SCSI?.MultiMediaDevice?.Id ?? 0; + int sscId = model.Report.SCSI?.SequentialDevice?.Id ?? 0; + + model.TestedMedias = _context.TestedMedia + .Where(t => t.AtaId == ataId || + t.AtaId == atapiId || + t.ScsiId == scsiId || + t.MmcId == mmcId) + .OrderBy(t => t.Manufacturer) + .ThenBy(t => t.Model) + .ThenBy(t => t.MediumTypeName) + .ToList(); + + model.TestedSequentialMedias = _context.TestedSequentialMedia.Where(t => t.SscId == sscId) + .OrderBy(t => t.Manufacturer) + .ThenBy(t => t.Model) + .ThenBy(t => t.MediumTypeName) + .ToList(); + + return View(model); + } + + // GET: Admin/Devices/Edit/5 + public async Task Edit(int? id) + { + if(id == null) return NotFound(); + + Device device = await _context.Devices.FindAsync(id); + + if(device == null) return NotFound(); + + return View(device); + } + + // POST: Admin/Devices/Edit/5 + // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit( + int id, + [Bind("OptimalMultipleSectorsRead,Id,CompactFlash,Manufacturer,Model,Revision,Type")] Device changedModel) + { + if(id != changedModel.Id) return NotFound(); + + if(!ModelState.IsValid) return View(changedModel); + + Device model = await _context.Devices.FirstOrDefaultAsync(m => m.Id == id); + + if(model is null) return NotFound(); + + model.CanReadGdRomUsingSwapDisc = changedModel.CanReadGdRomUsingSwapDisc; + model.OptimalMultipleSectorsRead = changedModel.OptimalMultipleSectorsRead; + model.CompactFlash = changedModel.CompactFlash; + model.Manufacturer = changedModel.Manufacturer; + model.Model = changedModel.Model; + model.Revision = changedModel.Revision; + model.Type = changedModel.Type; + model.ModifiedWhen = DateTime.UtcNow; + + try + { + _context.Update(model); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + ModelState.AddModelError("Concurrency", "Concurrency error, please report to the administrator."); + } + + return RedirectToAction(nameof(Index)); + } + + // GET: Admin/Devices/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Device device = await _context.Devices.FirstOrDefaultAsync(m => m.Id == id); + + if(device == null) return NotFound(); + + return View(device); + } + + // POST: Admin/Devices/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Device device = await _context.Devices.FindAsync(id); + _context.Devices.Remove(device); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + bool DeviceExists(int id) => _context.Devices.Any(e => e.Id == id); + + public IActionResult Merge(int? master, int? slave) + { + if(master is null || slave is null) return NotFound(); + + Device masterDevice = _context.Devices.FirstOrDefault(m => m.Id == master); + Device slaveDevice = _context.Devices.FirstOrDefault(m => m.Id == slave); + + if(masterDevice is null || slaveDevice is null) return NotFound(); + + if(masterDevice.ATAId != null && masterDevice.ATAId != slaveDevice.ATAId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == slaveDevice.ATAId)) + { + testedMedia.AtaId = masterDevice.ATAId; + _context.Update(testedMedia); + } + } + else if(masterDevice.ATAId == null && slaveDevice.ATAId != null) + { + masterDevice.ATAId = slaveDevice.ATAId; + _context.Update(masterDevice); + } + + if(masterDevice.ATAPIId != null && masterDevice.ATAPIId != slaveDevice.ATAPIId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == slaveDevice.ATAPIId)) + { + testedMedia.AtaId = masterDevice.ATAPIId; + _context.Update(testedMedia); + } + } + else if(masterDevice.ATAPIId == null && slaveDevice.ATAPIId != null) + { + masterDevice.ATAPIId = slaveDevice.ATAPIId; + _context.Update(masterDevice); + } + + if(masterDevice.SCSIId != null && masterDevice.SCSIId != slaveDevice.SCSIId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.ScsiId == slaveDevice.SCSIId)) + { + testedMedia.ScsiId = masterDevice.SCSIId; + _context.Update(testedMedia); + } + } + else if(masterDevice.SCSIId == null && slaveDevice.SCSIId != null) + { + masterDevice.SCSIId = slaveDevice.SCSIId; + _context.Update(masterDevice); + } + + masterDevice.ModifiedWhen = DateTime.UtcNow; + _context.Update(masterDevice); + _context.Remove(slaveDevice); + _context.SaveChanges(); + + return RedirectToAction(nameof(Details), + new + { + Id = master + }); + } + + public IActionResult MergeReports(int? deviceId, int? reportId) + { + if(deviceId is null || reportId is null) return NotFound(); + + Device device = _context.Devices.FirstOrDefault(m => m.Id == deviceId); + UploadedReport report = _context.Reports.FirstOrDefault(m => m.Id == reportId); + + if(device is null || report is null) return NotFound(); + + if(device.ATAId != null && device.ATAId != report.ATAId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == report.ATAId)) + { + testedMedia.AtaId = device.ATAId; + _context.Update(testedMedia); + } + + if(device.ATA != null && device.ATA.ReadCapabilities is null && report.ATA?.ReadCapabilities != null) + { + device.ATA.ReadCapabilities = report.ATA.ReadCapabilities; + _context.Update(device.ATA); + } + } + else if(device.ATAId == null && report.ATAId != null) + { + device.ATAId = report.ATAId; + _context.Update(device); + } + + if(device.ATAPIId != null && device.ATAPIId != report.ATAPIId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == report.ATAPIId)) + { + testedMedia.AtaId = device.ATAPIId; + _context.Update(testedMedia); + } + } + else if(device.ATAPIId == null && report.ATAPIId != null) + { + device.ATAPIId = report.ATAPIId; + _context.Update(device); + } + + if(device.SCSIId != null && device.SCSIId != report.SCSIId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.ScsiId == report.SCSIId)) + { + testedMedia.ScsiId = device.SCSIId; + _context.Update(testedMedia); + } + + if(device.SCSI != null && device.SCSI.ReadCapabilities is null && report.SCSI?.ReadCapabilities != null) + { + device.SCSI.ReadCapabilities = report.SCSI.ReadCapabilities; + _context.Update(device.SCSI); + } + + if(device.SCSI != null && device.SCSI.MultiMediaDevice is null && report.SCSI?.MultiMediaDevice != null) + { + device.SCSI.MultiMediaDevice = report.SCSI.MultiMediaDevice; + _context.Update(device.SCSI); + } + else if(device.SCSI?.MultiMediaDevice != null && report.SCSI?.MultiMediaDevice != null) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.MmcId == + report.SCSI.MultiMediaDevice.Id)) + { + testedMedia.MmcId = device.SCSI.MultiMediaDevice.Id; + _context.Update(testedMedia); + } + } + + if(device.SCSI != null && device.SCSI.SequentialDevice is null && report.SCSI?.SequentialDevice != null) + { + device.SCSI.SequentialDevice = report.SCSI.SequentialDevice; + _context.Update(device.SCSI); + } + else if(device.SCSI?.SequentialDevice != null && report.SCSI?.SequentialDevice != null) + { + foreach(TestedSequentialMedia testedSequentialMedia in + _context.TestedSequentialMedia.Where(d => d.SscId == report.SCSI.SequentialDevice.Id)) + { + testedSequentialMedia.SscId = device.SCSI.SequentialDevice.Id; + _context.Update(testedSequentialMedia); + } + } + } + else if(device.SCSIId == null && report.SCSIId != null) + { + device.SCSIId = report.SCSIId; + _context.Update(device); + } + + _context.Remove(report); + _context.SaveChanges(); + + return RedirectToAction(nameof(Details), + new + { + Id = deviceId + }); + } + + public IActionResult LinkReports(int? statsId, int? deviceId) + { + if(statsId is null || deviceId is null) return NotFound(); + + Device device = _context.Devices.FirstOrDefault(m => m.Id == deviceId); + DeviceStat stat = _context.DeviceStats.FirstOrDefault(m => m.Id == statsId); + + if(device is null || stat is null) return NotFound(); + + stat.Report = device; + _context.Update(stat); + _context.SaveChanges(); + + return RedirectToAction(nameof(Details), + new + { + Id = deviceId + }); + } + + public IActionResult Find(int id, string manufacturer, string model, string revision, string bus) + { + if(model is null) return NotFound(); + + var found = new FindReportModel + { + Id = id, + Manufacturer = manufacturer, + Model = model, + Revision = revision, + Bus = bus, + LikeDevices = _context.Devices.Where(r => r.Model.ToLower().Contains(model.ToLower())).ToList() + }; + + return View(found); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/FilesystemsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/FilesystemsController.cs new file mode 100644 index 00000000..6b2c5adf --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/FilesystemsController.cs @@ -0,0 +1,15 @@ +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class FilesystemsController : Controller +{ + readonly DbContext _context; + + public FilesystemsController(DbContext context) => _context = context; + + // GET: Admin/Filesystems + public async Task Index() => View(await _context.Filesystems.OrderBy(f => f.Name).ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/FiltersController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/FiltersController.cs new file mode 100644 index 00000000..4b9187f6 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/FiltersController.cs @@ -0,0 +1,15 @@ +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class FiltersController : Controller +{ + readonly DbContext _context; + + public FiltersController(DbContext context) => _context = context; + + // GET: Admin/Filters + public async Task Index() => View(await _context.Filters.OrderBy(f => f.Name).ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/FireWiresController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/FireWiresController.cs new file mode 100644 index 00000000..ca6d3e44 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/FireWiresController.cs @@ -0,0 +1,172 @@ +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class FireWiresController : Controller +{ + readonly DbContext _context; + + public FireWiresController(DbContext context) => _context = context; + + // GET: Admin/FireWires + public async Task Index() => + View(await _context.FireWire.OrderBy(f => f.Manufacturer).ThenBy(f => f.Product).ToListAsync()); + + // GET: Admin/FireWires/Edit/5 + public async Task Edit(int? id) + { + if(id == null) return NotFound(); + + FireWire fireWire = await _context.FireWire.FindAsync(id); + + if(fireWire == null) return NotFound(); + + return View(fireWire); + } + + // POST: Admin/FireWires/Edit/5 + // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit( + int id, [Bind("Id,VendorID,ProductID,Manufacturer,Product,RemovableMedia")] FireWire changedModel) + { + if(id != changedModel.Id) return NotFound(); + + if(!ModelState.IsValid) return View(changedModel); + + FireWire model = await _context.FireWire.FirstOrDefaultAsync(m => m.Id == id); + + if(model is null) return NotFound(); + + model.VendorID = changedModel.VendorID; + model.ProductID = changedModel.ProductID; + model.Manufacturer = changedModel.Manufacturer; + model.Product = changedModel.Product; + model.RemovableMedia = changedModel.RemovableMedia; + + try + { + _context.Update(model); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + ModelState.AddModelError("Concurrency", "Concurrency error, please report to the administrator."); + } + + return RedirectToAction(nameof(Index)); + } + + // GET: Admin/FireWires/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + FireWire fireWire = await _context.FireWire.FirstOrDefaultAsync(m => m.Id == id); + + if(fireWire == null) return NotFound(); + + return View(fireWire); + } + + // POST: Admin/FireWires/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + FireWire fireWire = await _context.FireWire.FindAsync(id); + _context.FireWire.Remove(fireWire); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + bool FireWireExists(int id) => _context.FireWire.Any(e => e.Id == id); + + public IActionResult Consolidate() + { + var dups = _context.FireWire.GroupBy(x => new + { + x.VendorID, + x.ProductID, + x.Manufacturer, + x.Product, + x.RemovableMedia + }) + .Where(x => x.Count() > 1) + .Select(x => new FireWireModel + { + VendorID = x.Key.VendorID, + ProductID = x.Key.ProductID, + Manufacturer = x.Key.Manufacturer, + Product = x.Key.Product, + RemovableMedia = x.Key.RemovableMedia + }) + .ToList(); + + return View(new FireWireModelForView + { + List = dups, + Json = JsonConvert.SerializeObject(dups) + }); + } + + [HttpPost] + [ActionName("Consolidate")] + [ValidateAntiForgeryToken] + public IActionResult ConsolidateConfirmed(string models) + { + FireWireModel[] duplicates; + + try + { + duplicates = JsonConvert.DeserializeObject(models); + } + catch(JsonSerializationException) + { + return BadRequest(); + } + + if(duplicates is null) return BadRequest(); + + foreach(FireWireModel duplicate in duplicates) + { + FireWire master = _context.FireWire.FirstOrDefault(m => m.VendorID == duplicate.VendorID && + m.ProductID == duplicate.ProductID && + m.Manufacturer == duplicate.Manufacturer && + m.Product == duplicate.Product && + m.RemovableMedia == duplicate.RemovableMedia); + + if(master is null) continue; + + foreach(FireWire firewire in _context.FireWire.Where(m => m.VendorID == duplicate.VendorID && + m.ProductID == duplicate.ProductID && + m.Manufacturer == duplicate.Manufacturer && + m.Product == duplicate.Product && + m.RemovableMedia == duplicate.RemovableMedia) + .Skip(1) + .ToArray()) + { + foreach(Device device in _context.Devices.Where(d => d.FireWire.Id == firewire.Id)) + device.FireWire = master; + + foreach(UploadedReport report in _context.Reports.Where(d => d.FireWire.Id == firewire.Id)) + report.FireWire = master; + + _context.FireWire.Remove(firewire); + } + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/GdRomSwapDiscCapabilitiesController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/GdRomSwapDiscCapabilitiesController.cs new file mode 100644 index 00000000..aa942c0e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/GdRomSwapDiscCapabilitiesController.cs @@ -0,0 +1,361 @@ +using System.Text; +using System.Web; +using Aaru.CommonTypes.Metadata; +using Aaru.Decoders.CD; +using Aaru.Helpers; +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class GdRomSwapDiscCapabilitiesController : Controller +{ + readonly DbContext _context; + + public GdRomSwapDiscCapabilitiesController(DbContext context) => _context = context; + + // GET: Admin/GdRomSwapDiscCapabilities/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + GdRomSwapDiscCapabilities caps = await _context.GdRomSwapDiscCapabilities.FirstOrDefaultAsync(m => m.Id == id); + + if(caps == null) return NotFound(); + + return View(caps); + } + + // GET: Admin/GdRomSwapDiscCapabilities/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + GdRomSwapDiscCapabilities caps = await _context.GdRomSwapDiscCapabilities.FirstOrDefaultAsync(m => m.Id == id); + + if(caps == null) return NotFound(); + + return View(caps); + } + + // POST: Admin/GdRomSwapDiscCapabilities/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + GdRomSwapDiscCapabilities caps = await _context.GdRomSwapDiscCapabilities.FindAsync(id); + _context.GdRomSwapDiscCapabilities.Remove(caps); + await _context.SaveChangesAsync(); + + return RedirectToAction("Index", "Admin"); + } + + public IActionResult ViewData(int id, string data) + { + if(string.IsNullOrWhiteSpace(data)) return NotFound(); + + GdRomSwapDiscCapabilities caps = _context.GdRomSwapDiscCapabilities.FirstOrDefault(m => m.Id == id); + + if(caps == null) return NotFound(); + + var model = new TestedMediaDataModel + { + TestedMediaId = id, + DataName = data + }; + + byte[] buffer; + var sb = new StringBuilder(); + var sector = new byte[2352]; + var subq = new byte[16]; + var fullsub = new byte[96]; + + var audio = true; + var pq = false; + var rw = false; + + switch(data) + { + case nameof(caps.Lba0Data): + buffer = caps.Lba0Data; + audio = false; + + break; + case nameof(caps.Lba0ScrambledData): + buffer = caps.Lba0ScrambledData; + + break; + case nameof(caps.Lba44990Data): + buffer = caps.Lba44990Data; + audio = false; + + break; + case nameof(caps.Lba44990PqData): + buffer = caps.Lba44990PqData; + audio = false; + pq = true; + + break; + case nameof(caps.Lba44990RwData): + buffer = caps.Lba44990RwData; + audio = false; + rw = true; + + break; + case nameof(caps.Lba44990AudioData): + buffer = caps.Lba44990AudioData; + + break; + case nameof(caps.Lba44990AudioPqData): + buffer = caps.Lba44990AudioPqData; + pq = true; + + break; + case nameof(caps.Lba44990AudioRwData): + buffer = caps.Lba44990AudioRwData; + rw = true; + + break; + case nameof(caps.Lba45000Data): + buffer = caps.Lba45000Data; + audio = false; + + break; + case nameof(caps.Lba45000PqData): + buffer = caps.Lba45000PqData; + audio = false; + pq = true; + + break; + case nameof(caps.Lba45000RwData): + buffer = caps.Lba45000RwData; + audio = false; + rw = true; + + break; + case nameof(caps.Lba45000AudioData): + buffer = caps.Lba45000AudioData; + + break; + case nameof(caps.Lba45000AudioPqData): + buffer = caps.Lba45000AudioPqData; + pq = true; + + break; + case nameof(caps.Lba45000AudioRwData): + buffer = caps.Lba45000AudioRwData; + rw = true; + + break; + case nameof(caps.Lba50000Data): + buffer = caps.Lba50000Data; + audio = false; + + break; + case nameof(caps.Lba50000PqData): + buffer = caps.Lba50000PqData; + audio = false; + pq = true; + + break; + case nameof(caps.Lba50000RwData): + buffer = caps.Lba50000RwData; + audio = false; + rw = true; + + break; + case nameof(caps.Lba50000AudioData): + buffer = caps.Lba50000AudioData; + + break; + case nameof(caps.Lba50000AudioPqData): + buffer = caps.Lba50000AudioPqData; + pq = true; + + break; + case nameof(caps.Lba50000AudioRwData): + buffer = caps.Lba50000AudioRwData; + rw = true; + + break; + case nameof(caps.Lba100000Data): + buffer = caps.Lba100000Data; + audio = false; + + break; + case nameof(caps.Lba100000PqData): + buffer = caps.Lba100000PqData; + audio = false; + pq = true; + + break; + case nameof(caps.Lba100000RwData): + buffer = caps.Lba100000RwData; + audio = false; + rw = true; + + break; + case nameof(caps.Lba100000AudioData): + buffer = caps.Lba100000AudioData; + + break; + case nameof(caps.Lba100000AudioPqData): + buffer = caps.Lba100000AudioPqData; + pq = true; + + break; + case nameof(caps.Lba100000AudioRwData): + buffer = caps.Lba100000AudioRwData; + rw = true; + + break; + case nameof(caps.Lba400000Data): + buffer = caps.Lba400000Data; + audio = false; + + break; + case nameof(caps.Lba400000PqData): + buffer = caps.Lba400000PqData; + audio = false; + pq = true; + + break; + case nameof(caps.Lba400000RwData): + buffer = caps.Lba400000RwData; + audio = false; + rw = true; + + break; + case nameof(caps.Lba400000AudioData): + buffer = caps.Lba400000AudioData; + + break; + case nameof(caps.Lba400000AudioPqData): + buffer = caps.Lba400000AudioPqData; + pq = true; + + break; + case nameof(caps.Lba400000AudioRwData): + buffer = caps.Lba400000AudioRwData; + rw = true; + + break; + case nameof(caps.Lba450000Data): + buffer = caps.Lba450000Data; + audio = false; + + break; + case nameof(caps.Lba450000PqData): + buffer = caps.Lba450000PqData; + audio = false; + pq = true; + + break; + case nameof(caps.Lba450000RwData): + buffer = caps.Lba450000RwData; + audio = false; + rw = true; + + break; + case nameof(caps.Lba450000AudioData): + buffer = caps.Lba450000AudioData; + + break; + case nameof(caps.Lba450000AudioPqData): + buffer = caps.Lba450000AudioPqData; + pq = true; + + break; + case nameof(caps.Lba450000AudioRwData): + buffer = caps.Lba450000AudioRwData; + rw = true; + + break; + default: + return NotFound(); + } + + if(pq && buffer != null && buffer.Length % 2368 != 0) pq = false; + + if(rw && buffer != null && buffer.Length % 2448 != 0) rw = false; + + int blockSize = pq + ? 2368 + : rw + ? 2448 + : 2352; + + model.RawDataAsHex = PrintHex.ByteArrayToHexArrayString(buffer); + + if(model.RawDataAsHex != null) + model.RawDataAsHex = HttpUtility.HtmlEncode(model.RawDataAsHex).Replace("\n", "
"); + + if(buffer == null) return View(model); + + for(var i = 0; i < buffer.Length; i += blockSize) + { + if(audio) + sb.AppendLine("Audio or scrambled data sector."); + else + { + Array.Copy(buffer, i, sector, 0, 2352); + + sb.AppendLine(Sector.Prettify(sector)); + } + + if(pq) + { + Array.Copy(buffer, i + 2352, subq, 0, 16); + fullsub = Subchannel.ConvertQToRaw(subq); + + sb.AppendLine(GetPrettySub(fullsub)); + } + else if(rw) + { + Array.Copy(buffer, i + 2352, fullsub, 0, 96); + + sb.AppendLine(GetPrettySub(fullsub)); + } + + sb.AppendLine(); + } + + model.Decoded = HttpUtility.HtmlEncode(sb.ToString()).Replace("\n", "
"); + + return View(model); + } + + static string GetPrettySub(byte[] sub) + { + byte[] deint = Subchannel.Deinterleave(sub); + + var validP = true; + var validRw = true; + + for(var i = 0; i < 12; i++) + { + if(deint[i] == 0x00 || deint[i] == 0xFF) continue; + + validP = false; + + break; + } + + for(var i = 24; i < 96; i++) + { + if(deint[i] == 0x00) continue; + + validRw = false; + + break; + } + + var q = new byte[12]; + Array.Copy(deint, 12, q, 0, 12); + + return Subchannel.PrettifyQ(q, deint[21] > 0x10, 16, !validP, false, validRw); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/HomeController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/HomeController.cs new file mode 100644 index 00000000..6b79768c --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/HomeController.cs @@ -0,0 +1,40 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : HomeController.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Provides documentation data for razor views. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class HomeController : Controller +{ + public ActionResult Index() => View(); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/MediaFormatsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/MediaFormatsController.cs new file mode 100644 index 00000000..e8d1de54 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/MediaFormatsController.cs @@ -0,0 +1,41 @@ +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class MediaFormatsController : Controller +{ + readonly DbContext _context; + + public MediaFormatsController(DbContext context) => _context = context; + + // GET: Admin/MediaFormats + public async Task Index() => View(await _context.MediaFormats.OrderBy(mf => mf.Name).ToListAsync()); + + // GET: Admin/MediaFormats/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + MediaFormat mediaFormat = await _context.MediaFormats.FirstOrDefaultAsync(m => m.Id == id); + + if(mediaFormat == null) return NotFound(); + + return View(mediaFormat); + } + + // POST: Admin/MediaFormats/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + MediaFormat mediaFormat = await _context.MediaFormats.FindAsync(id); + _context.MediaFormats.Remove(mediaFormat); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/MediasController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/MediasController.cs new file mode 100644 index 00000000..19d4e1ae --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/MediasController.cs @@ -0,0 +1,56 @@ +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class MediasController : Controller +{ + readonly DbContext _context; + + public MediasController(DbContext context) => _context = context; + + // GET: Admin/Medias + public IActionResult Index(bool? real) + { + switch(real) + { + case null: + return View(_context.Medias.ToList() + .OrderBy(m => m.PhysicalType) + .ThenBy(m => m.LogicalType) + .ThenBy(m => m.Real)); + default: + return View(_context.Medias.Where(m => m.Real == real) + .ToList() + .OrderBy(m => m.PhysicalType) + .ThenBy(m => m.LogicalType)); + } + } + + // GET: Admin/Medias/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Media media = await _context.Medias.FirstOrDefaultAsync(m => m.Id == id); + + if(media == null) return NotFound(); + + return View(media); + } + + // POST: Admin/Medias/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Media media = await _context.Medias.FindAsync(id); + _context.Medias.Remove(media); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/MmcController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/MmcController.cs new file mode 100644 index 00000000..0159be46 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/MmcController.cs @@ -0,0 +1,81 @@ +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class MmcController : Controller +{ + readonly DbContext _context; + + public MmcController(DbContext context) => _context = context; + + // GET: Admin/Mmc + public IActionResult Index() => View(_context.Mmc.Where(m => m.ModeSense2AData != null) + .Select(m => new MmcModelForView + { + Id = m.Id, + FeaturesId = m.FeaturesId, + DataLength = m.ModeSense2AData.Length + }) + .ToList() + .Concat(_context.Mmc.Where(m => m.ModeSense2AData == null) + .Select(m => new MmcModelForView + { + Id = m.Id, + FeaturesId = m.FeaturesId, + DataLength = 0 + }) + .ToList()) + .OrderBy(m => m.Id)); + + // GET: Admin/Mmc/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + Mmc mmc = await _context.Mmc.FirstOrDefaultAsync(m => m.Id == id); + + if(mmc == null) return NotFound(); + + return View(mmc); + } + + // GET: Admin/Mmc/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Mmc mmc = await _context.Mmc.FirstOrDefaultAsync(m => m.Id == id); + + if(mmc == null) return NotFound(); + + return View(mmc); + } + + // POST: Admin/Mmc/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Mmc mmc = await _context.Mmc.FindAsync(id); + MmcFeatures feature = await _context.MmcFeatures.FirstOrDefaultAsync(f => f.Id == mmc.FeaturesId); + + _context.MmcFeatures.Remove(feature); + _context.Mmc.Remove(mmc); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public async Task Clean() + { + _context.Mmc.RemoveRange(_context.Mmc.Where(m => m.FeaturesId == null && m.ModeSense2AData == null)); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/MmcFeaturesController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/MmcFeaturesController.cs new file mode 100644 index 00000000..7551289b --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/MmcFeaturesController.cs @@ -0,0 +1,28 @@ +using Aaru.CommonTypes.Metadata; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class MmcFeaturesController : Controller +{ + readonly DbContext _context; + + public MmcFeaturesController(DbContext context) => _context = context; + + // GET: Admin/MmcFeatures + public async Task Index() => View(await _context.MmcFeatures.ToListAsync()); + + // GET: Admin/MmcFeatures/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + MmcFeatures mmcFeatures = await _context.MmcFeatures.FirstOrDefaultAsync(m => m.Id == id); + + if(mmcFeatures == null) return NotFound(); + + return View(mmcFeatures); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/MmcSdsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/MmcSdsController.cs new file mode 100644 index 00000000..6d3834f7 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/MmcSdsController.cs @@ -0,0 +1,53 @@ +using Aaru.CommonTypes.Metadata; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class MmcSdsController : Controller +{ + readonly DbContext _context; + + public MmcSdsController(DbContext context) => _context = context; + + // GET: Admin/MmcSds + public async Task Index() => View(await _context.MmcSd.ToListAsync()); + + // GET: Admin/MmcSds/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + MmcSd mmcSd = await _context.MmcSd.FirstOrDefaultAsync(m => m.Id == id); + + if(mmcSd == null) return NotFound(); + + return View(mmcSd); + } + + // GET: Admin/MmcSds/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + MmcSd mmcSd = await _context.MmcSd.FirstOrDefaultAsync(m => m.Id == id); + + if(mmcSd == null) return NotFound(); + + return View(mmcSd); + } + + // POST: Admin/MmcSds/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + MmcSd mmcSd = await _context.MmcSd.FindAsync(id); + _context.MmcSd.Remove(mmcSd); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/OperatingSystemsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/OperatingSystemsController.cs new file mode 100644 index 00000000..81b5b64e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/OperatingSystemsController.cs @@ -0,0 +1,16 @@ +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class OperatingSystemsController : Controller +{ + readonly DbContext _context; + + public OperatingSystemsController(DbContext context) => _context = context; + + // GET: Admin/OperatingSystems + public async Task Index() => + View(await _context.OperatingSystems.OrderBy(o => o.Name).ThenBy(o => o.Version).ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/PartitionsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/PartitionsController.cs new file mode 100644 index 00000000..843ef7aa --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/PartitionsController.cs @@ -0,0 +1,15 @@ +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class PartitionsController : Controller +{ + readonly DbContext _context; + + public PartitionsController(DbContext context) => _context = context; + + // GET: Admin/Partitions + public async Task Index() => View(await _context.Partitions.OrderBy(p => p.Name).ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/PcmciasController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/PcmciasController.cs new file mode 100644 index 00000000..a79d06f5 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/PcmciasController.cs @@ -0,0 +1,41 @@ +using Aaru.CommonTypes.Metadata; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class PcmciasController : Controller +{ + readonly DbContext _context; + + public PcmciasController(DbContext context) => _context = context; + + // GET: Admin/Pcmcias + public async Task Index() => View(await _context.Pcmcia.ToListAsync()); + + // GET: Admin/Pcmcias/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Pcmcia pcmcia = await _context.Pcmcia.FirstOrDefaultAsync(m => m.Id == id); + + if(pcmcia == null) return NotFound(); + + return View(pcmcia); + } + + // POST: Admin/Pcmcias/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Pcmcia pcmcia = await _context.Pcmcia.FindAsync(id); + _context.Pcmcia.Remove(pcmcia); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/ReportsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/ReportsController.cs new file mode 100644 index 00000000..6d5eeb96 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/ReportsController.cs @@ -0,0 +1,292 @@ +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class ReportsController : Controller +{ + readonly DbContext _context; + + public ReportsController(DbContext context) => _context = context; + + // GET: Admin/Reports + public async Task Index() => View(await _context.Reports.OrderBy(r => r.Manufacturer) + .ThenBy(r => r.Model) + .ThenBy(r => r.Revision) + .ThenBy(r => r.CompactFlash) + .ThenBy(r => r.Type) + .ToListAsync()); + + // GET: Admin/Reports/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + var model = new UploadedReportDetails + { + Report = await _context.Reports.FirstOrDefaultAsync(m => m.Id == id) + }; + + if(model.Report is null) return NotFound(); + + model.ReportAll = _context.Devices + .Where(d => d.Manufacturer == model.Report.Manufacturer && + d.Model == model.Report.Model && + d.Revision == model.Report.Revision) + .Select(d => d.Id) + .ToList(); + + model.ReportButManufacturer = _context.Devices + .Where(d => d.Model == model.Report.Model && + d.Revision == model.Report.Revision) + .Select(d => d.Id) + .Where(d => model.ReportAll.All(r => r != d)) + .ToList(); + + model.SameAll = _context.Reports + .Where(d => d.Manufacturer == model.Report.Manufacturer && + d.Model == model.Report.Model && + d.Revision == model.Report.Revision && + d.Id != id) + .Select(d => d.Id) + .ToList(); + + model.SameButManufacturer = _context.Reports + .Where(d => d.Model == model.Report.Model && + d.Revision == model.Report.Revision && + d.Id != id) + .Select(d => d.Id) + .Where(d => model.SameAll.All(r => r != d)) + .ToList(); + + model.ReadCapabilitiesId = + model.Report.ATA?.ReadCapabilities?.Id ?? model.Report.SCSI?.ReadCapabilities?.Id ?? 0; + + // So we can check, as we know IDs with 0 will never exist, and EFCore does not allow null propagation in the LINQ + int ataId = model.Report.ATA?.Id ?? 0; + int atapiId = model.Report.ATAPI?.Id ?? 0; + int scsiId = model.Report.SCSI?.Id ?? 0; + int mmcId = model.Report.SCSI?.MultiMediaDevice?.Id ?? 0; + int sscId = model.Report.SCSI?.SequentialDevice?.Id ?? 0; + + model.TestedMedias = _context.TestedMedia + .Where(t => t.AtaId == ataId || + t.AtaId == atapiId || + t.ScsiId == scsiId || + t.MmcId == mmcId) + .OrderBy(t => t.Manufacturer) + .ThenBy(t => t.Model) + .ThenBy(t => t.MediumTypeName) + .ToList(); + + model.TestedSequentialMedias = _context.TestedSequentialMedia.Where(t => t.SscId == sscId) + .OrderBy(t => t.Manufacturer) + .ThenBy(t => t.Model) + .ThenBy(t => t.MediumTypeName) + .ToList(); + + return View(model); + } + + // GET: Admin/Reports/Edit/5 + public async Task Edit(int? id) + { + if(id == null) return NotFound(); + + UploadedReport uploadedReport = await _context.Reports.FindAsync(id); + + if(uploadedReport == null) return NotFound(); + + return View(uploadedReport); + } + + // POST: Admin/Reports/Edit/5 + // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit( + int id, [Bind("Id,CompactFlash,Manufacturer,Model,Revision,Type")] UploadedReport changedModel) + { + if(id != changedModel.Id) return NotFound(); + + if(!ModelState.IsValid) return View(changedModel); + + UploadedReport model = await _context.Reports.FirstOrDefaultAsync(m => m.Id == id); + + if(model is null) return NotFound(); + + model.CompactFlash = changedModel.CompactFlash; + model.Manufacturer = changedModel.Manufacturer; + model.Model = changedModel.Model; + model.Revision = changedModel.Revision; + model.Type = changedModel.Type; + + try + { + _context.Update(model); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + ModelState.AddModelError("Concurrency", "Concurrency error, please report to the administrator."); + } + + return RedirectToAction(nameof(Index)); + } + + // GET: Admin/Reports/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + UploadedReport uploadedReport = await _context.Reports.FirstOrDefaultAsync(m => m.Id == id); + + if(uploadedReport == null) return NotFound(); + + return View(uploadedReport); + } + + // POST: Admin/Reports/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + UploadedReport uploadedReport = await _context.Reports.FindAsync(id); + _context.Reports.Remove(uploadedReport); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Promote(int? id) + { + if(id == null) return NotFound(); + + UploadedReport uploadedReport = _context.Reports.FirstOrDefault(m => m.Id == id); + + if(uploadedReport == null) return NotFound(); + + var device = new Device(uploadedReport.ATAId, + uploadedReport.ATAPIId, + uploadedReport.FireWireId, + uploadedReport.MultiMediaCardId, + uploadedReport.PCMCIAId, + uploadedReport.SecureDigitalId, + uploadedReport.SCSIId, + uploadedReport.USBId, + uploadedReport.UploadedWhen, + uploadedReport.Manufacturer, + uploadedReport.Model, + uploadedReport.Revision, + uploadedReport.CompactFlash, + uploadedReport.Type, + uploadedReport.GdRomSwapDiscCapabilitiesId); + + EntityEntry res = _context.Devices.Add(device); + _context.Reports.Remove(uploadedReport); + _context.SaveChanges(); + + return RedirectToAction(nameof(DevicesController.Details), + "Devices", + new + { + id = res.Entity.Id + }); + } + + public IActionResult Merge(int? master, int? slave) + { + if(master is null || slave is null) return NotFound(); + + UploadedReport masterReport = _context.Reports.FirstOrDefault(m => m.Id == master); + UploadedReport slaveReport = _context.Reports.FirstOrDefault(m => m.Id == slave); + + if(masterReport is null || slaveReport is null) return NotFound(); + + if(masterReport.ATAId != null && masterReport.ATAId != slaveReport.ATAId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == slaveReport.ATAId)) + { + testedMedia.AtaId = masterReport.ATAId; + _context.Update(testedMedia); + } + } + else if(masterReport.ATAId == null && slaveReport.ATAId != null) + { + masterReport.ATAId = slaveReport.ATAId; + _context.Update(masterReport); + } + + if(masterReport.ATAPIId != null && masterReport.ATAPIId != slaveReport.ATAPIId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.AtaId == slaveReport.ATAPIId)) + { + testedMedia.AtaId = masterReport.ATAPIId; + _context.Update(testedMedia); + } + } + else if(masterReport.ATAPIId == null && slaveReport.ATAPIId != null) + { + masterReport.ATAPIId = slaveReport.ATAPIId; + _context.Update(masterReport); + } + + if(masterReport.SCSIId != null && masterReport.SCSIId != slaveReport.SCSIId) + { + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.ScsiId == slaveReport.SCSIId)) + { + testedMedia.ScsiId = masterReport.SCSIId; + _context.Update(testedMedia); + } + } + else if(masterReport.SCSIId == null && slaveReport.SCSIId != null) + { + masterReport.SCSIId = slaveReport.SCSIId; + _context.Update(masterReport); + } + + if(masterReport.SCSI?.SequentialDeviceId != null && + masterReport.SCSI?.SequentialDeviceId != slaveReport.SCSI?.SequentialDeviceId) + { + foreach(TestedSequentialMedia testedMedia in + _context.TestedSequentialMedia.Where(d => d.SscId == slaveReport.SCSI.SequentialDeviceId)) + { + testedMedia.SscId = masterReport.SCSI.SequentialDeviceId; + _context.Update(testedMedia); + } + } + else if(masterReport.SCSI != null && + masterReport.SCSI?.SequentialDeviceId == null && + slaveReport.SCSI?.SequentialDeviceId != null) + { + masterReport.SCSI.SequentialDeviceId = slaveReport.SCSI.SequentialDeviceId; + _context.Update(masterReport); + } + + if(masterReport.GdRomSwapDiscCapabilitiesId == null && slaveReport.GdRomSwapDiscCapabilitiesId != null) + { + masterReport.GdRomSwapDiscCapabilitiesId = slaveReport.GdRomSwapDiscCapabilitiesId; + _context.Update(masterReport); + } + else if(masterReport.GdRomSwapDiscCapabilitiesId != null && slaveReport.GdRomSwapDiscCapabilitiesId != null) + { + masterReport.GdRomSwapDiscCapabilitiesId = slaveReport.GdRomSwapDiscCapabilitiesId; + _context.Update(masterReport); + } + + _context.Remove(slaveReport); + _context.SaveChanges(); + + return RedirectToAction(nameof(Details), + new + { + Id = master + }); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/ScsiModesController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/ScsiModesController.cs new file mode 100644 index 00000000..37c8fa20 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/ScsiModesController.cs @@ -0,0 +1,41 @@ +using Aaru.CommonTypes.Metadata; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class ScsiModesController : Controller +{ + readonly DbContext _context; + + public ScsiModesController(DbContext context) => _context = context; + + // GET: Admin/ScsiModes + public async Task Index() => View(await _context.ScsiMode.ToListAsync()); + + // GET: Admin/ScsiModes/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + ScsiMode scsiMode = await _context.ScsiMode.FirstOrDefaultAsync(m => m.Id == id); + + if(scsiMode == null) return NotFound(); + + return View(scsiMode); + } + + // POST: Admin/ScsiModes/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + ScsiMode scsiMode = await _context.ScsiMode.FindAsync(id); + _context.ScsiMode.Remove(scsiMode); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/ScsiPagesController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/ScsiPagesController.cs new file mode 100644 index 00000000..2185f56c --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/ScsiPagesController.cs @@ -0,0 +1,41 @@ +using Aaru.CommonTypes.Metadata; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class ScsiPagesController : Controller +{ + readonly DbContext _context; + + public ScsiPagesController(DbContext context) => _context = context; + + // GET: Admin/ScsiPages + public async Task Index() => View(await _context.ScsiPage.ToListAsync()); + + // GET: Admin/ScsiPages/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + ScsiPage scsiPage = await _context.ScsiPage.FirstOrDefaultAsync(m => m.Id == id); + + if(scsiPage == null) return NotFound(); + + return View(scsiPage); + } + + // POST: Admin/ScsiPages/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + ScsiPage scsiPage = await _context.ScsiPage.FindAsync(id); + _context.ScsiPage.Remove(scsiPage); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/ScsisController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/ScsisController.cs new file mode 100644 index 00000000..5f1ff889 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/ScsisController.cs @@ -0,0 +1,355 @@ +using System.Reflection; +using Aaru.CommonTypes.Metadata; +using Aaru.CommonTypes.Structs.Devices.SCSI; +using Aaru.Helpers; +using Aaru.Server.Old.Database.Models; +using Aaru.Server.Old.Core; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; +using TestedMedia = Aaru.CommonTypes.Metadata.TestedMedia; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class ScsisController : Controller +{ + readonly DbContext _context; + + public ScsisController(DbContext context) => _context = context; + + // GET: Admin/Scsis + public IActionResult Index() => View(_context.Scsi.AsEnumerable() + .OrderBy(m => StringHandlers + .CToString(m.Inquiry?.VendorIdentification)) + .ThenBy(m => StringHandlers + .CToString(m.Inquiry?.ProductIdentification)) + .ThenBy(m => StringHandlers + .CToString(m.Inquiry?.ProductRevisionLevel))); + + // GET: Admin/Scsis/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + Scsi scsi = await _context.Scsi.FirstOrDefaultAsync(m => m.Id == id); + + if(scsi == null) return NotFound(); + + return View(scsi); + } + + // GET: Admin/Scsis/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Scsi scsi = await _context.Scsi.FirstOrDefaultAsync(m => m.Id == id); + + if(scsi == null) return NotFound(); + + return View(scsi); + } + + // POST: Admin/Scsis/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Scsi scsi = await _context.Scsi.FindAsync(id); + _context.Scsi.Remove(scsi); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Consolidate() + { + var hashes = _context.Scsi.Where(m => m.InquiryData != null) + .Select(m => new IdHashModel(m.Id, Hash.Sha512(m.InquiryData))) + .ToList(); + + var dups = hashes.GroupBy(x => x.Hash) + .Where(g => g.Count() > 1) + .Select(x => hashes.FirstOrDefault(y => y.Hash == x.Key)) + .ToList(); + + for(var i = 0; i < dups.Count; i++) + { + Scsi unique = _context.Scsi.First(a => a.Id == dups[i].Id); + + dups[i].Description = + $"{StringHandlers.CToString(unique.Inquiry?.VendorIdentification)} {StringHandlers.CToString(unique.Inquiry?.ProductIdentification)}"; + + dups[i].Duplicates = hashes.Where(h => h.Hash == dups[i].Hash).Skip(1).Select(x => x.Id).ToArray(); + } + + return View(new IdHashModelForView + { + List = dups, + Json = JsonConvert.SerializeObject(dups) + }); + } + + [HttpPost] + [ActionName("Consolidate")] + [ValidateAntiForgeryToken] + public IActionResult ConsolidateConfirmed(string models) + { + IdHashModel[] duplicates; + + try + { + duplicates = JsonConvert.DeserializeObject(models); + } + catch(JsonSerializationException) + { + return BadRequest(); + } + + if(duplicates is null) return BadRequest(); + + foreach(IdHashModel duplicate in duplicates) + { + Scsi master = _context.Scsi.FirstOrDefault(m => m.Id == duplicate.Id); + + if(master is null) continue; + + foreach(int duplicateId in duplicate.Duplicates) + { + Scsi slave = _context.Scsi.FirstOrDefault(m => m.Id == duplicateId); + + if(slave is null) continue; + + foreach(Device scsiDevice in _context.Devices.Where(d => d.SCSI.Id == duplicateId)) + scsiDevice.SCSI = master; + + foreach(UploadedReport scsiReport in _context.Reports.Where(d => d.SCSI.Id == duplicateId)) + scsiReport.SCSI = master; + + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.ScsiId == duplicateId)) + { + testedMedia.ScsiId = duplicate.Id; + _context.Update(testedMedia); + } + + if(master.ReadCapabilities is null && slave.ReadCapabilities != null) + master.ReadCapabilities = slave.ReadCapabilities; + + _context.Scsi.Remove(slave); + } + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Compare(int id, int rightId) + { + var model = new CompareModel + { + LeftId = id, + RightId = rightId + }; + + Scsi left = _context.Scsi.FirstOrDefault(l => l.Id == id); + Scsi right = _context.Scsi.FirstOrDefault(r => r.Id == rightId); + + if(left is null) + { + model.ErrorMessage = $"SCSI with id {id} has not been found"; + model.HasError = true; + + return View(model); + } + + if(right is null) + { + model.ErrorMessage = $"SCSI with id {rightId} has not been found"; + model.HasError = true; + + return View(model); + } + + Inquiry? leftNullable = left.Inquiry; + Inquiry? rightNullable = right.Inquiry; + model.ValueNames = new List(); + model.LeftValues = new List(); + model.RightValues = new List(); + + if(!leftNullable.HasValue && !rightNullable.HasValue) + { + model.AreEqual = true; + + return View(model); + } + + if(leftNullable.HasValue && !rightNullable.HasValue) + { + model.ValueNames.Add("Decoded"); + model.LeftValues.Add("decoded"); + model.RightValues.Add("null"); + + return View(model); + } + + if(!leftNullable.HasValue) + { + model.ValueNames.Add("Decoded"); + model.LeftValues.Add("null"); + model.RightValues.Add("decoded"); + + return View(model); + } + + Inquiry leftValue = left.Inquiry.Value; + Inquiry rightValue = right.Inquiry.Value; + + foreach(FieldInfo fieldInfo in leftValue.GetType().GetFields()) + { + object lv = fieldInfo.GetValue(leftValue); + object rv = fieldInfo.GetValue(rightValue); + + if(fieldInfo.FieldType.IsArray) + { + var la = lv as Array; + var ra = rv as Array; + + switch(la) + { + case null when ra is null: + continue; + case null: + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("null"); + model.RightValues.Add("[]"); + + continue; + } + + if(ra is null) + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("[]"); + model.RightValues.Add("null"); + + continue; + } + + var ll = la.Cast().ToList(); + var rl = ra.Cast().ToList(); + + for(var i = 0; i < ll.Count; i++) + { + if(ll[i].Equals(rl[i])) continue; + + switch(fieldInfo.Name) + { + case nameof(Inquiry.KreonIdentifier): + case nameof(Inquiry.ProductIdentification): + case nameof(Inquiry.ProductRevisionLevel): + case nameof(Inquiry.Qt_ModuleRevision): + case nameof(Inquiry.Seagate_Copyright): + case nameof(Inquiry.Seagate_DriveSerialNumber): + case nameof(Inquiry.Seagate_ServoPROMPartNo): + case nameof(Inquiry.VendorIdentification): + var lb = new byte[ll.Count]; + var rb = new byte[rl.Count]; + + for(var j = 0; j < ll.Count; j++) lb[j] = (byte)ll[j]; + + for(var j = 0; j < ll.Count; j++) rb[j] = (byte)rl[j]; + + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add($"{StringHandlers.CToString(lb) ?? ""}"); + model.RightValues.Add($"{StringHandlers.CToString(rb) ?? ""}"); + + break; + + default: + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("[]"); + model.RightValues.Add("[]"); + + break; + } + + break; + } + } + else if(lv == null && rv == null) {} + else if(lv != null && rv == null) + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add($"{lv}"); + model.RightValues.Add("null"); + } + else if(lv == null) + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add("null"); + model.RightValues.Add($"{rv}"); + } + else if(!lv.Equals(rv)) + + { + model.ValueNames.Add(fieldInfo.Name); + model.LeftValues.Add($"{lv}"); + model.RightValues.Add($"{rv}"); + } + } + + model.AreEqual = model.LeftValues.Count == 0 && model.RightValues.Count == 0; + + return View(model); + } + + public IActionResult ConsolidateWithIds(int masterId, int slaveId) + { + Scsi master = _context.Scsi.FirstOrDefault(m => m.Id == masterId); + + if(master is null) + { + return RedirectToAction(nameof(Compare), + new + { + id = masterId, + rightId = slaveId + }); + } + + Scsi slave = _context.Scsi.FirstOrDefault(m => m.Id == slaveId); + + if(slave is null) + { + return RedirectToAction(nameof(Compare), + new + { + id = masterId, + rightId = slaveId + }); + } + + foreach(Device scsiDevice in _context.Devices.Where(d => d.SCSI.Id == slaveId)) scsiDevice.SCSI = master; + + foreach(UploadedReport scsiReport in _context.Reports.Where(d => d.SCSI.Id == slaveId)) + scsiReport.SCSI = master; + + foreach(TestedMedia testedMedia in _context.TestedMedia.Where(d => d.ScsiId == slaveId)) + { + testedMedia.ScsiId = masterId; + _context.Update(testedMedia); + } + + if(master.ReadCapabilities is null && slave.ReadCapabilities != null) + master.ReadCapabilities = slave.ReadCapabilities; + + _context.Scsi.Remove(slave); + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/SscsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/SscsController.cs new file mode 100644 index 00000000..7d9051c3 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/SscsController.cs @@ -0,0 +1,115 @@ +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class SscsController : Controller +{ + readonly DbContext _context; + + public SscsController(DbContext context) => _context = context; + + // GET: Admin/Sscs + public async Task Index() => View(await _context.Ssc.OrderBy(s => s.MinBlockLength) + .ThenBy(s => s.MaxBlockLength) + .ThenBy(s => s.BlockSizeGranularity) + .ToListAsync()); + + // GET: Admin/Sscs/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Ssc ssc = await _context.Ssc.FirstOrDefaultAsync(m => m.Id == id); + + if(ssc == null) return NotFound(); + + return View(ssc); + } + + // POST: Admin/Sscs/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Ssc ssc = await _context.Ssc.FindAsync(id); + _context.Ssc.Remove(ssc); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Consolidate() + { + var dups = _context.Ssc.GroupBy(x => new + { + x.BlockSizeGranularity, + x.MaxBlockLength, + x.MinBlockLength + }) + .Where(x => x.Count() > 1) + .Select(x => new SscModel + { + BlockSizeGranularity = x.Key.BlockSizeGranularity, + MaxBlockLength = x.Key.MaxBlockLength, + MinBlockLength = x.Key.MinBlockLength + }) + .ToList(); + + return View(new SscModelForView + { + List = dups, + Json = JsonConvert.SerializeObject(dups) + }); + } + + [HttpPost] + [ActionName("Consolidate")] + [ValidateAntiForgeryToken] + public IActionResult ConsolidateConfirmed(string models) + { + SscModel[] duplicates; + + try + { + duplicates = JsonConvert.DeserializeObject(models); + } + catch(JsonSerializationException) + { + return BadRequest(); + } + + if(duplicates is null) return BadRequest(); + + foreach(SscModel duplicate in duplicates) + { + Ssc master = _context.Ssc.FirstOrDefault(m => m.BlockSizeGranularity == duplicate.BlockSizeGranularity && + m.MaxBlockLength == duplicate.MaxBlockLength && + m.MinBlockLength == duplicate.MinBlockLength); + + if(master is null) continue; + + foreach(Ssc ssc in _context.Ssc.Where(m => m.BlockSizeGranularity == duplicate.BlockSizeGranularity && + m.MaxBlockLength == duplicate.MaxBlockLength && + m.MinBlockLength == duplicate.MinBlockLength) + .Skip(1) + .ToArray()) + { + foreach(TestedSequentialMedia media in _context.TestedSequentialMedia.Where(d => d.SscId == ssc.Id)) + media.SscId = master.Id; + + _context.Ssc.Update(ssc); + _context.Ssc.Remove(ssc); + } + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/SupportedDensitiesController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/SupportedDensitiesController.cs new file mode 100644 index 00000000..f6df12f4 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/SupportedDensitiesController.cs @@ -0,0 +1,53 @@ +using Aaru.CommonTypes.Metadata; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class SupportedDensitiesController : Controller +{ + readonly DbContext _context; + + public SupportedDensitiesController(DbContext context) => _context = context; + + // GET: Admin/SupportedDensities + public async Task Index() => View(await _context.SupportedDensity.OrderBy(d => d.Organization) + .ThenBy(d => d.Name) + .ThenBy(d => d.Description) + .ThenBy(d => d.Capacity) + .ThenBy(d => d.PrimaryCode) + .ThenBy(d => d.SecondaryCode) + .ThenBy(d => d.BitsPerMm) + .ThenBy(d => d.Width) + .ThenBy(d => d.Tracks) + .ThenBy(d => d.DefaultDensity) + .ThenBy(d => d.Writable) + .ThenBy(d => d.Duplicate) + .ToListAsync()); + + // GET: Admin/SupportedDensities/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + SupportedDensity supportedDensity = await _context.SupportedDensity.FirstOrDefaultAsync(m => m.Id == id); + + if(supportedDensity == null) return NotFound(); + + return View(supportedDensity); + } + + // POST: Admin/SupportedDensities/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + SupportedDensity supportedDensity = await _context.SupportedDensity.FindAsync(id); + _context.SupportedDensity.Remove(supportedDensity); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/TestedMediasController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/TestedMediasController.cs new file mode 100644 index 00000000..a2c9470e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/TestedMediasController.cs @@ -0,0 +1,695 @@ +using System.Web; +using Aaru.CommonTypes.Metadata; +using Aaru.CommonTypes.Structs.Devices.SCSI; +using Aaru.Decoders.ATA; +using Aaru.Decoders.Bluray; +using Aaru.Decoders.CD; +using Aaru.Decoders.DVD; +using Aaru.Decoders.SCSI; +using Aaru.Helpers; +using Aaru.Server.Old.Database.Models; +using Cartridge = Aaru.Decoders.Bluray.Cartridge; +using DbContext = Aaru.Server.Old.Database.DbContext; +using DDS = Aaru.Decoders.Bluray.DDS; +using DMI = Aaru.Decoders.Xbox.DMI; +using MediaType = Aaru.CommonTypes.MediaType; +using Spare = Aaru.Decoders.Bluray.Spare; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class TestedMediasController : Controller +{ + readonly DbContext _context; + + public TestedMediasController(DbContext context) => _context = context; + + // GET: Admin/TestedMedias + public async Task Index() => View(await _context.TestedMedia.OrderBy(m => m.Manufacturer) + .ThenBy(m => m.Model) + .ThenBy(m => m.MediumTypeName) + .ThenBy(m => m.MediaIsRecognized) + .ThenBy(m => m.LongBlockSize) + .ThenBy(m => m.BlockSize) + .ThenBy(m => m.Blocks) + .ToListAsync()); + + // GET: Admin/TestedMedias/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + TestedMedia testedMedia = await _context.TestedMedia.FirstOrDefaultAsync(m => m.Id == id); + + if(testedMedia == null) return NotFound(); + + return View(testedMedia); + } + + // GET: Admin/TestedMedias/Edit/5 + public async Task Edit(int? id) + { + if(id == null) return NotFound(); + + TestedMedia testedMedia = await _context.TestedMedia.FindAsync(id); + + if(testedMedia == null) return NotFound(); + + return View(testedMedia); + } + + // POST: Admin/TestedMedias/Edit/5 + // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit( + int id, [Bind("Id,Blocks,BlockSize,LongBlockSize,Manufacturer,MediumTypeName,Model")] TestedMedia changedModel) + { + if(id != changedModel.Id) return NotFound(); + + if(!ModelState.IsValid) return View(changedModel); + + TestedMedia model = await _context.TestedMedia.FirstOrDefaultAsync(m => m.Id == id); + + if(model is null) return NotFound(); + + model.Blocks = changedModel.Blocks; + model.BlockSize = changedModel.BlockSize; + model.LongBlockSize = changedModel.LongBlockSize; + model.Manufacturer = changedModel.Manufacturer; + model.MediumTypeName = changedModel.MediumTypeName; + model.Model = changedModel.Model; + + try + { + _context.Update(model); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + ModelState.AddModelError("Concurrency", "Concurrency error, please report to the administrator."); + } + + return RedirectToAction(nameof(Index)); + } + + // GET: Admin/TestedMedias/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + TestedMedia testedMedia = await _context.TestedMedia.FirstOrDefaultAsync(m => m.Id == id); + + if(testedMedia == null) return NotFound(); + + return View(testedMedia); + } + + // POST: Admin/TestedMedias/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + TestedMedia testedMedia = await _context.TestedMedia.FindAsync(id); + _context.TestedMedia.Remove(testedMedia); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult ViewData(int id, string data) + { + if(string.IsNullOrWhiteSpace(data)) return NotFound(); + + TestedMedia testedMedia = _context.TestedMedia.FirstOrDefault(m => m.Id == id); + + if(testedMedia == null) return NotFound(); + + var model = new TestedMediaDataModel + { + TestedMediaId = id, + DataName = data + }; + + byte[] buffer; + var sector = new byte[2352]; + var subq = new byte[16]; + var fullsub = new byte[96]; + var c2Errors = false; + var scrambled = false; + + switch(data) + { + case nameof(testedMedia.AdipData): + buffer = testedMedia.AdipData; + + break; + case nameof(testedMedia.AtipData): + buffer = testedMedia.AtipData; + model.Decoded = ATIP.Prettify(buffer); + + break; + case nameof(testedMedia.BluBcaData): + buffer = testedMedia.BluBcaData; + + break; + case nameof(testedMedia.BluDdsData): + buffer = testedMedia.BluDdsData; + model.Decoded = DDS.Prettify(buffer); + + break; + case nameof(testedMedia.BluDiData): + buffer = testedMedia.BluDiData; + model.Decoded = DI.Prettify(buffer); + + break; + case nameof(testedMedia.BluPacData): + buffer = testedMedia.BluPacData; + model.Decoded = Cartridge.Prettify(buffer); + + break; + case nameof(testedMedia.BluSaiData): + buffer = testedMedia.BluSaiData; + model.Decoded = Spare.Prettify(buffer); + + break; + case nameof(testedMedia.C2PointersData): + buffer = testedMedia.C2PointersData; + + if(buffer is null || buffer.Length < 2352 || buffer.All(c => c == 0)) break; + + Array.Copy(buffer, 0, sector, 0, 2352); + + model.Decoded = Sector.Prettify(sector); + + for(var i = 2352; i < buffer.Length; i++) + { + if(buffer[i] == 0x00) continue; + + c2Errors = true; + + break; + } + + model.Decoded += "\n" + (c2Errors ? "C2 errors found." : "No C2 errors."); + + break; + case nameof(testedMedia.CmiData): + buffer = testedMedia.CmiData; + model.Decoded = CSS_CPRM.PrettifyLeadInCopyright(buffer); + + break; + case nameof(testedMedia.CorrectedSubchannelData): + buffer = testedMedia.CorrectedSubchannelData; + + if(buffer is null || buffer.Length < 2352 || buffer.All(c => c == 0)) break; + + Array.Copy(buffer, 0, sector, 0, 2352); + + model.Decoded = Sector.Prettify(sector); + + if(buffer.Length < 2448) break; + + Array.Copy(buffer, 2352, fullsub, 0, 96); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + break; + case nameof(testedMedia.CorrectedSubchannelWithC2Data): + buffer = testedMedia.CorrectedSubchannelWithC2Data; + + if(buffer is null || buffer.Length < 2352 || buffer.All(c => c == 0)) break; + + Array.Copy(buffer, 0, sector, 0, 2352); + + model.Decoded = Sector.Prettify(sector); + + if(buffer.Length < 2448) break; + + for(var i = 2352; i < 2616; i++) + { + if(buffer[i] == 0x00) continue; + + c2Errors = true; + + break; + } + + model.Decoded += "\n" + (c2Errors ? "C2 errors found." : "No C2 errors."); + + break; + case nameof(testedMedia.DcbData): + buffer = testedMedia.DcbData; + + break; + case nameof(testedMedia.DmiData): + buffer = testedMedia.DmiData; + + if(DMI.IsXbox(buffer)) + model.Decoded = DMI.PrettifyXbox(buffer); + else if(DMI.IsXbox360(buffer)) model.Decoded = DMI.PrettifyXbox360(buffer); + + break; + case nameof(testedMedia.DvdAacsData): + buffer = testedMedia.DvdAacsData; + + break; + case nameof(testedMedia.DvdBcaData): + buffer = testedMedia.DvdBcaData; + + break; + case nameof(testedMedia.DvdDdsData): + buffer = testedMedia.DvdDdsData; + model.Decoded = Decoders.DVD.DDS.Prettify(buffer); + + break; + case nameof(testedMedia.DvdLayerData): + buffer = testedMedia.DvdLayerData; + + break; + case nameof(testedMedia.DvdSaiData): + buffer = testedMedia.DvdSaiData; + model.Decoded = Decoders.DVD.Spare.Prettify(buffer); + + break; + case nameof(testedMedia.EmbossedPfiData): + buffer = testedMedia.EmbossedPfiData; + model.Decoded = PFI.Prettify(buffer, MediaType.DVDROM); // TODO: Get real media type here + + break; + case nameof(testedMedia.FullTocData): + buffer = testedMedia.FullTocData; + model.Decoded = FullTOC.Prettify(buffer); + + break; + case nameof(testedMedia.HdCmiData): + buffer = testedMedia.HdCmiData; + + break; + case nameof(testedMedia.HLDTSTReadRawDVDData): + buffer = testedMedia.HLDTSTReadRawDVDData; + + break; + case nameof(testedMedia.LiteOnReadRawDVDData): + buffer = testedMedia.LiteOnReadRawDVDData; + + break; + case nameof(testedMedia.IdentifyData): + buffer = testedMedia.IdentifyData; + model.Decoded = Identify.Prettify(buffer); + + break; + case nameof(testedMedia.IntersessionLeadInData): + buffer = testedMedia.IntersessionLeadInData; + + break; + case nameof(testedMedia.IntersessionLeadOutData): + buffer = testedMedia.IntersessionLeadOutData; + + break; + case nameof(testedMedia.LeadInData): + buffer = testedMedia.LeadInData; + model.Decoded = Sector.Prettify(buffer); + + break; + case nameof(testedMedia.LeadOutData): + buffer = testedMedia.LeadOutData; + model.Decoded = Sector.Prettify(buffer); + + break; + case nameof(testedMedia.ModeSense6Data): + buffer = testedMedia.ModeSense6Data; + model.Decoded = Modes.PrettifyModeHeader6(buffer, PeripheralDeviceTypes.DirectAccess); + + break; + case nameof(testedMedia.ModeSense10Data): + buffer = testedMedia.ModeSense10Data; + model.Decoded = Modes.PrettifyModeHeader10(buffer, PeripheralDeviceTypes.DirectAccess); + + break; + case nameof(testedMedia.NecReadCddaData): + buffer = testedMedia.NecReadCddaData; + + break; + case nameof(testedMedia.PfiData): + buffer = testedMedia.PfiData; + model.Decoded = PFI.Prettify(buffer, MediaType.DVDROM); // TODO: Get real media type here + + break; + case nameof(testedMedia.PioneerReadCddaData): + buffer = testedMedia.PioneerReadCddaData; + + break; + case nameof(testedMedia.PioneerReadCddaMsfData): + buffer = testedMedia.PioneerReadCddaMsfData; + + break; + case nameof(testedMedia.PlextorReadCddaData): + buffer = testedMedia.PlextorReadCddaData; + + break; + case nameof(testedMedia.PlextorReadRawDVDData): + buffer = testedMedia.PlextorReadRawDVDData; + + break; + case nameof(testedMedia.PmaData): + buffer = testedMedia.PmaData; + model.Decoded = PMA.Prettify(buffer); + + break; + case nameof(testedMedia.PQSubchannelData): + buffer = testedMedia.PQSubchannelData; + + if(buffer is null || buffer.Length < 2352 || buffer.All(c => c == 0)) break; + + Array.Copy(buffer, 0, sector, 0, 2352); + + model.Decoded = Sector.Prettify(sector); + + if(buffer.Length < 2368) break; + + Array.Copy(buffer, 2352, subq, 0, 16); + fullsub = Subchannel.ConvertQToRaw(subq); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + break; + case nameof(testedMedia.PQSubchannelWithC2Data): + buffer = testedMedia.PQSubchannelWithC2Data; + + if(buffer is null || buffer.Length < 2352 || buffer.All(c => c == 0)) break; + + Array.Copy(buffer, 0, sector, 0, 2352); + + model.Decoded = Sector.Prettify(sector); + + if(buffer.Length < 2368) break; + + Array.Copy(buffer, 2646, subq, 0, 16); + fullsub = Subchannel.ConvertQToRaw(subq); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + for(var i = 2352; i < 2646; i++) + { + if(buffer[i] == 0x00) continue; + + c2Errors = true; + + break; + } + + model.Decoded += "\n" + (c2Errors ? "C2 errors found." : "No C2 errors."); + + break; + case nameof(testedMedia.PriData): + buffer = testedMedia.PriData; + + break; + case nameof(testedMedia.Read6Data): + buffer = testedMedia.Read6Data; + + break; + case nameof(testedMedia.Read10Data): + buffer = testedMedia.Read10Data; + + break; + case nameof(testedMedia.Read12Data): + buffer = testedMedia.Read12Data; + + break; + case nameof(testedMedia.Read16Data): + buffer = testedMedia.Read16Data; + + break; + case nameof(testedMedia.ReadCdData): + buffer = testedMedia.ReadCdData; + + break; + case nameof(testedMedia.ReadCdFullData): + buffer = testedMedia.ReadCdFullData; + model.Decoded = Sector.Prettify(buffer); + + break; + case nameof(testedMedia.ReadCdMsfData): + buffer = testedMedia.ReadCdMsfData; + + break; + case nameof(testedMedia.ReadCdMsfFullData): + buffer = testedMedia.ReadCdMsfFullData; + model.Decoded = Sector.Prettify(buffer); + + break; + case nameof(testedMedia.ReadDmaData): + buffer = testedMedia.ReadDmaData; + + break; + case nameof(testedMedia.ReadDmaLba48Data): + buffer = testedMedia.ReadDmaLba48Data; + + break; + case nameof(testedMedia.ReadDmaLbaData): + buffer = testedMedia.ReadDmaLbaData; + + break; + case nameof(testedMedia.ReadDmaRetryData): + buffer = testedMedia.ReadDmaRetryData; + + break; + case nameof(testedMedia.ReadDmaRetryLbaData): + buffer = testedMedia.ReadDmaRetryLbaData; + + break; + case nameof(testedMedia.ReadLba48Data): + buffer = testedMedia.ReadLba48Data; + + break; + case nameof(testedMedia.ReadLbaData): + buffer = testedMedia.ReadLbaData; + + break; + case nameof(testedMedia.ReadLong10Data): + buffer = testedMedia.ReadLong10Data; + + break; + case nameof(testedMedia.ReadLong16Data): + buffer = testedMedia.ReadLong16Data; + + break; + case nameof(testedMedia.ReadLongData): + buffer = testedMedia.ReadLongData; + + break; + case nameof(testedMedia.ReadLongLbaData): + buffer = testedMedia.ReadLongLbaData; + + break; + case nameof(testedMedia.ReadLongRetryData): + buffer = testedMedia.ReadLongRetryData; + + break; + case nameof(testedMedia.ReadLongRetryLbaData): + buffer = testedMedia.ReadLongRetryLbaData; + + break; + case nameof(testedMedia.ReadRetryLbaData): + buffer = testedMedia.ReadRetryLbaData; + + break; + case nameof(testedMedia.ReadSectorsData): + buffer = testedMedia.ReadSectorsData; + + break; + case nameof(testedMedia.ReadSectorsRetryData): + buffer = testedMedia.ReadSectorsRetryData; + + break; + case nameof(testedMedia.RWSubchannelData): + buffer = testedMedia.RWSubchannelData; + + if(buffer is null || buffer.Length < 2352 || buffer.All(c => c == 0)) break; + + Array.Copy(buffer, 0, sector, 0, 2352); + + model.Decoded = Sector.Prettify(sector); + + if(buffer.Length < 2448) break; + + Array.Copy(buffer, 2352, fullsub, 0, 96); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + break; + case nameof(testedMedia.RWSubchannelWithC2Data): + buffer = testedMedia.RWSubchannelWithC2Data; + + if(buffer is null || buffer.Length < 2352 || buffer.All(c => c == 0)) break; + + Array.Copy(buffer, 0, sector, 0, 2352); + + model.Decoded = Sector.Prettify(sector); + + if(buffer.Length < 2448) break; + + Array.Copy(buffer, 2352, fullsub, 0, 96); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + for(var i = 2448; i < buffer.Length; i++) + { + if(buffer[i] != 0x00) + { + c2Errors = true; + + break; + } + } + + model.Decoded += "\n" + (c2Errors ? "C2 errors found." : "No C2 errors."); + + break; + case nameof(testedMedia.TocData): + buffer = testedMedia.TocData; + model.Decoded = TOC.Prettify(buffer); + + break; + case nameof(testedMedia.Track1PregapData): + buffer = testedMedia.Track1PregapData; + + model.Decoded = Sector.Prettify(buffer); + + break; + case nameof(testedMedia.ReadCdScrambledData): + buffer = testedMedia.ReadCdScrambledData; + + break; + case nameof(testedMedia.ReadF1_06Data): + buffer = testedMedia.ReadF1_06Data; + + if(buffer.Length != 0xB00) + { + model.Decoded = Sense.PrettifySense(buffer); + + break; + } + + Array.Copy(buffer, 0, sector, 0, 2352); + + if((sector[0xD] & 0x80) == 0x80) + { + scrambled = true; + Sector.Scramble(sector); + } + + model.Decoded = Sector.Prettify(sector) + "\n" + (scrambled ? "Scrambled." : "Descrambled."); + + Array.Copy(buffer, 2352, fullsub, 0, 96); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + Array.Copy(buffer, 2448, subq, 0, 16); + fullsub = Subchannel.ConvertQToRaw(subq); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + for(var i = 2468; i < 2762; i++) + { + if(buffer[i] == 0x00) continue; + + c2Errors = true; + + break; + } + + model.Decoded += "\n" + (c2Errors ? "C2 errors found." : "No C2 errors."); + + break; + case nameof(testedMedia.ReadF1_06LeadOutData): + buffer = testedMedia.ReadF1_06LeadOutData; + + if(buffer.Length != 0xB00) + { + model.Decoded = Sense.PrettifySense(buffer); + + break; + } + + Array.Copy(buffer, 0, sector, 0, 2352); + + if((sector[0xD] & 0x80) == 0x80) + { + scrambled = true; + Sector.Scramble(sector); + } + + model.Decoded = Sector.Prettify(sector) + "\n" + (scrambled ? "Scrambled." : "Descrambled."); + + Array.Copy(buffer, 2352, fullsub, 0, 96); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + Array.Copy(buffer, 2448, subq, 0, 16); + fullsub = Subchannel.ConvertQToRaw(subq); + + model.Decoded += "\n" + GetPrettySub(fullsub); + + for(var i = 2468; i < 2762; i++) + { + if(buffer[i] == 0x00) continue; + + c2Errors = true; + + break; + } + + model.Decoded += "\n" + (c2Errors ? "C2 errors found." : "No C2 errors."); + + break; + default: + return NotFound(); + } + + model.RawDataAsHex = PrintHex.ByteArrayToHexArrayString(buffer); + + if(model.RawDataAsHex != null) + model.RawDataAsHex = HttpUtility.HtmlEncode(model.RawDataAsHex).Replace("\n", "
"); + + if(model.Decoded != null) model.Decoded = HttpUtility.HtmlEncode(model.Decoded).Replace("\n", "
"); + + return View(model); + } + + static string GetPrettySub(byte[] sub) + { + byte[] deint = Subchannel.Deinterleave(sub); + + var validP = true; + var validRw = true; + + for(var i = 0; i < 12; i++) + { + if(deint[i] == 0x00 || deint[i] == 0xFF) continue; + + validP = false; + + break; + } + + for(var i = 24; i < 96; i++) + { + if(deint[i] == 0x00) continue; + + validRw = false; + + break; + } + + var q = new byte[12]; + Array.Copy(deint, 12, q, 0, 12); + + return Subchannel.PrettifyQ(q, deint[21] > 0x10, 16, !validP, false, validRw); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/TestedSequentialMediasController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/TestedSequentialMediasController.cs new file mode 100644 index 00000000..7e49d6ae --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/TestedSequentialMediasController.cs @@ -0,0 +1,90 @@ +using Aaru.CommonTypes.Metadata; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class TestedSequentialMediasController : Controller +{ + readonly DbContext _context; + + public TestedSequentialMediasController(DbContext context) => _context = context; + + // GET: Admin/TestedSequentialMedias + public async Task Index() => View(await _context.TestedSequentialMedia.OrderBy(m => m.Manufacturer) + .ThenBy(m => m.Model) + .ThenBy(m => m.MediumTypeName) + .ToListAsync()); + + // GET: Admin/TestedSequentialMedias/Edit/5 + public async Task Edit(int? id) + { + if(id == null) return NotFound(); + + TestedSequentialMedia testedSequentialMedia = await _context.TestedSequentialMedia.FindAsync(id); + + if(testedSequentialMedia == null) return NotFound(); + + return View(testedSequentialMedia); + } + + // POST: Admin/TestedSequentialMedias/Edit/5 + // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit( + int id, [Bind("Id,Manufacturer,MediumTypeName,Model")] TestedSequentialMedia changedModel) + { + if(id != changedModel.Id) return NotFound(); + + if(!ModelState.IsValid) return View(changedModel); + + TestedSequentialMedia model = await _context.TestedSequentialMedia.FirstOrDefaultAsync(m => m.Id == id); + + if(model is null) return NotFound(); + + model.Manufacturer = changedModel.Manufacturer; + model.MediumTypeName = changedModel.MediumTypeName; + model.Model = changedModel.Model; + + try + { + _context.Update(model); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + ModelState.AddModelError("Concurrency", "Concurrency error, please report to the administrator."); + } + + return RedirectToAction(nameof(Index)); + } + + // GET: Admin/TestedSequentialMedias/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + TestedSequentialMedia testedSequentialMedia = + await _context.TestedSequentialMedia.FirstOrDefaultAsync(m => m.Id == id); + + if(testedSequentialMedia == null) return NotFound(); + + return View(testedSequentialMedia); + } + + // POST: Admin/TestedSequentialMedias/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + TestedSequentialMedia testedSequentialMedia = await _context.TestedSequentialMedia.FindAsync(id); + _context.TestedSequentialMedia.Remove(testedSequentialMedia); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/UsbProductsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/UsbProductsController.cs new file mode 100644 index 00000000..277024b0 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/UsbProductsController.cs @@ -0,0 +1,27 @@ +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class UsbProductsController : Controller +{ + readonly DbContext _context; + + public UsbProductsController(DbContext context) => _context = context; + + // GET: Admin/UsbProducts + public async Task Index() => View(await _context.UsbProducts.Include(u => u.Vendor) + .OrderBy(p => p.Vendor.Vendor) + .ThenBy(p => p.Product) + .ThenBy(p => p.ProductId) + .Select(p => new UsbProductModel + { + ProductId = p.ProductId, + ProductName = p.Product, + VendorId = p.Vendor.Id, + VendorName = p.Vendor.Vendor + }) + .ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/UsbVendorsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/UsbVendorsController.cs new file mode 100644 index 00000000..b4757ede --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/UsbVendorsController.cs @@ -0,0 +1,42 @@ +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class UsbVendorsController : Controller +{ + readonly DbContext _context; + + public UsbVendorsController(DbContext context) => _context = context; + + // GET: Admin/UsbVendors + public async Task Index() => + View(await _context.UsbVendors.OrderBy(v => v.Vendor).ThenBy(v => v.VendorId).ToListAsync()); + + // GET: Admin/UsbVendors/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + UsbVendor usbVendor = await _context.UsbVendors.FirstOrDefaultAsync(m => m.Id == id); + + if(usbVendor == null) return NotFound(); + + return View(new UsbVendorModel + { + Vendor = usbVendor.Vendor, + VendorId = usbVendor.VendorId, + Products = _context.UsbProducts.Where(p => p.VendorId == usbVendor.Id) + .OrderBy(p => p.Product) + .ThenBy(p => p.ProductId) + .Select(p => new UsbProductModel + { + ProductId = p.ProductId, + ProductName = p.Product + }) + .ToList() + }); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/UsbsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/UsbsController.cs new file mode 100644 index 00000000..0a5e3b9b --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/UsbsController.cs @@ -0,0 +1,142 @@ +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class UsbsController : Controller +{ + readonly DbContext _context; + + public UsbsController(DbContext context) => _context = context; + + // GET: Admin/Usbs + public async Task Index() => View(await _context.Usb.OrderBy(u => u.Manufacturer) + .ThenBy(u => u.Product) + .ThenBy(u => u.VendorID) + .ThenBy(u => u.ProductID) + .ToListAsync()); + + // GET: Admin/Usbs/Details/5 + public async Task Details(int? id) + { + if(id == null) return NotFound(); + + Usb usb = await _context.Usb.FirstOrDefaultAsync(m => m.Id == id); + + if(usb == null) return NotFound(); + + return View(usb); + } + + // GET: Admin/Usbs/Delete/5 + public async Task Delete(int? id) + { + if(id == null) return NotFound(); + + Usb usb = await _context.Usb.FirstOrDefaultAsync(m => m.Id == id); + + if(usb == null) return NotFound(); + + return View(usb); + } + + // POST: Admin/Usbs/Delete/5 + [HttpPost] + [ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(int id) + { + Usb usb = await _context.Usb.FindAsync(id); + _context.Usb.Remove(usb); + await _context.SaveChangesAsync(); + + return RedirectToAction(nameof(Index)); + } + + public IActionResult Consolidate() + { + var dups = _context.Usb.GroupBy(x => new + { + x.Manufacturer, + x.Product, + x.VendorID, + x.ProductID + }) + .Where(x => x.Count() > 1) + .Select(x => new UsbModel + { + Manufacturer = x.Key.Manufacturer, + Product = x.Key.Product, + VendorID = x.Key.VendorID, + ProductID = x.Key.ProductID + }) + .ToList(); + + return View(new UsbModelForView + { + List = dups, + Json = JsonConvert.SerializeObject(dups) + }); + } + + [HttpPost] + [ActionName("Consolidate")] + [ValidateAntiForgeryToken] + public IActionResult ConsolidateConfirmed(string models) + { + UsbModel[] duplicates; + + try + { + duplicates = JsonConvert.DeserializeObject(models); + } + catch(JsonSerializationException) + { + return BadRequest(); + } + + if(duplicates is null) return BadRequest(); + + foreach(UsbModel duplicate in duplicates) + { + Usb master = _context.Usb.FirstOrDefault(m => m.Manufacturer == duplicate.Manufacturer && + m.Product == duplicate.Product && + m.VendorID == duplicate.VendorID && + m.ProductID == duplicate.ProductID); + + if(master is null) continue; + + foreach(Usb slave in _context.Usb.Where(m => m.Manufacturer == duplicate.Manufacturer && + m.Product == duplicate.Product && + m.VendorID == duplicate.VendorID && + m.ProductID == duplicate.ProductID) + .Skip(1) + .ToArray()) + { + if(slave.Descriptors != null && master.Descriptors != null) + if(!master.Descriptors.SequenceEqual(slave.Descriptors)) + continue; + + foreach(Device device in _context.Devices.Where(d => d.USB.Id == slave.Id)) device.USB = master; + + foreach(UploadedReport report in _context.Reports.Where(d => d.USB.Id == slave.Id)) report.USB = master; + + if(master.Descriptors is null && slave.Descriptors != null) + { + master.Descriptors = slave.Descriptors; + _context.Usb.Update(master); + } + + _context.Usb.Remove(slave); + } + } + + _context.SaveChanges(); + + return RedirectToAction(nameof(Index)); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Controllers/VersionsController.cs b/Aaru.Server.Old/Areas/Admin/Controllers/VersionsController.cs new file mode 100644 index 00000000..35c121f8 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Controllers/VersionsController.cs @@ -0,0 +1,15 @@ +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Areas.Admin.Controllers; + +[Area("Admin")] +[Authorize] +public sealed class VersionsController : Controller +{ + readonly DbContext _context; + + public VersionsController(DbContext context) => _context = context; + + // GET: Admin/Versions + public async Task Index() => View(await _context.Versions.OrderBy(v => v.Name).ToListAsync()); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Atas/CheckPrivate.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Atas/CheckPrivate.cshtml new file mode 100644 index 00000000..58703156 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Atas/CheckPrivate.cshtml @@ -0,0 +1,138 @@ +@using System.Text +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +ATA IDENTIFY DEVICE responses with possible private data + +@if(!Model.Any()) +{ +
+ No private data found. + Back to list +
+ + return; +} + + + + + + + + + + + + + + + + + + + + @foreach(Ata item in Model) + { + + + + + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Id) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.Model) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.SerialNumber) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.WWN) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.WWNExtension) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.MediaSerial) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.ReservedWords121) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.ReservedWords129) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.ReservedCFA) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.ReservedCEATA224) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.ReservedWords) + +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.IdentifyDevice.Value.Model) + + @Html.DisplayFor(modelItem => item.IdentifyDevice.Value.SerialNumber) + + @Html.DisplayFor(modelItem => item.IdentifyDevice.Value.WWN) + + @Html.DisplayFor(modelItem => item.IdentifyDevice.Value.WWNExtension) + + @Html.DisplayFor(modelItem => item.IdentifyDevice.Value.MediaSerial) + + @Html.Encode(Encoding.ASCII.GetString(item.Identify, 121 * 2, 10).Replace("\0", "")) + + @Html.Encode(Encoding.ASCII.GetString(item.Identify, 129 * 2, 62).Replace("\0", "")) + + @Html.Encode(Encoding.ASCII.GetString(item.Identify, 161 * 2, 14).Replace("\0", "")) + + @Html.Encode(Encoding.ASCII.GetString(item.Identify, 224 * 2, 12).Replace("\0", "")) + + @Html.Encode(Encoding.ASCII.GetString(item.Identify, 236 * 2, 38).Replace("\0", "")) + + Clear private fields + Clear reserved fields +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Atas/Compare.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Atas/Compare.cshtml new file mode 100644 index 00000000..6ed05734 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Atas/Compare.cshtml @@ -0,0 +1,86 @@ +@model Aaru.Server.Database.Models.CompareModel + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Comparing ATA IDENTIFY ID @Model.LeftId with ID @Model.RightId

+@if(Model.AreEqual) +{ +

No differences found.

+ + return; +} + +@if(Model.HasError) +{ +

@Model.ErrorMessage

+ + return; +} + + + + + + + + + + + @for(var i = 0; i < Model.ValueNames.Count; i++) + { + + + + + + } + +
+ Value name + + ID: @Model.LeftId + + ID: @Model.RightId +
+ @Model.ValueNames[i] + + @Model.LeftValues[i] + + @Model.RightValues[i] +
+Back to List +Delete ID @Model.LeftId +Delete ID @Model.RightId +Replace all dependencies from ID @Model.RightId with ID @Model.LeftId +Replace all dependencies from ID @Model.LeftId with ID @Model.RightId \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Atas/Consolidate.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Atas/Consolidate.cshtml new file mode 100644 index 00000000..4ab87a1e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Atas/Consolidate.cshtml @@ -0,0 +1,32 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.IdHashModelForView + +@{ + ViewBag.Title = "Consolidate duplicate ATAs"; + Layout = "_Layout"; +} +

Consolidate duplicate ATAs

+
+ The following ATA IDENTIFY DEVICE have duplicates. + + + + @foreach(IdHashModel item in Model.List) + { + + + + } + +
+ @Html.DisplayFor(modelItem => item.Description) +
+
+
+ Do you want to remove the duplicates? +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Atas/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Atas/Delete.cshtml new file mode 100644 index 00000000..0fcc30b8 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Atas/Delete.cshtml @@ -0,0 +1,50 @@ +@using Aaru.Decoders.ATA +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.Ata + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

ATA IDENTIFY DEVICE / ATAPI IDENTIFY PACKET DEVICE - ID = @Model.Id

+
+ @Html.Raw(Html.EncodedMultiLineText(Identify.Prettify(Model.Identify))) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Atas/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Atas/Details.cshtml new file mode 100644 index 00000000..dd49e526 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Atas/Details.cshtml @@ -0,0 +1,51 @@ +@using Aaru.Decoders.ATA +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.Ata + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

ATA IDENTIFY DEVICE / ATAPI IDENTIFY PACKET DEVICE - ID = @Model.Id

+
+ @Html.Raw(Html.EncodedMultiLineText(Identify.Prettify(Model.Identify))) +
+
+
+ + Compare to: + + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Atas/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Atas/Index.cshtml new file mode 100644 index 00000000..933df1ac --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Atas/Index.cshtml @@ -0,0 +1,77 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

ATA IDENTIFY DEVICE responses

+ + + + + + + + + + + + @foreach(Ata item in Model) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Id) + + @Html.DisplayNameFor(model => model.IdentifyDevice.Value.Model) + + Firmware revision +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.IdentifyDevice.Value.Model) + + @Html.DisplayFor(modelItem => item.IdentifyDevice.Value.FirmwareRevision) + + Details + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/BlockDescriptors/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/BlockDescriptors/Index.cshtml new file mode 100644 index 00000000..29494489 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/BlockDescriptors/Index.cshtml @@ -0,0 +1,68 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Block descriptors

+ + + + + + + + + + @foreach(BlockDescriptor item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Density) + + @Html.DisplayNameFor(model => model.Blocks) + + @Html.DisplayNameFor(model => model.BlockLength) +
+ @Html.DisplayFor(modelItem => item.Density) + + @Html.DisplayFor(modelItem => item.Blocks) + + @Html.DisplayFor(modelItem => item.BlockLength) +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Chs/Consolidate.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Chs/Consolidate.cshtml new file mode 100644 index 00000000..410eb670 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Chs/Consolidate.cshtml @@ -0,0 +1,32 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.ChsModelForView + +@{ + ViewBag.Title = "Consolidate duplicate CHS"; + Layout = "_Layout"; +} +

Consolidate duplicate CHS

+
+ The following CHS have duplicates. + + + + @foreach(ChsModel item in Model.List) + { + + + + } + +
+ @Html.DisplayFor(modelItem => item.Cylinders)/@Html.DisplayFor(modelItem => item.Heads)/@Html.DisplayFor(modelItem => item.Sectors) +
+
+
+ Do you want to remove the duplicates? +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Chs/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Chs/Index.cshtml new file mode 100644 index 00000000..a1807a60 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Chs/Index.cshtml @@ -0,0 +1,70 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} + + + + + + + + + + + @foreach(Chs item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Cylinders) + + @Html.DisplayNameFor(model => model.Heads) + + @Html.DisplayNameFor(model => model.Sectors) +
+ @Html.DisplayFor(modelItem => item.Cylinders) + + @Html.DisplayFor(modelItem => item.Heads) + + @Html.DisplayFor(modelItem => item.Sectors) +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Commands/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Commands/Index.cshtml new file mode 100644 index 00000000..7ddeab70 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Commands/Index.cshtml @@ -0,0 +1,63 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Commands

+ + + + + + + + + + @foreach(Command item in Model) + { + + + + + } + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Count) +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Delete.cshtml new file mode 100644 index 00000000..1992930a --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Delete.cshtml @@ -0,0 +1,89 @@ +@model Aaru.Server.Database.Models.CompactDiscOffset + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Compact disc offset

+
+
+
+ @Html.DisplayNameFor(model => model.AddedWhen) +
+
+ @Html.DisplayFor(model => model.AddedWhen) +
+
+ @Html.DisplayNameFor(model => model.ModifiedWhen) +
+
+ @Html.DisplayFor(model => model.ModifiedWhen) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+ @Html.DisplayNameFor(model => model.Offset) +
+
+ @Html.DisplayFor(model => model.Offset) +
+
+ @Html.DisplayNameFor(model => model.Submissions) +
+
+ @Html.DisplayFor(model => model.Submissions) +
+
+ @Html.DisplayNameFor(model => model.Agreement) +
+
+ @Html.DisplayFor(model => model.Agreement) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Edit.cshtml b/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Edit.cshtml new file mode 100644 index 00000000..d2476f34 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Edit.cshtml @@ -0,0 +1,74 @@ +@model Aaru.Server.Database.Models.CompactDiscOffset + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Edit.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Compact disc offset

+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + Back to List +
+
+
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml new file mode 100644 index 00000000..70f92a65 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml @@ -0,0 +1,107 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +Update from AccurateRip +

Compact Disc offsets

+ + + + + + + + + + + + + + + @foreach(CompactDiscOffset item in Model) + { + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Model) + + @Html.DisplayNameFor(model => model.Offset) + + @Html.DisplayNameFor(model => model.Submissions) + + @Html.DisplayNameFor(model => model.Agreement) + + @Html.DisplayNameFor(model => model.AddedWhen) + + @Html.DisplayNameFor(model => model.ModifiedWhen) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.Offset) + + @Html.DisplayFor(modelItem => item.Submissions) + + @Html.DisplayFor(modelItem => item.Agreement) + + @Html.DisplayFor(modelItem => item.AddedWhen) + + @Html.DisplayFor(modelItem => item.ModifiedWhen) + + Edit + Delete +
+ +@section scripts{ + + +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Delete.cshtml new file mode 100644 index 00000000..b56f8c9e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Delete.cshtml @@ -0,0 +1,71 @@ +@model Aaru.Server.Database.Models.DeviceStat + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Device statistic

+
+
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+ @Html.DisplayNameFor(model => model.Revision) +
+
+ @Html.DisplayFor(model => model.Revision) +
+
+ @Html.DisplayNameFor(model => model.Bus) +
+
+ @Html.DisplayFor(model => model.Bus) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Edit.cshtml b/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Edit.cshtml new file mode 100644 index 00000000..e1d65783 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Edit.cshtml @@ -0,0 +1,69 @@ +@model Aaru.Server.Database.Models.DeviceStat + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Edit.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Device statistic

+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + Back to List +
+
+
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Index.cshtml new file mode 100644 index 00000000..c2a68ab0 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/DeviceStats/Index.cshtml @@ -0,0 +1,94 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Device statistics

+ + + + + + + + + + + + + @foreach(DeviceStat item in Model) + { + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Model) + + @Html.DisplayNameFor(model => model.Revision) + + @Html.DisplayNameFor(model => model.Bus) + + Has report? +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.Revision) + + @Html.DisplayFor(modelItem => item.Bus) + + @if(item.Report is null) + { + @("No") + + (Find) + } + else + { + Yes + } + + Edit + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Devices/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Devices/Delete.cshtml new file mode 100644 index 00000000..25e8c2ac --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Devices/Delete.cshtml @@ -0,0 +1,101 @@ +@model Aaru.Server.Database.Models.Device + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Device report

+
+
+
+ @Html.DisplayNameFor(model => model.AddedWhen) +
+
+ @Html.DisplayFor(model => model.AddedWhen) +
+
+ @Html.DisplayNameFor(model => model.ModifiedWhen) +
+
+ @Html.DisplayFor(model => model.ModifiedWhen) +
+
+ @Html.DisplayNameFor(model => model.OptimalMultipleSectorsRead) +
+
+ @Html.DisplayFor(model => model.OptimalMultipleSectorsRead) +
+
+ @Html.DisplayNameFor(model => model.CanReadGdRomUsingSwapDisc) +
+
+ @Html.DisplayFor(model => model.CanReadGdRomUsingSwapDisc) +
+
+ @Html.DisplayNameFor(model => model.CompactFlash) +
+
+ @Html.DisplayFor(model => model.CompactFlash) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+ @Html.DisplayNameFor(model => model.Revision) +
+
+ @Html.DisplayFor(model => model.Revision) +
+
+ @Html.DisplayNameFor(model => model.Type) +
+
+ @Html.DisplayFor(model => model.Type) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Devices/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Devices/Details.cshtml new file mode 100644 index 00000000..b9686052 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Devices/Details.cshtml @@ -0,0 +1,490 @@ +@using Aaru.CommonTypes.Metadata +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.DeviceDetails + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

Device report

+
+
+
+ @Html.DisplayNameFor(model => model.Report.AddedWhen) +
+
+ @Html.DisplayFor(model => model.Report.AddedWhen) +
+
+ @Html.DisplayNameFor(model => model.Report.ModifiedWhen) +
+
+ @Html.DisplayFor(model => model.Report.ModifiedWhen) +
+
+ @Html.DisplayNameFor(model => model.Report.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Report.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Report.Model) +
+
+ @Html.DisplayFor(model => model.Report.Model) +
+
+ @Html.DisplayNameFor(model => model.Report.Revision) +
+
+ @Html.DisplayFor(model => model.Report.Revision) +
+
+ @Html.DisplayNameFor(model => model.Report.CompactFlash) +
+
+ @Html.DisplayFor(model => model.Report.CompactFlash) +
+
+ @Html.DisplayNameFor(model => model.Report.OptimalMultipleSectorsRead) +
+
+ @Html.DisplayFor(model => model.Report.OptimalMultipleSectorsRead) +
+
+ @Html.DisplayNameFor(model => model.Report.CanReadGdRomUsingSwapDisc) +
+
+ @Html.DisplayFor(model => model.Report.CanReadGdRomUsingSwapDisc) +
+
+ @Html.DisplayNameFor(model => model.Report.Type) +
+
+ @Html.DisplayFor(model => model.Report.Type) +
+
+
+ +@if(Model.ReadCapabilitiesId != 0) +{ + +} +@if(Model.Report.ATA != null) +{ + +} +@if(Model.Report.ATAPI != null) +{ + +} +@if(Model.Report.SCSI != null) +{ + +} +@if(Model.Report.MultiMediaCard != null) +{ + +} +@if(Model.Report.SecureDigital != null) +{ + +} +@if(Model.Report.USB != null) +{ + +} +@if(Model.Report.GdRomSwapDiscCapabilitiesId != null) +{ + +} +@if(Model.Report.FireWire != null) +{ +
+ Has a FireWire report. +
+} +@if(Model.Report.PCMCIA != null) +{ +
+ Has a PCMCIA report. +
+} +@if(Model.SameAll.Count > 0) +{ +
+

Other device reports with same manufacturer, model and revision:

+ + + + + + + + + @foreach(int item in Model.SameAll) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.SameButManufacturer.Count > 0) +{ +
+

Other device reports with same model and revision:

+ + + + + + + + + @foreach(int item in Model.SameButManufacturer) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.ReportAll.Count > 0) +{ +
+

Uploaded reports with same manufacturer, model and revision:

+ + + + + + + + + @foreach(int item in Model.ReportAll) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.ReportButManufacturer.Count > 0) +{ +
+

Device reports with same model and revision:

+ + + + + + + + + @foreach(int item in Model.ReportButManufacturer) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.StatsAll.Count > 0) +{ +
+

Device statistics with same manufacturer, model and revision:

+ + + + + + + + + + + + + @foreach(DeviceStat item in Model.StatsAll) + { + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.StatsAll[0].Manufacturer) + + @Html.DisplayNameFor(model => model.StatsAll[0].Model) + + @Html.DisplayNameFor(model => model.StatsAll[0].Revision) + + @Html.DisplayNameFor(model => model.StatsAll[0].Bus) + + Has a linked report? +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.Revision) + + @Html.DisplayFor(modelItem => item.Bus) + + @if(item.Report is null) + { + @("No") + } + else + { + @if(item.Report.Id == Model.Report.Id) + { + @("Us") + } + else + { + @("Yes") + } + } + + Link +
+
+} +@if(Model.StatsButManufacturer.Count > 0) +{ +
+

Device statistics with same model and revision:

+ + + + + + + + + + + + + @foreach(DeviceStat item in Model.StatsButManufacturer) + { + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.StatsButManufacturer[0].Manufacturer) + + @Html.DisplayNameFor(model => model.StatsButManufacturer[0].Model) + + @Html.DisplayNameFor(model => model.StatsButManufacturer[0].Revision) + + @Html.DisplayNameFor(model => model.StatsButManufacturer[0].Bus) + + Has a linked report? +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.Revision) + + @Html.DisplayFor(modelItem => item.Bus) + + @if(item.Report is null) + { + @("No") + } + else + { + Yes + } + + Link +
+
+} +@if(Model.TestedMedias.Count > 0) +{ +
+

Tested media:

+ + + + + + + + + + + @foreach(TestedMedia item in Model.TestedMedias) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.TestedMedias[0].Manufacturer) + + @Html.DisplayNameFor(model => model.TestedMedias[0].Model) + + @Html.DisplayNameFor(model => model.TestedMedias[0].MediumTypeName) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.MediumTypeName) + + Details +
+
+} +@if(Model.TestedSequentialMedias.Count > 0) +{ +
+

Tested media:

+ + + + + + + + + + + @foreach(TestedSequentialMedia item in Model.TestedSequentialMedias) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.TestedSequentialMedias[0].Manufacturer) + + @Html.DisplayNameFor(model => model.TestedSequentialMedias[0].Model) + + @Html.DisplayNameFor(model => model.TestedSequentialMedias[0].MediumTypeName) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.MediumTypeName) + + Delete +
+
+} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Devices/Edit.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Devices/Edit.cshtml new file mode 100644 index 00000000..898c3015 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Devices/Edit.cshtml @@ -0,0 +1,85 @@ +@using Aaru.CommonTypes.Enums +@model Aaru.Server.Database.Models.Device + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Edit.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Device report

+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + Back to List +
+
+
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Devices/Find.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Devices/Find.cshtml new file mode 100644 index 00000000..b2c29825 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Devices/Find.cshtml @@ -0,0 +1,120 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.FindReportModel + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Find.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

Found device reports with similar data

+
+
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+ @Html.DisplayNameFor(model => model.Revision) +
+
+ @Html.DisplayFor(model => model.Revision) +
+
+ @Html.DisplayNameFor(model => model.Bus) +
+
+ @Html.DisplayFor(model => model.Bus) +
+
+
+@if(Model.LikeDevices.Count == 0) +{ +
No device report with similar information has been found!
+} +else +{ + + + + + + + + + + + + + @foreach(Device item in Model.LikeDevices) + { + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.LikeDevices[0].Manufacturer) + + @Html.DisplayNameFor(model => model.LikeDevices[0].Model) + + @Html.DisplayNameFor(model => model.LikeDevices[0].Revision) + + @Html.DisplayNameFor(model => model.LikeDevices[0].CompactFlash) + + @Html.DisplayNameFor(model => model.LikeDevices[0].Type) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.Revision) + + @Html.DisplayFor(modelItem => item.CompactFlash) + + @Html.DisplayFor(modelItem => item.Type) + + Link +
+} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Devices/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Devices/Index.cshtml new file mode 100644 index 00000000..e7f94bfc --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Devices/Index.cshtml @@ -0,0 +1,98 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Device reports

+ + + + + + + + + + + + + + + @foreach(Device item in Model) + { + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Model) + + @Html.DisplayNameFor(model => model.Revision) + + @Html.DisplayNameFor(model => model.CompactFlash) + + @Html.DisplayNameFor(model => model.OptimalMultipleSectorsRead) + + @Html.DisplayNameFor(model => model.CanReadGdRomUsingSwapDisc) + + @Html.DisplayNameFor(model => model.Type) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.Revision) + + @Html.DisplayFor(modelItem => item.CompactFlash) + + @Html.DisplayFor(modelItem => item.OptimalMultipleSectorsRead) + + @Html.DisplayFor(modelItem => item.CanReadGdRomUsingSwapDisc) + + @Html.DisplayFor(modelItem => item.Type) + + Details + Edit + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Filesystems/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Filesystems/Index.cshtml new file mode 100644 index 00000000..f9d53e90 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Filesystems/Index.cshtml @@ -0,0 +1,62 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Filesystems

+ + + + + + + + + @foreach(Filesystem item in Model) + { + + + + + } + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Count) +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Filters/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Filters/Index.cshtml new file mode 100644 index 00000000..24a81dce --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Filters/Index.cshtml @@ -0,0 +1,62 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Filters

+ + + + + + + + + @foreach(Filter item in Model) + { + + + + + } + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Count) +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/FireWires/Consolidate.cshtml b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Consolidate.cshtml new file mode 100644 index 00000000..b91fcd82 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Consolidate.cshtml @@ -0,0 +1,62 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.FireWireModelForView + +@{ + ViewBag.Title = "Consolidate duplicate FireWire"; + Layout = "_Layout"; +} +

Consolidate duplicate FireWire

+
+ The following FireWire have duplicates. + + + + + + + + + + + + @foreach(FireWireModel item in Model.List) + { + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.List[0].Manufacturer) + + @Html.DisplayNameFor(model => model.List[0].Product) + + @Html.DisplayNameFor(model => model.List[0].VendorID) + + @Html.DisplayNameFor(model => model.List[0].ProductID) + + @Html.DisplayNameFor(model => model.List[0].RemovableMedia) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Product) + + @Html.DisplayFor(modelItem => item.VendorID) + + @Html.DisplayFor(modelItem => item.ProductID) + + @Html.DisplayFor(modelItem => item.RemovableMedia) +
+
+
+ Do you want to remove the duplicates? +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/FireWires/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Delete.cshtml new file mode 100644 index 00000000..2b9f1d0e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Delete.cshtml @@ -0,0 +1,77 @@ +@model Aaru.CommonTypes.Metadata.FireWire + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

FireWire registers

+
+
+
+ @Html.DisplayNameFor(model => model.VendorID) +
+
+ @Html.DisplayFor(model => model.VendorID) +
+
+ @Html.DisplayNameFor(model => model.ProductID) +
+
+ @Html.DisplayFor(model => model.ProductID) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Product) +
+
+ @Html.DisplayFor(model => model.Product) +
+
+ @Html.DisplayNameFor(model => model.RemovableMedia) +
+
+ @Html.DisplayFor(model => model.RemovableMedia) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/FireWires/Edit.cshtml b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Edit.cshtml new file mode 100644 index 00000000..fec6fe0a --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Edit.cshtml @@ -0,0 +1,74 @@ +@model Aaru.CommonTypes.Metadata.FireWire + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Edit.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

FireWire registers

+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+ + Back to List +
+
+
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/FireWires/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Index.cshtml new file mode 100644 index 00000000..c7feb046 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/FireWires/Index.cshtml @@ -0,0 +1,86 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +Consolidate +

FireWire registers

+ + + + + + + + + + + + + @foreach(FireWire item in Model) + { + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Product) + + @Html.DisplayNameFor(model => model.VendorID) + + @Html.DisplayNameFor(model => model.ProductID) + + @Html.DisplayNameFor(model => model.RemovableMedia) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Product) + + @Html.DisplayFor(modelItem => item.VendorID) + + @Html.DisplayFor(modelItem => item.ProductID) + + @Html.DisplayFor(modelItem => item.RemovableMedia) + + Edit + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Delete.cshtml new file mode 100644 index 00000000..18f9a90f --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Delete.cshtml @@ -0,0 +1,1151 @@ +@using Aaru.Decoders.SCSI +@model Aaru.CommonTypes.Metadata.GdRomSwapDiscCapabilities + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

GD-ROM swap-trick capabilities report

+
+@if(Model.TestCrashed) +{ +

Computer crashed while testing.

+} +else if(Model.RecognizedSwapDisc) +{ +

Swap disc Lead-Out starts at @($"{Model.SwapDiscLeadOutPMIN:X2}"):@($"{Model.SwapDiscLeadOutPSEC:X2}"):@($"{Model.SwapDiscLeadOutPFRAM:X2}") (@($"{Model.SwapDiscLeadOutStart}") sectors).

+
+
+
Minimum readable sector in HD area:
+
@Model.MinimumReadableSectorInHdArea
+
Maximum readable sector in HD area:
+
@Model.MaximumReadableSectorInHdArea
+ @if(Model.MaximumReadablePqInHdArea != null) + { +
Contents of last readable sector in HD area (with PQ):
+
+ @Model.MaximumReadablePqInHdArea.Length bytes +
+ } + @if(Model.MaximumReadableRwInHdArea != null) + { +
Contents of last readable sector in HD area (with RW):
+
+ @Model.MaximumReadableRwInHdArea.Length bytes +
+ } +
+ + + + + + + + + + + + @if(Model.Lba0Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba0ScrambledReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000AudioRwReadable) + { + + } + else + { + + } + + + +
LBARead modeStatusDataSense
0Data + ✔️ + + ❌️ + + @if(Model.Lba0Data != null) + { + @Model.Lba0Data.Length bytes + } + + @if(Model.Lba0DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba0Sense)).Replace(" ", "
")) + } +
0Audio (scrambled) + ✔️ + + ❌️ + + @if(Model.Lba0ScrambledData != null) + { + @Model.Lba0ScrambledData.Length bytes + } + + @if(Model.Lba0ScrambledDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba0ScrambledSense)).Replace(" ", "
")) + } +
44990Data + ✔️ + + ❌️ + + @if(Model.Lba44990Data != null) + { + @Model.Lba44990Data.Length bytes + } + + @if(Model.Lba44990DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990Sense)).Replace(" ", "
")) + } +
44990Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba44990PqData != null) + { + @Model.Lba44990PqData.Length bytes + } + + @if(Model.Lba44990PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990PqSense)).Replace(" ", "
")) + } +
44990Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba44990RwData != null) + { + @Model.Lba44990RwData.Length bytes + } + + @if(Model.Lba44990RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990RwSense)).Replace(" ", "
")) + } +
44990Audio + ✔️ + + ❌️ + + @if(Model.Lba44990AudioData != null) + { + @Model.Lba44990AudioData.Length bytes + } + + @if(Model.Lba44990AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990AudioSense)).Replace(" ", "
")) + } +
44990Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba44990AudioRwData != null) + { + @Model.Lba44990AudioRwData.Length bytes + } + + @if(Model.Lba44990AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990AudioPqSense)).Replace(" ", "
")) + } +
44990Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba44990AudioRwData != null) + { + @Model.Lba44990AudioRwData.Length bytes + } + + @if(Model.Lba44990AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990AudioRwSense)).Replace(" ", "
")) + } +
45000Data + ✔️ + + ❌️ + + @if(Model.Lba45000Data != null) + { + @Model.Lba45000Data.Length bytes + } + + @if(Model.Lba45000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000Sense)).Replace(" ", "
")) + } +
45000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba45000PqData != null) + { + @Model.Lba45000PqData.Length bytes + } + + @if(Model.Lba45000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000PqSense)).Replace(" ", "
")) + } +
45000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba45000RwData != null) + { + @Model.Lba45000RwData.Length bytes + } + + @if(Model.Lba45000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000RwSense)).Replace(" ", "
")) + } +
45000Audio + ✔️ + + ❌️ + + @if(Model.Lba45000AudioData != null) + { + @Model.Lba45000AudioData.Length bytes + } + + @if(Model.Lba45000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000AudioSense)).Replace(" ", "
")) + } +
45000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba45000AudioRwData != null) + { + @Model.Lba45000AudioRwData.Length bytes + } + + @if(Model.Lba45000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000AudioPqSense)).Replace(" ", "
")) + } +
45000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba45000AudioRwData != null) + { + @Model.Lba45000AudioRwData.Length bytes + } + + @if(Model.Lba45000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000AudioRwSense)).Replace(" ", "
")) + } +
50000Data + ✔️ + + ❌️ + + @if(Model.Lba50000Data != null) + { + @Model.Lba50000Data.Length bytes + } + + @if(Model.Lba50000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000Sense)).Replace(" ", "
")) + } +
50000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba50000PqData != null) + { + @Model.Lba50000PqData.Length bytes + } + + @if(Model.Lba50000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000PqSense)).Replace(" ", "
")) + } +
50000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba50000RwData != null) + { + @Model.Lba50000RwData.Length bytes + } + + @if(Model.Lba50000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000RwSense)).Replace(" ", "
")) + } +
50000Audio + ✔️ + + ❌️ + + @if(Model.Lba50000AudioData != null) + { + @Model.Lba50000AudioData.Length bytes + } + + @if(Model.Lba50000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000AudioSense)).Replace(" ", "
")) + } +
50000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba50000AudioRwData != null) + { + @Model.Lba50000AudioRwData.Length bytes + } + + @if(Model.Lba50000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000AudioPqSense)).Replace(" ", "
")) + } +
50000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba50000AudioRwData != null) + { + @Model.Lba50000AudioRwData.Length bytes + } + + @if(Model.Lba50000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000AudioRwSense)).Replace(" ", "
")) + } +
100000Data + ✔️ + + ❌️ + + @if(Model.Lba100000Data != null) + { + @Model.Lba100000Data.Length bytes + } + + @if(Model.Lba100000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000Sense)).Replace(" ", "
")) + } +
100000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba100000PqData != null) + { + @Model.Lba100000PqData.Length bytes + } + + @if(Model.Lba100000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000PqSense)).Replace(" ", "
")) + } +
100000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba100000RwData != null) + { + @Model.Lba100000RwData.Length bytes + } + + @if(Model.Lba100000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000RwSense)).Replace(" ", "
")) + } +
100000Audio + ✔️ + + ❌️ + + @if(Model.Lba100000AudioData != null) + { + @Model.Lba100000AudioData.Length bytes + } + + @if(Model.Lba100000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000AudioSense)).Replace(" ", "
")) + } +
100000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba100000AudioRwData != null) + { + @Model.Lba100000AudioRwData.Length bytes + } + + @if(Model.Lba100000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000AudioPqSense)).Replace(" ", "
")) + } +
100000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba100000AudioRwData != null) + { + @Model.Lba100000AudioRwData.Length bytes + } + + @if(Model.Lba100000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000AudioRwSense)).Replace(" ", "
")) + } +
400000Data + ✔️ + + ❌️ + + @if(Model.Lba400000Data != null) + { + @Model.Lba400000Data.Length bytes + } + + @if(Model.Lba400000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000Sense)).Replace(" ", "
")) + } +
400000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba400000PqData != null) + { + @Model.Lba400000PqData.Length bytes + } + + @if(Model.Lba400000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000PqSense)).Replace(" ", "
")) + } +
400000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba400000RwData != null) + { + @Model.Lba400000RwData.Length bytes + } + + @if(Model.Lba400000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000RwSense)).Replace(" ", "
")) + } +
400000Audio + ✔️ + + ❌️ + + @if(Model.Lba400000AudioData != null) + { + @Model.Lba400000AudioData.Length bytes + } + + @if(Model.Lba400000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000AudioSense)).Replace(" ", "
")) + } +
400000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba400000AudioRwData != null) + { + @Model.Lba400000AudioRwData.Length bytes + } + + @if(Model.Lba400000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000AudioPqSense)).Replace(" ", "
")) + } +
400000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba400000AudioRwData != null) + { + @Model.Lba400000AudioRwData.Length bytes + } + + @if(Model.Lba400000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000AudioRwSense)).Replace(" ", "
")) + } +
450000Data + ✔️ + + ❌️ + + @if(Model.Lba450000Data != null) + { + @Model.Lba450000Data.Length bytes + } + + @if(Model.Lba450000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000Sense)).Replace(" ", "
")) + } +
450000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba450000PqData != null) + { + @Model.Lba450000PqData.Length bytes + } + + @if(Model.Lba450000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000PqSense)).Replace(" ", "
")) + } +
450000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba450000RwData != null) + { + @Model.Lba450000RwData.Length bytes + } + + @if(Model.Lba450000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000RwSense)).Replace(" ", "
")) + } +
450000Audio + ✔️ + + ❌️ + + @if(Model.Lba450000AudioData != null) + { + @Model.Lba450000AudioData.Length bytes + } + + @if(Model.Lba450000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000AudioSense)).Replace(" ", "
")) + } +
450000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba450000AudioRwData != null) + { + @Model.Lba450000AudioRwData.Length bytes + } + + @if(Model.Lba450000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000AudioPqSense)).Replace(" ", "
")) + } +
450000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba450000AudioRwData != null) + { + @Model.Lba450000AudioRwData.Length bytes + } + + @if(Model.Lba450000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000AudioRwSense)).Replace(" ", "
")) + } +
+} +else +{ +

Swap disc not recognized, or firmware reset after tray opened.

+} +
+ + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Details.cshtml new file mode 100644 index 00000000..3f8197f5 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/Details.cshtml @@ -0,0 +1,1146 @@ +@using Aaru.Decoders.SCSI +@model Aaru.CommonTypes.Metadata.GdRomSwapDiscCapabilities + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

GD-ROM swap-trick capabilities report

+
+@if(Model.TestCrashed) +{ +

Computer crashed while testing.

+} +else if(Model.RecognizedSwapDisc) +{ +

Swap disc Lead-Out starts at @($"{Model.SwapDiscLeadOutPMIN:X2}"):@($"{Model.SwapDiscLeadOutPSEC:X2}"):@($"{Model.SwapDiscLeadOutPFRAM:X2}") (@($"{Model.SwapDiscLeadOutStart}") sectors).

+
+
+
Minimum readable sector in HD area:
+
@Model.MinimumReadableSectorInHdArea
+
Maximum readable sector in HD area:
+
@Model.MaximumReadableSectorInHdArea
+ @if(Model.MaximumReadablePqInHdArea != null) + { +
Contents of last readable sector in HD area (with PQ):
+
+ @Model.MaximumReadablePqInHdArea.Length bytes +
+ } + @if(Model.MaximumReadableRwInHdArea != null) + { +
Contents of last readable sector in HD area (with RW):
+
+ @Model.MaximumReadableRwInHdArea.Length bytes +
+ } +
+ + + + + + + + + + + + @if(Model.Lba0Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba0ScrambledReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba44990AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba45000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba50000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba100000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba400000AudioRwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000Readable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000PqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000RwReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000AudioReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000AudioPqReadable) + { + + } + else + { + + } + + + + + + + @if(Model.Lba450000AudioRwReadable) + { + + } + else + { + + } + + + +
LBARead modeStatusDataSense
0Data + ✔️ + + ❌️ + + @if(Model.Lba0Data != null) + { + @Model.Lba0Data.Length bytes + } + + @if(Model.Lba0DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba0Sense)).Replace(" ", "
")) + } +
0Audio (scrambled) + ✔️ + + ❌️ + + @if(Model.Lba0ScrambledData != null) + { + @Model.Lba0ScrambledData.Length bytes + } + + @if(Model.Lba0ScrambledDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba0ScrambledSense)).Replace(" ", "
")) + } +
44990Data + ✔️ + + ❌️ + + @if(Model.Lba44990Data != null) + { + @Model.Lba44990Data.Length bytes + } + + @if(Model.Lba44990DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990Sense)).Replace(" ", "
")) + } +
44990Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba44990PqData != null) + { + @Model.Lba44990PqData.Length bytes + } + + @if(Model.Lba44990PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990PqSense)).Replace(" ", "
")) + } +
44990Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba44990RwData != null) + { + @Model.Lba44990RwData.Length bytes + } + + @if(Model.Lba44990RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990RwSense)).Replace(" ", "
")) + } +
44990Audio + ✔️ + + ❌️ + + @if(Model.Lba44990AudioData != null) + { + @Model.Lba44990AudioData.Length bytes + } + + @if(Model.Lba44990AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990AudioSense)).Replace(" ", "
")) + } +
44990Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba44990AudioRwData != null) + { + @Model.Lba44990AudioRwData.Length bytes + } + + @if(Model.Lba44990AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990AudioPqSense)).Replace(" ", "
")) + } +
44990Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba44990AudioRwData != null) + { + @Model.Lba44990AudioRwData.Length bytes + } + + @if(Model.Lba44990AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba44990AudioRwSense)).Replace(" ", "
")) + } +
45000Data + ✔️ + + ❌️ + + @if(Model.Lba45000Data != null) + { + @Model.Lba45000Data.Length bytes + } + + @if(Model.Lba45000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000Sense)).Replace(" ", "
")) + } +
45000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba45000PqData != null) + { + @Model.Lba45000PqData.Length bytes + } + + @if(Model.Lba45000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000PqSense)).Replace(" ", "
")) + } +
45000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba45000RwData != null) + { + @Model.Lba45000RwData.Length bytes + } + + @if(Model.Lba45000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000RwSense)).Replace(" ", "
")) + } +
45000Audio + ✔️ + + ❌️ + + @if(Model.Lba45000AudioData != null) + { + @Model.Lba45000AudioData.Length bytes + } + + @if(Model.Lba45000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000AudioSense)).Replace(" ", "
")) + } +
45000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba45000AudioRwData != null) + { + @Model.Lba45000AudioRwData.Length bytes + } + + @if(Model.Lba45000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000AudioPqSense)).Replace(" ", "
")) + } +
45000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba45000AudioRwData != null) + { + @Model.Lba45000AudioRwData.Length bytes + } + + @if(Model.Lba45000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba45000AudioRwSense)).Replace(" ", "
")) + } +
50000Data + ✔️ + + ❌️ + + @if(Model.Lba50000Data != null) + { + @Model.Lba50000Data.Length bytes + } + + @if(Model.Lba50000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000Sense)).Replace(" ", "
")) + } +
50000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba50000PqData != null) + { + @Model.Lba50000PqData.Length bytes + } + + @if(Model.Lba50000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000PqSense)).Replace(" ", "
")) + } +
50000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba50000RwData != null) + { + @Model.Lba50000RwData.Length bytes + } + + @if(Model.Lba50000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000RwSense)).Replace(" ", "
")) + } +
50000Audio + ✔️ + + ❌️ + + @if(Model.Lba50000AudioData != null) + { + @Model.Lba50000AudioData.Length bytes + } + + @if(Model.Lba50000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000AudioSense)).Replace(" ", "
")) + } +
50000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba50000AudioRwData != null) + { + @Model.Lba50000AudioRwData.Length bytes + } + + @if(Model.Lba50000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000AudioPqSense)).Replace(" ", "
")) + } +
50000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba50000AudioRwData != null) + { + @Model.Lba50000AudioRwData.Length bytes + } + + @if(Model.Lba50000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba50000AudioRwSense)).Replace(" ", "
")) + } +
100000Data + ✔️ + + ❌️ + + @if(Model.Lba100000Data != null) + { + @Model.Lba100000Data.Length bytes + } + + @if(Model.Lba100000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000Sense)).Replace(" ", "
")) + } +
100000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba100000PqData != null) + { + @Model.Lba100000PqData.Length bytes + } + + @if(Model.Lba100000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000PqSense)).Replace(" ", "
")) + } +
100000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba100000RwData != null) + { + @Model.Lba100000RwData.Length bytes + } + + @if(Model.Lba100000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000RwSense)).Replace(" ", "
")) + } +
100000Audio + ✔️ + + ❌️ + + @if(Model.Lba100000AudioData != null) + { + @Model.Lba100000AudioData.Length bytes + } + + @if(Model.Lba100000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000AudioSense)).Replace(" ", "
")) + } +
100000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba100000AudioRwData != null) + { + @Model.Lba100000AudioRwData.Length bytes + } + + @if(Model.Lba100000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000AudioPqSense)).Replace(" ", "
")) + } +
100000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba100000AudioRwData != null) + { + @Model.Lba100000AudioRwData.Length bytes + } + + @if(Model.Lba100000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba100000AudioRwSense)).Replace(" ", "
")) + } +
400000Data + ✔️ + + ❌️ + + @if(Model.Lba400000Data != null) + { + @Model.Lba400000Data.Length bytes + } + + @if(Model.Lba400000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000Sense)).Replace(" ", "
")) + } +
400000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba400000PqData != null) + { + @Model.Lba400000PqData.Length bytes + } + + @if(Model.Lba400000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000PqSense)).Replace(" ", "
")) + } +
400000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba400000RwData != null) + { + @Model.Lba400000RwData.Length bytes + } + + @if(Model.Lba400000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000RwSense)).Replace(" ", "
")) + } +
400000Audio + ✔️ + + ❌️ + + @if(Model.Lba400000AudioData != null) + { + @Model.Lba400000AudioData.Length bytes + } + + @if(Model.Lba400000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000AudioSense)).Replace(" ", "
")) + } +
400000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba400000AudioRwData != null) + { + @Model.Lba400000AudioRwData.Length bytes + } + + @if(Model.Lba400000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000AudioPqSense)).Replace(" ", "
")) + } +
400000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba400000AudioRwData != null) + { + @Model.Lba400000AudioRwData.Length bytes + } + + @if(Model.Lba400000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba400000AudioRwSense)).Replace(" ", "
")) + } +
450000Data + ✔️ + + ❌️ + + @if(Model.Lba450000Data != null) + { + @Model.Lba450000Data.Length bytes + } + + @if(Model.Lba450000DecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000Sense)).Replace(" ", "
")) + } +
450000Data (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba450000PqData != null) + { + @Model.Lba450000PqData.Length bytes + } + + @if(Model.Lba450000PqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000PqSense)).Replace(" ", "
")) + } +
450000Data (with RW) + ✔️ + + ❌️ + + @if(Model.Lba450000RwData != null) + { + @Model.Lba450000RwData.Length bytes + } + + @if(Model.Lba450000RwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000RwSense)).Replace(" ", "
")) + } +
450000Audio + ✔️ + + ❌️ + + @if(Model.Lba450000AudioData != null) + { + @Model.Lba450000AudioData.Length bytes + } + + @if(Model.Lba450000AudioDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000AudioSense)).Replace(" ", "
")) + } +
450000Audio (with PQ) + ✔️ + + ❌️ + + @if(Model.Lba450000AudioRwData != null) + { + @Model.Lba450000AudioRwData.Length bytes + } + + @if(Model.Lba450000AudioPqDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000AudioPqSense)).Replace(" ", "
")) + } +
450000Audio (with RW) + ✔️ + + ❌️ + + @if(Model.Lba450000AudioRwData != null) + { + @Model.Lba450000AudioRwData.Length bytes + } + + @if(Model.Lba450000AudioRwDecodedSense != null) + { + @Html.Raw(Html.Encode(Sense.PrettifySense(Model.Lba450000AudioRwSense)).Replace(" ", "
")) + } +
+} +else +{ +

Swap disc not recognized, or firmware reset after tray opened.

+} +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/ViewData.cshtml b/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/ViewData.cshtml new file mode 100644 index 00000000..151808cf --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/GdRomSwapDiscCapabilities/ViewData.cshtml @@ -0,0 +1,27 @@ +@model Aaru.Server.Database.Models.TestedMediaDataModel + +@{ + ViewBag.Title = $"{Model.DataName} data"; + Layout = "_Layout"; +} +

Showing data from @Model.DataName for GD-ROM capabilities id @Model.TestedMediaId

+@if(Model.Decoded is null && Model.RawDataAsHex is null) +{ +
No data found
+} + +@if(Model.RawDataAsHex != null) +{ +

Hex dump:

+
+ @Html.Raw(Model.RawDataAsHex) +
+} + +@if(Model.Decoded != null) +{ +

Decoded information:

+
+ @Html.Raw(Model.Decoded) +
+} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Home/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Home/Index.cshtml new file mode 100644 index 00000000..f4969778 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Home/Index.cshtml @@ -0,0 +1,97 @@ +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +ATA IDENTIFY DEVICE / ATAPI IDENTIFY PACKET DEVICE responses +
+SCSI Streaming Devices Block Descriptors +
+Cylinders / Heads / Sectors triplets +
+Commands used +
+Compact Disc Offsets +
+Device reports +
+Device statistics +
+Filesystems detected +
+Filters detected +
+FireWire devices reported +
+Media image formats detected +
+Media types detected +
+Media types detected in real devices +
+Media types detected in images +
+MODE SENSE page 2Ah responses +
+MMC GET FEATURES responses +
+MultiMediaCard / SecureDigital registers +
+Operating systems detected +
+Partitioning schemes detected +
+PCMCIA card registers +
+Uploaded reports +
+SCSI MODE SENSE responses +
+SCSI MODE SENSE pages +
+SCSI INQUIRY responses +
+SCSI STREAMING COMMANDS limits +
+SCSI supported densities +
+Tested media +
+Tested media on SCSI streaming devices +
+USB devices +
+USB products +
+USB vendors +
+Aaru versions used +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Delete.cshtml new file mode 100644 index 00000000..f35601a7 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Delete.cshtml @@ -0,0 +1,59 @@ +@model Aaru.Server.Database.Models.MediaFormat + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Media image format

+
+
+
+ @Html.DisplayNameFor(model => model.Name) +
+
+ @Html.DisplayFor(model => model.Name) +
+
+ @Html.DisplayNameFor(model => model.Count) +
+
+ @Html.DisplayFor(model => model.Count) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Index.cshtml new file mode 100644 index 00000000..1969a0d5 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/MediaFormats/Index.cshtml @@ -0,0 +1,66 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Media image formats

+ + + + + + + + + + @foreach(MediaFormat item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Count) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Medias/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Medias/Delete.cshtml new file mode 100644 index 00000000..eb29d15d --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Medias/Delete.cshtml @@ -0,0 +1,65 @@ +@model Aaru.Server.Database.Models.Media + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Media

+
+
+
+ @Html.DisplayNameFor(model => model.Type) +
+
+ @Html.DisplayFor(model => model.Type) +
+
+ @Html.DisplayNameFor(model => model.Real) +
+
+ @Html.DisplayFor(model => model.Real) +
+
+ @Html.DisplayNameFor(model => model.Count) +
+
+ @Html.DisplayFor(model => model.Count) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Medias/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Medias/Index.cshtml new file mode 100644 index 00000000..d795dfa3 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Medias/Index.cshtml @@ -0,0 +1,78 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Medias

+ + + + + + + + + + + + @foreach(Media item in Model) + { + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.PhysicalType) + + @Html.DisplayNameFor(model => model.LogicalType) + + @Html.DisplayNameFor(model => model.Real) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.PhysicalType) + + @Html.DisplayFor(modelItem => item.LogicalType) + + @Html.DisplayFor(modelItem => item.Real) + + @Html.DisplayFor(modelItem => item.Count) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Mmc/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Mmc/Delete.cshtml new file mode 100644 index 00000000..76c19a3e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Mmc/Delete.cshtml @@ -0,0 +1,48 @@ +@using Aaru.Decoders.SCSI +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.Mmc + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

SCSI CD-ROM capabilities page - ID = @Model.Id

+
+ @Html.Raw(Html.EncodedMultiLineText(Modes.PrettifyModePage_2A(Model.ModeSense2AData))) +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Mmc/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Mmc/Details.cshtml new file mode 100644 index 00000000..c8cd5ada --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Mmc/Details.cshtml @@ -0,0 +1,45 @@ +@using Aaru.Decoders.SCSI +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.Mmc + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

SCSI CD-ROM capabilities page - ID = @Model.Id

+
+ @Html.Raw(Html.EncodedMultiLineText(Modes.PrettifyModePage_2A(Model.ModeSense2AData))) +
+ \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Mmc/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Mmc/Index.cshtml new file mode 100644 index 00000000..1c97c1ae --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Mmc/Index.cshtml @@ -0,0 +1,81 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +Clean +

SCSI CD-ROM capabilities pages

+ + + + + + + + + + + @foreach(MmcModelForView item in Model) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Id) + + @Html.DisplayNameFor(model => model.FeaturesId) + + @Html.DisplayNameFor(model => model.DataLength) +
+ @Html.DisplayFor(modelItem => item.Id) + + @if(item.FeaturesId != null) + { + @Html.DisplayFor(modelItem => item.FeaturesId) + } + else + { + @Html.DisplayFor(modelItem => item.FeaturesId) + } + + @Html.DisplayFor(modelItem => item.DataLength) + + Details + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Details.cshtml new file mode 100644 index 00000000..c32dc092 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Details.cshtml @@ -0,0 +1,782 @@ +@model Aaru.CommonTypes.Metadata.MmcFeatures + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

MMC FEATURES

+
+
+
+ @Html.DisplayNameFor(model => model.AACSVersion) +
+
+ @Html.DisplayFor(model => model.AACSVersion) +
+
+ @Html.DisplayNameFor(model => model.AGIDs) +
+
+ @Html.DisplayFor(model => model.AGIDs) +
+
+ @Html.DisplayNameFor(model => model.BindingNonceBlocks) +
+
+ @Html.DisplayFor(model => model.BindingNonceBlocks) +
+
+ @Html.DisplayNameFor(model => model.BlocksPerReadableUnit) +
+
+ @Html.DisplayFor(model => model.BlocksPerReadableUnit) +
+
+ @Html.DisplayNameFor(model => model.BufferUnderrunFreeInDVD) +
+
+ @Html.DisplayFor(model => model.BufferUnderrunFreeInDVD) +
+
+ @Html.DisplayNameFor(model => model.BufferUnderrunFreeInSAO) +
+
+ @Html.DisplayFor(model => model.BufferUnderrunFreeInSAO) +
+
+ @Html.DisplayNameFor(model => model.BufferUnderrunFreeInTAO) +
+
+ @Html.DisplayFor(model => model.BufferUnderrunFreeInTAO) +
+
+ @Html.DisplayNameFor(model => model.CanAudioScan) +
+
+ @Html.DisplayFor(model => model.CanAudioScan) +
+
+ @Html.DisplayNameFor(model => model.CanEject) +
+
+ @Html.DisplayFor(model => model.CanEject) +
+
+ @Html.DisplayNameFor(model => model.CanEraseSector) +
+
+ @Html.DisplayFor(model => model.CanEraseSector) +
+
+ @Html.DisplayNameFor(model => model.CanExpandBDRESpareArea) +
+
+ @Html.DisplayFor(model => model.CanExpandBDRESpareArea) +
+
+ @Html.DisplayNameFor(model => model.CanFormat) +
+
+ @Html.DisplayFor(model => model.CanFormat) +
+
+ @Html.DisplayNameFor(model => model.CanFormatBDREWithoutSpare) +
+
+ @Html.DisplayFor(model => model.CanFormatBDREWithoutSpare) +
+
+ @Html.DisplayNameFor(model => model.CanFormatCert) +
+
+ @Html.DisplayFor(model => model.CanFormatCert) +
+
+ @Html.DisplayNameFor(model => model.CanFormatFRF) +
+
+ @Html.DisplayFor(model => model.CanFormatFRF) +
+
+ @Html.DisplayNameFor(model => model.CanFormatQCert) +
+
+ @Html.DisplayFor(model => model.CanFormatQCert) +
+
+ @Html.DisplayNameFor(model => model.CanFormatRRM) +
+
+ @Html.DisplayFor(model => model.CanFormatRRM) +
+
+ @Html.DisplayNameFor(model => model.CanGenerateBindingNonce) +
+
+ @Html.DisplayFor(model => model.CanGenerateBindingNonce) +
+
+ @Html.DisplayNameFor(model => model.CanLoad) +
+
+ @Html.DisplayFor(model => model.CanLoad) +
+
+ @Html.DisplayNameFor(model => model.CanMuteSeparateChannels) +
+
+ @Html.DisplayFor(model => model.CanMuteSeparateChannels) +
+
+ @Html.DisplayNameFor(model => model.CanOverwriteSAOTrack) +
+
+ @Html.DisplayFor(model => model.CanOverwriteSAOTrack) +
+
+ @Html.DisplayNameFor(model => model.CanOverwriteTAOTrack) +
+
+ @Html.DisplayFor(model => model.CanOverwriteTAOTrack) +
+
+ @Html.DisplayNameFor(model => model.CanPlayCDAudio) +
+
+ @Html.DisplayFor(model => model.CanPlayCDAudio) +
+
+ @Html.DisplayNameFor(model => model.CanPseudoOverwriteBDR) +
+
+ @Html.DisplayFor(model => model.CanPseudoOverwriteBDR) +
+
+ @Html.DisplayNameFor(model => model.CanReadAllDualR) +
+
+ @Html.DisplayFor(model => model.CanReadAllDualR) +
+
+ @Html.DisplayNameFor(model => model.CanReadAllDualRW) +
+
+ @Html.DisplayFor(model => model.CanReadAllDualRW) +
+
+ @Html.DisplayNameFor(model => model.CanReadBD) +
+
+ @Html.DisplayFor(model => model.CanReadBD) +
+
+ @Html.DisplayNameFor(model => model.CanReadBDR) +
+
+ @Html.DisplayFor(model => model.CanReadBDR) +
+
+ @Html.DisplayNameFor(model => model.CanReadBDRE1) +
+
+ @Html.DisplayFor(model => model.CanReadBDRE1) +
+
+ @Html.DisplayNameFor(model => model.CanReadBDRE2) +
+
+ @Html.DisplayFor(model => model.CanReadBDRE2) +
+
+ @Html.DisplayNameFor(model => model.CanReadBDROM) +
+
+ @Html.DisplayFor(model => model.CanReadBDROM) +
+
+ @Html.DisplayNameFor(model => model.CanReadBluBCA) +
+
+ @Html.DisplayFor(model => model.CanReadBluBCA) +
+
+ @Html.DisplayNameFor(model => model.CanReadCD) +
+
+ @Html.DisplayFor(model => model.CanReadCD) +
+
+ @Html.DisplayNameFor(model => model.CanReadCDMRW) +
+
+ @Html.DisplayFor(model => model.CanReadCDMRW) +
+
+ @Html.DisplayNameFor(model => model.CanReadCPRM_MKB) +
+
+ @Html.DisplayFor(model => model.CanReadCPRM_MKB) +
+
+ @Html.DisplayNameFor(model => model.CanReadDDCD) +
+
+ @Html.DisplayFor(model => model.CanReadDDCD) +
+
+ @Html.DisplayNameFor(model => model.CanReadDVD) +
+
+ @Html.DisplayFor(model => model.CanReadDVD) +
+
+ @Html.DisplayNameFor(model => model.CanReadDVDPlusMRW) +
+
+ @Html.DisplayFor(model => model.CanReadDVDPlusMRW) +
+
+ @Html.DisplayNameFor(model => model.CanReadDVDPlusR) +
+
+ @Html.DisplayFor(model => model.CanReadDVDPlusR) +
+
+ @Html.DisplayNameFor(model => model.CanReadDVDPlusRDL) +
+
+ @Html.DisplayFor(model => model.CanReadDVDPlusRDL) +
+
+ @Html.DisplayNameFor(model => model.CanReadDVDPlusRW) +
+
+ @Html.DisplayFor(model => model.CanReadDVDPlusRW) +
+
+ @Html.DisplayNameFor(model => model.CanReadDVDPlusRWDL) +
+
+ @Html.DisplayFor(model => model.CanReadDVDPlusRWDL) +
+
+ @Html.DisplayNameFor(model => model.CanReadDriveAACSCertificate) +
+
+ @Html.DisplayFor(model => model.CanReadDriveAACSCertificate) +
+
+ @Html.DisplayNameFor(model => model.CanReadHDDVD) +
+
+ @Html.DisplayFor(model => model.CanReadHDDVD) +
+
+ @Html.DisplayNameFor(model => model.CanReadHDDVDR) +
+
+ @Html.DisplayFor(model => model.CanReadHDDVDR) +
+
+ @Html.DisplayNameFor(model => model.CanReadHDDVDRAM) +
+
+ @Html.DisplayFor(model => model.CanReadHDDVDRAM) +
+
+ @Html.DisplayNameFor(model => model.CanReadLeadInCDText) +
+
+ @Html.DisplayFor(model => model.CanReadLeadInCDText) +
+
+ @Html.DisplayNameFor(model => model.CanReadOldBDR) +
+
+ @Html.DisplayFor(model => model.CanReadOldBDR) +
+
+ @Html.DisplayNameFor(model => model.CanReadOldBDRE) +
+
+ @Html.DisplayFor(model => model.CanReadOldBDRE) +
+
+ @Html.DisplayNameFor(model => model.CanReadOldBDROM) +
+
+ @Html.DisplayFor(model => model.CanReadOldBDROM) +
+
+ @Html.DisplayNameFor(model => model.CanReadSpareAreaInformation) +
+
+ @Html.DisplayFor(model => model.CanReadSpareAreaInformation) +
+
+ @Html.DisplayNameFor(model => model.CanReportDriveSerial) +
+
+ @Html.DisplayFor(model => model.CanReportDriveSerial) +
+
+ @Html.DisplayNameFor(model => model.CanReportMediaSerial) +
+
+ @Html.DisplayFor(model => model.CanReportMediaSerial) +
+
+ @Html.DisplayNameFor(model => model.CanTestWriteDDCDR) +
+
+ @Html.DisplayFor(model => model.CanTestWriteDDCDR) +
+
+ @Html.DisplayNameFor(model => model.CanTestWriteDVD) +
+
+ @Html.DisplayFor(model => model.CanTestWriteDVD) +
+
+ @Html.DisplayNameFor(model => model.CanTestWriteInSAO) +
+
+ @Html.DisplayFor(model => model.CanTestWriteInSAO) +
+
+ @Html.DisplayNameFor(model => model.CanTestWriteInTAO) +
+
+ @Html.DisplayFor(model => model.CanTestWriteInTAO) +
+
+ @Html.DisplayNameFor(model => model.CanUpgradeFirmware) +
+
+ @Html.DisplayFor(model => model.CanUpgradeFirmware) +
+
+ @Html.DisplayNameFor(model => model.CanWriteBD) +
+
+ @Html.DisplayFor(model => model.CanWriteBD) +
+
+ @Html.DisplayNameFor(model => model.CanWriteBDR) +
+
+ @Html.DisplayFor(model => model.CanWriteBDR) +
+
+ @Html.DisplayNameFor(model => model.CanWriteBDRE1) +
+
+ @Html.DisplayFor(model => model.CanWriteBDRE1) +
+
+ @Html.DisplayNameFor(model => model.CanWriteBDRE2) +
+
+ @Html.DisplayFor(model => model.CanWriteBDRE2) +
+
+ @Html.DisplayNameFor(model => model.CanWriteBusEncryptedBlocks) +
+
+ @Html.DisplayFor(model => model.CanWriteBusEncryptedBlocks) +
+
+ @Html.DisplayNameFor(model => model.CanWriteCDMRW) +
+
+ @Html.DisplayFor(model => model.CanWriteCDMRW) +
+
+ @Html.DisplayNameFor(model => model.CanWriteCDRW) +
+
+ @Html.DisplayFor(model => model.CanWriteCDRW) +
+
+ @Html.DisplayNameFor(model => model.CanWriteCDRWCAV) +
+
+ @Html.DisplayFor(model => model.CanWriteCDRWCAV) +
+
+ @Html.DisplayNameFor(model => model.CanWriteCDSAO) +
+
+ @Html.DisplayFor(model => model.CanWriteCDSAO) +
+
+ @Html.DisplayNameFor(model => model.CanWriteCDTAO) +
+
+ @Html.DisplayFor(model => model.CanWriteCDTAO) +
+
+ @Html.DisplayNameFor(model => model.CanWriteCSSManagedDVD) +
+
+ @Html.DisplayFor(model => model.CanWriteCSSManagedDVD) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDDCDR) +
+
+ @Html.DisplayFor(model => model.CanWriteDDCDR) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDDCDRW) +
+
+ @Html.DisplayFor(model => model.CanWriteDDCDRW) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDPlusMRW) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDPlusMRW) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDPlusR) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDPlusR) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDPlusRDL) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDPlusRDL) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDPlusRW) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDPlusRW) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDPlusRWDL) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDPlusRWDL) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDR) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDR) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDRDL) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDRDL) +
+
+ @Html.DisplayNameFor(model => model.CanWriteDVDRW) +
+
+ @Html.DisplayFor(model => model.CanWriteDVDRW) +
+
+ @Html.DisplayNameFor(model => model.CanWriteHDDVDR) +
+
+ @Html.DisplayFor(model => model.CanWriteHDDVDR) +
+
+ @Html.DisplayNameFor(model => model.CanWriteHDDVDRAM) +
+
+ @Html.DisplayFor(model => model.CanWriteHDDVDRAM) +
+
+ @Html.DisplayNameFor(model => model.CanWriteOldBDR) +
+
+ @Html.DisplayFor(model => model.CanWriteOldBDR) +
+
+ @Html.DisplayNameFor(model => model.CanWriteOldBDRE) +
+
+ @Html.DisplayFor(model => model.CanWriteOldBDRE) +
+
+ @Html.DisplayNameFor(model => model.CanWritePackedSubchannelInTAO) +
+
+ @Html.DisplayFor(model => model.CanWritePackedSubchannelInTAO) +
+
+ @Html.DisplayNameFor(model => model.CanWriteRWSubchannelInSAO) +
+
+ @Html.DisplayFor(model => model.CanWriteRWSubchannelInSAO) +
+
+ @Html.DisplayNameFor(model => model.CanWriteRWSubchannelInTAO) +
+
+ @Html.DisplayFor(model => model.CanWriteRWSubchannelInTAO) +
+
+ @Html.DisplayNameFor(model => model.CanWriteRaw) +
+
+ @Html.DisplayFor(model => model.CanWriteRaw) +
+
+ @Html.DisplayNameFor(model => model.CanWriteRawMultiSession) +
+
+ @Html.DisplayFor(model => model.CanWriteRawMultiSession) +
+
+ @Html.DisplayNameFor(model => model.CanWriteRawSubchannelInTAO) +
+
+ @Html.DisplayFor(model => model.CanWriteRawSubchannelInTAO) +
+
+ @Html.DisplayNameFor(model => model.ChangerIsSideChangeCapable) +
+
+ @Html.DisplayFor(model => model.ChangerIsSideChangeCapable) +
+
+ @Html.DisplayNameFor(model => model.ChangerSlots) +
+
+ @Html.DisplayFor(model => model.ChangerSlots) +
+
+ @Html.DisplayNameFor(model => model.ChangerSupportsDiscPresent) +
+
+ @Html.DisplayFor(model => model.ChangerSupportsDiscPresent) +
+
+ @Html.DisplayNameFor(model => model.CPRMVersion) +
+
+ @Html.DisplayFor(model => model.CPRMVersion) +
+
+ @Html.DisplayNameFor(model => model.CSSVersion) +
+
+ @Html.DisplayFor(model => model.CSSVersion) +
+
+ @Html.DisplayNameFor(model => model.DBML) +
+
+ @Html.DisplayFor(model => model.DBML) +
+
+ @Html.DisplayNameFor(model => model.DVDMultiRead) +
+
+ @Html.DisplayFor(model => model.DVDMultiRead) +
+
+ @Html.DisplayNameFor(model => model.EmbeddedChanger) +
+
+ @Html.DisplayFor(model => model.EmbeddedChanger) +
+
+ @Html.DisplayNameFor(model => model.ErrorRecoveryPage) +
+
+ @Html.DisplayFor(model => model.ErrorRecoveryPage) +
+
+ @Html.DisplayNameFor(model => model.FirmwareDate) +
+
+ @Html.DisplayFor(model => model.FirmwareDate) +
+
+ @Html.DisplayNameFor(model => model.LoadingMechanismType) +
+
+ @Html.DisplayFor(model => model.LoadingMechanismType) +
+
+ @Html.DisplayNameFor(model => model.Locked) +
+
+ @Html.DisplayFor(model => model.Locked) +
+
+ @Html.DisplayNameFor(model => model.LogicalBlockSize) +
+
+ @Html.DisplayFor(model => model.LogicalBlockSize) +
+
+ @Html.DisplayNameFor(model => model.MultiRead) +
+
+ @Html.DisplayFor(model => model.MultiRead) +
+
+ @Html.DisplayNameFor(model => model.PhysicalInterfaceStandardNumber) +
+
+ @Html.DisplayFor(model => model.PhysicalInterfaceStandardNumber) +
+
+ @Html.DisplayNameFor(model => model.PreventJumper) +
+
+ @Html.DisplayFor(model => model.PreventJumper) +
+
+ @Html.DisplayNameFor(model => model.SupportsAACS) +
+
+ @Html.DisplayFor(model => model.SupportsAACS) +
+
+ @Html.DisplayNameFor(model => model.SupportsBusEncryption) +
+
+ @Html.DisplayFor(model => model.SupportsBusEncryption) +
+
+ @Html.DisplayNameFor(model => model.SupportsC2) +
+
+ @Html.DisplayFor(model => model.SupportsC2) +
+
+ @Html.DisplayNameFor(model => model.SupportsCPRM) +
+
+ @Html.DisplayFor(model => model.SupportsCPRM) +
+
+ @Html.DisplayNameFor(model => model.SupportsCSS) +
+
+ @Html.DisplayFor(model => model.SupportsCSS) +
+
+ @Html.DisplayNameFor(model => model.SupportsDAP) +
+
+ @Html.DisplayFor(model => model.SupportsDAP) +
+
+ @Html.DisplayNameFor(model => model.SupportsDeviceBusyEvent) +
+
+ @Html.DisplayFor(model => model.SupportsDeviceBusyEvent) +
+
+ @Html.DisplayNameFor(model => model.SupportsHybridDiscs) +
+
+ @Html.DisplayFor(model => model.SupportsHybridDiscs) +
+
+ @Html.DisplayNameFor(model => model.SupportsModePage1Ch) +
+
+ @Html.DisplayFor(model => model.SupportsModePage1Ch) +
+
+ @Html.DisplayNameFor(model => model.SupportsOSSC) +
+
+ @Html.DisplayFor(model => model.SupportsOSSC) +
+
+ @Html.DisplayNameFor(model => model.SupportsPWP) +
+
+ @Html.DisplayFor(model => model.SupportsPWP) +
+
+ @Html.DisplayNameFor(model => model.SupportsSWPP) +
+
+ @Html.DisplayFor(model => model.SupportsSWPP) +
+
+ @Html.DisplayNameFor(model => model.SupportsSecurDisc) +
+
+ @Html.DisplayFor(model => model.SupportsSecurDisc) +
+
+ @Html.DisplayNameFor(model => model.SupportsSeparateVolume) +
+
+ @Html.DisplayFor(model => model.SupportsSeparateVolume) +
+
+ @Html.DisplayNameFor(model => model.SupportsVCPS) +
+
+ @Html.DisplayFor(model => model.SupportsVCPS) +
+
+ @Html.DisplayNameFor(model => model.SupportsWriteInhibitDCB) +
+
+ @Html.DisplayFor(model => model.SupportsWriteInhibitDCB) +
+
+ @Html.DisplayNameFor(model => model.SupportsWriteProtectPAC) +
+
+ @Html.DisplayFor(model => model.SupportsWriteProtectPAC) +
+
+ @Html.DisplayNameFor(model => model.VolumeLevels) +
+
+ @Html.DisplayFor(model => model.VolumeLevels) +
+
+
+ \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Index.cshtml new file mode 100644 index 00000000..dc0071b8 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/MmcFeatures/Index.cshtml @@ -0,0 +1,792 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

MMC FEATURES

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@foreach(MmcFeatures item in Model) +{ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +
+ @Html.DisplayNameFor(model => model.AACSVersion) + + @Html.DisplayNameFor(model => model.AGIDs) + + @Html.DisplayNameFor(model => model.BindingNonceBlocks) + + @Html.DisplayNameFor(model => model.BlocksPerReadableUnit) + + @Html.DisplayNameFor(model => model.BufferUnderrunFreeInDVD) + + @Html.DisplayNameFor(model => model.BufferUnderrunFreeInSAO) + + @Html.DisplayNameFor(model => model.BufferUnderrunFreeInTAO) + + @Html.DisplayNameFor(model => model.CanAudioScan) + + @Html.DisplayNameFor(model => model.CanEject) + + @Html.DisplayNameFor(model => model.CanEraseSector) + + @Html.DisplayNameFor(model => model.CanExpandBDRESpareArea) + + @Html.DisplayNameFor(model => model.CanFormat) + + @Html.DisplayNameFor(model => model.CanFormatBDREWithoutSpare) + + @Html.DisplayNameFor(model => model.CanFormatCert) + + @Html.DisplayNameFor(model => model.CanFormatFRF) + + @Html.DisplayNameFor(model => model.CanFormatQCert) + + @Html.DisplayNameFor(model => model.CanFormatRRM) + + @Html.DisplayNameFor(model => model.CanGenerateBindingNonce) + + @Html.DisplayNameFor(model => model.CanLoad) + + @Html.DisplayNameFor(model => model.CanMuteSeparateChannels) + + @Html.DisplayNameFor(model => model.CanOverwriteSAOTrack) + + @Html.DisplayNameFor(model => model.CanOverwriteTAOTrack) + + @Html.DisplayNameFor(model => model.CanPlayCDAudio) + + @Html.DisplayNameFor(model => model.CanPseudoOverwriteBDR) + + @Html.DisplayNameFor(model => model.CanReadAllDualR) + + @Html.DisplayNameFor(model => model.CanReadAllDualRW) + + @Html.DisplayNameFor(model => model.CanReadBD) + + @Html.DisplayNameFor(model => model.CanReadBDR) + + @Html.DisplayNameFor(model => model.CanReadBDRE1) + + @Html.DisplayNameFor(model => model.CanReadBDRE2) + + @Html.DisplayNameFor(model => model.CanReadBDROM) + + @Html.DisplayNameFor(model => model.CanReadBluBCA) + + @Html.DisplayNameFor(model => model.CanReadCD) + + @Html.DisplayNameFor(model => model.CanReadCDMRW) + + @Html.DisplayNameFor(model => model.CanReadCPRM_MKB) + + @Html.DisplayNameFor(model => model.CanReadDDCD) + + @Html.DisplayNameFor(model => model.CanReadDVD) + + @Html.DisplayNameFor(model => model.CanReadDVDPlusMRW) + + @Html.DisplayNameFor(model => model.CanReadDVDPlusR) + + @Html.DisplayNameFor(model => model.CanReadDVDPlusRDL) + + @Html.DisplayNameFor(model => model.CanReadDVDPlusRW) + + @Html.DisplayNameFor(model => model.CanReadDVDPlusRWDL) + + @Html.DisplayNameFor(model => model.CanReadDriveAACSCertificate) + + @Html.DisplayNameFor(model => model.CanReadHDDVD) + + @Html.DisplayNameFor(model => model.CanReadHDDVDR) + + @Html.DisplayNameFor(model => model.CanReadHDDVDRAM) + + @Html.DisplayNameFor(model => model.CanReadLeadInCDText) + + @Html.DisplayNameFor(model => model.CanReadOldBDR) + + @Html.DisplayNameFor(model => model.CanReadOldBDRE) + + @Html.DisplayNameFor(model => model.CanReadOldBDROM) + + @Html.DisplayNameFor(model => model.CanReadSpareAreaInformation) + + @Html.DisplayNameFor(model => model.CanReportDriveSerial) + + @Html.DisplayNameFor(model => model.CanReportMediaSerial) + + @Html.DisplayNameFor(model => model.CanTestWriteDDCDR) + + @Html.DisplayNameFor(model => model.CanTestWriteDVD) + + @Html.DisplayNameFor(model => model.CanTestWriteInSAO) + + @Html.DisplayNameFor(model => model.CanTestWriteInTAO) + + @Html.DisplayNameFor(model => model.CanUpgradeFirmware) + + @Html.DisplayNameFor(model => model.CanWriteBD) + + @Html.DisplayNameFor(model => model.CanWriteBDR) + + @Html.DisplayNameFor(model => model.CanWriteBDRE1) + + @Html.DisplayNameFor(model => model.CanWriteBDRE2) + + @Html.DisplayNameFor(model => model.CanWriteBusEncryptedBlocks) + + @Html.DisplayNameFor(model => model.CanWriteCDMRW) + + @Html.DisplayNameFor(model => model.CanWriteCDRW) + + @Html.DisplayNameFor(model => model.CanWriteCDRWCAV) + + @Html.DisplayNameFor(model => model.CanWriteCDSAO) + + @Html.DisplayNameFor(model => model.CanWriteCDTAO) + + @Html.DisplayNameFor(model => model.CanWriteCSSManagedDVD) + + @Html.DisplayNameFor(model => model.CanWriteDDCDR) + + @Html.DisplayNameFor(model => model.CanWriteDDCDRW) + + @Html.DisplayNameFor(model => model.CanWriteDVDPlusMRW) + + @Html.DisplayNameFor(model => model.CanWriteDVDPlusR) + + @Html.DisplayNameFor(model => model.CanWriteDVDPlusRDL) + + @Html.DisplayNameFor(model => model.CanWriteDVDPlusRW) + + @Html.DisplayNameFor(model => model.CanWriteDVDPlusRWDL) + + @Html.DisplayNameFor(model => model.CanWriteDVDR) + + @Html.DisplayNameFor(model => model.CanWriteDVDRDL) + + @Html.DisplayNameFor(model => model.CanWriteDVDRW) + + @Html.DisplayNameFor(model => model.CanWriteHDDVDR) + + @Html.DisplayNameFor(model => model.CanWriteHDDVDRAM) + + @Html.DisplayNameFor(model => model.CanWriteOldBDR) + + @Html.DisplayNameFor(model => model.CanWriteOldBDRE) + + @Html.DisplayNameFor(model => model.CanWritePackedSubchannelInTAO) + + @Html.DisplayNameFor(model => model.CanWriteRWSubchannelInSAO) + + @Html.DisplayNameFor(model => model.CanWriteRWSubchannelInTAO) + + @Html.DisplayNameFor(model => model.CanWriteRaw) + + @Html.DisplayNameFor(model => model.CanWriteRawMultiSession) + + @Html.DisplayNameFor(model => model.CanWriteRawSubchannelInTAO) + + @Html.DisplayNameFor(model => model.ChangerIsSideChangeCapable) + + @Html.DisplayNameFor(model => model.ChangerSlots) + + @Html.DisplayNameFor(model => model.ChangerSupportsDiscPresent) + + @Html.DisplayNameFor(model => model.CPRMVersion) + + @Html.DisplayNameFor(model => model.CSSVersion) + + @Html.DisplayNameFor(model => model.DBML) + + @Html.DisplayNameFor(model => model.DVDMultiRead) + + @Html.DisplayNameFor(model => model.EmbeddedChanger) + + @Html.DisplayNameFor(model => model.ErrorRecoveryPage) + + @Html.DisplayNameFor(model => model.FirmwareDate) + + @Html.DisplayNameFor(model => model.LoadingMechanismType) + + @Html.DisplayNameFor(model => model.Locked) + + @Html.DisplayNameFor(model => model.LogicalBlockSize) + + @Html.DisplayNameFor(model => model.MultiRead) + + @Html.DisplayNameFor(model => model.PhysicalInterfaceStandardNumber) + + @Html.DisplayNameFor(model => model.PreventJumper) + + @Html.DisplayNameFor(model => model.SupportsAACS) + + @Html.DisplayNameFor(model => model.SupportsBusEncryption) + + @Html.DisplayNameFor(model => model.SupportsC2) + + @Html.DisplayNameFor(model => model.SupportsCPRM) + + @Html.DisplayNameFor(model => model.SupportsCSS) + + @Html.DisplayNameFor(model => model.SupportsDAP) + + @Html.DisplayNameFor(model => model.SupportsDeviceBusyEvent) + + @Html.DisplayNameFor(model => model.SupportsHybridDiscs) + + @Html.DisplayNameFor(model => model.SupportsModePage1Ch) + + @Html.DisplayNameFor(model => model.SupportsOSSC) + + @Html.DisplayNameFor(model => model.SupportsPWP) + + @Html.DisplayNameFor(model => model.SupportsSWPP) + + @Html.DisplayNameFor(model => model.SupportsSecurDisc) + + @Html.DisplayNameFor(model => model.SupportsSeparateVolume) + + @Html.DisplayNameFor(model => model.SupportsVCPS) + + @Html.DisplayNameFor(model => model.SupportsWriteInhibitDCB) + + @Html.DisplayNameFor(model => model.SupportsWriteProtectPAC) + + @Html.DisplayNameFor(model => model.VolumeLevels) +
+ @Html.DisplayFor(modelItem => item.AACSVersion) + + @Html.DisplayFor(modelItem => item.AGIDs) + + @Html.DisplayFor(modelItem => item.BindingNonceBlocks) + + @Html.DisplayFor(modelItem => item.BlocksPerReadableUnit) + + @Html.DisplayFor(modelItem => item.BufferUnderrunFreeInDVD) + + @Html.DisplayFor(modelItem => item.BufferUnderrunFreeInSAO) + + @Html.DisplayFor(modelItem => item.BufferUnderrunFreeInTAO) + + @Html.DisplayFor(modelItem => item.CanAudioScan) + + @Html.DisplayFor(modelItem => item.CanEject) + + @Html.DisplayFor(modelItem => item.CanEraseSector) + + @Html.DisplayFor(modelItem => item.CanExpandBDRESpareArea) + + @Html.DisplayFor(modelItem => item.CanFormat) + + @Html.DisplayFor(modelItem => item.CanFormatBDREWithoutSpare) + + @Html.DisplayFor(modelItem => item.CanFormatCert) + + @Html.DisplayFor(modelItem => item.CanFormatFRF) + + @Html.DisplayFor(modelItem => item.CanFormatQCert) + + @Html.DisplayFor(modelItem => item.CanFormatRRM) + + @Html.DisplayFor(modelItem => item.CanGenerateBindingNonce) + + @Html.DisplayFor(modelItem => item.CanLoad) + + @Html.DisplayFor(modelItem => item.CanMuteSeparateChannels) + + @Html.DisplayFor(modelItem => item.CanOverwriteSAOTrack) + + @Html.DisplayFor(modelItem => item.CanOverwriteTAOTrack) + + @Html.DisplayFor(modelItem => item.CanPlayCDAudio) + + @Html.DisplayFor(modelItem => item.CanPseudoOverwriteBDR) + + @Html.DisplayFor(modelItem => item.CanReadAllDualR) + + @Html.DisplayFor(modelItem => item.CanReadAllDualRW) + + @Html.DisplayFor(modelItem => item.CanReadBD) + + @Html.DisplayFor(modelItem => item.CanReadBDR) + + @Html.DisplayFor(modelItem => item.CanReadBDRE1) + + @Html.DisplayFor(modelItem => item.CanReadBDRE2) + + @Html.DisplayFor(modelItem => item.CanReadBDROM) + + @Html.DisplayFor(modelItem => item.CanReadBluBCA) + + @Html.DisplayFor(modelItem => item.CanReadCD) + + @Html.DisplayFor(modelItem => item.CanReadCDMRW) + + @Html.DisplayFor(modelItem => item.CanReadCPRM_MKB) + + @Html.DisplayFor(modelItem => item.CanReadDDCD) + + @Html.DisplayFor(modelItem => item.CanReadDVD) + + @Html.DisplayFor(modelItem => item.CanReadDVDPlusMRW) + + @Html.DisplayFor(modelItem => item.CanReadDVDPlusR) + + @Html.DisplayFor(modelItem => item.CanReadDVDPlusRDL) + + @Html.DisplayFor(modelItem => item.CanReadDVDPlusRW) + + @Html.DisplayFor(modelItem => item.CanReadDVDPlusRWDL) + + @Html.DisplayFor(modelItem => item.CanReadDriveAACSCertificate) + + @Html.DisplayFor(modelItem => item.CanReadHDDVD) + + @Html.DisplayFor(modelItem => item.CanReadHDDVDR) + + @Html.DisplayFor(modelItem => item.CanReadHDDVDRAM) + + @Html.DisplayFor(modelItem => item.CanReadLeadInCDText) + + @Html.DisplayFor(modelItem => item.CanReadOldBDR) + + @Html.DisplayFor(modelItem => item.CanReadOldBDRE) + + @Html.DisplayFor(modelItem => item.CanReadOldBDROM) + + @Html.DisplayFor(modelItem => item.CanReadSpareAreaInformation) + + @Html.DisplayFor(modelItem => item.CanReportDriveSerial) + + @Html.DisplayFor(modelItem => item.CanReportMediaSerial) + + @Html.DisplayFor(modelItem => item.CanTestWriteDDCDR) + + @Html.DisplayFor(modelItem => item.CanTestWriteDVD) + + @Html.DisplayFor(modelItem => item.CanTestWriteInSAO) + + @Html.DisplayFor(modelItem => item.CanTestWriteInTAO) + + @Html.DisplayFor(modelItem => item.CanUpgradeFirmware) + + @Html.DisplayFor(modelItem => item.CanWriteBD) + + @Html.DisplayFor(modelItem => item.CanWriteBDR) + + @Html.DisplayFor(modelItem => item.CanWriteBDRE1) + + @Html.DisplayFor(modelItem => item.CanWriteBDRE2) + + @Html.DisplayFor(modelItem => item.CanWriteBusEncryptedBlocks) + + @Html.DisplayFor(modelItem => item.CanWriteCDMRW) + + @Html.DisplayFor(modelItem => item.CanWriteCDRW) + + @Html.DisplayFor(modelItem => item.CanWriteCDRWCAV) + + @Html.DisplayFor(modelItem => item.CanWriteCDSAO) + + @Html.DisplayFor(modelItem => item.CanWriteCDTAO) + + @Html.DisplayFor(modelItem => item.CanWriteCSSManagedDVD) + + @Html.DisplayFor(modelItem => item.CanWriteDDCDR) + + @Html.DisplayFor(modelItem => item.CanWriteDDCDRW) + + @Html.DisplayFor(modelItem => item.CanWriteDVDPlusMRW) + + @Html.DisplayFor(modelItem => item.CanWriteDVDPlusR) + + @Html.DisplayFor(modelItem => item.CanWriteDVDPlusRDL) + + @Html.DisplayFor(modelItem => item.CanWriteDVDPlusRW) + + @Html.DisplayFor(modelItem => item.CanWriteDVDPlusRWDL) + + @Html.DisplayFor(modelItem => item.CanWriteDVDR) + + @Html.DisplayFor(modelItem => item.CanWriteDVDRDL) + + @Html.DisplayFor(modelItem => item.CanWriteDVDRW) + + @Html.DisplayFor(modelItem => item.CanWriteHDDVDR) + + @Html.DisplayFor(modelItem => item.CanWriteHDDVDRAM) + + @Html.DisplayFor(modelItem => item.CanWriteOldBDR) + + @Html.DisplayFor(modelItem => item.CanWriteOldBDRE) + + @Html.DisplayFor(modelItem => item.CanWritePackedSubchannelInTAO) + + @Html.DisplayFor(modelItem => item.CanWriteRWSubchannelInSAO) + + @Html.DisplayFor(modelItem => item.CanWriteRWSubchannelInTAO) + + @Html.DisplayFor(modelItem => item.CanWriteRaw) + + @Html.DisplayFor(modelItem => item.CanWriteRawMultiSession) + + @Html.DisplayFor(modelItem => item.CanWriteRawSubchannelInTAO) + + @Html.DisplayFor(modelItem => item.ChangerIsSideChangeCapable) + + @Html.DisplayFor(modelItem => item.ChangerSlots) + + @Html.DisplayFor(modelItem => item.ChangerSupportsDiscPresent) + + @Html.DisplayFor(modelItem => item.CPRMVersion) + + @Html.DisplayFor(modelItem => item.CSSVersion) + + @Html.DisplayFor(modelItem => item.DBML) + + @Html.DisplayFor(modelItem => item.DVDMultiRead) + + @Html.DisplayFor(modelItem => item.EmbeddedChanger) + + @Html.DisplayFor(modelItem => item.ErrorRecoveryPage) + + @Html.DisplayFor(modelItem => item.FirmwareDate) + + @Html.DisplayFor(modelItem => item.LoadingMechanismType) + + @Html.DisplayFor(modelItem => item.Locked) + + @Html.DisplayFor(modelItem => item.LogicalBlockSize) + + @Html.DisplayFor(modelItem => item.MultiRead) + + @Html.DisplayFor(modelItem => item.PhysicalInterfaceStandardNumber) + + @Html.DisplayFor(modelItem => item.PreventJumper) + + @Html.DisplayFor(modelItem => item.SupportsAACS) + + @Html.DisplayFor(modelItem => item.SupportsBusEncryption) + + @Html.DisplayFor(modelItem => item.SupportsC2) + + @Html.DisplayFor(modelItem => item.SupportsCPRM) + + @Html.DisplayFor(modelItem => item.SupportsCSS) + + @Html.DisplayFor(modelItem => item.SupportsDAP) + + @Html.DisplayFor(modelItem => item.SupportsDeviceBusyEvent) + + @Html.DisplayFor(modelItem => item.SupportsHybridDiscs) + + @Html.DisplayFor(modelItem => item.SupportsModePage1Ch) + + @Html.DisplayFor(modelItem => item.SupportsOSSC) + + @Html.DisplayFor(modelItem => item.SupportsPWP) + + @Html.DisplayFor(modelItem => item.SupportsSWPP) + + @Html.DisplayFor(modelItem => item.SupportsSecurDisc) + + @Html.DisplayFor(modelItem => item.SupportsSeparateVolume) + + @Html.DisplayFor(modelItem => item.SupportsVCPS) + + @Html.DisplayFor(modelItem => item.SupportsWriteInhibitDCB) + + @Html.DisplayFor(modelItem => item.SupportsWriteProtectPAC) + + @Html.DisplayFor(modelItem => item.VolumeLevels) + + Details +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Delete.cshtml new file mode 100644 index 00000000..102f6970 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Delete.cshtml @@ -0,0 +1,130 @@ +@using Aaru.Decoders.SecureDigital +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.MmcSd + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

MultiMediaCard / SecureDigital registers

+
+
+ @if(Model.SCR != null) + { + if(Model.CID != null) + { +
+ @Html.DisplayNameFor(model => model.CID) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyCID(Model.CID))) +
+ } + + if(Model.CSD != null) + { +
+ @Html.DisplayNameFor(model => model.CSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyCSD(Model.CSD))) +
+ } + + if(Model.OCR != null) + { +
+ @Html.DisplayNameFor(model => model.OCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyOCR(Model.OCR))) +
+ } + +
+ @Html.DisplayNameFor(model => model.SCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifySCR(Model.SCR))) +
+ } + else + { + if(Model.CID != null) + { +
+ @Html.DisplayNameFor(model => model.CID) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyCID(Model.CID))) +
+ } + + if(Model.CSD != null) + { +
+ @Html.DisplayNameFor(model => model.CSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyCSD(Model.CSD))) +
+ } + + if(Model.OCR != null) + { +
+ @Html.DisplayNameFor(model => model.OCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyOCR(Model.OCR))) +
+ } + + if(Model.ExtendedCSD != null) + { +
+ @Html.DisplayNameFor(model => model.ExtendedCSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyExtendedCSD(Model.ExtendedCSD))) +
+ } + } +
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Details.cshtml new file mode 100644 index 00000000..bc359dab --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Details.cshtml @@ -0,0 +1,127 @@ +@using Aaru.Decoders.SecureDigital +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.MmcSd + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

MultiMediaCard / SecureDigital registers

+
+
+ @if(Model.SCR != null) + { + if(Model.CID != null) + { +
+ @Html.DisplayNameFor(model => model.CID) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyCID(Model.CID))) +
+ } + + if(Model.CSD != null) + { +
+ @Html.DisplayNameFor(model => model.CSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyCSD(Model.CSD))) +
+ } + + if(Model.OCR != null) + { +
+ @Html.DisplayNameFor(model => model.OCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyOCR(Model.OCR))) +
+ } + +
+ @Html.DisplayNameFor(model => model.SCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifySCR(Model.SCR))) +
+ } + else + { + if(Model.CID != null) + { +
+ @Html.DisplayNameFor(model => model.CID) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyCID(Model.CID))) +
+ } + + if(Model.CSD != null) + { +
+ @Html.DisplayNameFor(model => model.CSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyCSD(Model.CSD))) +
+ } + + if(Model.OCR != null) + { +
+ @Html.DisplayNameFor(model => model.OCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyOCR(Model.OCR))) +
+ } + + if(Model.ExtendedCSD != null) + { +
+ @Html.DisplayNameFor(model => model.ExtendedCSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Aaru.Decoders.MMC.Decoders.PrettifyExtendedCSD(Model.ExtendedCSD))) +
+ } + } +
+
+ \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Index.cshtml new file mode 100644 index 00000000..051365ef --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/MmcSds/Index.cshtml @@ -0,0 +1,61 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

MultiMediaCard / SecureDigital registers

+ + + + + + + + + @foreach(MmcSd item in Model) + { + + + + + } + +
+ @Html.DisplayNameFor(model => model.Id) +
+ @Html.DisplayFor(modelItem => item.Id) + + Details + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/OperatingSystems/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/OperatingSystems/Index.cshtml new file mode 100644 index 00000000..952d4d19 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/OperatingSystems/Index.cshtml @@ -0,0 +1,68 @@ +@using OperatingSystem = Aaru.Server.Old.Database.Models.OperatingSystem +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Operating systems

+ + + + + + + + + + @foreach(OperatingSystem item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Version) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Version) + + @Html.DisplayFor(modelItem => item.Count) +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Partitions/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Partitions/Index.cshtml new file mode 100644 index 00000000..95d59070 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Partitions/Index.cshtml @@ -0,0 +1,62 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Partitioning schemes

+ + + + + + + + + @foreach(Partition item in Model) + { + + + + + } + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Count) +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Delete.cshtml new file mode 100644 index 00000000..88c87e7f --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Delete.cshtml @@ -0,0 +1,83 @@ +@model Aaru.CommonTypes.Metadata.Pcmcia + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

PCMCIA data

+
+
+
+ @Html.DisplayNameFor(model => model.CIS) +
+
+ @Html.DisplayFor(model => model.CIS) +
+
+ @Html.DisplayNameFor(model => model.Compliance) +
+
+ @Html.DisplayFor(model => model.Compliance) +
+
+ @Html.DisplayNameFor(model => model.ManufacturerCode) +
+
+ @Html.DisplayFor(model => model.ManufacturerCode) +
+
+ @Html.DisplayNameFor(model => model.CardCode) +
+
+ @Html.DisplayFor(model => model.CardCode) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.ProductName) +
+
+ @Html.DisplayFor(model => model.ProductName) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Index.cshtml new file mode 100644 index 00000000..4260c423 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Pcmcias/Index.cshtml @@ -0,0 +1,90 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

PCMCIA data

+ + + + + + + + + + + + + + @foreach(Pcmcia item in Model) + { + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.CIS) + + @Html.DisplayNameFor(model => model.Compliance) + + @Html.DisplayNameFor(model => model.ManufacturerCode) + + @Html.DisplayNameFor(model => model.CardCode) + + @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.ProductName) +
+ @Html.DisplayFor(modelItem => item.CIS) + + @Html.DisplayFor(modelItem => item.Compliance) + + @Html.DisplayFor(modelItem => item.ManufacturerCode) + + @Html.DisplayFor(modelItem => item.CardCode) + + @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.ProductName) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Reports/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Reports/Delete.cshtml new file mode 100644 index 00000000..549b3a2d --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Reports/Delete.cshtml @@ -0,0 +1,53 @@ +@model Aaru.Server.Database.Models.UploadedReport + +@{ + ViewData["Title"] = "Delete"; +} +

Are you sure you want to delete this?

+
+

Uploaded report

+
+
+
+ @Html.DisplayNameFor(model => model.UploadedWhen) +
+
+ @Html.DisplayFor(model => model.UploadedWhen) +
+
+ @Html.DisplayNameFor(model => model.CompactFlash) +
+
+ @Html.DisplayFor(model => model.CompactFlash) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+ @Html.DisplayNameFor(model => model.Revision) +
+
+ @Html.DisplayFor(model => model.Revision) +
+
+ @Html.DisplayNameFor(model => model.Type) +
+
+ @Html.DisplayFor(model => model.Type) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Reports/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Reports/Details.cshtml new file mode 100644 index 00000000..efe8af1e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Reports/Details.cshtml @@ -0,0 +1,315 @@ +@using Aaru.CommonTypes.Metadata +@model Aaru.Server.Database.Models.UploadedReportDetails + +@{ + ViewData["Title"] = "Details"; +} +
+

Uploaded report

+
+
+
+ @Html.DisplayNameFor(model => model.Report.UploadedWhen) +
+
+ @Html.DisplayFor(model => model.Report.UploadedWhen) +
+
+ @Html.DisplayNameFor(model => model.Report.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Report.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Report.Model) +
+
+ @Html.DisplayFor(model => model.Report.Model) +
+
+ @Html.DisplayNameFor(model => model.Report.Revision) +
+
+ @Html.DisplayFor(model => model.Report.Revision) +
+
+ @Html.DisplayNameFor(model => model.Report.CompactFlash) +
+
+ @Html.DisplayFor(model => model.Report.CompactFlash) +
+
+ @Html.DisplayNameFor(model => model.Report.Type) +
+
+ @Html.DisplayFor(model => model.Report.Type) +
+
+
+ +@if(Model.ReadCapabilitiesId != 0) +{ + +} +@if(Model.Report.ATA != null) +{ + +} +@if(Model.Report.ATAPI != null) +{ + +} +@if(Model.Report.SCSI != null) +{ + +} +@if(Model.Report.MultiMediaCard != null) +{ + +} +@if(Model.Report.SecureDigital != null) +{ + +} +@if(Model.Report.USB != null) +{ + +} +@if(Model.Report.GdRomSwapDiscCapabilitiesId != null) +{ + +} +@if(Model.Report.FireWire != null) +{ +
+ Has a FireWire report. +
+} +@if(Model.Report.PCMCIA != null) +{ +
+ Has a PCMCIA report. +
+} +@if(Model.SameAll.Count > 0) +{ +
+

Other uploaded reports with same manufacturer, model and revision:

+ + + + + + + + + @foreach(int item in Model.SameAll) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.SameButManufacturer.Count > 0) +{ +
+

Other uploaded reports with same model and revision:

+ + + + + + + + + @foreach(int item in Model.SameButManufacturer) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.ReportAll.Count > 0) +{ +
+

Device reports with same manufacturer, model and revision:

+ + + + + + + + + @foreach(int item in Model.ReportAll) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.ReportButManufacturer.Count > 0) +{ +
+

Device reports with same model and revision:

+ + + + + + + + + @foreach(int item in Model.ReportButManufacturer) + { + + + + + } + +
+ Id +
+ @item + + Details + Merge +
+
+} +@if(Model.TestedMedias.Count > 0) +{ +
+

Tested media:

+ + + + + + + + + + + @foreach(TestedMedia item in Model.TestedMedias) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.TestedMedias[0].Manufacturer) + + @Html.DisplayNameFor(model => model.TestedMedias[0].Model) + + @Html.DisplayNameFor(model => model.TestedMedias[0].MediumTypeName) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.MediumTypeName) + + Details +
+
+} +@if(Model.TestedSequentialMedias.Count > 0) +{ +
+

Tested media:

+ + + + + + + + + + + @foreach(TestedSequentialMedia item in Model.TestedSequentialMedias) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.TestedSequentialMedias[0].Manufacturer) + + @Html.DisplayNameFor(model => model.TestedSequentialMedias[0].Model) + + @Html.DisplayNameFor(model => model.TestedSequentialMedias[0].MediumTypeName) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.MediumTypeName) + + Delete +
+
+} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Reports/Edit.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Reports/Edit.cshtml new file mode 100644 index 00000000..0017a92a --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Reports/Edit.cshtml @@ -0,0 +1,45 @@ +@using Aaru.CommonTypes.Enums +@model Aaru.Server.Database.Models.UploadedReport + +@{ + ViewData["Title"] = "Edit"; +} +

Uploaded report

+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+ + + +
+
+ + Back to List +
+
+
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Reports/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Reports/Index.cshtml new file mode 100644 index 00000000..9284ce7c --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Reports/Index.cshtml @@ -0,0 +1,56 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + ViewData["Title"] = "Index"; +} +

Uploaded reports

+ + + + + + + + + + + + + @foreach(UploadedReport item in Model) + { + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Model) + + @Html.DisplayNameFor(model => model.Revision) + + @Html.DisplayNameFor(model => model.CompactFlash) + + @Html.DisplayNameFor(model => model.Type) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.Revision) + + @Html.DisplayFor(modelItem => item.CompactFlash) + + @Html.DisplayFor(modelItem => item.Type) + + Details + Edit + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Delete.cshtml new file mode 100644 index 00000000..5a284bb3 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Delete.cshtml @@ -0,0 +1,83 @@ +@model Aaru.CommonTypes.Metadata.ScsiMode + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

SCSI MODE SENSE response

+
+
+
+ @Html.DisplayNameFor(model => model.MediumType) +
+
+ @Html.DisplayFor(model => model.MediumType) +
+
+ @Html.DisplayNameFor(model => model.WriteProtected) +
+
+ @Html.DisplayFor(model => model.WriteProtected) +
+
+ @Html.DisplayNameFor(model => model.Speed) +
+
+ @Html.DisplayFor(model => model.Speed) +
+
+ @Html.DisplayNameFor(model => model.BufferedMode) +
+
+ @Html.DisplayFor(model => model.BufferedMode) +
+
+ @Html.DisplayNameFor(model => model.BlankCheckEnabled) +
+
+ @Html.DisplayFor(model => model.BlankCheckEnabled) +
+
+ @Html.DisplayNameFor(model => model.DPOandFUA) +
+
+ @Html.DisplayFor(model => model.DPOandFUA) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Index.cshtml new file mode 100644 index 00000000..b789ac28 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/ScsiModes/Index.cshtml @@ -0,0 +1,90 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

SCSI MODE SENSE responses

+ + + + + + + + + + + + + + @foreach(ScsiMode item in Model) + { + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.MediumType) + + @Html.DisplayNameFor(model => model.WriteProtected) + + @Html.DisplayNameFor(model => model.Speed) + + @Html.DisplayNameFor(model => model.BufferedMode) + + @Html.DisplayNameFor(model => model.BlankCheckEnabled) + + @Html.DisplayNameFor(model => model.DPOandFUA) +
+ @Html.DisplayFor(modelItem => item.MediumType) + + @Html.DisplayFor(modelItem => item.WriteProtected) + + @Html.DisplayFor(modelItem => item.Speed) + + @Html.DisplayFor(modelItem => item.BufferedMode) + + @Html.DisplayFor(modelItem => item.BlankCheckEnabled) + + @Html.DisplayFor(modelItem => item.DPOandFUA) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Delete.cshtml new file mode 100644 index 00000000..6c5465a5 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Delete.cshtml @@ -0,0 +1,65 @@ +@model Aaru.CommonTypes.Metadata.ScsiPage + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

ScsiPage

+
+
+
+ @Html.DisplayNameFor(model => model.page) +
+
+ @Html.DisplayFor(model => model.page) +
+
+ @Html.DisplayNameFor(model => model.subpage) +
+
+ @Html.DisplayFor(model => model.subpage) +
+
+ @Html.DisplayNameFor(model => model.value) +
+
+ @Html.DisplayFor(model => model.value) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Index.cshtml new file mode 100644 index 00000000..5e2ffae7 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/ScsiPages/Index.cshtml @@ -0,0 +1,66 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

SCSI MODE SENSE pages

+ + + + + + + + + + @foreach(ScsiPage item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.page) + + @Html.DisplayNameFor(model => model.subpage) +
+ @Html.DisplayFor(modelItem => item.page) + + @Html.DisplayFor(modelItem => item.subpage) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Scsis/Compare.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Compare.cshtml new file mode 100644 index 00000000..32499b5d --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Compare.cshtml @@ -0,0 +1,86 @@ +@model Aaru.Server.Database.Models.CompareModel + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Comparing SCSI INQUIRY ID @Model.LeftId with ID @Model.RightId

+@if(Model.AreEqual) +{ +

No differences found.

+ + return; +} + +@if(Model.HasError) +{ +

@Model.ErrorMessage

+ + return; +} + + + + + + + + + + + @for(var i = 0; i < Model.ValueNames.Count; i++) + { + + + + + + } + +
+ Value name + + ID: @Model.LeftId + + ID: @Model.RightId +
+ @Model.ValueNames[i] + + @Model.LeftValues[i] + + @Model.RightValues[i] +
+Back to List +Delete ID @Model.LeftId +Delete ID @Model.RightId +Replace all dependencies from ID @Model.RightId with ID @Model.LeftId +Replace all dependencies from ID @Model.LeftId with ID @Model.RightId \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Scsis/Consolidate.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Consolidate.cshtml new file mode 100644 index 00000000..fa6fa524 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Consolidate.cshtml @@ -0,0 +1,32 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.IdHashModelForView + +@{ + ViewBag.Title = "Consolidate duplicate SCSIs"; + Layout = "_Layout"; +} +

Consolidate duplicate SCSIs

+
+ The following SCSI INQUIRY have duplicates. + + + + @foreach(IdHashModel item in Model.List) + { + + + + } + +
+ @Html.DisplayFor(modelItem => item.Description) +
+
+
+ Do you want to remove the duplicates? +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Scsis/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Delete.cshtml new file mode 100644 index 00000000..4cca4f6f --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Delete.cshtml @@ -0,0 +1,48 @@ +@using Aaru.Decoders.SCSI +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.Scsi + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

SCSI INQUIRY - ID = @Model.Id

+
+ @Html.Raw(Html.EncodedMultiLineText(Inquiry.Prettify(Model.InquiryData))) +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Scsis/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Details.cshtml new file mode 100644 index 00000000..2dcabd89 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Details.cshtml @@ -0,0 +1,51 @@ +@using Aaru.Decoders.SCSI +@using Aaru.Server.Old.Core +@model Aaru.CommonTypes.Metadata.Scsi + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

SCSI INQUIRY - ID = @Model.Id

+
+ @Html.Raw(Html.EncodedMultiLineText(Inquiry.Prettify(Model.InquiryData))) +
+
+
+ + Compare to: + + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Scsis/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Index.cshtml new file mode 100644 index 00000000..92ba17a4 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Scsis/Index.cshtml @@ -0,0 +1,101 @@ +@using Aaru.CommonTypes.Metadata +@using Aaru.Helpers +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

SCSI INQUIRY responses

+ + + + + + + + + + + + + + + + @foreach(Scsi item in Model) + { + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Id) + + Vendor identification + + Product identification + + Product revision level + + @Html.DisplayNameFor(model => model.SupportsModeSense6) + + @Html.DisplayNameFor(model => model.SupportsModeSense10) + + @Html.DisplayNameFor(model => model.SupportsModeSubpages) +
+ @Html.DisplayFor(modelItem => item.Id) + + @StringHandlers.CToString(item.Inquiry?.VendorIdentification) + + @StringHandlers.CToString(item.Inquiry?.ProductIdentification) + + @StringHandlers.CToString(item.Inquiry?.ProductRevisionLevel) + + @Html.DisplayFor(modelItem => item.SupportsModeSense6) + + @Html.DisplayFor(modelItem => item.SupportsModeSense10) + + @Html.DisplayFor(modelItem => item.SupportsModeSubpages) + + Details + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Shared/_Layout.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000..69613ae3 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Shared/_Layout.cshtml @@ -0,0 +1,140 @@ +@using Microsoft.AspNetCore.Identity +@inject SignInManager SignInManager +@inject UserManager UserManager +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : _Layout.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ Description ] ---------------------------------------------------------- + // + // Contains layout. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} + + + + + @switch(DateTime.UtcNow.DayOfYear) + { + // 24th January, Macintosh launch + case 24: + + + + break; + + // 23rd July, Amiga launch + case 204: + + + + break; + default: + + + + break; + } + + @ViewBag.Title + + + + @Html.Raw(JavaScriptSnippet.FullScript) + + +
+ Welcome to + + + Aaru + + Server Administrative Area + @if(SignInManager.IsSignedIn(User)) + { + + } + else + { +
+ Login +
+ } +
+@RenderBody() +
+ © 2021-2019 + + Claunia.com + +
+ @switch(DateTime.UtcNow.DayOfYear) + { + // 24th January, Macintosh launch + case 24: + @Html.Raw("Fonts are © 2014 Robin Casady") + + break; + + // 23rd July, Amiga launch + case 204: + @Html.Raw("Fonts are © 2013 TrueSchool Ascii") + + break; + default: + @Html.Raw("Fonts are © 2015 - 2016 VileR") + + break; + } +
+ CSS © 2018-2019 + + Bootstrap + and + + Claunia.com + +
+ + + +@RenderSection("Scripts", false) + + \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Shared/_LoginPartial.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Shared/_LoginPartial.cshtml new file mode 100644 index 00000000..e4abe576 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Shared/_LoginPartial.cshtml @@ -0,0 +1,25 @@ +@using Microsoft.AspNetCore.Identity +@inject SignInManager SignInManager +@inject UserManager UserManager + \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Sscs/Consolidate.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Sscs/Consolidate.cshtml new file mode 100644 index 00000000..5c1ff90a --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Sscs/Consolidate.cshtml @@ -0,0 +1,50 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.SscModelForView + +@{ + ViewBag.Title = "Consolidate duplicate CHS"; + Layout = "_Layout"; +} +

Consolidate duplicate SSC

+
+ The following SSC have duplicates. + + + + + + + + + + @foreach(SscModel item in Model.List) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.List[0].MinBlockLength) + + @Html.DisplayNameFor(model => model.List[0].MaxBlockLength) + + @Html.DisplayNameFor(model => model.List[0].BlockSizeGranularity) +
+ @Html.DisplayFor(modelItem => item.MinBlockLength) + + @Html.DisplayFor(modelItem => item.MaxBlockLength) + + @Html.DisplayFor(modelItem => item.BlockSizeGranularity) +
+
+
+ Do you want to remove the duplicates? +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Sscs/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Sscs/Delete.cshtml new file mode 100644 index 00000000..cb5b2125 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Sscs/Delete.cshtml @@ -0,0 +1,65 @@ +@model Aaru.CommonTypes.Metadata.Ssc + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

SSC

+
+
+
+ @Html.DisplayNameFor(model => model.BlockSizeGranularity) +
+
+ @Html.DisplayFor(model => model.BlockSizeGranularity) +
+
+ @Html.DisplayNameFor(model => model.MaxBlockLength) +
+
+ @Html.DisplayFor(model => model.MaxBlockLength) +
+
+ @Html.DisplayNameFor(model => model.MinBlockLength) +
+
+ @Html.DisplayFor(model => model.MinBlockLength) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Sscs/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Sscs/Index.cshtml new file mode 100644 index 00000000..80ba5fb9 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Sscs/Index.cshtml @@ -0,0 +1,75 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} + +

SSCs

+ + + + + + + + + + + @foreach(Ssc item in Model) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.MinBlockLength) + + @Html.DisplayNameFor(model => model.MaxBlockLength) + + @Html.DisplayNameFor(model => model.BlockSizeGranularity) +
+ @Html.DisplayFor(modelItem => item.MinBlockLength) + + @Html.DisplayFor(modelItem => item.MaxBlockLength) + + @Html.DisplayFor(modelItem => item.BlockSizeGranularity) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Delete.cshtml new file mode 100644 index 00000000..6f5eea27 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Delete.cshtml @@ -0,0 +1,119 @@ +@model Aaru.CommonTypes.Metadata.SupportedDensity + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Supported density

+
+
+
+ @Html.DisplayNameFor(model => model.PrimaryCode) +
+
+ @Html.DisplayFor(model => model.PrimaryCode) +
+
+ @Html.DisplayNameFor(model => model.SecondaryCode) +
+
+ @Html.DisplayFor(model => model.SecondaryCode) +
+
+ @Html.DisplayNameFor(model => model.Writable) +
+
+ @Html.DisplayFor(model => model.Writable) +
+
+ @Html.DisplayNameFor(model => model.Duplicate) +
+
+ @Html.DisplayFor(model => model.Duplicate) +
+
+ @Html.DisplayNameFor(model => model.DefaultDensity) +
+
+ @Html.DisplayFor(model => model.DefaultDensity) +
+
+ @Html.DisplayNameFor(model => model.BitsPerMm) +
+
+ @Html.DisplayFor(model => model.BitsPerMm) +
+
+ @Html.DisplayNameFor(model => model.Width) +
+
+ @Html.DisplayFor(model => model.Width) +
+
+ @Html.DisplayNameFor(model => model.Tracks) +
+
+ @Html.DisplayFor(model => model.Tracks) +
+
+ @Html.DisplayNameFor(model => model.Capacity) +
+
+ @Html.DisplayFor(model => model.Capacity) +
+
+ @Html.DisplayNameFor(model => model.Organization) +
+
+ @Html.DisplayFor(model => model.Organization) +
+
+ @Html.DisplayNameFor(model => model.Name) +
+
+ @Html.DisplayFor(model => model.Name) +
+
+ @Html.DisplayNameFor(model => model.Description) +
+
+ @Html.DisplayFor(model => model.Description) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Index.cshtml new file mode 100644 index 00000000..8b69ff06 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/SupportedDensities/Index.cshtml @@ -0,0 +1,126 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Supported densities

+ + + + + + + + + + + + + + + + + + + + @foreach(SupportedDensity item in Model) + { + + + + + + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Organization) + + @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Description) + + @Html.DisplayNameFor(model => model.Capacity) + + @Html.DisplayNameFor(model => model.PrimaryCode) + + @Html.DisplayNameFor(model => model.SecondaryCode) + + @Html.DisplayNameFor(model => model.BitsPerMm) + + @Html.DisplayNameFor(model => model.Width) + + @Html.DisplayNameFor(model => model.Tracks) + + @Html.DisplayNameFor(model => model.DefaultDensity) + + @Html.DisplayNameFor(model => model.Writable) + + @Html.DisplayNameFor(model => model.Duplicate) +
+ @Html.DisplayFor(modelItem => item.Organization) + + @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Description) + + @Html.DisplayFor(modelItem => item.Capacity) + + @Html.DisplayFor(modelItem => item.PrimaryCode) + + @Html.DisplayFor(modelItem => item.SecondaryCode) + + @Html.DisplayFor(modelItem => item.BitsPerMm) + + @Html.DisplayFor(modelItem => item.Width) + + @Html.DisplayFor(modelItem => item.Tracks) + + @Html.DisplayFor(modelItem => item.DefaultDensity) + + @Html.DisplayFor(modelItem => item.Writable) + + @Html.DisplayFor(modelItem => item.Duplicate) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Delete.cshtml new file mode 100644 index 00000000..0738a523 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Delete.cshtml @@ -0,0 +1,1507 @@ +@model Aaru.CommonTypes.Metadata.TestedMedia + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Tested media

+
+
+
+ @Html.DisplayNameFor(model => model.IdentifyData) +
+
+ @if(Model.IdentifyData != null) + { + @Model.IdentifyData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Blocks) +
+
+ @Html.DisplayFor(model => model.Blocks) +
+
+ @Html.DisplayNameFor(model => model.BlockSize) +
+
+ @Html.DisplayFor(model => model.BlockSize) +
+
+ @Html.DisplayNameFor(model => model.CanReadAACS) +
+
+ @Html.DisplayFor(model => model.CanReadAACS) +
+
+ @Html.DisplayNameFor(model => model.CanReadADIP) +
+
+ @Html.DisplayFor(model => model.CanReadADIP) +
+
+ @Html.DisplayNameFor(model => model.CanReadATIP) +
+
+ @Html.DisplayFor(model => model.CanReadATIP) +
+
+ @Html.DisplayNameFor(model => model.CanReadBCA) +
+
+ @Html.DisplayFor(model => model.CanReadBCA) +
+
+ @Html.DisplayNameFor(model => model.CanReadC2Pointers) +
+
+ @Html.DisplayFor(model => model.CanReadC2Pointers) +
+
+ @Html.DisplayNameFor(model => model.CanReadCMI) +
+
+ @Html.DisplayFor(model => model.CanReadCMI) +
+
+ @Html.DisplayNameFor(model => model.CanReadCorrectedSubchannel) +
+
+ @Html.DisplayFor(model => model.CanReadCorrectedSubchannel) +
+
+ @Html.DisplayNameFor(model => model.CanReadCorrectedSubchannelWithC2) +
+
+ @Html.DisplayFor(model => model.CanReadCorrectedSubchannelWithC2) +
+
+ @Html.DisplayNameFor(model => model.CanReadDCB) +
+
+ @Html.DisplayFor(model => model.CanReadDCB) +
+
+ @Html.DisplayNameFor(model => model.CanReadDDS) +
+
+ @Html.DisplayFor(model => model.CanReadDDS) +
+
+ @Html.DisplayNameFor(model => model.CanReadDMI) +
+
+ @Html.DisplayFor(model => model.CanReadDMI) +
+
+ @Html.DisplayNameFor(model => model.CanReadDiscInformation) +
+
+ @Html.DisplayFor(model => model.CanReadDiscInformation) +
+
+ @Html.DisplayNameFor(model => model.CanReadFullTOC) +
+
+ @Html.DisplayFor(model => model.CanReadFullTOC) +
+
+ @Html.DisplayNameFor(model => model.CanReadHDCMI) +
+
+ @Html.DisplayFor(model => model.CanReadHDCMI) +
+
+ @Html.DisplayNameFor(model => model.CanReadLayerCapacity) +
+
+ @Html.DisplayFor(model => model.CanReadLayerCapacity) +
+
+ @Html.DisplayNameFor(model => model.CanReadFirstTrackPreGap) +
+
+ @Html.DisplayFor(model => model.CanReadFirstTrackPreGap) +
+
+ @Html.DisplayNameFor(model => model.CanReadLeadIn) +
+
+ @Html.DisplayFor(model => model.CanReadLeadIn) +
+
+ @Html.DisplayNameFor(model => model.CanReadLeadOut) +
+
+ @Html.DisplayFor(model => model.CanReadLeadOut) +
+
+ @Html.DisplayNameFor(model => model.CanReadMediaID) +
+
+ @Html.DisplayFor(model => model.CanReadMediaID) +
+
+ @Html.DisplayNameFor(model => model.CanReadMediaSerial) +
+
+ @Html.DisplayFor(model => model.CanReadMediaSerial) +
+
+ @Html.DisplayNameFor(model => model.CanReadPAC) +
+
+ @Html.DisplayFor(model => model.CanReadPAC) +
+
+ @Html.DisplayNameFor(model => model.CanReadPFI) +
+
+ @Html.DisplayFor(model => model.CanReadPFI) +
+
+ @Html.DisplayNameFor(model => model.CanReadPMA) +
+
+ @Html.DisplayFor(model => model.CanReadPMA) +
+
+ @Html.DisplayNameFor(model => model.CanReadPQSubchannel) +
+
+ @Html.DisplayFor(model => model.CanReadPQSubchannel) +
+
+ @Html.DisplayNameFor(model => model.CanReadPQSubchannelWithC2) +
+
+ @Html.DisplayFor(model => model.CanReadPQSubchannelWithC2) +
+
+ @Html.DisplayNameFor(model => model.CanReadPRI) +
+
+ @Html.DisplayFor(model => model.CanReadPRI) +
+
+ @Html.DisplayNameFor(model => model.CanReadRWSubchannel) +
+
+ @Html.DisplayFor(model => model.CanReadRWSubchannel) +
+
+ @Html.DisplayNameFor(model => model.CanReadRWSubchannelWithC2) +
+
+ @Html.DisplayFor(model => model.CanReadRWSubchannelWithC2) +
+
+ @Html.DisplayNameFor(model => model.CanReadRecordablePFI) +
+
+ @Html.DisplayFor(model => model.CanReadRecordablePFI) +
+
+ @Html.DisplayNameFor(model => model.CanReadSpareAreaInformation) +
+
+ @Html.DisplayFor(model => model.CanReadSpareAreaInformation) +
+
+ @Html.DisplayNameFor(model => model.CanReadTOC) +
+
+ @Html.DisplayFor(model => model.CanReadTOC) +
+
+ @Html.DisplayNameFor(model => model.Density) +
+
+ @if(Model.Density is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.Density) + } +
+
+ @Html.DisplayNameFor(model => model.LongBlockSize) +
+
+ @Html.DisplayFor(model => model.LongBlockSize) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.MediaIsRecognized) +
+
+ @Html.DisplayFor(model => model.MediaIsRecognized) +
+
+ @Html.DisplayNameFor(model => model.MediumType) +
+
+ @if(Model.MediumType is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.MediumType) + } +
+
+ @Html.DisplayNameFor(model => model.MediumTypeName) +
+
+ @Html.DisplayFor(model => model.MediumTypeName) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+ @Html.DisplayNameFor(model => model.SupportsHLDTSTReadRawDVD) +
+
+ @Html.DisplayFor(model => model.SupportsHLDTSTReadRawDVD) +
+
+ @Html.DisplayNameFor(model => model.SupportsLiteOnReadRawDVD) +
+
+ @Html.DisplayFor(model => model.SupportsLiteOnReadRawDVD) +
+
+ @Html.DisplayNameFor(model => model.SupportsNECReadCDDA) +
+
+ @Html.DisplayFor(model => model.SupportsNECReadCDDA) +
+
+ @Html.DisplayNameFor(model => model.SupportsPioneerReadCDDA) +
+
+ @Html.DisplayFor(model => model.SupportsPioneerReadCDDA) +
+
+ @Html.DisplayNameFor(model => model.SupportsPioneerReadCDDAMSF) +
+
+ @Html.DisplayFor(model => model.SupportsPioneerReadCDDAMSF) +
+
+ @Html.DisplayNameFor(model => model.SupportsPlextorReadCDDA) +
+
+ @Html.DisplayFor(model => model.SupportsPlextorReadCDDA) +
+
+ @Html.DisplayNameFor(model => model.SupportsPlextorReadRawDVD) +
+
+ @Html.DisplayFor(model => model.SupportsPlextorReadRawDVD) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead10) +
+
+ @Html.DisplayFor(model => model.SupportsRead10) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead12) +
+
+ @Html.DisplayFor(model => model.SupportsRead12) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead16) +
+
+ @Html.DisplayFor(model => model.SupportsRead16) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead6) +
+
+ @Html.DisplayFor(model => model.SupportsRead6) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCapacity16) +
+
+ @Html.DisplayFor(model => model.SupportsReadCapacity16) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCapacity) +
+
+ @Html.DisplayFor(model => model.SupportsReadCapacity) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCd) +
+
+ @Html.DisplayFor(model => model.SupportsReadCd) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCdMsf) +
+
+ @Html.DisplayFor(model => model.SupportsReadCdMsf) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCdRaw) +
+
+ @Html.DisplayFor(model => model.SupportsReadCdRaw) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCdMsfRaw) +
+
+ @Html.DisplayFor(model => model.SupportsReadCdMsfRaw) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLong16) +
+
+ @Html.DisplayFor(model => model.SupportsReadLong16) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLong) +
+
+ @Html.DisplayFor(model => model.SupportsReadLong) +
+
+ @Html.DisplayNameFor(model => model.ModeSense6Data) +
+
+ @if(Model.ModeSense6Data != null) + { + @Model.ModeSense6Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ModeSense10Data) +
+
+ @if(Model.ModeSense10Data != null) + { + @Model.ModeSense10Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.LBASectors) +
+
+ @Html.DisplayFor(model => model.LBASectors) +
+
+ @Html.DisplayNameFor(model => model.LBA48Sectors) +
+
+ @Html.DisplayFor(model => model.LBA48Sectors) +
+
+ @Html.DisplayNameFor(model => model.LogicalAlignment) +
+
+ @Html.DisplayFor(model => model.LogicalAlignment) +
+
+ @Html.DisplayNameFor(model => model.NominalRotationRate) +
+
+ @Html.DisplayFor(model => model.NominalRotationRate) +
+
+ @Html.DisplayNameFor(model => model.PhysicalBlockSize) +
+
+ @Html.DisplayFor(model => model.PhysicalBlockSize) +
+
+ @Html.DisplayNameFor(model => model.SolidStateDevice) +
+
+ @Html.DisplayFor(model => model.SolidStateDevice) +
+
+ @Html.DisplayNameFor(model => model.UnformattedBPT) +
+
+ @if(Model.UnformattedBPT is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.UnformattedBPT) + } +
+
+ @Html.DisplayNameFor(model => model.UnformattedBPS) +
+
+ @if(Model.UnformattedBPS is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.UnformattedBPS) + } +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaRetryLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaRetryLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadRetryLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadRetryLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLongLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadLongLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLongRetryLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadLongRetryLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsSeekLba) +
+
+ @Html.DisplayFor(model => model.SupportsSeekLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaLba48) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaLba48) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLba48) +
+
+ @Html.DisplayFor(model => model.SupportsReadLba48) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDma) +
+
+ @Html.DisplayFor(model => model.SupportsReadDma) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaRetry) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaRetry) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadRetry) +
+
+ @Html.DisplayFor(model => model.SupportsReadRetry) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadSectors) +
+
+ @Html.DisplayFor(model => model.SupportsReadSectors) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLongRetry) +
+
+ @Html.DisplayFor(model => model.SupportsReadLongRetry) +
+
+ @Html.DisplayNameFor(model => model.SupportsSeek) +
+
+ @Html.DisplayFor(model => model.SupportsSeek) +
+
+ @Html.DisplayNameFor(model => model.CanReadingIntersessionLeadIn) +
+
+ @Html.DisplayFor(model => model.CanReadingIntersessionLeadIn) +
+
+ @Html.DisplayNameFor(model => model.CanReadingIntersessionLeadOut) +
+
+ @Html.DisplayFor(model => model.CanReadingIntersessionLeadOut) +
+
+ @Html.DisplayNameFor(model => model.IntersessionLeadInData) +
+
+ @if(Model.IntersessionLeadInData != null) + { + @Model.IntersessionLeadInData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.IntersessionLeadOutData) +
+
+ @if(Model.IntersessionLeadOutData != null) + { + @Model.IntersessionLeadOutData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read6Data) +
+
+ @if(Model.Read6Data != null) + { + @Model.Read6Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read10Data) +
+
+ @if(Model.Read10Data != null) + { + @Model.Read10Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read12Data) +
+
+ @if(Model.Read12Data != null) + { + @Model.Read12Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read16Data) +
+
+ @if(Model.Read16Data != null) + { + @Model.Read16Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLong10Data) +
+
+ @if(Model.ReadLong10Data != null) + { + @Model.ReadLong10Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLong16Data) +
+
+ @if(Model.ReadLong16Data != null) + { + @Model.ReadLong16Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadSectorsData) +
+
+ @if(Model.ReadSectorsData != null) + { + @Model.ReadSectorsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadSectorsRetryData) +
+
+ @if(Model.ReadSectorsRetryData != null) + { + @Model.ReadSectorsRetryData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaData) +
+
+ @if(Model.ReadDmaData != null) + { + @Model.ReadDmaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaRetryData) +
+
+ @if(Model.ReadDmaRetryData != null) + { + @Model.ReadDmaRetryData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLbaData) +
+
+ @if(Model.ReadLbaData != null) + { + @Model.ReadLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadRetryLbaData) +
+
+ @if(Model.ReadRetryLbaData != null) + { + @Model.ReadRetryLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaLbaData) +
+
+ @if(Model.ReadDmaLbaData != null) + { + @Model.ReadDmaLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaRetryLbaData) +
+
+ @if(Model.ReadDmaRetryLbaData != null) + { + @Model.ReadDmaRetryLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLba48Data) +
+
+ @if(Model.ReadLba48Data != null) + { + @Model.ReadLba48Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaLba48Data) +
+
+ @if(Model.ReadDmaLba48Data != null) + { + @Model.ReadDmaLba48Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongData) +
+
+ @if(Model.ReadLongData != null) + { + @Model.ReadLongData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongRetryData) +
+
+ @if(Model.ReadLongRetryData != null) + { + @Model.ReadLongRetryData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongLbaData) +
+
+ @if(Model.ReadLongLbaData != null) + { + @Model.ReadLongLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongRetryLbaData) +
+
+ @if(Model.ReadLongRetryLbaData != null) + { + @Model.ReadLongRetryLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.TocData) +
+
+ @if(Model.TocData != null) + { + @Model.TocData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.FullTocData) +
+
+ @if(Model.FullTocData != null) + { + @Model.FullTocData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.AtipData) +
+
+ @if(Model.AtipData != null) + { + @Model.AtipData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PmaData) +
+
+ @if(Model.PmaData != null) + { + @Model.PmaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdData) +
+
+ @if(Model.ReadCdData != null) + { + @Model.ReadCdData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdMsfData) +
+
+ @if(Model.ReadCdMsfData != null) + { + @Model.ReadCdMsfData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdFullData) +
+
+ @if(Model.ReadCdFullData != null) + { + @Model.ReadCdFullData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdMsfFullData) +
+
+ @if(Model.ReadCdMsfFullData != null) + { + @Model.ReadCdMsfFullData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Track1PregapData) +
+
+ @if(Model.Track1PregapData != null) + { + @Model.Track1PregapData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.LeadInData) +
+
+ @if(Model.LeadInData != null) + { + @Model.LeadInData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.LeadOutData) +
+
+ @if(Model.LeadOutData != null) + { + @Model.LeadOutData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.C2PointersData) +
+
+ @if(Model.C2PointersData != null) + { + @Model.C2PointersData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PQSubchannelData) +
+
+ @if(Model.PQSubchannelData != null) + { + @Model.PQSubchannelData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.RWSubchannelData) +
+
+ @if(Model.RWSubchannelData != null) + { + @Model.RWSubchannelData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CorrectedSubchannelData) +
+
+ @if(Model.CorrectedSubchannelData != null) + { + @Model.CorrectedSubchannelData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PQSubchannelWithC2Data) +
+
+ @if(Model.PQSubchannelWithC2Data != null) + { + @Model.PQSubchannelWithC2Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.RWSubchannelWithC2Data) +
+
+ @if(Model.RWSubchannelWithC2Data != null) + { + @Model.RWSubchannelWithC2Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CorrectedSubchannelWithC2Data) +
+
+ @if(Model.CorrectedSubchannelWithC2Data != null) + { + @Model.CorrectedSubchannelWithC2Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PfiData) +
+
+ @if(Model.PfiData != null) + { + @Model.PfiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DmiData) +
+
+ @if(Model.DmiData != null) + { + @Model.DmiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CmiData) +
+
+ @if(Model.CmiData != null) + { + @Model.CmiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdBcaData) +
+
+ @if(Model.DvdBcaData != null) + { + @Model.DvdBcaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdAacsData) +
+
+ @if(Model.DvdAacsData != null) + { + @Model.DvdAacsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdDdsData) +
+
+ @if(Model.DvdDdsData != null) + { + @Model.DvdDdsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdSaiData) +
+
+ @if(Model.DvdSaiData != null) + { + @Model.DvdSaiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PriData) +
+
+ @if(Model.PriData != null) + { + @Model.PriData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.EmbossedPfiData) +
+
+ @if(Model.EmbossedPfiData != null) + { + @Model.EmbossedPfiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.AdipData) +
+
+ @if(Model.AdipData != null) + { + @Model.AdipData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DcbData) +
+
+ @if(Model.DcbData != null) + { + @Model.DcbData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.HdCmiData) +
+
+ @if(Model.HdCmiData != null) + { + @Model.HdCmiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdLayerData) +
+
+ @if(Model.DvdLayerData != null) + { + @Model.DvdLayerData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluBcaData) +
+
+ @if(Model.BluBcaData != null) + { + @Model.BluBcaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluDdsData) +
+
+ @if(Model.BluDdsData != null) + { + @Model.BluDdsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluSaiData) +
+
+ @if(Model.BluSaiData != null) + { + @Model.BluSaiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluDiData) +
+
+ @if(Model.BluDiData != null) + { + @Model.BluDiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluPacData) +
+
+ @if(Model.PlextorReadCddaData != null) + { + @Model.PlextorReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PlextorReadCddaData) +
+
+ @if(Model.PlextorReadCddaData != null) + { + @Model.PlextorReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PioneerReadCddaData) +
+
+ @if(Model.PioneerReadCddaData != null) + { + @Model.PioneerReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PioneerReadCddaMsfData) +
+
+ @if(Model.PioneerReadCddaMsfData != null) + { + @Model.PioneerReadCddaMsfData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.NecReadCddaData) +
+
+ @if(Model.NecReadCddaData != null) + { + @Model.NecReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PlextorReadRawDVDData) +
+
+ @if(Model.PlextorReadRawDVDData != null) + { + @Model.PlextorReadRawDVDData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.HLDTSTReadRawDVDData) +
+
+ @if(Model.HLDTSTReadRawDVDData != null) + { + @Model.HLDTSTReadRawDVDData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CanReadCdScrambled) +
+
+ @Html.DisplayFor(model => model.CanReadCdScrambled) +
+
+ @Html.DisplayNameFor(model => model.ReadCdScrambledData) +
+
+ @if(Model.ReadCdScrambledData != null) + { + @Model.ReadCdScrambledData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CanReadF1_06) +
+
+ @Html.DisplayFor(model => model.CanReadF1_06) +
+
+ @Html.DisplayNameFor(model => model.ReadF1_06Data) +
+
+ @if(Model.ReadF1_06Data != null) + { + @Model.ReadF1_06Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CanReadF1_06LeadOut) +
+
+ @Html.DisplayFor(model => model.CanReadF1_06LeadOut) +
+
+ @Html.DisplayNameFor(model => model.ReadF1_06LeadOutData) +
+
+ @if(Model.ReadF1_06LeadOutData != null) + { + @Model.ReadF1_06Data.Length bytes + } + else + { + @("") + } +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Details.cshtml new file mode 100644 index 00000000..7f63176e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Details.cshtml @@ -0,0 +1,1505 @@ +@model Aaru.CommonTypes.Metadata.TestedMedia + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

Tested media

+
+
+
+ @Html.DisplayNameFor(model => model.IdentifyData) +
+
+ @if(Model.IdentifyData != null) + { + @Model.IdentifyData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Blocks) +
+
+ @Html.DisplayFor(model => model.Blocks) +
+
+ @Html.DisplayNameFor(model => model.BlockSize) +
+
+ @Html.DisplayFor(model => model.BlockSize) +
+
+ @Html.DisplayNameFor(model => model.CanReadAACS) +
+
+ @Html.DisplayFor(model => model.CanReadAACS) +
+
+ @Html.DisplayNameFor(model => model.CanReadADIP) +
+
+ @Html.DisplayFor(model => model.CanReadADIP) +
+
+ @Html.DisplayNameFor(model => model.CanReadATIP) +
+
+ @Html.DisplayFor(model => model.CanReadATIP) +
+
+ @Html.DisplayNameFor(model => model.CanReadBCA) +
+
+ @Html.DisplayFor(model => model.CanReadBCA) +
+
+ @Html.DisplayNameFor(model => model.CanReadC2Pointers) +
+
+ @Html.DisplayFor(model => model.CanReadC2Pointers) +
+
+ @Html.DisplayNameFor(model => model.CanReadCMI) +
+
+ @Html.DisplayFor(model => model.CanReadCMI) +
+
+ @Html.DisplayNameFor(model => model.CanReadCorrectedSubchannel) +
+
+ @Html.DisplayFor(model => model.CanReadCorrectedSubchannel) +
+
+ @Html.DisplayNameFor(model => model.CanReadCorrectedSubchannelWithC2) +
+
+ @Html.DisplayFor(model => model.CanReadCorrectedSubchannelWithC2) +
+
+ @Html.DisplayNameFor(model => model.CanReadDCB) +
+
+ @Html.DisplayFor(model => model.CanReadDCB) +
+
+ @Html.DisplayNameFor(model => model.CanReadDDS) +
+
+ @Html.DisplayFor(model => model.CanReadDDS) +
+
+ @Html.DisplayNameFor(model => model.CanReadDMI) +
+
+ @Html.DisplayFor(model => model.CanReadDMI) +
+
+ @Html.DisplayNameFor(model => model.CanReadDiscInformation) +
+
+ @Html.DisplayFor(model => model.CanReadDiscInformation) +
+
+ @Html.DisplayNameFor(model => model.CanReadFullTOC) +
+
+ @Html.DisplayFor(model => model.CanReadFullTOC) +
+
+ @Html.DisplayNameFor(model => model.CanReadHDCMI) +
+
+ @Html.DisplayFor(model => model.CanReadHDCMI) +
+
+ @Html.DisplayNameFor(model => model.CanReadLayerCapacity) +
+
+ @Html.DisplayFor(model => model.CanReadLayerCapacity) +
+
+ @Html.DisplayNameFor(model => model.CanReadFirstTrackPreGap) +
+
+ @Html.DisplayFor(model => model.CanReadFirstTrackPreGap) +
+
+ @Html.DisplayNameFor(model => model.CanReadLeadIn) +
+
+ @Html.DisplayFor(model => model.CanReadLeadIn) +
+
+ @Html.DisplayNameFor(model => model.CanReadLeadOut) +
+
+ @Html.DisplayFor(model => model.CanReadLeadOut) +
+
+ @Html.DisplayNameFor(model => model.CanReadMediaID) +
+
+ @Html.DisplayFor(model => model.CanReadMediaID) +
+
+ @Html.DisplayNameFor(model => model.CanReadMediaSerial) +
+
+ @Html.DisplayFor(model => model.CanReadMediaSerial) +
+
+ @Html.DisplayNameFor(model => model.CanReadPAC) +
+
+ @Html.DisplayFor(model => model.CanReadPAC) +
+
+ @Html.DisplayNameFor(model => model.CanReadPFI) +
+
+ @Html.DisplayFor(model => model.CanReadPFI) +
+
+ @Html.DisplayNameFor(model => model.CanReadPMA) +
+
+ @Html.DisplayFor(model => model.CanReadPMA) +
+
+ @Html.DisplayNameFor(model => model.CanReadPQSubchannel) +
+
+ @Html.DisplayFor(model => model.CanReadPQSubchannel) +
+
+ @Html.DisplayNameFor(model => model.CanReadPQSubchannelWithC2) +
+
+ @Html.DisplayFor(model => model.CanReadPQSubchannelWithC2) +
+
+ @Html.DisplayNameFor(model => model.CanReadPRI) +
+
+ @Html.DisplayFor(model => model.CanReadPRI) +
+
+ @Html.DisplayNameFor(model => model.CanReadRWSubchannel) +
+
+ @Html.DisplayFor(model => model.CanReadRWSubchannel) +
+
+ @Html.DisplayNameFor(model => model.CanReadRWSubchannelWithC2) +
+
+ @Html.DisplayFor(model => model.CanReadRWSubchannelWithC2) +
+
+ @Html.DisplayNameFor(model => model.CanReadRecordablePFI) +
+
+ @Html.DisplayFor(model => model.CanReadRecordablePFI) +
+
+ @Html.DisplayNameFor(model => model.CanReadSpareAreaInformation) +
+
+ @Html.DisplayFor(model => model.CanReadSpareAreaInformation) +
+
+ @Html.DisplayNameFor(model => model.CanReadTOC) +
+
+ @Html.DisplayFor(model => model.CanReadTOC) +
+
+ @Html.DisplayNameFor(model => model.Density) +
+
+ @if(Model.Density is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.Density) + } +
+
+ @Html.DisplayNameFor(model => model.LongBlockSize) +
+
+ @Html.DisplayFor(model => model.LongBlockSize) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.MediaIsRecognized) +
+
+ @Html.DisplayFor(model => model.MediaIsRecognized) +
+
+ @Html.DisplayNameFor(model => model.MediumType) +
+
+ @if(Model.MediumType is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.MediumType) + } +
+
+ @Html.DisplayNameFor(model => model.MediumTypeName) +
+
+ @Html.DisplayFor(model => model.MediumTypeName) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+ @Html.DisplayNameFor(model => model.SupportsHLDTSTReadRawDVD) +
+
+ @Html.DisplayFor(model => model.SupportsHLDTSTReadRawDVD) +
+
+ @Html.DisplayNameFor(model => model.SupportsLiteOnReadRawDVD) +
+
+ @Html.DisplayFor(model => model.SupportsLiteOnReadRawDVD) +
+
+ @Html.DisplayNameFor(model => model.SupportsNECReadCDDA) +
+
+ @Html.DisplayFor(model => model.SupportsNECReadCDDA) +
+
+ @Html.DisplayNameFor(model => model.SupportsPioneerReadCDDA) +
+
+ @Html.DisplayFor(model => model.SupportsPioneerReadCDDA) +
+
+ @Html.DisplayNameFor(model => model.SupportsPioneerReadCDDAMSF) +
+
+ @Html.DisplayFor(model => model.SupportsPioneerReadCDDAMSF) +
+
+ @Html.DisplayNameFor(model => model.SupportsPlextorReadCDDA) +
+
+ @Html.DisplayFor(model => model.SupportsPlextorReadCDDA) +
+
+ @Html.DisplayNameFor(model => model.SupportsPlextorReadRawDVD) +
+
+ @Html.DisplayFor(model => model.SupportsPlextorReadRawDVD) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead10) +
+
+ @Html.DisplayFor(model => model.SupportsRead10) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead12) +
+
+ @Html.DisplayFor(model => model.SupportsRead12) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead16) +
+
+ @Html.DisplayFor(model => model.SupportsRead16) +
+
+ @Html.DisplayNameFor(model => model.SupportsRead6) +
+
+ @Html.DisplayFor(model => model.SupportsRead6) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCapacity16) +
+
+ @Html.DisplayFor(model => model.SupportsReadCapacity16) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCapacity) +
+
+ @Html.DisplayFor(model => model.SupportsReadCapacity) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCd) +
+
+ @Html.DisplayFor(model => model.SupportsReadCd) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCdMsf) +
+
+ @Html.DisplayFor(model => model.SupportsReadCdMsf) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCdRaw) +
+
+ @Html.DisplayFor(model => model.SupportsReadCdRaw) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadCdMsfRaw) +
+
+ @Html.DisplayFor(model => model.SupportsReadCdMsfRaw) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLong16) +
+
+ @Html.DisplayFor(model => model.SupportsReadLong16) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLong) +
+
+ @Html.DisplayFor(model => model.SupportsReadLong) +
+
+ @Html.DisplayNameFor(model => model.ModeSense6Data) +
+
+ @if(Model.ModeSense6Data != null) + { + @Model.ModeSense6Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ModeSense10Data) +
+
+ @if(Model.ModeSense10Data != null) + { + @Model.ModeSense10Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.LBASectors) +
+
+ @Html.DisplayFor(model => model.LBASectors) +
+
+ @Html.DisplayNameFor(model => model.LBA48Sectors) +
+
+ @Html.DisplayFor(model => model.LBA48Sectors) +
+
+ @Html.DisplayNameFor(model => model.LogicalAlignment) +
+
+ @Html.DisplayFor(model => model.LogicalAlignment) +
+
+ @Html.DisplayNameFor(model => model.NominalRotationRate) +
+
+ @Html.DisplayFor(model => model.NominalRotationRate) +
+
+ @Html.DisplayNameFor(model => model.PhysicalBlockSize) +
+
+ @Html.DisplayFor(model => model.PhysicalBlockSize) +
+
+ @Html.DisplayNameFor(model => model.SolidStateDevice) +
+
+ @Html.DisplayFor(model => model.SolidStateDevice) +
+
+ @Html.DisplayNameFor(model => model.UnformattedBPT) +
+
+ @if(Model.UnformattedBPT is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.UnformattedBPT) + } +
+
+ @Html.DisplayNameFor(model => model.UnformattedBPS) +
+
+ @if(Model.UnformattedBPS is null) + { + @("") + } + else + { + @Html.DisplayFor(model => model.UnformattedBPS) + } +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaRetryLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaRetryLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadRetryLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadRetryLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLongLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadLongLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLongRetryLba) +
+
+ @Html.DisplayFor(model => model.SupportsReadLongRetryLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsSeekLba) +
+
+ @Html.DisplayFor(model => model.SupportsSeekLba) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaLba48) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaLba48) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLba48) +
+
+ @Html.DisplayFor(model => model.SupportsReadLba48) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDma) +
+
+ @Html.DisplayFor(model => model.SupportsReadDma) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadDmaRetry) +
+
+ @Html.DisplayFor(model => model.SupportsReadDmaRetry) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadRetry) +
+
+ @Html.DisplayFor(model => model.SupportsReadRetry) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadSectors) +
+
+ @Html.DisplayFor(model => model.SupportsReadSectors) +
+
+ @Html.DisplayNameFor(model => model.SupportsReadLongRetry) +
+
+ @Html.DisplayFor(model => model.SupportsReadLongRetry) +
+
+ @Html.DisplayNameFor(model => model.SupportsSeek) +
+
+ @Html.DisplayFor(model => model.SupportsSeek) +
+
+ @Html.DisplayNameFor(model => model.CanReadingIntersessionLeadIn) +
+
+ @Html.DisplayFor(model => model.CanReadingIntersessionLeadIn) +
+
+ @Html.DisplayNameFor(model => model.CanReadingIntersessionLeadOut) +
+
+ @Html.DisplayFor(model => model.CanReadingIntersessionLeadOut) +
+
+ @Html.DisplayNameFor(model => model.IntersessionLeadInData) +
+
+ @if(Model.IntersessionLeadInData != null) + { + @Model.IntersessionLeadInData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.IntersessionLeadOutData) +
+
+ @if(Model.IntersessionLeadOutData != null) + { + @Model.IntersessionLeadOutData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read6Data) +
+
+ @if(Model.Read6Data != null) + { + @Model.Read6Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read10Data) +
+
+ @if(Model.Read10Data != null) + { + @Model.Read10Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read12Data) +
+
+ @if(Model.Read12Data != null) + { + @Model.Read12Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Read16Data) +
+
+ @if(Model.Read16Data != null) + { + @Model.Read16Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLong10Data) +
+
+ @if(Model.ReadLong10Data != null) + { + @Model.ReadLong10Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLong16Data) +
+
+ @if(Model.ReadLong16Data != null) + { + @Model.ReadLong16Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadSectorsData) +
+
+ @if(Model.ReadSectorsData != null) + { + @Model.ReadSectorsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadSectorsRetryData) +
+
+ @if(Model.ReadSectorsRetryData != null) + { + @Model.ReadSectorsRetryData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaData) +
+
+ @if(Model.ReadDmaData != null) + { + @Model.ReadDmaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaRetryData) +
+
+ @if(Model.ReadDmaRetryData != null) + { + @Model.ReadDmaRetryData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLbaData) +
+
+ @if(Model.ReadLbaData != null) + { + @Model.ReadLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadRetryLbaData) +
+
+ @if(Model.ReadRetryLbaData != null) + { + @Model.ReadRetryLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaLbaData) +
+
+ @if(Model.ReadDmaLbaData != null) + { + @Model.ReadDmaLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaRetryLbaData) +
+
+ @if(Model.ReadDmaRetryLbaData != null) + { + @Model.ReadDmaRetryLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLba48Data) +
+
+ @if(Model.ReadLba48Data != null) + { + @Model.ReadLba48Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadDmaLba48Data) +
+
+ @if(Model.ReadDmaLba48Data != null) + { + @Model.ReadDmaLba48Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongData) +
+
+ @if(Model.ReadLongData != null) + { + @Model.ReadLongData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongRetryData) +
+
+ @if(Model.ReadLongRetryData != null) + { + @Model.ReadLongRetryData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongLbaData) +
+
+ @if(Model.ReadLongLbaData != null) + { + @Model.ReadLongLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadLongRetryLbaData) +
+
+ @if(Model.ReadLongRetryLbaData != null) + { + @Model.ReadLongRetryLbaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.TocData) +
+
+ @if(Model.TocData != null) + { + @Model.TocData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.FullTocData) +
+
+ @if(Model.FullTocData != null) + { + @Model.FullTocData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.AtipData) +
+
+ @if(Model.AtipData != null) + { + @Model.AtipData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PmaData) +
+
+ @if(Model.PmaData != null) + { + @Model.PmaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdData) +
+
+ @if(Model.ReadCdData != null) + { + @Model.ReadCdData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdMsfData) +
+
+ @if(Model.ReadCdMsfData != null) + { + @Model.ReadCdMsfData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdFullData) +
+
+ @if(Model.ReadCdFullData != null) + { + @Model.ReadCdFullData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.ReadCdMsfFullData) +
+
+ @if(Model.ReadCdMsfFullData != null) + { + @Model.ReadCdMsfFullData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.Track1PregapData) +
+
+ @if(Model.Track1PregapData != null) + { + @Model.Track1PregapData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.LeadInData) +
+
+ @if(Model.LeadInData != null) + { + @Model.LeadInData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.LeadOutData) +
+
+ @if(Model.LeadOutData != null) + { + @Model.LeadOutData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.C2PointersData) +
+
+ @if(Model.C2PointersData != null) + { + @Model.C2PointersData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PQSubchannelData) +
+
+ @if(Model.PQSubchannelData != null) + { + @Model.PQSubchannelData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.RWSubchannelData) +
+
+ @if(Model.RWSubchannelData != null) + { + @Model.RWSubchannelData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CorrectedSubchannelData) +
+
+ @if(Model.CorrectedSubchannelData != null) + { + @Model.CorrectedSubchannelData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PQSubchannelWithC2Data) +
+
+ @if(Model.PQSubchannelWithC2Data != null) + { + @Model.PQSubchannelWithC2Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.RWSubchannelWithC2Data) +
+
+ @if(Model.RWSubchannelWithC2Data != null) + { + @Model.RWSubchannelWithC2Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CorrectedSubchannelWithC2Data) +
+
+ @if(Model.CorrectedSubchannelWithC2Data != null) + { + @Model.CorrectedSubchannelWithC2Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PfiData) +
+
+ @if(Model.PfiData != null) + { + @Model.PfiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DmiData) +
+
+ @if(Model.DmiData != null) + { + @Model.DmiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CmiData) +
+
+ @if(Model.CmiData != null) + { + @Model.CmiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdBcaData) +
+
+ @if(Model.DvdBcaData != null) + { + @Model.DvdBcaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdAacsData) +
+
+ @if(Model.DvdAacsData != null) + { + @Model.DvdAacsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdDdsData) +
+
+ @if(Model.DvdDdsData != null) + { + @Model.DvdDdsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdSaiData) +
+
+ @if(Model.DvdSaiData != null) + { + @Model.DvdSaiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PriData) +
+
+ @if(Model.PriData != null) + { + @Model.PriData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.EmbossedPfiData) +
+
+ @if(Model.EmbossedPfiData != null) + { + @Model.EmbossedPfiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.AdipData) +
+
+ @if(Model.AdipData != null) + { + @Model.AdipData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DcbData) +
+
+ @if(Model.DcbData != null) + { + @Model.DcbData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.HdCmiData) +
+
+ @if(Model.HdCmiData != null) + { + @Model.HdCmiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.DvdLayerData) +
+
+ @if(Model.DvdLayerData != null) + { + @Model.DvdLayerData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluBcaData) +
+
+ @if(Model.BluBcaData != null) + { + @Model.BluBcaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluDdsData) +
+
+ @if(Model.BluDdsData != null) + { + @Model.BluDdsData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluSaiData) +
+
+ @if(Model.BluSaiData != null) + { + @Model.BluSaiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluDiData) +
+
+ @if(Model.BluDiData != null) + { + @Model.BluDiData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.BluPacData) +
+
+ @if(Model.PlextorReadCddaData != null) + { + @Model.PlextorReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PlextorReadCddaData) +
+
+ @if(Model.PlextorReadCddaData != null) + { + @Model.PlextorReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PioneerReadCddaData) +
+
+ @if(Model.PioneerReadCddaData != null) + { + @Model.PioneerReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PioneerReadCddaMsfData) +
+
+ @if(Model.PioneerReadCddaMsfData != null) + { + @Model.PioneerReadCddaMsfData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.NecReadCddaData) +
+
+ @if(Model.NecReadCddaData != null) + { + @Model.NecReadCddaData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.PlextorReadRawDVDData) +
+
+ @if(Model.PlextorReadRawDVDData != null) + { + @Model.PlextorReadRawDVDData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.HLDTSTReadRawDVDData) +
+
+ @if(Model.HLDTSTReadRawDVDData != null) + { + @Model.HLDTSTReadRawDVDData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CanReadCdScrambled) +
+
+ @Html.DisplayFor(model => model.CanReadCdScrambled) +
+
+ @Html.DisplayNameFor(model => model.ReadCdScrambledData) +
+
+ @if(Model.ReadCdScrambledData != null) + { + @Model.ReadCdScrambledData.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CanReadF1_06) +
+
+ @Html.DisplayFor(model => model.CanReadF1_06) +
+
+ @Html.DisplayNameFor(model => model.ReadF1_06Data) +
+
+ @if(Model.ReadF1_06Data != null) + { + @Model.ReadF1_06Data.Length bytes + } + else + { + @("") + } +
+
+ @Html.DisplayNameFor(model => model.CanReadF1_06LeadOut) +
+
+ @Html.DisplayFor(model => model.CanReadF1_06LeadOut) +
+
+ @Html.DisplayNameFor(model => model.ReadF1_06LeadOutData) +
+
+ @if(Model.ReadF1_06LeadOutData != null) + { + @Model.ReadF1_06LeadOutData.Length bytes + } + else + { + @("") + } +
+
+
+ \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Edit.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Edit.cshtml new file mode 100644 index 00000000..9368fb3e --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Edit.cshtml @@ -0,0 +1,79 @@ +@model Aaru.CommonTypes.Metadata.TestedMedia + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Edit.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Tested media

+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + Back to List +
+
+
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Index.cshtml new file mode 100644 index 00000000..de491423 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/Index.cshtml @@ -0,0 +1,98 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Tested media

+ + + + + + + + + + + + + + + @foreach(TestedMedia item in Model) + { + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Model) + + @Html.DisplayNameFor(model => model.MediumTypeName) + + @Html.DisplayNameFor(model => model.MediaIsRecognized) + + @Html.DisplayNameFor(model => model.Blocks) + + @Html.DisplayNameFor(model => model.BlockSize) + + @Html.DisplayNameFor(model => model.LongBlockSize) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.MediumTypeName) + + @Html.DisplayFor(modelItem => item.MediaIsRecognized) + + @Html.DisplayFor(modelItem => item.Blocks) + + @Html.DisplayFor(modelItem => item.BlockSize) + + @Html.DisplayFor(modelItem => item.LongBlockSize) + + Details + Edit + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/ViewData.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/ViewData.cshtml new file mode 100644 index 00000000..f8710f89 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedMedias/ViewData.cshtml @@ -0,0 +1,27 @@ +@model Aaru.Server.Database.Models.TestedMediaDataModel + +@{ + ViewBag.Title = $"{Model.DataName} data"; + Layout = "_Layout"; +} +

Showing data from @Model.DataName for tested media id @Model.TestedMediaId

+@if(Model.Decoded is null && Model.RawDataAsHex is null) +{ +
No data found
+} + +@if(Model.RawDataAsHex != null) +{ +

Hex dump:

+
+ @Html.Raw(Model.RawDataAsHex) +
+} + +@if(Model.Decoded != null) +{ +

Decoded information:

+
+ @Html.Raw(Model.Decoded) +
+} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Delete.cshtml new file mode 100644 index 00000000..2b99510d --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Delete.cshtml @@ -0,0 +1,89 @@ +@model Aaru.CommonTypes.Metadata.TestedSequentialMedia + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

Tested sequential media

+
+
+
+ @Html.DisplayNameFor(model => model.CanReadMediaSerial) +
+
+ @Html.DisplayFor(model => model.CanReadMediaSerial) +
+
+ @Html.DisplayNameFor(model => model.Density) +
+
+ @Html.DisplayFor(model => model.Density) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.MediaIsRecognized) +
+
+ @Html.DisplayFor(model => model.MediaIsRecognized) +
+
+ @Html.DisplayNameFor(model => model.MediumType) +
+
+ @Html.DisplayFor(model => model.MediumType) +
+
+ @Html.DisplayNameFor(model => model.MediumTypeName) +
+
+ @Html.DisplayFor(model => model.MediumTypeName) +
+
+ @Html.DisplayNameFor(model => model.Model) +
+
+ @Html.DisplayFor(model => model.Model) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Edit.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Edit.cshtml new file mode 100644 index 00000000..3d730954 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Edit.cshtml @@ -0,0 +1,64 @@ +@model Aaru.CommonTypes.Metadata.TestedSequentialMedia + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Edit.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Tested sequential media

+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + Back to List +
+
+
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Index.cshtml new file mode 100644 index 00000000..6622472b --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/TestedSequentialMedias/Index.cshtml @@ -0,0 +1,97 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Tested sequential media

+ + + + + + + + + + + + + + + @foreach(TestedSequentialMedia item in Model) + { + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Model) + + @Html.DisplayNameFor(model => model.MediumTypeName) + + @Html.DisplayNameFor(model => model.MediaIsRecognized) + + @Html.DisplayNameFor(model => model.MediumType) + + @Html.DisplayNameFor(model => model.Density) + + @Html.DisplayNameFor(model => model.CanReadMediaSerial) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Model) + + @Html.DisplayFor(modelItem => item.MediumTypeName) + + @Html.DisplayFor(modelItem => item.MediaIsRecognized) + + @Html.DisplayFor(modelItem => item.MediumType) + + @Html.DisplayFor(modelItem => item.Density) + + @Html.DisplayFor(modelItem => item.CanReadMediaSerial) + + Edit + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/UsbProducts/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/UsbProducts/Index.cshtml new file mode 100644 index 00000000..ba0ba51b --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/UsbProducts/Index.cshtml @@ -0,0 +1,77 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

USB products

+ + + + + + + + + + @foreach(UsbProductModel item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.VendorName) + + @Html.DisplayNameFor(model => model.ProductName) + + @Html.DisplayNameFor(model => model.ProductId) +
+ @Html.DisplayFor(modelItem => item.VendorName) + + @Html.DisplayFor(modelItem => item.ProductName) + + @Html.DisplayFor(modelItem => item.ProductId) +
+ +@section scripts{ + + +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Details.cshtml new file mode 100644 index 00000000..723dbfe4 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Details.cshtml @@ -0,0 +1,94 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.UsbVendorModel + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

USB vendor

+
+
+
+ @Html.DisplayNameFor(model => model.Vendor) +
+
+ @Html.DisplayFor(model => model.Vendor) +
+
+ @Html.DisplayNameFor(model => model.VendorId) +
+
+ @Html.DisplayFor(model => model.VendorId) +
+
+
+
+

Products:

+ + + + + + + + + @foreach(UsbProductModel item in Model.Products) + { + + + + + } + +
+ @Html.DisplayNameFor(model => model.Products[0].ProductName) + + @Html.DisplayNameFor(model => model.Products[0].ProductId) +
+ @Html.DisplayFor(modelItem => item.ProductName) + + @Html.DisplayFor(modelItem => item.ProductId) +
+
+ + +@section scripts{ + + +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Index.cshtml new file mode 100644 index 00000000..3f3904d0 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/UsbVendors/Index.cshtml @@ -0,0 +1,75 @@ +@using Aaru.Server.Old.Database.Models +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

USB vendors

+ + + + + + + + + + @foreach(UsbVendor item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Vendor) + + @Html.DisplayNameFor(model => model.VendorId) +
+ @Html.DisplayFor(modelItem => item.Vendor) + + @Html.DisplayFor(modelItem => item.VendorId) + + Details +
+ +@section scripts{ + + +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Usbs/Consolidate.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Consolidate.cshtml new file mode 100644 index 00000000..f4430c06 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Consolidate.cshtml @@ -0,0 +1,56 @@ +@using Aaru.Server.Old.Database.Models +@model Aaru.Server.Database.Models.UsbModelForView + +@{ + ViewBag.Title = "Consolidate duplicate USB devices"; + Layout = "_Layout"; +} +

Consolidate duplicate ATAs

+
+ The following USB devices have duplicates. + + + + + + + + + + + @foreach(UsbModel item in Model.List) + { + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.List[0].Manufacturer) + + @Html.DisplayNameFor(model => model.List[0].Product) + + @Html.DisplayNameFor(model => model.List[0].VendorID) + + @Html.DisplayNameFor(model => model.List[0].ProductID) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Product) + + @Html.DisplayFor(modelItem => item.VendorID) + + @Html.DisplayFor(modelItem => item.ProductID) +
+
+
+ Do you want to remove the duplicates? +
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Usbs/Delete.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Delete.cshtml new file mode 100644 index 00000000..e94d0cd5 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Delete.cshtml @@ -0,0 +1,83 @@ +@model Aaru.CommonTypes.Metadata.Usb + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Delete.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Are you sure you want to delete this?

+
+

USB

+
+
+
+ @Html.DisplayNameFor(model => model.VendorID) +
+
+ @Html.DisplayFor(model => model.VendorID) +
+
+ @Html.DisplayNameFor(model => model.ProductID) +
+
+ @Html.DisplayFor(model => model.ProductID) +
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Product) +
+
+ @Html.DisplayFor(model => model.Product) +
+
+ @Html.DisplayNameFor(model => model.RemovableMedia) +
+
+ @Html.DisplayFor(model => model.RemovableMedia) +
+
+ @Html.DisplayNameFor(model => model.Descriptors) +
+
+ @Html.DisplayFor(model => model.Descriptors) +
+
+
+ + Back to List + +
+
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Usbs/Details.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Details.cshtml new file mode 100644 index 00000000..6f72d76b --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Details.cshtml @@ -0,0 +1,74 @@ +@model Aaru.CommonTypes.Metadata.Usb + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Details.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+

USB

+
+
+
+ @Html.DisplayNameFor(model => model.Manufacturer) +
+
+ @Html.DisplayFor(model => model.Manufacturer) +
+
+ @Html.DisplayNameFor(model => model.Product) +
+
+ @Html.DisplayFor(model => model.Product) +
+
+ @Html.DisplayNameFor(model => model.VendorID) +
+
+ @Html.DisplayFor(model => model.VendorID) +
+
+ @Html.DisplayNameFor(model => model.ProductID) +
+
+ @Html.DisplayFor(model => model.ProductID) +
+
+ @Html.DisplayNameFor(model => model.RemovableMedia) +
+
+ @Html.DisplayFor(model => model.RemovableMedia) +
+
+
+ \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Usbs/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Index.cshtml new file mode 100644 index 00000000..b66fb98c --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Usbs/Index.cshtml @@ -0,0 +1,88 @@ +@using Aaru.CommonTypes.Metadata +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

USB devices

+ + + + + + + + + + + + + + @foreach(Usb item in Model) + { + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Manufacturer) + + @Html.DisplayNameFor(model => model.Product) + + @Html.DisplayNameFor(model => model.VendorID) + + @Html.DisplayNameFor(model => model.ProductID) + + @Html.DisplayNameFor(model => model.RemovableMedia) +
+ @Html.DisplayFor(modelItem => item.Manufacturer) + + @Html.DisplayFor(modelItem => item.Product) + + @Html.DisplayFor(modelItem => item.VendorID) + + @Html.DisplayFor(modelItem => item.ProductID) + + @Html.DisplayFor(modelItem => item.RemovableMedia) + + Details + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/Versions/Index.cshtml b/Aaru.Server.Old/Areas/Admin/Views/Versions/Index.cshtml new file mode 100644 index 00000000..7a35e819 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/Versions/Index.cshtml @@ -0,0 +1,66 @@ +@using Version = Aaru.Server.Old.Database.Models.Version +@model IEnumerable + +@{ + Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Server"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +

Aaru versions

+ + + + + + + + + + @foreach(Version item in Model) + { + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.Count) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Count) + + Delete +
\ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/_ViewImports.cshtml b/Aaru.Server.Old/Areas/Admin/Views/_ViewImports.cshtml new file mode 100644 index 00000000..6fe656ec --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@using Aaru.Server.Old +@using Microsoft.ApplicationInsights.AspNetCore +@inject JavaScriptSnippet JavaScriptSnippet +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Admin/Views/_ViewStart.cshtml b/Aaru.Server.Old/Areas/Admin/Views/_ViewStart.cshtml new file mode 100644 index 00000000..1af6e494 --- /dev/null +++ b/Aaru.Server.Old/Areas/Admin/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml b/Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml new file mode 100644 index 00000000..3e30cfa5 --- /dev/null +++ b/Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml @@ -0,0 +1,7 @@ +@page +@model RegisterModel +@{ + ViewData["Title"] = "Register"; +} +

@ViewData["Title"]

+Registration is not allowed \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml.cs b/Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml.cs new file mode 100644 index 00000000..69dcba2f --- /dev/null +++ b/Aaru.Server.Old/Areas/Identity/Pages/Account/Register.cshtml.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Aaru.Server.Old.Areas.Identity.Pages.Account; + +[AllowAnonymous] +public sealed class RegisterModel : PageModel +{ + public IActionResult OnGetAsync(string returnUrl = null) => RedirectToPage("Login"); + + public IActionResult OnPostAsync(string returnUrl = null) => RedirectToPage("Login"); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Identity/Pages/Account/_ViewImports.cshtml b/Aaru.Server.Old/Areas/Identity/Pages/Account/_ViewImports.cshtml new file mode 100644 index 00000000..dcb10026 --- /dev/null +++ b/Aaru.Server.Old/Areas/Identity/Pages/Account/_ViewImports.cshtml @@ -0,0 +1 @@ +@using Aaru.Server.Old.Areas.Identity.Pages.Account \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml b/Aaru.Server.Old/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml new file mode 100644 index 00000000..ca256c0d --- /dev/null +++ b/Aaru.Server.Old/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Identity/Pages/_ViewImports.cshtml b/Aaru.Server.Old/Areas/Identity/Pages/_ViewImports.cshtml new file mode 100644 index 00000000..63c5ef0b --- /dev/null +++ b/Aaru.Server.Old/Areas/Identity/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@using Microsoft.AspNetCore.Identity +@using Aaru.Server.Old.Areas.Identity +@using Aaru.Server.Old.Areas.Identity.Pages +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers \ No newline at end of file diff --git a/Aaru.Server.Old/Areas/Identity/Pages/_ViewStart.cshtml b/Aaru.Server.Old/Areas/Identity/Pages/_ViewStart.cshtml new file mode 100644 index 00000000..b4341452 --- /dev/null +++ b/Aaru.Server.Old/Areas/Identity/Pages/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/Aaru.Server.Old/BasicAuthMiddleware.cs b/Aaru.Server.Old/BasicAuthMiddleware.cs new file mode 100644 index 00000000..b703eba4 --- /dev/null +++ b/Aaru.Server.Old/BasicAuthMiddleware.cs @@ -0,0 +1,73 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (c) Johan Boström. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. +// ------------------------------------------------------------------------------------------------- + +using System.Net; +using System.Text; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; + +namespace Aaru.Server.Old; + +public sealed class BasicAuthMiddleware +{ + readonly RequestDelegate _next; + readonly string _realm; + + public BasicAuthMiddleware(RequestDelegate next, string realm) + { + _next = next; + _realm = realm; + } + + public async Task Invoke(HttpContext context) + { + string authHeader = context.Request.Headers["Authorization"]; + + if(authHeader?.StartsWith("Basic ") == true) + { + // Get the encoded username and password + string encodedUsernamePassword = authHeader.Split(' ', 2, StringSplitOptions.RemoveEmptyEntries)[1]?.Trim(); + + // Decode from Base64 to string + string decodedUsernamePassword = Encoding.UTF8.GetString(Convert.FromBase64String(encodedUsernamePassword)); + + // Split username and password + string username = decodedUsernamePassword.Split(':', 2)[0]; + string password = decodedUsernamePassword.Split(':', 2)[1]; + + // Check if login is correct + if(IsAuthorized(username, password)) + { + await _next.Invoke(context); + + return; + } + } + + // Return authentication type (causes browser to show login dialog) + context.Response.Headers["WWW-Authenticate"] = "Basic"; + + // Add realm if it is not null + if(!string.IsNullOrWhiteSpace(_realm)) context.Response.Headers["WWW-Authenticate"] += $" realm=\"{_realm}\""; + + // Return unauthorized + context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; + } + + // Make your own implementation of this + // Check that username and password are correct + public bool IsAuthorized(string username, string password) + { + IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); + IConfigurationRoot configuration = builder.Build(); + string validUser = configuration.GetValue("MetricsAuthentication:Username"); + string validPassword = configuration.GetValue("MetricsAuthentication:Password"); + + return !string.IsNullOrWhiteSpace(validUser) && + !string.IsNullOrWhiteSpace(validPassword) && + username.Equals(validUser, StringComparison.InvariantCultureIgnoreCase) && + password.Equals(validPassword); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Controllers/ReportController.cs b/Aaru.Server.Old/Controllers/ReportController.cs new file mode 100644 index 00000000..9480d142 --- /dev/null +++ b/Aaru.Server.Old/Controllers/ReportController.cs @@ -0,0 +1,551 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ReportController.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Fetches reports from database for Razor views. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Structs.Devices.SCSI; +using Aaru.Decoders.PCMCIA; +using Aaru.Decoders.SCSI; +using Aaru.Helpers; +using Aaru.Server.Old.Database.Models; +using Aaru.Server.Old.Core; +using Microsoft.AspNetCore.Routing; +using Ata = Aaru.CommonTypes.Metadata.Ata; +using DbContext = Aaru.Server.Old.Database.DbContext; +using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry; +using TestedMedia = Aaru.CommonTypes.Metadata.TestedMedia; +using Tuple = Aaru.Decoders.PCMCIA.Tuple; + +namespace Aaru.Server.Old.Controllers; + +public sealed class ReportController : Controller +{ + readonly DbContext _ctx; + + public ReportController(DbContext context) => _ctx = context; + + public ActionResult Index() => RedirectToAction("View", + "Report", + new RouteValueDictionary + { + { + "id", 1 + } + }); + + public ActionResult View(int? id) + { + if(id == null || id <= 0) return Content("Incorrect device report request"); + + try + { + Device report = _ctx.Devices.FirstOrDefault(d => d.Id == id); + + if(report is null) return Content("Cannot find requested report"); + + ViewBag.lblManufacturer = report.Manufacturer; + ViewBag.lblModel = report.Model; + ViewBag.lblRevision = report.Revision; + + if(report.USB != null) + { + string usbVendorDescription = null; + string usbProductDescription = null; + + UsbProduct dbProduct = + _ctx.UsbProducts.FirstOrDefault(p => p.ProductId == report.USB.ProductID && + p.Vendor != null && + p.Vendor.VendorId == report.USB.VendorID); + + if(dbProduct is null) + { + UsbVendor dbVendor = _ctx.UsbVendors.FirstOrDefault(v => v.VendorId == report.USB.VendorID); + + if(!(dbVendor is null)) usbVendorDescription = dbVendor.Vendor; + } + else + { + usbProductDescription = dbProduct.Product; + usbVendorDescription = dbProduct.Vendor.Vendor; + } + + ViewBag.UsbItem = new Item + { + Manufacturer = report.USB.Manufacturer, + Product = report.USB.Product, + VendorDescription = + usbVendorDescription != null + ? $"0x{report.USB.VendorID:x4} ({usbVendorDescription})" + : $"0x{report.USB.VendorID:x4}", + ProductDescription = usbProductDescription != null + ? $"0x{report.USB.ProductID:x4} ({usbProductDescription})" + : $"0x{report.USB.ProductID:x4}" + }; + } + + if(report.FireWire != null) + { + ViewBag.FireWireItem = new Item + { + Manufacturer = report.FireWire.Manufacturer, + Product = report.FireWire.Product, + VendorDescription = $"0x{report.FireWire.VendorID:x8}", + ProductDescription = $"0x{report.FireWire.ProductID:x8}" + }; + } + + if(report.PCMCIA != null) + { + ViewBag.PcmciaItem = new PcmciaItem + { + Manufacturer = report.PCMCIA.Manufacturer, + Product = report.PCMCIA.ProductName, + VendorDescription = $"0x{report.PCMCIA.ManufacturerCode:x4}", + ProductDescription = $"0x{report.PCMCIA.CardCode:x4}", + Compliance = report.PCMCIA.Compliance + }; + + Tuple[] tuples = CIS.GetTuples(report.PCMCIA.CIS); + + if(tuples != null) + { + Dictionary decodedTuples = new(); + + foreach(Tuple tuple in tuples) + { + switch(tuple.Code) + { + case TupleCodes.CISTPL_NULL: + case TupleCodes.CISTPL_END: + case TupleCodes.CISTPL_MANFID: + case TupleCodes.CISTPL_VERS_1: + break; + case TupleCodes.CISTPL_DEVICEGEO: + case TupleCodes.CISTPL_DEVICEGEO_A: + DeviceGeometryTuple geom = CIS.DecodeDeviceGeometryTuple(tuple.Data); + + if(geom?.Geometries != null) + { + foreach(DeviceGeometry geometry in geom.Geometries) + { + decodedTuples.Add("Device width", + $"{(1 << geometry.CardInterface - 1) * 8} bits"); + + decodedTuples.Add("Erase block", + $"{(1 << geometry.EraseBlockSize - 1) * (1 << geometry.Interleaving - 1)} bytes"); + + decodedTuples.Add("Read block", + $"{(1 << geometry.ReadBlockSize - 1) * (1 << geometry.Interleaving - 1)} bytes"); + + decodedTuples.Add("Write block", + $"{(1 << geometry.WriteBlockSize - 1) * (1 << geometry.Interleaving - 1)} bytes"); + + decodedTuples.Add("Partition alignment", + $"{(1 << geometry.EraseBlockSize - 1) * (1 << geometry.Interleaving - 1) * (1 << geometry.Partitions - 1)} bytes"); + } + } + + break; + case TupleCodes.CISTPL_ALTSTR: + case TupleCodes.CISTPL_BAR: + case TupleCodes.CISTPL_BATTERY: + case TupleCodes.CISTPL_BYTEORDER: + case TupleCodes.CISTPL_CFTABLE_ENTRY: + case TupleCodes.CISTPL_CFTABLE_ENTRY_CB: + case TupleCodes.CISTPL_CHECKSUM: + case TupleCodes.CISTPL_CONFIG: + case TupleCodes.CISTPL_CONFIG_CB: + case TupleCodes.CISTPL_DATE: + case TupleCodes.CISTPL_DEVICE: + case TupleCodes.CISTPL_DEVICE_A: + case TupleCodes.CISTPL_DEVICE_OA: + case TupleCodes.CISTPL_DEVICE_OC: + case TupleCodes.CISTPL_EXTDEVIC: + case TupleCodes.CISTPL_FORMAT: + case TupleCodes.CISTPL_FORMAT_A: + case TupleCodes.CISTPL_FUNCE: + case TupleCodes.CISTPL_FUNCID: + case TupleCodes.CISTPL_GEOMETRY: + case TupleCodes.CISTPL_INDIRECT: + case TupleCodes.CISTPL_JEDEC_A: + case TupleCodes.CISTPL_JEDEC_C: + case TupleCodes.CISTPL_LINKTARGET: + case TupleCodes.CISTPL_LONGLINK_A: + case TupleCodes.CISTPL_LONGLINK_C: + case TupleCodes.CISTPL_LONGLINK_CB: + case TupleCodes.CISTPL_LONGLINK_MFC: + case TupleCodes.CISTPL_NO_LINK: + case TupleCodes.CISTPL_ORG: + case TupleCodes.CISTPL_PWR_MGMNT: + case TupleCodes.CISTPL_SPCL: + case TupleCodes.CISTPL_SWIL: + case TupleCodes.CISTPL_VERS_2: + decodedTuples.Add("Undecoded tuple ID", tuple.Code.ToString()); + + break; + default: + decodedTuples.Add("Unknown tuple ID", $"0x{(byte)tuple.Code:X2}"); + + break; + } + } + + if(decodedTuples.Count > 0) ViewBag.repPcmciaTuples = decodedTuples; + } + } + + var removable = true; + List testedMedia = null; + var atapi = false; + var sscMedia = false; + + if(report.ATA != null || report.ATAPI != null) + { + List ataOneValue = new(); + Dictionary ataTwoValue = new(); + Ata ataReport; + + if(report.ATAPI != null) + { + ViewBag.AtaItem = "ATAPI"; + ataReport = report.ATAPI; + atapi = true; + } + else + { + ViewBag.AtaItem = "ATA"; + ataReport = report.ATA; + } + + bool cfa = report.CompactFlash; + + if(atapi && !cfa) + ViewBag.lblAtaDeviceType = "ATAPI device"; + else if(!atapi && cfa) + ViewBag.lblAtaDeviceType = "CompactFlash device"; + else + ViewBag.lblAtaDeviceType = "ATA device"; + + Core.Ata.Report(ataReport, + cfa, + atapi, + ref removable, + ref ataOneValue, + ref ataTwoValue, + ref testedMedia); + + ViewBag.repAtaOne = ataOneValue; + ViewBag.repAtaTwo = ataTwoValue; + } + + if(report.SCSI != null) + { + List scsiOneValue = new(); + Dictionary modePages = new(); + Dictionary evpdPages = new(); + + string vendorId = StringHandlers.CToString(report.SCSI.Inquiry?.VendorIdentification); + + if(report.SCSI.Inquiry != null) + { + Inquiry inq = report.SCSI.Inquiry.Value; + + ViewBag.lblScsiVendor = VendorString.Prettify(vendorId) != vendorId + ? $"{vendorId} ({VendorString.Prettify(vendorId)})" + : vendorId; + + ViewBag.lblScsiProduct = StringHandlers.CToString(inq.ProductIdentification); + ViewBag.lblScsiRevision = StringHandlers.CToString(inq.ProductRevisionLevel); + } + + scsiOneValue.AddRange(ScsiInquiry.Report(report.SCSI.Inquiry)); + + if(report.SCSI.SupportsModeSense6) scsiOneValue.Add("Device supports MODE SENSE (6)"); + + if(report.SCSI.SupportsModeSense10) scsiOneValue.Add("Device supports MODE SENSE (10)"); + + if(report.SCSI.SupportsModeSubpages) scsiOneValue.Add("Device supports MODE SENSE subpages"); + + if(report.SCSI.ModeSense != null) + { + PeripheralDeviceTypes devType = PeripheralDeviceTypes.DirectAccess; + + if(report.SCSI.Inquiry != null) + devType = (PeripheralDeviceTypes)report.SCSI.Inquiry.Value.PeripheralDeviceType; + + ScsiModeSense.Report(report.SCSI.ModeSense, vendorId, devType, ref scsiOneValue, ref modePages); + } + + if(modePages.Count > 0) ViewBag.repModeSense = modePages; + + if(report.SCSI.EVPDPages != null) ScsiEvpd.Report(report.SCSI.EVPDPages, vendorId, ref evpdPages); + + if(evpdPages.Count > 0) ViewBag.repEvpd = evpdPages; + + if(report.SCSI.MultiMediaDevice != null) + { + testedMedia = report.SCSI.MultiMediaDevice.TestedMedia; + + if(report.SCSI.MultiMediaDevice.ModeSense2A != null) + { + List mmcModeOneValue = new(); + ScsiMmcMode.Report(report.SCSI.MultiMediaDevice.ModeSense2A, ref mmcModeOneValue); + + if(mmcModeOneValue.Count > 0) ViewBag.repScsiMmcMode = mmcModeOneValue; + } + + if(report.SCSI.MultiMediaDevice.Features != null) + { + List mmcFeaturesOneValue = new(); + ScsiMmcFeatures.Report(report.SCSI.MultiMediaDevice.Features, ref mmcFeaturesOneValue); + + if(mmcFeaturesOneValue.Count > 0) ViewBag.repScsiMmcFeatures = mmcFeaturesOneValue; + } + } + else if(report.SCSI.SequentialDevice != null) + { + ViewBag.divScsiSscVisible = true; + + ViewBag.lblScsiSscGranularity = + report.SCSI.SequentialDevice.BlockSizeGranularity?.ToString() ?? "Unspecified"; + + ViewBag.lblScsiSscMaxBlock = + report.SCSI.SequentialDevice.MaxBlockLength?.ToString() ?? "Unspecified"; + + ViewBag.lblScsiSscMinBlock = + report.SCSI.SequentialDevice.MinBlockLength?.ToString() ?? "Unspecified"; + + if(report.SCSI.SequentialDevice.SupportedDensities != null) + ViewBag.repScsiSscDensities = report.SCSI.SequentialDevice.SupportedDensities; + + if(report.SCSI.SequentialDevice.SupportedMediaTypes != null) + ViewBag.repScsiSscMedias = report.SCSI.SequentialDevice.SupportedMediaTypes; + + if(report.SCSI.SequentialDevice.TestedMedia != null) + { + List mediaOneValue = new(); + SscTestedMedia.Report(report.SCSI.SequentialDevice.TestedMedia, ref mediaOneValue); + + if(mediaOneValue.Count > 0) + { + sscMedia = true; + ViewBag.repTestedMedia = mediaOneValue; + } + } + } + else if(report.SCSI.ReadCapabilities != null) + { + removable = false; + scsiOneValue.Add(""); + + if(report.SCSI.ReadCapabilities.Blocks.HasValue && report.SCSI.ReadCapabilities.BlockSize.HasValue) + { + scsiOneValue + .Add($"Device has {report.SCSI.ReadCapabilities.Blocks} blocks of {report.SCSI.ReadCapabilities.BlockSize} bytes each"); + + if(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1024 / 1024 > + 1000000) + { + scsiOneValue + .Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB"); + } + else if(report.SCSI.ReadCapabilities.Blocks * + report.SCSI.ReadCapabilities.BlockSize / + 1024 / + 1024 > + 1000) + { + scsiOneValue + .Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024:F2} GiB"); + } + else + { + scsiOneValue + .Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000} Mb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024:F2} MiB"); + } + } + + if(report.SCSI.ReadCapabilities.MediumType.HasValue) + scsiOneValue.Add($"Medium type code: {report.SCSI.ReadCapabilities.MediumType:X2}h"); + + if(report.SCSI.ReadCapabilities.Density.HasValue) + scsiOneValue.Add($"Density code: {report.SCSI.ReadCapabilities.Density:X2}h"); + + if((report.SCSI.ReadCapabilities.SupportsReadLong == true || + report.SCSI.ReadCapabilities.SupportsReadLong16 == true) && + report.SCSI.ReadCapabilities.LongBlockSize.HasValue) + scsiOneValue.Add($"Long block size: {report.SCSI.ReadCapabilities.LongBlockSize} bytes"); + + if(report.SCSI.ReadCapabilities.SupportsReadCapacity == true) + scsiOneValue.Add("Device supports READ CAPACITY (10) command."); + + if(report.SCSI.ReadCapabilities.SupportsReadCapacity16 == true) + scsiOneValue.Add("Device supports READ CAPACITY (16) command."); + + if(report.SCSI.ReadCapabilities.SupportsRead6 == true) + scsiOneValue.Add("Device supports READ (6) command."); + + if(report.SCSI.ReadCapabilities.SupportsRead10 == true) + scsiOneValue.Add("Device supports READ (10) command."); + + if(report.SCSI.ReadCapabilities.SupportsRead12 == true) + scsiOneValue.Add("Device supports READ (12) command."); + + if(report.SCSI.ReadCapabilities.SupportsRead16 == true) + scsiOneValue.Add("Device supports READ (16) command."); + + if(report.SCSI.ReadCapabilities.SupportsReadLong == true) + scsiOneValue.Add("Device supports READ LONG (10) command."); + + if(report.SCSI.ReadCapabilities.SupportsReadLong16 == true) + scsiOneValue.Add("Device supports READ LONG (16) command."); + + if(report.SCSI.ReadCapabilities.SupportsHLDTSTReadRawDVD == true) + scsiOneValue.Add("Device supports reading RAW DVD data using HL-DT-ST vendor command"); + + if(report.SCSI.ReadCapabilities.SupportsLiteOnReadRawDVD == true) + scsiOneValue.Add("Device supports reading RAW DVD data using Lite-On READ BUFFER command"); + } + else + testedMedia = report.SCSI.RemovableMedias; + + ViewBag.repScsi = scsiOneValue; + } + + if(report.MultiMediaCard != null) + { + List mmcOneValue = new(); + + if(report.MultiMediaCard.CID != null) + { + mmcOneValue.Add(Decoders.MMC.Decoders.PrettifyCID(report.MultiMediaCard.CID) + .Replace("\n", "
")); + + mmcOneValue.Add(""); + } + + if(report.MultiMediaCard.CSD != null) + { + mmcOneValue.Add(Decoders.MMC.Decoders.PrettifyCSD(report.MultiMediaCard.CSD) + .Replace("\n", "
")); + + mmcOneValue.Add(""); + } + + if(report.MultiMediaCard.ExtendedCSD != null) + { + mmcOneValue.Add(Decoders.MMC.Decoders.PrettifyExtendedCSD(report.MultiMediaCard.ExtendedCSD) + .Replace("\n", "
")); + + mmcOneValue.Add(""); + } + + if(report.MultiMediaCard.OCR != null) + { + mmcOneValue.Add(Decoders.MMC.Decoders.PrettifyCSD(report.MultiMediaCard.OCR) + .Replace("\n", "
")); + + mmcOneValue.Add(""); + } + + ViewBag.repMMC = mmcOneValue; + } + + if(report.SecureDigital != null) + { + List sdOneValue = new(); + + if(report.SecureDigital.CID != null) + { + sdOneValue.Add(Decoders.SecureDigital.Decoders.PrettifyCID(report.SecureDigital.CID) + .Replace("\n", "
")); + + sdOneValue.Add(""); + } + + if(report.SecureDigital.CSD != null) + { + sdOneValue.Add(Decoders.SecureDigital.Decoders.PrettifyCSD(report.SecureDigital.CSD) + .Replace("\n", "
")); + + sdOneValue.Add(""); + } + + if(report.SecureDigital.SCR != null) + { + sdOneValue.Add(Decoders.SecureDigital.Decoders.PrettifySCR(report.SecureDigital.SCR) + .Replace("\n", "
")); + + sdOneValue.Add(""); + } + + if(report.SecureDigital.OCR != null) + { + sdOneValue.Add(Decoders.SecureDigital.Decoders.PrettifyCSD(report.SecureDigital.OCR) + .Replace("\n", "
")); + + sdOneValue.Add(""); + } + + ViewBag.repSD = sdOneValue; + } + + if(removable && !sscMedia && testedMedia != null) + { + List mediaOneValue = new(); + Core.TestedMedia.Report(testedMedia, ref mediaOneValue); + + if(mediaOneValue.Count > 0) ViewBag.repTestedMedia = mediaOneValue; + } + } + catch(Exception) + { +#if DEBUG + throw; +#endif + return Content("Could not load device report"); + } + + return View(); + } +} + +public class Item +{ + public string Manufacturer; + public string Product; + public string ProductDescription; + public string VendorDescription; +} + +public sealed class PcmciaItem : Item +{ + public string Compliance; +} \ No newline at end of file diff --git a/Aaru.Server.Old/Controllers/StatsController.cs b/Aaru.Server.Old/Controllers/StatsController.cs new file mode 100644 index 00000000..47fdd497 --- /dev/null +++ b/Aaru.Server.Old/Controllers/StatsController.cs @@ -0,0 +1,657 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : StatsController.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Fetches statistics for Razor views. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using System.IO; +using System.Reflection; +using System.Threading; +using System.Xml; +using System.Xml.Serialization; +using Aaru.CommonTypes.Interop; +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Aaru.Server.Old.Core; +using Microsoft.AspNetCore.Hosting; +using DbContext = Aaru.Server.Old.Database.DbContext; +using OperatingSystem = Aaru.Server.Old.Database.Models.OperatingSystem; +using PlatformID = Aaru.CommonTypes.Interop.PlatformID; +using Version = Aaru.Server.Old.Database.Models.Version; + +namespace Aaru.Server.Old.Controllers; + +/// Renders a page with statistics, list of media type, devices, etc +public sealed class StatsController : Controller +{ + readonly DbContext _ctx; + readonly IWebHostEnvironment _env; + + public StatsController(IWebHostEnvironment environment, DbContext context) + { + _env = environment; + _ctx = context; + } + + public ActionResult Index() + { + ViewBag.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + + try + { + if(System.IO.File.Exists(Path.Combine(_env.ContentRootPath ?? throw new InvalidOperationException(), + "Statistics", + "Statistics.xml"))) + { + try + { + var statistics = new Stats(); + + var xs = new XmlSerializer(statistics.GetType()); + + FileStream fs = + WaitForFile(Path.Combine(_env.ContentRootPath ?? throw new InvalidOperationException(), + "Statistics", + "Statistics.xml"), + FileMode.Open, + FileAccess.Read, + FileShare.Read); + + statistics = (Stats)xs.Deserialize(fs); + fs.Close(); + + StatsConverter.Convert(statistics); + + System.IO.File.Delete(Path.Combine(_env.ContentRootPath ?? throw new InvalidOperationException(), + "Statistics", + "Statistics.xml")); + } + catch(XmlException) + { + // Do nothing + } + } + + if(_ctx.OperatingSystems.Any()) + { + List operatingSystems = new(); + + foreach(OperatingSystem nvs in _ctx.OperatingSystems) + { + operatingSystems.Add(new NameValueStats + { + name = + $"{DetectOS.GetPlatformName((PlatformID)Enum.Parse(typeof(PlatformID), nvs.Name), nvs.Version)}{(string.IsNullOrEmpty(nvs.Version) ? "" : " ")}{nvs.Version}", + Value = nvs.Count + }); + } + + ViewBag.repOperatingSystems = operatingSystems.OrderBy(os => os.name).ToList(); + } + + if(_ctx.Versions.Any()) + { + List versions = new(); + + foreach(Version nvs in _ctx.Versions) + { + versions.Add(new NameValueStats + { + name = nvs.Name == "previous" ? "Previous than 3.4.99.0" : nvs.Name, + Value = nvs.Count + }); + } + + ViewBag.repVersions = versions.OrderBy(ver => ver.name).ToList(); + } + + if(_ctx.Commands.Any()) ViewBag.repCommands = _ctx.Commands.OrderBy(c => c.Name).ToList(); + + if(_ctx.Filters.Any()) ViewBag.repFilters = _ctx.Filters.OrderBy(filter => filter.Name).ToList(); + + if(_ctx.MediaFormats.Any()) + ViewBag.repMediaImages = _ctx.MediaFormats.OrderBy(filter => filter.Name).ToList(); + + if(_ctx.Partitions.Any()) ViewBag.repPartitions = _ctx.Partitions.OrderBy(filter => filter.Name).ToList(); + + if(_ctx.Filesystems.Any()) + ViewBag.repFilesystems = _ctx.Filesystems.OrderBy(filter => filter.Name).ToList(); + + if(_ctx.Medias.Any()) + { + List realMedia = new(); + List virtualMedia = new(); + + foreach(Media nvs in _ctx.Medias) + { + try + { + (string type, string subType) mediaType = + MediaType.MediaTypeToString((CommonTypes.MediaType)Enum.Parse(typeof(CommonTypes.MediaType), + nvs.Type)); + + if(nvs.Real) + { + realMedia.Add(new MediaItem + { + Type = mediaType.type, + SubType = mediaType.subType, + Count = nvs.Count + }); + } + else + { + virtualMedia.Add(new MediaItem + { + Type = mediaType.type, + SubType = mediaType.subType, + Count = nvs.Count + }); + } + } + catch + { + if(nvs.Real) + { + realMedia.Add(new MediaItem + { + Type = nvs.Type, + SubType = null, + Count = nvs.Count + }); + } + else + { + virtualMedia.Add(new MediaItem + { + Type = nvs.Type, + SubType = null, + Count = nvs.Count + }); + } + } + } + + if(realMedia.Count > 0) + { + ViewBag.repRealMedia = + realMedia.OrderBy(media => media.Type).ThenBy(media => media.SubType).ToList(); + } + + if(virtualMedia.Count > 0) + { + ViewBag.repVirtualMedia = virtualMedia.OrderBy(media => media.Type) + .ThenBy(media => media.SubType) + .ToList(); + } + } + + if(_ctx.DeviceStats.Any()) + { + List devices = new(); + + foreach(DeviceStat device in _ctx.DeviceStats.ToList()) + { + string xmlFile; + + if(!string.IsNullOrWhiteSpace(device.Manufacturer) && + !string.IsNullOrWhiteSpace(device.Model) && + !string.IsNullOrWhiteSpace(device.Revision)) + xmlFile = device.Manufacturer + "_" + device.Model + "_" + device.Revision + ".xml"; + else if(!string.IsNullOrWhiteSpace(device.Manufacturer) && !string.IsNullOrWhiteSpace(device.Model)) + xmlFile = device.Manufacturer + "_" + device.Model + ".xml"; + else if(!string.IsNullOrWhiteSpace(device.Model) && !string.IsNullOrWhiteSpace(device.Revision)) + xmlFile = device.Model + "_" + device.Revision + ".xml"; + else + xmlFile = device.Model + ".xml"; + + xmlFile = xmlFile.Replace('/', '_').Replace('\\', '_').Replace('?', '_'); + + if(System.IO.File.Exists(Path.Combine(_env.ContentRootPath, "Reports", xmlFile))) + { + var deviceReport = new DeviceReport(); + + var xs = new XmlSerializer(deviceReport.GetType()); + + FileStream fs = + WaitForFile(Path.Combine(_env.ContentRootPath ?? throw new InvalidOperationException(), + "Reports", + xmlFile), + FileMode.Open, + FileAccess.Read, + FileShare.Read); + + deviceReport = (DeviceReport)xs.Deserialize(fs); + fs.Close(); + + var deviceReportV2 = new DeviceReportV2(deviceReport); + + device.Report = _ctx.Devices.Add(new Device(deviceReportV2)).Entity; + _ctx.SaveChanges(); + + System.IO.File.Delete(Path.Combine(_env.ContentRootPath ?? + throw new InvalidOperationException(), + "Reports", + xmlFile)); + } + + devices.Add(new DeviceItem + { + Manufacturer = device.Manufacturer, + Model = device.Model, + Revision = device.Revision, + Bus = device.Bus, + ReportId = device.Report != null && device.Report.Id != 0 ? device.Report.Id : 0 + }); + } + + ViewBag.repDevices = devices.OrderBy(device => device.Manufacturer) + .ThenBy(device => device.Model) + .ThenBy(device => device.Revision) + .ThenBy(device => device.Bus) + .ToList(); + } + } + catch(Exception) + { +#if DEBUG + throw; +#endif + return Content("Could not read statistics"); + } + + return View(); + } + + static FileStream WaitForFile(string fullPath, FileMode mode, FileAccess access, FileShare share) + { + for(var numTries = 0; numTries < 100; numTries++) + { + FileStream fs = null; + + try + { + fs = new FileStream(fullPath, mode, access, share); + + return fs; + } + catch(IOException) + { + fs?.Dispose(); + Thread.Sleep(50); + } + } + + return null; + } + + public IActionResult GetOsData() + { + var query = _ctx.OperatingSystems.GroupBy(x => new + { + x.Name + }, + x => x.Count) + .Select(g => new + { + g.Key.Name, + Count = g.Sum() + }); + + var result = new string[2][]; + result[0] = query.Select(x => x.Name).ToArray(); + result[1] = query.Select(x => x.Count.ToString()).ToArray(); + + for(var i = 0; i < result[0].Length; i++) + result[0][i] = DetectOS.GetPlatformName((PlatformID)Enum.Parse(typeof(PlatformID), result[0][i])); + + return Json(result); + } + + public IActionResult GetLinuxData() + { + string[][] result = + { + _ctx.OperatingSystems.Where(o => o.Name == PlatformID.Linux.ToString()) + .OrderByDescending(o => o.Count) + .Take(10) + .Select(x => + $"{DetectOS.GetPlatformName(PlatformID.Linux, x.Version)}{(string.IsNullOrEmpty(x.Version) ? "" : " ")}{x.Version}") + .ToArray(), + _ctx.OperatingSystems.Where(o => o.Name == PlatformID.Linux.ToString()) + .OrderByDescending(o => o.Count) + .Take(10) + .Select(x => x.Count.ToString()) + .ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.OperatingSystems.Where(o => o.Name == PlatformID.Linux.ToString()).Sum(o => o.Count) - + result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetMacOsData() + { + string[][] result = + { + _ctx.OperatingSystems.Where(o => o.Name == PlatformID.MacOSX.ToString()) + .OrderByDescending(o => o.Count) + .Take(10) + .Select(x => + $"{DetectOS.GetPlatformName(PlatformID.MacOSX, x.Version)}{(string.IsNullOrEmpty(x.Version) ? "" : " ")}{x.Version}") + .ToArray(), + _ctx.OperatingSystems.Where(o => o.Name == PlatformID.MacOSX.ToString()) + .OrderByDescending(o => o.Count) + .Take(10) + .Select(x => x.Count.ToString()) + .ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.OperatingSystems.Where(o => o.Name == PlatformID.MacOSX.ToString()).Sum(o => o.Count) - + result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetWindowsData() + { + string[][] result = + { + _ctx.OperatingSystems.Where(o => o.Name == PlatformID.Win32NT.ToString()) + .OrderByDescending(o => o.Count) + .Take(10) + .Select(x => + $"{DetectOS.GetPlatformName(PlatformID.Win32NT, x.Version)}{(string.IsNullOrEmpty(x.Version) ? "" : " ")}{x.Version}") + .ToArray(), + _ctx.OperatingSystems.Where(o => o.Name == PlatformID.Win32NT.ToString()) + .OrderByDescending(o => o.Count) + .Take(10) + .Select(x => x.Count.ToString()) + .ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.OperatingSystems.Where(o => o.Name == PlatformID.Win32NT.ToString()).Sum(o => o.Count) - + result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetVersionsData() + { + string[][] result = + { + _ctx.Versions.OrderByDescending(o => o.Count) + .Take(10) + .Select(v => v.Name == "previous" ? "Previous than 3.4.99.0" : v.Name) + .ToArray(), + _ctx.Versions.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.Versions.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetCommandsData() + { + string[][] result = + { + _ctx.Commands.OrderByDescending(o => o.Count).Take(10).Select(v => v.Name).ToArray(), + _ctx.Commands.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.Commands.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetFiltersData() + { + string[][] result = + { + _ctx.Filters.OrderByDescending(o => o.Count).Take(10).Select(v => v.Name).ToArray(), + _ctx.Filters.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.Filters.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetFormatsData() + { + string[][] result = + { + _ctx.MediaFormats.OrderByDescending(o => o.Count).Take(10).Select(v => v.Name).ToArray(), + _ctx.MediaFormats.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.MediaFormats.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetPartitionsData() + { + string[][] result = + { + _ctx.Partitions.OrderByDescending(o => o.Count).Take(10).Select(v => v.Name).ToArray(), + _ctx.Partitions.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.Partitions.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetFilesystemsData() + { + string[][] result = + { + _ctx.Filesystems.OrderByDescending(o => o.Count).Take(10).Select(v => v.Name).ToArray(), + _ctx.Filesystems.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.Filesystems.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetVirtualMediaData() + { + Media[] virtualMedias = _ctx.Medias.Where(o => !o.Real).OrderByDescending(o => o.Count).Take(10).ToArray(); + + foreach(Media media in virtualMedias) + { + try + { + (string type, string subType) mediaType = + MediaType.MediaTypeToString((CommonTypes.MediaType)Enum.Parse(typeof(CommonTypes.MediaType), + media.Type)); + + media.Type = $"{mediaType.type} ({mediaType.subType})"; + } + catch + { + // Could not get media type/subtype pair from type, so just leave it as is + } + } + + string[][] result = + { + virtualMedias.Select(v => v.Type).ToArray(), virtualMedias.Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = + (_ctx.Medias.Where(o => !o.Real).Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetRealMediaData() + { + Media[] realMedias = _ctx.Medias.Where(o => o.Real).OrderByDescending(o => o.Count).Take(10).ToArray(); + + foreach(Media media in realMedias) + { + try + { + (string type, string subType) mediaType = + MediaType.MediaTypeToString((CommonTypes.MediaType)Enum.Parse(typeof(CommonTypes.MediaType), + media.Type)); + + media.Type = $"{mediaType.type} ({mediaType.subType})"; + } + catch + { + // Could not get media type/subtype pair from type, so just leave it as is + } + } + + string[][] result = + { + realMedias.Select(v => v.Type).ToArray(), realMedias.Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (_ctx.Medias.Where(o => o.Real).Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)) + .ToString(); + + return Json(result); + } + + public IActionResult GetDevicesByBusData() + { + var data = _ctx.DeviceStats.Select(d => d.Bus) + .Distinct() + .Select(deviceBus => new + { + deviceBus, + deviceBusCount = _ctx.DeviceStats.Count(d => d.Bus == deviceBus) + }) + .Select(t => new + { + Name = t.deviceBus, + Count = t.deviceBusCount + }) + .ToList(); + + string[][] result = + { + data.OrderByDescending(o => o.Count).Take(10).Select(v => v.Name).ToArray(), + data.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "Other"; + + result[1][9] = (data.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } + + public IActionResult GetDevicesByManufacturerData() + { + var devices = _ctx.Devices.Where(d => d.Manufacturer != null && d.Manufacturer != "").ToList(); + + var data = devices.Select(d => d.Manufacturer.ToLowerInvariant()) + .Distinct() + .Select(manufacturer => new + { + manufacturer, + manufacturerCount = + devices.Count(d => d.Manufacturer?.ToLowerInvariant() == manufacturer) + }) + .Select(t => new + { + Name = t.manufacturer, + Count = t.manufacturerCount + }) + .ToList(); + + string[][] result = + { + data.OrderByDescending(o => o.Count).Take(10).Select(v => v.Name).ToArray(), + data.OrderByDescending(o => o.Count).Take(10).Select(x => x.Count.ToString()).ToArray() + }; + + if(result[0].Length < 10) return Json(result); + + result[0][9] = "other"; + + result[1][9] = (data.Sum(o => o.Count) - result[1].Take(9).Sum(long.Parse)).ToString(); + + return Json(result); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Controllers/UpdateController.cs b/Aaru.Server.Old/Controllers/UpdateController.cs new file mode 100644 index 00000000..d956de59 --- /dev/null +++ b/Aaru.Server.Old/Controllers/UpdateController.cs @@ -0,0 +1,139 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : UploadReportController.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Handles report uploads. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using System.IO; +using System.Net; +using Aaru.CommonTypes.Metadata; +using Aaru.Dto; +using Aaru.Helpers; +using Aaru.Server.Old.Database.Models; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Controllers; + +public sealed class UpdateController : Controller +{ + readonly DbContext _ctx; + + public UpdateController(DbContext ctx) => _ctx = ctx; + + /// Receives a report from Aaru.Core, verifies it's in the correct format and stores it on the server + /// HTTP response + [Route("api/update")] + [HttpGet] + public ActionResult Update(long timestamp) + { + var sync = new SyncDto(); + DateTime lastSync = DateHandlers.UnixToDateTime(timestamp); + + sync.UsbVendors = new List(); + + foreach(UsbVendor vendor in _ctx.UsbVendors.Where(v => v.ModifiedWhen > lastSync)) + { + sync.UsbVendors.Add(new UsbVendorDto + { + VendorId = vendor.VendorId, + Vendor = vendor.Vendor + }); + } + + sync.UsbProducts = new List(); + + foreach(UsbProduct product in _ctx.UsbProducts.Include(p => p.Vendor).Where(p => p.ModifiedWhen > lastSync)) + { + sync.UsbProducts.Add(new UsbProductDto + { + Id = product.Id, + Product = product.Product, + ProductId = product.ProductId, + VendorId = product.Vendor.VendorId + }); + } + + sync.Offsets = new List(); + + foreach(CompactDiscOffset offset in _ctx.CdOffsets.Where(o => o.ModifiedWhen > lastSync)) + sync.Offsets.Add(new CdOffsetDto(offset, offset.Id)); + + sync.Devices = new List(); + + foreach(Device device in _ctx.Devices.Where(d => d.ModifiedWhen > lastSync).ToList()) + { + sync.Devices.Add(new + DeviceDto(JsonConvert + .DeserializeObject(JsonConvert.SerializeObject(device, + Formatting.None, + new JsonSerializerSettings + { + ReferenceLoopHandling = + ReferenceLoopHandling.Ignore + })), + device.Id, + device.OptimalMultipleSectorsRead, + device.CanReadGdRomUsingSwapDisc)); + } + + sync.NesHeaders = new List(); + + foreach(NesHeaderInfo header in _ctx.NesHeaders.Where(v => v.ModifiedWhen > lastSync)) + { + sync.NesHeaders.Add(new NesHeaderDto + { + Id = header.Id, + BatteryPresent = header.BatteryPresent, + ConsoleType = header.ConsoleType, + DefaultExpansionDevice = header.DefaultExpansionDevice, + ExtendedConsoleType = header.ExtendedConsoleType, + FourScreenMode = header.FourScreenMode, + Mapper = header.Mapper, + NametableMirroring = header.NametableMirroring, + Sha256 = header.Sha256, + Submapper = header.Submapper, + TimingMode = header.TimingMode, + VsHardwareType = header.VsHardwareType, + VsPpuType = header.VsPpuType + }); + } + + var js = JsonSerializer.Create(); + var sw = new StringWriter(); + js.Serialize(sw, sync); + + return new ContentResult + { + StatusCode = (int)HttpStatusCode.OK, + Content = sw.ToString(), + ContentType = "application/json" + }; + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Controllers/UploadReportController.cs b/Aaru.Server.Old/Controllers/UploadReportController.cs new file mode 100644 index 00000000..055b4db2 --- /dev/null +++ b/Aaru.Server.Old/Controllers/UploadReportController.cs @@ -0,0 +1,375 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : UploadReportController.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Handles report uploads. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Cinchoo.PGP; +using MailKit.Net.Smtp; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using MimeKit; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old.Controllers; + +public sealed class UploadReportController : Controller +{ + readonly DbContext _ctx; + readonly IWebHostEnvironment _environment; + + public UploadReportController(IWebHostEnvironment environment, DbContext ctx) + { + _environment = environment; + _ctx = ctx; + } + + /// Receives a report from Aaru.Core, verifies it's in the correct format and stores it on the server + /// HTTP response + [Route("api/uploadreport")] + [HttpPost] + public async Task UploadReport() + { + var response = new ContentResult + { + StatusCode = (int)HttpStatusCode.OK, + ContentType = "text/plain" + }; + + try + { + var newReport = new DeviceReport(); + HttpRequest request = HttpContext.Request; + + var xs = new XmlSerializer(newReport.GetType()); + + newReport = + (DeviceReport)xs.Deserialize(new StringReader(await new StreamReader(request.Body).ReadToEndAsync())); + + if(newReport == null) + { + response.Content = "notstats"; + + return response; + } + + var reportV2 = new DeviceReportV2(newReport); + var jsonSw = new StringWriter(); + + await jsonSw.WriteAsync(JsonConvert.SerializeObject(reportV2, + Formatting.Indented, + new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore + })); + + var reportV2String = jsonSw.ToString(); + jsonSw.Close(); + + var newUploadedReport = new UploadedReport(reportV2); + + // Ensure CHS and CurrentCHS are not duplicates + if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null && + newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null) + { + if(newUploadedReport.ATA.ReadCapabilities.CHS.Cylinders == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Cylinders && + newUploadedReport.ATA.ReadCapabilities.CHS.Heads == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Heads && + newUploadedReport.ATA.ReadCapabilities.CHS.Sectors == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Sectors) + newUploadedReport.ATA.ReadCapabilities.CHS = newUploadedReport.ATA.ReadCapabilities.CurrentCHS; + } + + // Check if the CHS or CurrentCHS of this report already exist in the database + if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => c.Cylinders == newUploadedReport.ATA.ReadCapabilities.CHS.Cylinders && + c.Heads == newUploadedReport.ATA.ReadCapabilities.CHS.Heads && + c.Sectors == newUploadedReport.ATA.ReadCapabilities.CHS.Sectors); + + if(existingChs != null) newUploadedReport.ATA.ReadCapabilities.CHS = existingChs; + } + + if(newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => + c.Cylinders == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Cylinders && + c.Heads == newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Heads && + c.Sectors == newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Sectors); + + if(existingChs != null) newUploadedReport.ATA.ReadCapabilities.CurrentCHS = existingChs; + } + + if(newUploadedReport.ATA?.RemovableMedias != null) + { + foreach(TestedMedia media in newUploadedReport.ATA.RemovableMedias) + { + if(media.CHS != null && media.CurrentCHS != null) + { + if(media.CHS.Cylinders == media.CurrentCHS.Cylinders && + media.CHS.Heads == media.CurrentCHS.Heads && + media.CHS.Sectors == media.CurrentCHS.Sectors) + media.CHS = media.CurrentCHS; + } + + if(media.CHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CHS.Cylinders && + c.Heads == media.CHS.Heads && + c.Sectors == media.CHS.Sectors); + + if(existingChs != null) media.CHS = existingChs; + } + + if(media.CHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CurrentCHS.Cylinders && + c.Heads == media.CurrentCHS.Heads && + c.Sectors == media.CurrentCHS.Sectors); + + if(existingChs != null) media.CurrentCHS = existingChs; + } + } + } + + await _ctx.Reports.AddAsync(newUploadedReport); + await _ctx.SaveChangesAsync(); + + var pgpIn = new MemoryStream(Encoding.UTF8.GetBytes(reportV2String)); + var pgpOut = new MemoryStream(); + var pgp = new ChoPGPEncryptDecrypt(); + + await pgp.EncryptAsync(pgpIn, + pgpOut, + Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), + "public.asc")); + + pgpOut.Position = 0; + reportV2String = Encoding.UTF8.GetString(pgpOut.ToArray()); + + var message = new MimeMessage + { + Subject = "New device report (old version)", + Body = new TextPart("plain") + { + Text = reportV2String + } + }; + + message.From.Add(new MailboxAddress("Aaru Server", "aaru@claunia.com")); + message.To.Add(new MailboxAddress("Natalia Portillo", "claunia@claunia.com")); + + using(var client = new SmtpClient()) + { + await client.ConnectAsync("mail.claunia.com", 25, false); + await client.SendAsync(message); + await client.DisconnectAsync(true); + } + + response.Content = "ok"; + + return response; + } + + // ReSharper disable once RedundantCatchClause + catch + { +#if DEBUG + if(Debugger.IsAttached) throw; +#endif + response.Content = "error"; + + return response; + } + } + + /// Receives a report from Aaru.Core, verifies it's in the correct format and stores it on the server + /// HTTP response + [Route("api/uploadreportv2")] + [HttpPost] + public async Task UploadReportV2() + { + var response = new ContentResult + { + StatusCode = (int)HttpStatusCode.OK, + ContentType = "text/plain" + }; + + try + { + HttpRequest request = HttpContext.Request; + + var sr = new StreamReader(request.Body); + string reportJson = await sr.ReadToEndAsync(); + DeviceReportV2 newReport = JsonConvert.DeserializeObject(reportJson); + + if(newReport == null) + { + response.Content = "notstats"; + + return response; + } + + var newUploadedReport = new UploadedReport(newReport); + + // Ensure CHS and CurrentCHS are not duplicates + if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null && + newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null) + { + if(newUploadedReport.ATA.ReadCapabilities.CHS.Cylinders == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Cylinders && + newUploadedReport.ATA.ReadCapabilities.CHS.Heads == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Heads && + newUploadedReport.ATA.ReadCapabilities.CHS.Sectors == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Sectors) + newUploadedReport.ATA.ReadCapabilities.CHS = newUploadedReport.ATA.ReadCapabilities.CurrentCHS; + } + + // Check if the CHS or CurrentCHS of this report already exist in the database + if(newUploadedReport.ATA?.ReadCapabilities?.CHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => c.Cylinders == newUploadedReport.ATA.ReadCapabilities.CHS.Cylinders && + c.Heads == newUploadedReport.ATA.ReadCapabilities.CHS.Heads && + c.Sectors == newUploadedReport.ATA.ReadCapabilities.CHS.Sectors); + + if(existingChs != null) newUploadedReport.ATA.ReadCapabilities.CHS = existingChs; + } + + if(newUploadedReport.ATA?.ReadCapabilities?.CurrentCHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => + c.Cylinders == + newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Cylinders && + c.Heads == newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Heads && + c.Sectors == newUploadedReport.ATA.ReadCapabilities.CurrentCHS.Sectors); + + if(existingChs != null) newUploadedReport.ATA.ReadCapabilities.CurrentCHS = existingChs; + } + + if(newUploadedReport.ATA?.RemovableMedias != null) + { + foreach(TestedMedia media in newUploadedReport.ATA.RemovableMedias) + { + if(media.CHS != null && media.CurrentCHS != null) + { + if(media.CHS.Cylinders == media.CurrentCHS.Cylinders && + media.CHS.Heads == media.CurrentCHS.Heads && + media.CHS.Sectors == media.CurrentCHS.Sectors) + media.CHS = media.CurrentCHS; + } + + if(media.CHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CHS.Cylinders && + c.Heads == media.CHS.Heads && + c.Sectors == media.CHS.Sectors); + + if(existingChs != null) media.CHS = existingChs; + } + + if(media.CHS != null) + { + Chs existingChs = + _ctx.Chs.FirstOrDefault(c => c.Cylinders == media.CurrentCHS.Cylinders && + c.Heads == media.CurrentCHS.Heads && + c.Sectors == media.CurrentCHS.Sectors); + + if(existingChs != null) media.CurrentCHS = existingChs; + } + } + } + + await _ctx.Reports.AddAsync(newUploadedReport); + await _ctx.SaveChangesAsync(); + + var pgpIn = new MemoryStream(Encoding.UTF8.GetBytes(reportJson)); + var pgpOut = new MemoryStream(); + var pgp = new ChoPGPEncryptDecrypt(); + + await pgp.EncryptAsync(pgpIn, + pgpOut, + Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), + "public.asc")); + + pgpOut.Position = 0; + reportJson = Encoding.UTF8.GetString(pgpOut.ToArray()); + + var message = new MimeMessage + { + Subject = "New device report", + Body = new TextPart("plain") + { + Text = reportJson + } + }; + + message.From.Add(new MailboxAddress("Aaru Server", "aaru@claunia.com")); + message.To.Add(new MailboxAddress("Natalia Portillo", "claunia@claunia.com")); + + using(var client = new SmtpClient()) + { + await client.ConnectAsync("mail.claunia.com", 25, false); + await client.SendAsync(message); + await client.DisconnectAsync(true); + } + + response.Content = "ok"; + + return response; + } + + // ReSharper disable once RedundantCatchClause + catch + { +#if DEBUG + if(Debugger.IsAttached) throw; +#endif + response.Content = "error"; + + return response; + } + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Controllers/UploadStatsController.cs b/Aaru.Server.Old/Controllers/UploadStatsController.cs new file mode 100644 index 00000000..70479ec3 --- /dev/null +++ b/Aaru.Server.Old/Controllers/UploadStatsController.cs @@ -0,0 +1,386 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : UploadStatsController.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Handles statistics uploads. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Xml.Serialization; +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using Aaru.Server.Old.Core; +using Microsoft.AspNetCore.Http; +using Newtonsoft.Json; +using DbContext = Aaru.Server.Old.Database.DbContext; +using OperatingSystem = Aaru.Server.Old.Database.Models.OperatingSystem; +using Version = Aaru.Server.Old.Database.Models.Version; + +namespace Aaru.Server.Old.Controllers; + +public sealed class UploadStatsController : Controller +{ + readonly DbContext _ctx; + + public UploadStatsController(DbContext ctx) => _ctx = ctx; + + /// Receives statistics from Aaru.Core, processes them and adds them to a server-side global statistics XML + /// HTTP response + [Route("api/uploadstats")] + [HttpPost] + public async Task UploadStats() + { + var response = new ContentResult + { + StatusCode = (int)HttpStatusCode.OK, + ContentType = "text/plain" + }; + + try + { + var newStats = new Stats(); + HttpRequest request = HttpContext.Request; + + var xs = new XmlSerializer(newStats.GetType()); + + newStats = (Stats)xs.Deserialize(new StringReader(await new StreamReader(request.Body).ReadToEndAsync())); + + if(newStats == null) + { + response.Content = "notstats"; + + return response; + } + + StatsConverter.Convert(newStats); + + response.Content = "ok"; + + return response; + } + catch(Exception) + { +#if DEBUG + if(Debugger.IsAttached) throw; +#endif + response.Content = "error"; + + return response; + } + } + + /// Receives a report from Aaru.Core, verifies it's in the correct format and stores it on the server + /// HTTP response + [Route("api/uploadstatsv2")] + [HttpPost] + public async Task UploadStatsV2() + { + var response = new ContentResult + { + StatusCode = (int)HttpStatusCode.OK, + ContentType = "text/plain" + }; + + try + { + HttpRequest request = HttpContext.Request; + + var sr = new StreamReader(request.Body); + string statsString = await sr.ReadToEndAsync(); + StatsDto newstats = JsonConvert.DeserializeObject(statsString); + + if(newstats == null) + { + response.Content = "notstats"; + + return response; + } + + if(newstats.Commands != null) + { + foreach(NameValueStats nvs in newstats.Commands) + { + if(nvs.name == "analyze") nvs.name = "fs-info"; + + Command existing = _ctx.Commands.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + await _ctx.Commands.AddAsync(new Command + { + Name = nvs.name, + Count = nvs.Value + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newstats.Versions != null) + { + foreach(NameValueStats nvs in newstats.Versions) + { + Version existing = _ctx.Versions.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + await _ctx.Versions.AddAsync(new Version + { + Name = nvs.name, + Count = nvs.Value + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newstats.Filesystems != null) + { + foreach(NameValueStats nvs in newstats.Filesystems) + { + Filesystem existing = _ctx.Filesystems.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + await _ctx.Filesystems.AddAsync(new Filesystem + { + Name = nvs.name, + Count = nvs.Value + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newstats.Partitions != null) + { + foreach(NameValueStats nvs in newstats.Partitions) + { + Partition existing = _ctx.Partitions.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + await _ctx.Partitions.AddAsync(new Partition + { + Name = nvs.name, + Count = nvs.Value + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newstats.MediaFormats != null) + { + foreach(NameValueStats nvs in newstats.MediaFormats) + { + MediaFormat existing = _ctx.MediaFormats.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + await _ctx.MediaFormats.AddAsync(new MediaFormat + { + Name = nvs.name, + Count = nvs.Value + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newstats.Filters != null) + { + foreach(NameValueStats nvs in newstats.Filters) + { + Filter existing = _ctx.Filters.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + await _ctx.Filters.AddAsync(new Filter + { + Name = nvs.name, + Count = nvs.Value + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newstats.OperatingSystems != null) + { + foreach(OsStats operatingSystem in newstats.OperatingSystems) + { + OperatingSystem existing = + _ctx.OperatingSystems.FirstOrDefault(c => c.Name == operatingSystem.name && + c.Version == operatingSystem.version); + + if(existing == null) + { + await _ctx.OperatingSystems.AddAsync(new OperatingSystem + { + Name = operatingSystem.name, + Version = operatingSystem.version, + Count = operatingSystem.Value + }); + } + else + existing.Count += operatingSystem.Value; + } + } + + if(newstats.Medias != null) + { + foreach(MediaStats media in newstats.Medias) + { + Media existing = _ctx.Medias.FirstOrDefault(c => c.Type == media.type && c.Real == media.real); + + if(existing == null) + { + await _ctx.Medias.AddAsync(new Media + { + Type = media.type, + Real = media.real, + Count = media.Value + }); + } + else + existing.Count += media.Value; + } + } + + if(newstats.Devices != null) + { + foreach(DeviceStats device in from device in newstats.Devices + let existing = + _ctx.DeviceStats.FirstOrDefault(c => c.Bus == device.Bus && + c.Manufacturer == device.Manufacturer && + c.Model == device.Model && + c.Revision == device.Revision) + where existing == null + select device) + { + await _ctx.DeviceStats.AddAsync(new DeviceStat + { + Bus = device.Bus, + Manufacturer = device.Manufacturer, + Model = device.Model, + Revision = device.Revision + }); + } + } + + if(newstats.RemoteApplications != null) + { + foreach(OsStats application in newstats.RemoteApplications) + { + RemoteApplication existing = + _ctx.RemoteApplications.FirstOrDefault(c => c.Name == application.name && + c.Version == application.version); + + if(existing == null) + { + await _ctx.RemoteApplications.AddAsync(new RemoteApplication + { + Name = application.name, + Version = application.version, + Count = application.Value + }); + } + else + existing.Count += application.Value; + } + } + + if(newstats.RemoteArchitectures != null) + { + foreach(NameValueStats nvs in newstats.RemoteArchitectures) + { + RemoteArchitecture existing = _ctx.RemoteArchitectures.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + await _ctx.RemoteArchitectures.AddAsync(new RemoteArchitecture + { + Name = nvs.name, + Count = nvs.Value + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newstats.RemoteOperatingSystems != null) + { + foreach(OsStats remoteOperatingSystem in newstats.RemoteOperatingSystems) + { + RemoteOperatingSystem existing = + _ctx.RemoteOperatingSystems.FirstOrDefault(c => c.Name == remoteOperatingSystem.name && + c.Version == remoteOperatingSystem.version); + + if(existing == null) + { + await _ctx.RemoteOperatingSystems.AddAsync(new RemoteOperatingSystem + { + Name = remoteOperatingSystem.name, + Version = remoteOperatingSystem.version, + Count = remoteOperatingSystem.Value + }); + } + else + existing.Count += remoteOperatingSystem.Value; + } + } + + await _ctx.SaveChangesAsync(); + + response.Content = "ok"; + + return response; + } + + // ReSharper disable once RedundantCatchClause + catch + { +#if DEBUG + if(Debugger.IsAttached) throw; +#endif + response.Content = "error"; + + return response; + } + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/Ata.cs b/Aaru.Server.Old/Core/Ata.cs new file mode 100644 index 00000000..435fb8a0 --- /dev/null +++ b/Aaru.Server.Old/Core/Ata.cs @@ -0,0 +1,1938 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Ata.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes ATA information from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Structs.Devices.ATA; +using Aaru.CommonTypes.Structs.Devices.SCSI; + +namespace Aaru.Server.Old.Core; + +public static class Ata +{ + /// + /// Takes the ATA part of a device report and prints it as a list of values and another list of key=value pairs to + /// be sequenced by ASP.NET in the rendering + /// + /// ATA part of a device report + /// true if compact flash device + /// true if atapi device + /// true if removable device + /// List to put values on + /// List to put key=value pairs on + /// List of tested media + public static void Report(CommonTypes.Metadata.Ata ataReport, bool cfa, bool atapi, ref bool removable, + ref List ataOneValue, ref Dictionary ataTwoValue, + ref List testedMedia) + { + uint logicalSectorSize = 0; + + Identify.IdentifyDevice? ataIdentifyNullable = Identify.Decode(ataReport.Identify); + + if(!ataIdentifyNullable.HasValue) return; + + Identify.IdentifyDevice ataIdentify = ataIdentifyNullable.Value; + + if(!string.IsNullOrEmpty(ataIdentify.Model)) ataTwoValue.Add("Model", ataIdentify.Model); + + if(!string.IsNullOrEmpty(ataIdentify.FirmwareRevision)) + ataTwoValue.Add("Firmware revision", ataIdentify.FirmwareRevision); + + if(!string.IsNullOrEmpty(ataIdentify.AdditionalPID)) + ataTwoValue.Add("Additional product ID", ataIdentify.AdditionalPID); + + bool ata1 = false, + ata2 = false, + ata3 = false, + ata4 = false, + ata5 = false, + ata6 = false, + ata7 = false, + acs = false, + acs2 = false, + acs3 = false, + acs4 = false; + + if((ushort)ataIdentify.MajorVersion == 0x0000 || (ushort)ataIdentify.MajorVersion == 0xFFFF) + { + // Obsolete in ATA-2, if present, device supports ATA-1 + ata1 |= ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.FastIDE) || + ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SlowIDE) || + ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.UltraFastIDE); + + ata2 |= ataIdentify.ExtendedIdentify.HasFlag(Identify.ExtendedIdentifyBit.Words54to58Valid) || + ataIdentify.ExtendedIdentify.HasFlag(Identify.ExtendedIdentifyBit.Words64to70Valid) || + ataIdentify.ExtendedIdentify.HasFlag(Identify.ExtendedIdentifyBit.Word88Valid); + + if(!ata1 && !ata2 && !atapi && !cfa) ata2 = true; + + ata4 |= atapi; + ata3 |= cfa; + + if(cfa && ata1) ata1 = false; + + if(cfa && ata2) ata2 = false; + } + else + { + ata1 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata1); + ata2 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata2); + ata3 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata3); + ata4 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi4); + ata5 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi5); + ata6 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi6); + ata7 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi7); + acs |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata8ACS); + acs2 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.ACS2); + acs3 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.ACS3); + acs4 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.ACS4); + } + + var maxAtaLevel = 0; + var minAtaLevel = 255; + var tmpString = ""; + + if(ata1) + { + tmpString += "ATA-1 "; + maxAtaLevel = 1; + minAtaLevel = 1; + } + + if(ata2) + { + tmpString += "ATA-2 "; + maxAtaLevel = 2; + + if(minAtaLevel > 2) minAtaLevel = 2; + } + + if(ata3) + { + tmpString += "ATA-3 "; + maxAtaLevel = 3; + + if(minAtaLevel > 3) minAtaLevel = 3; + } + + if(ata4) + { + tmpString += "ATA/ATAPI-4 "; + maxAtaLevel = 4; + + if(minAtaLevel > 4) minAtaLevel = 4; + } + + if(ata5) + { + tmpString += "ATA/ATAPI-5 "; + maxAtaLevel = 5; + + if(minAtaLevel > 5) minAtaLevel = 5; + } + + if(ata6) + { + tmpString += "ATA/ATAPI-6 "; + maxAtaLevel = 6; + + if(minAtaLevel > 6) minAtaLevel = 6; + } + + if(ata7) + { + tmpString += "ATA/ATAPI-7 "; + maxAtaLevel = 7; + + if(minAtaLevel > 7) minAtaLevel = 7; + } + + if(acs) + { + tmpString += "ATA8-ACS "; + maxAtaLevel = 8; + + if(minAtaLevel > 8) minAtaLevel = 8; + } + + if(acs2) + { + tmpString += "ATA8-ACS2 "; + maxAtaLevel = 9; + + if(minAtaLevel > 9) minAtaLevel = 9; + } + + if(acs3) + { + tmpString += "ATA8-ACS3 "; + maxAtaLevel = 10; + + if(minAtaLevel > 10) minAtaLevel = 10; + } + + if(acs4) + { + tmpString += "ATA8-ACS4 "; + maxAtaLevel = 11; + + if(minAtaLevel > 11) minAtaLevel = 11; + } + + if(tmpString != "") ataTwoValue.Add("Supported ATA versions", tmpString); + + if(maxAtaLevel >= 3) + { + switch(ataIdentify.MinorVersion) + { + case 0x0000: + case 0xFFFF: + tmpString = "Minor ATA version not specified"; + + break; + case 0x0001: + tmpString = "ATA (ATA-1) X3T9.2 781D prior to revision 4"; + + break; + case 0x0002: + tmpString = "ATA-1 published, ANSI X3.221-1994"; + + break; + case 0x0003: + tmpString = "ATA (ATA-1) X3T9.2 781D revision 4"; + + break; + case 0x0004: + tmpString = "ATA-2 published, ANSI X3.279-1996"; + + break; + case 0x0005: + tmpString = "ATA-2 X3T10 948D prior to revision 2k"; + + break; + case 0x0006: + tmpString = "ATA-3 X3T10 2008D revision 1"; + + break; + case 0x0007: + tmpString = "ATA-2 X3T10 948D revision 2k"; + + break; + case 0x0008: + tmpString = "ATA-3 X3T10 2008D revision 0"; + + break; + case 0x0009: + tmpString = "ATA-2 X3T10 948D revision 3"; + + break; + case 0x000A: + tmpString = "ATA-3 published, ANSI X3.298-1997"; + + break; + case 0x000B: + tmpString = "ATA-3 X3T10 2008D revision 6"; + + break; + case 0x000C: + tmpString = "ATA-3 X3T13 2008D revision 7"; + + break; + case 0x000D: + tmpString = "ATA/ATAPI-4 X3T13 1153D revision 6"; + + break; + case 0x000E: + tmpString = "ATA/ATAPI-4 T13 1153D revision 13"; + + break; + case 0x000F: + tmpString = "ATA/ATAPI-4 X3T13 1153D revision 7"; + + break; + case 0x0010: + tmpString = "ATA/ATAPI-4 T13 1153D revision 18"; + + break; + case 0x0011: + tmpString = "ATA/ATAPI-4 T13 1153D revision 15"; + + break; + case 0x0012: + tmpString = "ATA/ATAPI-4 published, ANSI INCITS 317-1998"; + + break; + case 0x0013: + tmpString = "ATA/ATAPI-5 T13 1321D revision 3"; + + break; + case 0x0014: + tmpString = "ATA/ATAPI-4 T13 1153D revision 14"; + + break; + case 0x0015: + tmpString = "ATA/ATAPI-5 T13 1321D revision 1"; + + break; + case 0x0016: + tmpString = "ATA/ATAPI-5 published, ANSI INCITS 340-2000"; + + break; + case 0x0017: + tmpString = "ATA/ATAPI-4 T13 1153D revision 17"; + + break; + case 0x0018: + tmpString = "ATA/ATAPI-6 T13 1410D revision 0"; + + break; + case 0x0019: + tmpString = "ATA/ATAPI-6 T13 1410D revision 3a"; + + break; + case 0x001A: + tmpString = "ATA/ATAPI-7 T13 1532D revision 1"; + + break; + case 0x001B: + tmpString = "ATA/ATAPI-6 T13 1410D revision 2"; + + break; + case 0x001C: + tmpString = "ATA/ATAPI-6 T13 1410D revision 1"; + + break; + case 0x001D: + tmpString = "ATA/ATAPI-7 published ANSI INCITS 397-2005"; + + break; + case 0x001E: + tmpString = "ATA/ATAPI-7 T13 1532D revision 0"; + + break; + case 0x001F: + tmpString = "ACS-3 Revision 3b"; + + break; + case 0x0021: + tmpString = "ATA/ATAPI-7 T13 1532D revision 4a"; + + break; + case 0x0022: + tmpString = "ATA/ATAPI-6 published, ANSI INCITS 361-2002"; + + break; + case 0x0027: + tmpString = "ATA8-ACS revision 3c"; + + break; + case 0x0028: + tmpString = "ATA8-ACS revision 6"; + + break; + case 0x0029: + tmpString = "ATA8-ACS revision 4"; + + break; + case 0x0031: + tmpString = "ACS-2 Revision 2"; + + break; + case 0x0033: + tmpString = "ATA8-ACS Revision 3e"; + + break; + case 0x0039: + tmpString = "ATA8-ACS Revision 4c"; + + break; + case 0x0042: + tmpString = "ATA8-ACS Revision 3f"; + + break; + case 0x0052: + tmpString = "ATA8-ACS revision 3b"; + + break; + case 0x006D: + tmpString = "ACS-3 Revision 5"; + + break; + case 0x0082: + tmpString = "ACS-2 published, ANSI INCITS 482-2012"; + + break; + case 0x0107: + tmpString = "ATA8-ACS revision 2d"; + + break; + case 0x0110: + tmpString = "ACS-2 Revision 3"; + + break; + case 0x011B: + tmpString = "ACS-3 Revision 4"; + + break; + default: + tmpString = $"Unknown ATA revision 0x{ataIdentify.MinorVersion:X4}"; + + break; + } + + ataTwoValue.Add("Maximum ATA revision supported", tmpString); + } + + tmpString = ""; + + switch((ataIdentify.TransportMajorVersion & 0xF000) >> 12) + { + case 0x0: + if((ataIdentify.TransportMajorVersion & 0x0002) == 0x0002) tmpString += "ATA/ATAPI-7 "; + + if((ataIdentify.TransportMajorVersion & 0x0001) == 0x0001) tmpString += "ATA8-APT "; + + ataTwoValue.Add("Parallel ATA device", tmpString); + + break; + case 0x1: + if((ataIdentify.TransportMajorVersion & 0x0001) == 0x0001) tmpString += "ATA8-AST "; + + if((ataIdentify.TransportMajorVersion & 0x0002) == 0x0002) tmpString += "SATA 1.0a "; + + if((ataIdentify.TransportMajorVersion & 0x0004) == 0x0004) tmpString += "SATA II Extensions "; + + if((ataIdentify.TransportMajorVersion & 0x0008) == 0x0008) tmpString += "SATA 2.5 "; + + if((ataIdentify.TransportMajorVersion & 0x0010) == 0x0010) tmpString += "SATA 2.6 "; + + if((ataIdentify.TransportMajorVersion & 0x0020) == 0x0020) tmpString += "SATA 3.0 "; + + if((ataIdentify.TransportMajorVersion & 0x0040) == 0x0040) tmpString += "SATA 3.1 "; + + ataTwoValue.Add("Serial ATA device: ", tmpString); + + break; + case 0xE: + ataTwoValue.Add("SATA Express device", "No version"); + + break; + default: + ataTwoValue.Add("Unknown transport type", $"0x{(ataIdentify.TransportMajorVersion & 0xF000) >> 12:X1}"); + + break; + } + + if(atapi) + { + // Bits 12 to 8, SCSI Peripheral Device Type + switch((PeripheralDeviceTypes)(((ushort)ataIdentify.GeneralConfiguration & 0x1F00) >> 8)) + { + case PeripheralDeviceTypes.DirectAccess: //0x00, + ataOneValue.Add("ATAPI Direct-access device"); + + break; + case PeripheralDeviceTypes.SequentialAccess: //0x01, + ataOneValue.Add("ATAPI Sequential-access device"); + + break; + case PeripheralDeviceTypes.PrinterDevice: //0x02, + ataOneValue.Add("ATAPI Printer device"); + + break; + case PeripheralDeviceTypes.ProcessorDevice: //0x03, + ataOneValue.Add("ATAPI Processor device"); + + break; + case PeripheralDeviceTypes.WriteOnceDevice: //0x04, + ataOneValue.Add("ATAPI Write-once device"); + + break; + case PeripheralDeviceTypes.MultiMediaDevice: //0x05, + ataOneValue.Add("ATAPI CD-ROM/DVD/etc device"); + + break; + case PeripheralDeviceTypes.ScannerDevice: //0x06, + ataOneValue.Add("ATAPI Scanner device"); + + break; + case PeripheralDeviceTypes.OpticalDevice: //0x07, + ataOneValue.Add("ATAPI Optical memory device"); + + break; + case PeripheralDeviceTypes.MediumChangerDevice: //0x08, + ataOneValue.Add("ATAPI Medium change device"); + + break; + case PeripheralDeviceTypes.CommsDevice: //0x09, + ataOneValue.Add("ATAPI Communications device"); + + break; + case PeripheralDeviceTypes.PrePressDevice1: //0x0A, + ataOneValue.Add("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); + + break; + case PeripheralDeviceTypes.PrePressDevice2: //0x0B, + ataOneValue.Add("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); + + break; + case PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, + ataOneValue.Add("ATAPI Array controller device"); + + break; + case PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, + ataOneValue.Add("ATAPI Enclosure services device"); + + break; + case PeripheralDeviceTypes.SimplifiedDevice: //0x0E, + ataOneValue.Add("ATAPI Simplified direct-access device"); + + break; + case PeripheralDeviceTypes.OCRWDevice: //0x0F, + ataOneValue.Add("ATAPI Optical card reader/writer device"); + + break; + case PeripheralDeviceTypes.BridgingExpander: //0x10, + ataOneValue.Add("ATAPI Bridging Expanders"); + + break; + case PeripheralDeviceTypes.ObjectDevice: //0x11, + ataOneValue.Add("ATAPI Object-based Storage Device"); + + break; + case PeripheralDeviceTypes.ADCDevice: //0x12, + ataOneValue.Add("ATAPI Automation/Drive Interface"); + + break; + case PeripheralDeviceTypes.WellKnownDevice: //0x1E, + ataOneValue.Add("ATAPI Well known logical unit"); + + break; + case PeripheralDeviceTypes.UnknownDevice: //0x1F + ataOneValue.Add("ATAPI Unknown or no device type"); + + break; + default: + ataOneValue + .Add($"ATAPI Unknown device type field value 0x{((ushort)ataIdentify.GeneralConfiguration & 0x1F00) >> 8:X2}"); + + break; + } + + // ATAPI DRQ behaviour + switch(((ushort)ataIdentify.GeneralConfiguration & 0x60) >> 5) + { + case 0: + ataOneValue.Add("Device shall set DRQ within 3 ms of receiving PACKET"); + + break; + case 1: + ataOneValue.Add("Device shall assert INTRQ when DRQ is set to one"); + + break; + case 2: + ataOneValue.Add("Device shall set DRQ within 50 µs of receiving PACKET"); + + break; + default: + ataOneValue + .Add($"Unknown ATAPI DRQ behaviour code {((ushort)ataIdentify.GeneralConfiguration & 0x60) >> 5}"); + + break; + } + + // ATAPI PACKET size + switch((ushort)ataIdentify.GeneralConfiguration & 0x03) + { + case 0: + ataOneValue.Add("ATAPI device uses 12 byte command packet"); + + break; + case 1: + ataOneValue.Add("ATAPI device uses 16 byte command packet"); + + break; + default: + ataOneValue + .Add($"Unknown ATAPI packet size code {(ushort)ataIdentify.GeneralConfiguration & 0x03}"); + + break; + } + } + else if(!cfa) + { + if(minAtaLevel >= 5) + { + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.IncompleteResponse)) + ataOneValue.Add("Incomplete identify response"); + } + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.NonMagnetic)) + ataOneValue.Add("Device uses non-magnetic media"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.Removable)) + ataOneValue.Add("Device is removable"); + + if(minAtaLevel <= 5) + { + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.Fixed)) + ataOneValue.Add("Device is fixed"); + } + + if(ata1) + { + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SlowIDE)) + ataOneValue.Add("Device transfer rate is <= 5 Mb/s"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.FastIDE)) + ataOneValue.Add("Device transfer rate is > 5 Mb/s but <= 10 Mb/s"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.UltraFastIDE)) + ataOneValue.Add("Device transfer rate is > 10 Mb/s"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SoftSector)) + ataOneValue.Add("Device is soft sectored"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.HardSector)) + ataOneValue.Add("Device is hard sectored"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.NotMFM)) + ataOneValue.Add("Device is not MFM encoded"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.FormatGapReq)) + ataOneValue.Add("Format speed tolerance gap is required"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.TrackOffset)) + ataOneValue.Add("Track offset option is available"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.DataStrobeOffset)) + ataOneValue.Add("Data strobe offset option is available"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.RotationalSpeedTolerance)) + ataOneValue.Add("Rotational speed tolerance is higher than 0,5%"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SpindleControl)) + ataOneValue.Add("Spindle motor control is implemented"); + + if(ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.HighHeadSwitch)) + ataOneValue.Add("Head switch time is bigger than 15 µs."); + } + } + + if((ushort)ataIdentify.SpecificConfiguration != 0x0000 && (ushort)ataIdentify.SpecificConfiguration != 0xFFFF) + { + switch(ataIdentify.SpecificConfiguration) + { + case Identify.SpecificConfigurationEnum.RequiresSetIncompleteResponse: + ataOneValue + .Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete."); + + break; + case Identify.SpecificConfigurationEnum.RequiresSetCompleteResponse: + ataOneValue + .Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is complete."); + + break; + case Identify.SpecificConfigurationEnum.NotRequiresSetIncompleteResponse: + ataOneValue + .Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete."); + + break; + case Identify.SpecificConfigurationEnum.NotRequiresSetCompleteResponse: + ataOneValue + .Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is complete."); + + break; + default: + ataOneValue + .Add($"Unknown device specific configuration 0x{(ushort)ataIdentify.SpecificConfiguration:X4}"); + + break; + } + } + + // Obsolete since ATA-2, however, it is yet used in ATA-8 devices + if(ataIdentify.BufferSize != 0x0000 && + ataIdentify.BufferSize != 0xFFFF && + ataIdentify.BufferType != 0x0000 && + ataIdentify.BufferType != 0xFFFF) + { + switch(ataIdentify.BufferType) + { + case 1: + ataOneValue + .Add($"{ataIdentify.BufferSize * logicalSectorSize / 1024} KiB of single ported single sector buffer"); + + break; + case 2: + ataOneValue + .Add($"{ataIdentify.BufferSize * logicalSectorSize / 1024} KiB of dual ported multi sector buffer"); + + break; + case 3: + ataOneValue + .Add($"{ataIdentify.BufferSize * logicalSectorSize / 1024} KiB of dual ported multi sector buffer with read caching"); + + break; + default: + ataOneValue + .Add($"{ataIdentify.BufferSize * logicalSectorSize / 1024} KiB of unknown type {ataIdentify.BufferType} buffer"); + + break; + } + } + + ataOneValue.Add("Device capabilities:"); + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.StandardStandbyTimer)) + ataOneValue.Add("Standby time values are standard"); + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.IORDY)) + { + ataOneValue.Add(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.CanDisableIORDY) + ? "IORDY is supported and can be disabled" + : "IORDY is supported"); + } + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.DMASupport)) ataOneValue.Add("DMA is supported"); + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.PhysicalAlignment1) || + ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.PhysicalAlignment0)) + ataOneValue.Add($"Long Physical Alignment setting is {(ushort)ataIdentify.Capabilities & 0x03}"); + + if(atapi) + { + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.InterleavedDMA)) + ataOneValue.Add("ATAPI device supports interleaved DMA"); + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.CommandQueue)) + ataOneValue.Add("ATAPI device supports command queueing"); + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.OverlapOperation)) + ataOneValue.Add("ATAPI device supports overlapped operations"); + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.RequiresATASoftReset)) + ataOneValue.Add("ATAPI device requires ATA software reset"); + } + + if(ataIdentify.Capabilities2.HasFlag(Identify.CapabilitiesBit2.MustBeSet) && + !ataIdentify.Capabilities2.HasFlag(Identify.CapabilitiesBit2.MustBeClear)) + { + if(ataIdentify.Capabilities2.HasFlag(Identify.CapabilitiesBit2.SpecificStandbyTimer)) + ataOneValue.Add("Device indicates a specific minimum standby timer value"); + } + + if(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.MultipleValid)) + { + ataOneValue.Add($"A maximum of {ataIdentify.MultipleSectorNumber} sectors can be transferred per interrupt on READ/WRITE MULTIPLE"); + + ataOneValue.Add($"Device supports setting a maximum of {ataIdentify.MultipleMaxSectors} sectors"); + } + + if(ata1) + { + if(ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.TrustedComputing)) + ataOneValue.Add("Device supports doubleword I/O"); + } + + if(minAtaLevel <= 3) + { + if(ataIdentify.PIOTransferTimingMode > 0) + ataTwoValue.Add("PIO timing mode", $"{ataIdentify.PIOTransferTimingMode}"); + + if(ataIdentify.DMATransferTimingMode > 0) + ataTwoValue.Add("DMA timing mode", $"{ataIdentify.DMATransferTimingMode}"); + } + + tmpString = ""; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode0)) tmpString += "PIO0 "; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode1)) tmpString += "PIO1 "; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode2)) tmpString += "PIO2 "; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode3)) tmpString += "PIO3 "; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode4)) tmpString += "PIO4 "; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode5)) tmpString += "PIO5 "; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode6)) tmpString += "PIO6 "; + + if(ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode7)) tmpString += "PIO7 "; + + if(!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Advanced PIO", tmpString); + + if(minAtaLevel <= 3 && !atapi) + { + tmpString = ""; + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode0)) + { + tmpString += "DMA0 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode0)) tmpString += "(active) "; + } + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode1)) + { + tmpString += "DMA1 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode1)) tmpString += "(active) "; + } + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode2)) + { + tmpString += "DMA2 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode2)) tmpString += "(active) "; + } + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode3)) + { + tmpString += "DMA3 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode3)) tmpString += "(active) "; + } + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode4)) + { + tmpString += "DMA4 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode4)) tmpString += "(active) "; + } + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode5)) + { + tmpString += "DMA5 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode5)) tmpString += "(active) "; + } + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode6)) + { + tmpString += "DMA6 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode6)) tmpString += "(active) "; + } + + if(ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode7)) + { + tmpString += "DMA7 "; + + if(ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode7)) tmpString += "(active) "; + } + + if(!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Single-word DMA", tmpString); + } + + tmpString = ""; + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode0)) + { + tmpString += "MDMA0 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode0)) tmpString += "(active) "; + } + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode1)) + { + tmpString += "MDMA1 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode1)) tmpString += "(active) "; + } + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode2)) + { + tmpString += "MDMA2 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode2)) tmpString += "(active) "; + } + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode3)) + { + tmpString += "MDMA3 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode3)) tmpString += "(active) "; + } + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode4)) + { + tmpString += "MDMA4 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode4)) tmpString += "(active) "; + } + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode5)) + { + tmpString += "MDMA5 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode5)) tmpString += "(active) "; + } + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode6)) + { + tmpString += "MDMA6 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode6)) tmpString += "(active) "; + } + + if(ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode7)) + { + tmpString += "MDMA7 "; + + if(ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode7)) tmpString += "(active) "; + } + + if(!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Multi-word DMA", tmpString); + + tmpString = ""; + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode0)) + { + tmpString += "UDMA0 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode0)) tmpString += "(active) "; + } + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode1)) + { + tmpString += "UDMA1 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode1)) tmpString += "(active) "; + } + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode2)) + { + tmpString += "UDMA2 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode2)) tmpString += "(active) "; + } + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode3)) + { + tmpString += "UDMA3 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode3)) tmpString += "(active) "; + } + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode4)) + { + tmpString += "UDMA4 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode4)) tmpString += "(active) "; + } + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode5)) + { + tmpString += "UDMA5 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode5)) tmpString += "(active) "; + } + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode6)) + { + tmpString += "UDMA6 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode6)) tmpString += "(active) "; + } + + if(ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode7)) + { + tmpString += "UDMA7 "; + + if(ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode7)) tmpString += "(active) "; + } + + if(!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Ultra DMA", tmpString); + + if(ataIdentify.MinMDMACycleTime != 0 && ataIdentify.RecMDMACycleTime != 0) + { + ataOneValue.Add($"At minimum {ataIdentify.MinMDMACycleTime} ns. transfer cycle time per word in MDMA, " + + $"{ataIdentify.RecMDMACycleTime} ns. recommended"); + } + + if(ataIdentify.MinPIOCycleTimeNoFlow != 0) + { + ataOneValue.Add($"At minimum {ataIdentify.MinPIOCycleTimeNoFlow} ns. transfer cycle time per word in PIO, " + + "without flow control"); + } + + if(ataIdentify.MinPIOCycleTimeFlow != 0) + { + ataOneValue.Add($"At minimum {ataIdentify.MinPIOCycleTimeFlow} ns. transfer cycle time per word in PIO, " + + "with IORDY flow control"); + } + + if(ataIdentify.MaxQueueDepth != 0) ataOneValue.Add($"{ataIdentify.MaxQueueDepth + 1} depth of queue maximum"); + + if(atapi) + { + if(ataIdentify.PacketBusRelease != 0) + ataOneValue.Add($"{ataIdentify.PacketBusRelease} ns. typical to release bus from receipt of PACKET"); + + if(ataIdentify.ServiceBusyClear != 0) + ataOneValue.Add($"{ataIdentify.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE"); + } + + if((ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0x1 || + (ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0xE) + { + if(!ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Clear)) + { + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Gen1Speed)) + ataOneValue.Add("SATA 1.5Gb/s is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Gen2Speed)) + ataOneValue.Add("SATA 3.0Gb/s is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Gen3Speed)) + ataOneValue.Add("SATA 6.0Gb/s is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.PowerReceipt)) + ataOneValue.Add("Receipt of host initiated power management requests is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.PHYEventCounter)) + ataOneValue.Add("PHY Event counters are supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.HostSlumbTrans)) + ataOneValue.Add("Supports host automatic partial to slumber transitions is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.DevSlumbTrans)) + ataOneValue.Add("Supports device automatic partial to slumber transitions is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.NCQ)) + { + ataOneValue.Add("NCQ is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.NCQPriority)) + ataOneValue.Add("NCQ priority is supported"); + + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.UnloadNCQ)) + ataOneValue.Add("Unload is supported with outstanding NCQ commands"); + } + } + + if(!ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.Clear)) + { + if(!ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Clear) && + ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.NCQ)) + { + if(ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.NCQMgmt)) + ataOneValue.Add("NCQ queue management is supported"); + + if(ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.NCQStream)) + ataOneValue.Add("NCQ streaming is supported"); + } + + if(atapi) + { + if(ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.HostEnvDetect)) + ataOneValue.Add("ATAPI device supports host environment detection"); + + if(ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.DevAttSlimline)) + ataOneValue.Add("ATAPI device supports attention on slimline connected devices"); + } + } + } + + if(ataIdentify.InterseekDelay != 0x0000 && ataIdentify.InterseekDelay != 0xFFFF) + ataOneValue.Add($"{ataIdentify.InterseekDelay} microseconds of interseek delay for ISO-7779 acoustic testing"); + + if((ushort)ataIdentify.DeviceFormFactor != 0x0000 && (ushort)ataIdentify.DeviceFormFactor != 0xFFFF) + { + switch(ataIdentify.DeviceFormFactor) + { + case Identify.DeviceFormFactorEnum.FiveAndQuarter: + ataOneValue.Add("Device nominal size is 5.25\""); + + break; + case Identify.DeviceFormFactorEnum.ThreeAndHalf: + ataOneValue.Add("Device nominal size is 3.5\""); + + break; + case Identify.DeviceFormFactorEnum.TwoAndHalf: + ataOneValue.Add("Device nominal size is 2.5\""); + + break; + case Identify.DeviceFormFactorEnum.OnePointEight: + ataOneValue.Add("Device nominal size is 1.8\""); + + break; + case Identify.DeviceFormFactorEnum.LessThanOnePointEight: + ataOneValue.Add("Device nominal size is smaller than 1.8\""); + + break; + default: + ataOneValue.Add($"Device nominal size field value {ataIdentify.DeviceFormFactor} is unknown"); + + break; + } + } + + if(atapi) + { + if(ataIdentify.ATAPIByteCount > 0) + ataOneValue.Add($"{ataIdentify.ATAPIByteCount} bytes count limit for ATAPI"); + } + + if(cfa) + { + if((ataIdentify.CFAPowerMode & 0x8000) == 0x8000) + { + ataOneValue.Add("CompactFlash device supports power mode 1"); + + if((ataIdentify.CFAPowerMode & 0x2000) == 0x2000) + ataOneValue.Add("CompactFlash power mode 1 required for one or more commands"); + + if((ataIdentify.CFAPowerMode & 0x1000) == 0x1000) + ataOneValue.Add("CompactFlash power mode 1 is disabled"); + + ataOneValue.Add($"CompactFlash device uses a maximum of {ataIdentify.CFAPowerMode & 0x0FFF} mA"); + } + } + + ataOneValue.Add("Command set and features:"); + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Nop)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Nop) + ? "NOP is supported and enabled" + : "NOP is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.ReadBuffer)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.ReadBuffer) + ? "READ BUFFER is supported and enabled" + : "READ BUFFER is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.WriteBuffer)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.WriteBuffer) + ? "WRITE BUFFER is supported and enabled" + : "WRITE BUFFER is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.HPA)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.HPA) + ? "Host Protected Area is supported and enabled" + : "Host Protected Area is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.DeviceReset)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.DeviceReset) + ? "DEVICE RESET is supported and enabled" + : "DEVICE RESET is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Service)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Service) + ? "SERVICE interrupt is supported and enabled" + : "SERVICE interrupt is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Release)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Release) + ? "Release is supported and enabled" + : "Release is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.LookAhead)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.LookAhead) + ? "Look-ahead read is supported and enabled" + : "Look-ahead read is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.WriteCache)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.WriteCache) + ? "Write cache is supported and enabled" + : "Write cache is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Packet)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Packet) + ? "PACKET is supported and enabled" + : "PACKET is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.PowerManagement)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.PowerManagement) + ? "Power management is supported and enabled" + : "Power management is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.RemovableMedia)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.RemovableMedia) + ? "Removable media feature set is supported and enabled" + : "Removable media feature set is supported"); + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.SecurityMode)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.SecurityMode) + ? "Security mode is supported and enabled" + : "Security mode is supported"); + } + + if(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.LBASupport)) + ataOneValue.Add("28-bit LBA is supported"); + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.MustBeSet) && + !ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.MustBeClear)) + { + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.LBA48)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.LBA48) + ? "48-bit LBA is supported and enabled" + : "48-bit LBA is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.FlushCache)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.FlushCache) + ? "FLUSH CACHE is supported and enabled" + : "FLUSH CACHE is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.FlushCacheExt)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.FlushCacheExt) + ? "FLUSH CACHE EXT is supported and enabled" + : "FLUSH CACHE EXT is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.DCO)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.DCO) + ? "Device Configuration Overlay feature set is supported and enabled" + : "Device Configuration Overlay feature set is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.AAM)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.AAM) + ? $"Automatic Acoustic Management is supported and enabled with value {ataIdentify.CurrentAAM} (vendor recommends {ataIdentify.RecommendedAAM}" + : "Automatic Acoustic Management is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.SetMax)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.SetMax) + ? "SET MAX security extension is supported and enabled" + : "SET MAX security extension is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.AddressOffsetReservedAreaBoot)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2 + .AddressOffsetReservedAreaBoot) + ? "Address Offset Reserved Area Boot is supported and enabled" + : "Address Offset Reserved Area Boot is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.SetFeaturesRequired)) + ataOneValue.Add("SET FEATURES is required before spin-up"); + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.PowerUpInStandby)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.PowerUpInStandby) + ? "Power-up in standby is supported and enabled" + : "Power-up in standby is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.RemovableNotification)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.RemovableNotification) + ? "Removable Media Status Notification is supported and enabled" + : "Removable Media Status Notification is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.APM)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.APM) + ? $"Advanced Power Management is supported and enabled with value {ataIdentify.CurrentAPM}" + : "Advanced Power Management is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.CompactFlash)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.CompactFlash) + ? "CompactFlash feature set is supported and enabled" + : "CompactFlash feature set is supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.RWQueuedDMA)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.RWQueuedDMA) + ? "READ DMA QUEUED and WRITE DMA QUEUED are supported and enabled" + : "READ DMA QUEUED and WRITE DMA QUEUED are supported"); + } + + if(ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.DownloadMicrocode)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.DownloadMicrocode) + ? "DOWNLOAD MICROCODE is supported and enabled" + : "DOWNLOAD MICROCODE is supported"); + } + } + + if(ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.SMART)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.SMART) + ? "S.M.A.R.T. is supported and enabled" + : "S.M.A.R.T. is supported"); + } + + if(ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.Supported)) + ataOneValue.Add("S.M.A.R.T. Command Transport is supported"); + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeSet) && + !ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeClear)) + { + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.SMARTSelfTest)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.SMARTSelfTest) + ? "S.M.A.R.T. self-testing is supported and enabled" + : "S.M.A.R.T. self-testing is supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.SMARTLog)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.SMARTLog) + ? "S.M.A.R.T. error logging is supported and enabled" + : "S.M.A.R.T. error logging is supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.IdleImmediate)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.IdleImmediate) + ? "IDLE IMMEDIATE with UNLOAD FEATURE is supported and enabled" + : "IDLE IMMEDIATE with UNLOAD FEATURE is supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.WriteURG)) + ataOneValue.Add("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT"); + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.ReadURG)) + ataOneValue.Add("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT"); + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.WWN)) + ataOneValue.Add("Device has a World Wide Name"); + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.FUAWriteQ)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.FUAWriteQ) + ? "WRITE DMA QUEUED FUA EXT is supported and enabled" + : "WRITE DMA QUEUED FUA EXT is supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.FUAWrite)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.FUAWrite) + ? "WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported and enabled" + : "WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.GPL)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.GPL) + ? "General Purpose Logging is supported and enabled" + : "General Purpose Logging is supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.Streaming)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.Streaming) + ? "Streaming feature set is supported and enabled" + : "Streaming feature set is supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MCPT)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.MCPT) + ? "Media Card Pass Through command set is supported and enabled" + : "Media Card Pass Through command set is supported"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MediaSerial)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.MediaSerial) + ? "Media Serial is supported and valid" + : "Media Serial is supported"); + } + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.MustBeSet) && + !ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.MustBeClear)) + { + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.DSN)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.DSN) + ? "DSN feature set is supported and enabled" + : "DSN feature set is supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.AMAC)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.AMAC) + ? "Accessible Max Address Configuration is supported and enabled" + : "Accessible Max Address Configuration is supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.ExtPowerCond)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.ExtPowerCond) + ? "Extended Power Conditions are supported and enabled" + : "Extended Power Conditions are supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.ExtStatusReport)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.ExtStatusReport) + ? "Extended Status Reporting is supported and enabled" + : "Extended Status Reporting is supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.FreeFallControl)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.FreeFallControl) + ? "Free-fall control feature set is supported and enabled" + : "Free-fall control feature set is supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.SegmentedDownloadMicrocode)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4 + .SegmentedDownloadMicrocode) + ? "Segmented feature in DOWNLOAD MICROCODE is supported and enabled" + : "Segmented feature in DOWNLOAD MICROCODE is supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.RWDMAExtGpl)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.RWDMAExtGpl) + ? "READ/WRITE DMA EXT GPL are supported and enabled" + : "READ/WRITE DMA EXT GPL are supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.WriteUnc)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.WriteUnc) + ? "WRITE UNCORRECTABLE is supported and enabled" + : "WRITE UNCORRECTABLE is supported"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.WRV)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.WRV) + ? "Write/Read/Verify is supported and enabled" + : "Write/Read/Verify is supported"); + + ataOneValue.Add($"{ataIdentify.WRVSectorCountMode2} sectors for Write/Read/Verify mode 2"); + ataOneValue.Add($"{ataIdentify.WRVSectorCountMode3} sectors for Write/Read/Verify mode 3"); + + if(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.WRV)) + ataOneValue.Add($"Current Write/Read/Verify mode: {ataIdentify.WRVMode}"); + } + + if(ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.DT1825)) + { + ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.DT1825) + ? "DT1825 is supported and enabled" + : "DT1825 is supported"); + } + } + + if(true) + { + if(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.BlockErase)) + ataOneValue.Add("BLOCK ERASE EXT is supported"); + + if(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.Overwrite)) + ataOneValue.Add("OVERWRITE EXT is supported"); + + if(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.CryptoScramble)) + ataOneValue.Add("CRYPTO SCRAMBLE EXT is supported"); + } + + if(true) + { + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.DeviceConfDMA)) + ataOneValue.Add("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ReadBufferDMA)) + ataOneValue.Add("READ BUFFER DMA is supported"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.WriteBufferDMA)) + ataOneValue.Add("WRITE BUFFER DMA is supported"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.DownloadMicroCodeDMA)) + ataOneValue.Add("DOWNLOAD MICROCODE DMA is supported"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.SetMaxDMA)) + ataOneValue.Add("SET PASSWORD DMA and SET UNLOCK DMA are supported"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.Ata28)) + ataOneValue.Add("Not all 28-bit commands are supported"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.CFast)) + ataOneValue.Add("Device follows CFast specification"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.IEEE1667)) + ataOneValue.Add("Device follows IEEE-1667"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.DeterministicTrim)) + { + ataOneValue.Add("Read after TRIM is deterministic"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ReadZeroTrim)) + ataOneValue.Add("Read after TRIM returns empty data"); + } + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.LongPhysSectorAligError)) + ataOneValue.Add("Device supports Long Physical Sector Alignment Error Reporting Control"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.Encrypted)) + ataOneValue.Add("Device encrypts all user data"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.AllCacheNV)) + ataOneValue.Add("Device's write cache is non-volatile"); + + if(ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ZonedBit0) || + ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ZonedBit1)) + ataOneValue.Add("Device is zoned"); + } + + if(true) + { + if(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.Sanitize)) + { + ataOneValue.Add("Sanitize feature set is supported"); + + ataOneValue.Add(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.SanitizeCommands) + ? "Sanitize commands are specified by ACS-3 or higher" + : "Sanitize commands are specified by ACS-2"); + + if(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.SanitizeAntifreeze)) + ataOneValue.Add("SANITIZE ANTIFREEZE LOCK EXT is supported"); + } + } + + if(!ata1 && maxAtaLevel >= 8) + { + if(ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.Set) && + !ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.Clear) && + ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.TrustedComputing)) + ataOneValue.Add("Trusted Computing feature set is supported"); + } + + if((ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0x1 || + (ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0xE) + { + if(true) + { + if(!ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Clear)) + { + if(ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.ReadLogDMAExt)) + ataOneValue.Add("READ LOG DMA EXT is supported"); + } + } + + if(true) + { + if(!ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.Clear)) + { + if(ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.FPDMAQ)) + ataOneValue.Add("RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED are supported"); + } + } + + if(true) + { + if(!ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.Clear)) + { + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.NonZeroBufferOffset)) + { + ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit + .NonZeroBufferOffset) + ? "Non-zero buffer offsets are supported and enabled" + : "Non-zero buffer offsets are supported"); + } + + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.DMASetup)) + { + ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.DMASetup) + ? "DMA Setup auto-activation is supported and enabled" + : "DMA Setup auto-activation is supported"); + } + + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.InitPowerMgmt)) + { + ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.InitPowerMgmt) + ? "Device-initiated power management is supported and enabled" + : "Device-initiated power management is supported"); + } + + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.InOrderData)) + { + ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.InOrderData) + ? "In-order data delivery is supported and enabled" + : "In-order data delivery is supported"); + } + + if(!atapi) + { + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.HardwareFeatureControl)) + { + ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit + .HardwareFeatureControl) + ? "Hardware Feature Control is supported and enabled" + : "Hardware Feature Control is supported"); + } + } + + if(atapi) + { + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.AsyncNotification)) + { + if(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.AsyncNotification)) + ataOneValue.Add("Asynchronous notification is supported"); + else + ataOneValue.Add("Asynchronous notification is supported"); + } + } + + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.SettingsPreserve)) + { + if(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.SettingsPreserve)) + ataOneValue.Add("Software Settings Preservation is supported"); + else + ataOneValue.Add("Software Settings Preservation is supported"); + } + + if(ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.NCQAutoSense)) + ataOneValue.Add("NCQ Autosense is supported"); + + if(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.EnabledSlumber)) + ataOneValue.Add("Automatic Partial to Slumber transitions are enabled"); + } + } + } + + if((ataIdentify.RemovableStatusSet & 0x03) > 0) + ataOneValue.Add("Removable Media Status Notification feature set is supported"); + + if(ataIdentify.FreeFallSensitivity != 0x00 && ataIdentify.FreeFallSensitivity != 0xFF) + ataOneValue.Add($"Free-fall sensitivity set to {ataIdentify.FreeFallSensitivity}"); + + if(ataIdentify.DataSetMgmt.HasFlag(Identify.DataSetMgmtBit.Trim)) ataOneValue.Add("TRIM is supported"); + + if(ataIdentify.DataSetMgmtSize > 0) + ataOneValue.Add($"DATA SET MANAGEMENT can receive a maximum of {ataIdentify.DataSetMgmtSize} blocks of 512 bytes"); + + if(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Supported)) + { + ataOneValue.Add("Security:"); + + if(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Enabled)) + { + ataOneValue.Add("Security is enabled"); + + ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Locked) + ? "Security is locked" + : "Security is not locked"); + + ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Frozen) + ? "Security is frozen" + : "Security is not frozen"); + + ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Expired) + ? "Security count has expired" + : "Security count has not expired"); + + ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Maximum) + ? "Security level is maximum" + : "Security level is high"); + } + else + ataOneValue.Add("Security is not enabled"); + + if(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Enhanced)) + ataOneValue.Add("Supports enhanced security erase"); + + ataOneValue.Add($"{ataIdentify.SecurityEraseTime * 2} minutes to complete secure erase"); + + if(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Enhanced)) + ataOneValue.Add($"{ataIdentify.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase"); + + ataOneValue.Add($"Master password revision code: {ataIdentify.MasterPasswordRevisionCode}"); + } + + if(ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeSet) && + !ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeClear) && + ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.Streaming)) + { + ataOneValue.Add("Streaming:"); + ataOneValue.Add($"Minimum request size is {ataIdentify.StreamMinReqSize}"); + ataOneValue.Add($"Streaming transfer time in PIO is {ataIdentify.StreamTransferTimePIO}"); + ataOneValue.Add($"Streaming transfer time in DMA is {ataIdentify.StreamTransferTimeDMA}"); + ataOneValue.Add($"Streaming access latency is {ataIdentify.StreamAccessLatency}"); + ataOneValue.Add($"Streaming performance granularity is {ataIdentify.StreamPerformanceGranularity}"); + } + + if(ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.Supported)) + { + ataOneValue.Add("S.M.A.R.T. Command Transport (SCT):"); + + if(ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.LongSectorAccess)) + ataOneValue.Add("SCT Long Sector Address is supported"); + + if(ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.WriteSame)) + ataOneValue.Add("SCT Write Same is supported"); + + if(ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.ErrorRecoveryControl)) + ataOneValue.Add("SCT Error Recovery Control is supported"); + + if(ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.FeaturesControl)) + ataOneValue.Add("SCT Features Control is supported"); + + if(ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.DataTables)) + ataOneValue.Add("SCT Data Tables are supported"); + } + + if((ataIdentify.NVCacheCaps & 0x0010) == 0x0010) + { + ataOneValue.Add("Non-Volatile Cache:"); + ataOneValue.Add($"Version {(ataIdentify.NVCacheCaps & 0xF000) >> 12}"); + + if((ataIdentify.NVCacheCaps & 0x0001) == 0x0001) + { + ataOneValue.Add((ataIdentify.NVCacheCaps & 0x0002) == 0x0002 + ? "Power mode feature set is supported and enabled" + : "Power mode feature set is supported"); + + ataOneValue.Add($"Version {(ataIdentify.NVCacheCaps & 0x0F00) >> 8}"); + } + + ataOneValue.Add($"Non-Volatile Cache is {ataIdentify.NVCacheSize * logicalSectorSize} bytes"); + } + + if(ataReport.ReadCapabilities != null) + { + removable = false; + ataOneValue.Add(""); + + if(ataReport.ReadCapabilities.NominalRotationRate != null && + ataReport.ReadCapabilities.NominalRotationRate != 0x0000 && + ataReport.ReadCapabilities.NominalRotationRate != 0xFFFF) + { + ataOneValue.Add(ataReport.ReadCapabilities.NominalRotationRate == 0x0001 + ? "Device does not rotate." + : $"Device rotates at {ataReport.ReadCapabilities.NominalRotationRate} rpm"); + } + + if(!atapi) + { + if(ataReport.ReadCapabilities.BlockSize != null) + { + ataTwoValue.Add("Logical sector size", $"{ataReport.ReadCapabilities.BlockSize} bytes"); + logicalSectorSize = ataReport.ReadCapabilities.BlockSize.Value; + } + + if(ataReport.ReadCapabilities.PhysicalBlockSize != null) + ataTwoValue.Add("Physical sector size", $"{ataReport.ReadCapabilities.PhysicalBlockSize} bytes"); + + if(ataReport.ReadCapabilities.LongBlockSize != null) + ataTwoValue.Add("READ LONG sector size", $"{ataReport.ReadCapabilities.LongBlockSize} bytes"); + + if(ataReport.ReadCapabilities.BlockSize != null && + ataReport.ReadCapabilities.PhysicalBlockSize != null && + ataReport.ReadCapabilities.BlockSize.Value != ataReport.ReadCapabilities.PhysicalBlockSize.Value && + (ataReport.ReadCapabilities.LogicalAlignment & 0x8000) == 0x0000 && + (ataReport.ReadCapabilities.LogicalAlignment & 0x4000) == 0x4000) + { + ataOneValue + .Add($"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector"); + } + + if(ataReport.ReadCapabilities.CHS != null && ataReport.ReadCapabilities.CurrentCHS != null) + { + int currentSectors = ataReport.ReadCapabilities.CurrentCHS.Cylinders * + ataReport.ReadCapabilities.CurrentCHS.Heads * + ataReport.ReadCapabilities.CurrentCHS.Sectors; + + ataTwoValue.Add("Cylinders", + $"{ataReport.ReadCapabilities.CHS.Cylinders} max., {ataReport.ReadCapabilities.CurrentCHS.Cylinders} current"); + + ataTwoValue.Add("Heads", + $"{ataReport.ReadCapabilities.CHS.Heads} max., {ataReport.ReadCapabilities.CurrentCHS.Heads} current"); + + ataTwoValue.Add("Sectors per track", + $"{ataReport.ReadCapabilities.CHS.Sectors} max., {ataReport.ReadCapabilities.CurrentCHS.Sectors} current"); + + ataTwoValue.Add("Sectors addressable in CHS mode", + $"{ataReport.ReadCapabilities.CHS.Cylinders * ataReport.ReadCapabilities.CHS.Heads * ataReport.ReadCapabilities.CHS.Sectors} max., {currentSectors} current"); + + ataTwoValue.Add("Device size in CHS mode", + $"{(ulong)currentSectors * logicalSectorSize} bytes, {(ulong)currentSectors * logicalSectorSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * logicalSectorSize) / 1024 / 1024:F2} MiB"); + } + else if(ataReport.ReadCapabilities.CHS != null) + { + int currentSectors = ataReport.ReadCapabilities.CHS.Cylinders * + ataReport.ReadCapabilities.CHS.Heads * + ataReport.ReadCapabilities.CHS.Sectors; + + ataTwoValue.Add("Cylinders", $"{ataReport.ReadCapabilities.CHS.Cylinders}"); + ataTwoValue.Add("Heads", $"{ataReport.ReadCapabilities.CHS.Heads}"); + ataTwoValue.Add("Sectors per track", $"{ataReport.ReadCapabilities.CHS.Sectors}"); + ataTwoValue.Add("Sectors addressable in CHS mode", $"{currentSectors}"); + + ataTwoValue.Add("Device size in CHS mode", + $"{(ulong)currentSectors * logicalSectorSize} bytes, {(ulong)currentSectors * logicalSectorSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * logicalSectorSize) / 1024 / 1024:F2} MiB"); + } + + if(ataReport.ReadCapabilities.LBASectors != null) + { + ataTwoValue.Add("Sectors addressable in sectors in 28-bit LBA mode", + $"{ataReport.ReadCapabilities.LBASectors}"); + + if((ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize / 1024 / 1024 > 1000000) + { + ataTwoValue.Add("Device size in 28-bit LBA mode", + $"{(ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize} bytes, {(ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize) / 1024 / 1024 / 1024 / 1024:F2} TiB"); + } + else if((ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize / 1024 / 1024 > 1000) + { + ataTwoValue.Add("Device size in 28-bit LBA mode", + $"{(ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize} bytes, {(ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize) / 1024 / 1024 / 1024:F2} GiB"); + } + else + { + ataTwoValue.Add("Device size in 28-bit LBA mode", + $"{(ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize} bytes, {(ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize / 1000 / 1000} Mb, {(double)((ulong)ataReport.ReadCapabilities.LBASectors * logicalSectorSize) / 1024 / 1024:F2} MiB"); + } + } + + if(ataReport.ReadCapabilities.LBA48Sectors != null) + { + ataTwoValue.Add("Sectors addressable in sectors in 48-bit LBA mode", + $"{ataReport.ReadCapabilities.LBA48Sectors}"); + + if(ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize / 1024 / 1024 > 1000000) + { + ataTwoValue.Add("Device size in 48-bit LBA mode", + $"{ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize} bytes, {ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize) / 1024 / 1024 / 1024 / 1024:F2} TiB"); + } + else if(ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize / 1024 / 1024 > 1000) + { + ataTwoValue.Add("Device size in 48-bit LBA mode", + $"{ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize} bytes, {ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize / 1000 / 1000 / 1000} Gb, {(double)(ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize) / 1024 / 1024 / 1024:F2} GiB"); + } + else + { + ataTwoValue.Add("Device size in 48-bit LBA mode", + $"{ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize} bytes, {ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize / 1000 / 1000} Mb, {(double)(ataReport.ReadCapabilities.LBA48Sectors * logicalSectorSize) / 1024 / 1024:F2} MiB"); + } + } + + if(ata1 || cfa) + { + if(ataReport.ReadCapabilities.UnformattedBPT > 0) + ataTwoValue.Add("Bytes per unformatted track", $"{ataReport.ReadCapabilities.UnformattedBPT}"); + + if(ataReport.ReadCapabilities.UnformattedBPS > 0) + ataTwoValue.Add("Bytes per unformatted sector", $"{ataReport.ReadCapabilities.UnformattedBPS}"); + } + } + + if(ataReport.ReadCapabilities.SupportsReadSectors == true) + ataOneValue.Add("Device supports READ SECTOR(S) command in CHS mode"); + + if(ataReport.ReadCapabilities.SupportsReadRetry == true) + ataOneValue.Add("Device supports READ SECTOR(S) RETRY command in CHS mode"); + + if(ataReport.ReadCapabilities.SupportsReadDma == true) + ataOneValue.Add("Device supports READ DMA command in CHS mode"); + + if(ataReport.ReadCapabilities.SupportsReadDmaRetry == true) + ataOneValue.Add("Device supports READ DMA RETRY command in CHS mode"); + + if(ataReport.ReadCapabilities.SupportsReadLong == true) + ataOneValue.Add("Device supports READ LONG command in CHS mode"); + + if(ataReport.ReadCapabilities.SupportsReadLongRetry == true) + ataOneValue.Add("Device supports READ LONG RETRY command in CHS mode"); + + if(ataReport.ReadCapabilities.SupportsReadLba == true) + ataOneValue.Add("Device supports READ SECTOR(S) command in 28-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsReadRetryLba == true) + ataOneValue.Add("Device supports READ SECTOR(S) RETRY command in 28-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsReadDmaLba == true) + ataOneValue.Add("Device supports READ DMA command in 28-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsReadDmaRetryLba == true) + ataOneValue.Add("Device supports READ DMA RETRY command in 28-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsReadLongLba == true) + ataOneValue.Add("Device supports READ LONG command in 28-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsReadLongRetryLba == true) + ataOneValue.Add("Device supports READ LONG RETRY command in 28-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsReadLba48 == true) + ataOneValue.Add("Device supports READ SECTOR(S) command in 48-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsReadDmaLba48 == true) + ataOneValue.Add("Device supports READ DMA command in 48-bit LBA mode"); + + if(ataReport.ReadCapabilities.SupportsSeek == true) + ataOneValue.Add("Device supports SEEK command in CHS mode"); + + if(ataReport.ReadCapabilities.SupportsSeekLba == true) + ataOneValue.Add("Device supports SEEK command in 28-bit LBA mode"); + } + else + testedMedia = ataReport.RemovableMedias; + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/Hash.cs b/Aaru.Server.Old/Core/Hash.cs new file mode 100644 index 00000000..5b02387b --- /dev/null +++ b/Aaru.Server.Old/Core/Hash.cs @@ -0,0 +1,35 @@ +using System.Security.Cryptography; + +namespace Aaru.Server.Old.Core; + +public static class Hash +{ + public static string Sha512(byte[] data) + { + byte[] hash; + + using(var sha = new SHA512Managed()) + { + sha.Initialize(); + hash = sha.ComputeHash(data); + } + + var chars = new char[hash.Length * 2]; + + var j = 0; + + foreach(byte b in hash) + { + int nibble1 = (b & 0xF0) >> 4; + int nibble2 = b & 0x0F; + + nibble1 += nibble1 > 9 ? 0x57 : 0x30; + nibble2 += nibble2 > 9 ? 0x57 : 0x30; + + chars[j++] = (char)nibble1; + chars[j++] = (char)nibble2; + } + + return new string(chars); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/HtmlHelpers.cs b/Aaru.Server.Old/Core/HtmlHelpers.cs new file mode 100644 index 00000000..3e401ab9 --- /dev/null +++ b/Aaru.Server.Old/Core/HtmlHelpers.cs @@ -0,0 +1,28 @@ +using System.Text.RegularExpressions; +using Aaru.CommonTypes.Metadata; +using Microsoft.AspNetCore.Mvc.Rendering; + +namespace Aaru.Server.Old.Core; + +public static class HtmlHelpers +{ + public static string EncodedMultiLineText(this IHtmlHelper helper, string text) => + string.IsNullOrEmpty(text) + ? string.Empty + : Regex.Replace(helper.Encode(text), " | | ", "
"); + + public static string EncodedMultiLineText(this IHtmlHelper helper, string text) => + string.IsNullOrEmpty(text) + ? string.Empty + : Regex.Replace(helper.Encode(text), " | | ", "
"); + + public static string EncodedMultiLineText(this IHtmlHelper helper, string text) => + string.IsNullOrEmpty(text) + ? string.Empty + : Regex.Replace(helper.Encode(text), " | | ", "
"); + + public static string EncodedMultiLineText(this IHtmlHelper helper, string text) => + string.IsNullOrEmpty(text) + ? string.Empty + : Regex.Replace(helper.Encode(text), " | | ", "
"); +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/ScsiEvpd.cs b/Aaru.Server.Old/Core/ScsiEvpd.cs new file mode 100644 index 00000000..e3d29788 --- /dev/null +++ b/Aaru.Server.Old/Core/ScsiEvpd.cs @@ -0,0 +1,110 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ScsiEvpd.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes SCSI EVPDs from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Metadata; +using Aaru.Decoders.SCSI; + +namespace Aaru.Server.Old.Core; + +public static class ScsiEvpd +{ + /// + /// Takes the SCSI EVPD part of a device report and prints it as a list key=value pairs to be sequenced by ASP.NET + /// in the rendering + /// + /// EVPD pages + /// SCSI vendor string + /// List to put the key=value pairs on + public static void Report(IEnumerable pages, string vendor, ref Dictionary evpdPages) + { + foreach(ScsiPage evpd in pages) + { + string decoded; + + if(evpd.page >= 0x01 && evpd.page <= 0x7F) + decoded = EVPD.DecodeASCIIPage(evpd.value); + else if(evpd.page == 0x81) + decoded = EVPD.PrettifyPage_81(evpd.value); + else if(evpd.page == 0x82) + decoded = EVPD.DecodePage82(evpd.value); + else if(evpd.page == 0x83) + decoded = EVPD.PrettifyPage_83(evpd.value); + else if(evpd.page == 0x84) + decoded = EVPD.PrettifyPage_84(evpd.value); + else if(evpd.page == 0x85) + decoded = EVPD.PrettifyPage_85(evpd.value); + else if(evpd.page == 0x86) + decoded = EVPD.PrettifyPage_86(evpd.value); + else if(evpd.page == 0x89) + decoded = EVPD.PrettifyPage_89(evpd.value); + else if(evpd.page == 0xB0) + decoded = EVPD.PrettifyPage_B0(evpd.value); + else if(evpd.page == 0xB2) + decoded = $"TapeAlert Supported Flags Bitmap: 0x{EVPD.DecodePageB2(evpd.value):X16}
"; + else if(evpd.page == 0xB4) + decoded = EVPD.DecodePageB4(evpd.value); + else if(evpd.page == 0xC0 && vendor.Trim() == "quantum") + decoded = EVPD.PrettifyPage_C0_Quantum(evpd.value); + else if(evpd.page == 0xC0 && vendor.Trim() == "seagate") + decoded = EVPD.PrettifyPage_C0_Seagate(evpd.value); + else if(evpd.page == 0xC0 && vendor.Trim() == "ibm") + decoded = EVPD.PrettifyPage_C0_IBM(evpd.value); + else if(evpd.page == 0xC1 && vendor.Trim() == "ibm") + decoded = EVPD.PrettifyPage_C1_IBM(evpd.value); + else if((evpd.page == 0xC0 || evpd.page == 0xC1) && vendor.Trim() == "certance") + decoded = EVPD.PrettifyPage_C0_C1_Certance(evpd.value); + else if((evpd.page == 0xC2 || + evpd.page == 0xC3 || + evpd.page == 0xC4 || + evpd.page == 0xC5 || + evpd.page == 0xC6) && + vendor.Trim() == "certance") + decoded = EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value); + else if((evpd.page == 0xC0 || + evpd.page == 0xC1 || + evpd.page == 0xC2 || + evpd.page == 0xC3 || + evpd.page == 0xC4 || + evpd.page == 0xC5) && + vendor.Trim() == "hp") + decoded = EVPD.PrettifyPage_C0_to_C5_HP(evpd.value); + else if(evpd.page == 0xDF && vendor.Trim() == "certance") + decoded = EVPD.PrettifyPage_DF_Certance(evpd.value); + else + decoded = "Undecoded"; + + if(!string.IsNullOrEmpty(decoded)) decoded = decoded.Replace("\n", "
"); + + evpdPages.Add($"EVPD page {evpd.page:X2}h", decoded); + } + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/ScsiInquiry.cs b/Aaru.Server.Old/Core/ScsiInquiry.cs new file mode 100644 index 00000000..195044c8 --- /dev/null +++ b/Aaru.Server.Old/Core/ScsiInquiry.cs @@ -0,0 +1,2238 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ScsiInquiry.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes SCSI INQUIRY from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Structs.Devices.SCSI; + +namespace Aaru.Server.Old.Core; + +static class ScsiInquiry +{ + /// + /// Takes the SCSI INQUIRY part of a device report and prints it as a list of values to be sequenced by ASP.NET in + /// the rendering + /// + /// INQUIRY part of the report + /// List of values + internal static IEnumerable Report(Inquiry? inquiryNullable) + { + List scsiOneValue = new(); + + if(!inquiryNullable.HasValue) return scsiOneValue; + + Inquiry inquiry = inquiryNullable.Value; + + switch((PeripheralQualifiers)inquiry.PeripheralQualifier) + { + case PeripheralQualifiers.Supported: + scsiOneValue.Add("Device is connected and supported."); + + break; + case PeripheralQualifiers.Unconnected: + scsiOneValue.Add("Device is supported but not connected."); + + break; + case PeripheralQualifiers.Reserved: + scsiOneValue.Add("Reserved value set in Peripheral Qualifier field."); + + break; + case PeripheralQualifiers.Unsupported: + scsiOneValue.Add("Device is connected but unsupported."); + + break; + default: + scsiOneValue.Add($"Vendor value {inquiry.PeripheralQualifier} set in Peripheral Qualifier field."); + + break; + } + + switch((PeripheralDeviceTypes)inquiry.PeripheralDeviceType) + { + case PeripheralDeviceTypes.DirectAccess: //0x00, + scsiOneValue.Add("Direct-access device"); + + break; + case PeripheralDeviceTypes.SequentialAccess: //0x01, + scsiOneValue.Add("Sequential-access device"); + + break; + case PeripheralDeviceTypes.PrinterDevice: //0x02, + scsiOneValue.Add("Printer device"); + + break; + case PeripheralDeviceTypes.ProcessorDevice: //0x03, + scsiOneValue.Add("Processor device"); + + break; + case PeripheralDeviceTypes.WriteOnceDevice: //0x04, + scsiOneValue.Add("Write-once device"); + + break; + case PeripheralDeviceTypes.MultiMediaDevice: //0x05, + scsiOneValue.Add("CD-ROM/DVD/etc device"); + + break; + case PeripheralDeviceTypes.ScannerDevice: //0x06, + scsiOneValue.Add("Scanner device"); + + break; + case PeripheralDeviceTypes.OpticalDevice: //0x07, + scsiOneValue.Add("Optical memory device"); + + break; + case PeripheralDeviceTypes.MediumChangerDevice: //0x08, + scsiOneValue.Add("Medium change device"); + + break; + case PeripheralDeviceTypes.CommsDevice: //0x09, + scsiOneValue.Add("Communications device"); + + break; + case PeripheralDeviceTypes.PrePressDevice1: //0x0A, + scsiOneValue.Add("Graphics arts pre-press device (defined in ASC IT8)"); + + break; + case PeripheralDeviceTypes.PrePressDevice2: //0x0B, + scsiOneValue.Add("Graphics arts pre-press device (defined in ASC IT8)"); + + break; + case PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, + scsiOneValue.Add("Array controller device"); + + break; + case PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, + scsiOneValue.Add("Enclosure services device"); + + break; + case PeripheralDeviceTypes.SimplifiedDevice: //0x0E, + scsiOneValue.Add("Simplified direct-access device"); + + break; + case PeripheralDeviceTypes.OCRWDevice: //0x0F, + scsiOneValue.Add("Optical card reader/writer device"); + + break; + case PeripheralDeviceTypes.BridgingExpander: //0x10, + scsiOneValue.Add("Bridging Expanders"); + + break; + case PeripheralDeviceTypes.ObjectDevice: //0x11, + scsiOneValue.Add("Object-based Storage Device"); + + break; + case PeripheralDeviceTypes.ADCDevice: //0x12, + scsiOneValue.Add("Automation/Drive Interface"); + + break; + case PeripheralDeviceTypes.SCSISecurityManagerDevice: //0x13, + scsiOneValue.Add("Security Manager Device"); + + break; + case PeripheralDeviceTypes.SCSIZonedBlockDevice: //0x14 + scsiOneValue.Add("Host managed zoned block device"); + + break; + case PeripheralDeviceTypes.WellKnownDevice: //0x1E, + scsiOneValue.Add("Well known logical unit"); + + break; + case PeripheralDeviceTypes.UnknownDevice: //0x1F + scsiOneValue.Add("Unknown or no device type"); + + break; + default: + scsiOneValue.Add($"Unknown device type field value 0x{inquiry.PeripheralDeviceType:X2}"); + + break; + } + + switch((ANSIVersions)inquiry.ANSIVersion) + { + case ANSIVersions.ANSINoVersion: + scsiOneValue.Add("Device does not claim to comply with any SCSI ANSI standard"); + + break; + case ANSIVersions.ANSI1986Version: + scsiOneValue.Add("Device claims to comply with ANSI X3.131:1986 (SCSI-1)"); + + break; + case ANSIVersions.ANSI1994Version: + scsiOneValue.Add("Device claims to comply with ANSI X3.131:1994 (SCSI-2)"); + + break; + case ANSIVersions.ANSI1997Version: + scsiOneValue.Add("Device claims to comply with ANSI X3.301:1997 (SPC-1)"); + + break; + case ANSIVersions.ANSI2001Version: + scsiOneValue.Add("Device claims to comply with ANSI X3.351:2001 (SPC-2)"); + + break; + case ANSIVersions.ANSI2005Version: + scsiOneValue.Add("Device claims to comply with ANSI X3.408:2005 (SPC-3)"); + + break; + case ANSIVersions.ANSI2008Version: + scsiOneValue.Add("Device claims to comply with ANSI X3.408:2005 (SPC-4)"); + + break; + default: + scsiOneValue + .Add($"Device claims to comply with unknown SCSI ANSI standard value 0x{inquiry.ANSIVersion:X2})"); + + break; + } + + switch((ECMAVersions)inquiry.ECMAVersion) + { + case ECMAVersions.ECMANoVersion: + scsiOneValue.Add("Device does not claim to comply with any SCSI ECMA standard"); + + break; + case ECMAVersions.ECMA111: + scsiOneValue.Add("Device claims to comply ECMA-111: Small Computer System Interface SCSI"); + + break; + default: + scsiOneValue + .Add($"Device claims to comply with unknown SCSI ECMA standard value 0x{inquiry.ECMAVersion:X2})"); + + break; + } + + switch((ISOVersions)inquiry.ISOVersion) + { + case ISOVersions.ISONoVersion: + scsiOneValue.Add("Device does not claim to comply with any SCSI ISO/IEC standard"); + + break; + case ISOVersions.ISO1995Version: + scsiOneValue.Add("Device claims to comply with ISO/IEC 9316:1995"); + + break; + default: + scsiOneValue + .Add($"Device claims to comply with unknown SCSI ISO/IEC standard value 0x{inquiry.ISOVersion:X2})"); + + break; + } + + if(inquiry.RMB) scsiOneValue.Add("Device is removable"); + + if(inquiry.AERC) scsiOneValue.Add("Device supports Asynchronous Event Reporting Capability"); + + if(inquiry.TrmTsk) scsiOneValue.Add("Device supports TERMINATE TASK command"); + + if(inquiry.NormACA) scsiOneValue.Add("Device supports setting Normal ACA"); + + if(inquiry.HiSup) scsiOneValue.Add("Device supports LUN hierarchical addressing"); + + if(inquiry.SCCS) scsiOneValue.Add("Device contains an embedded storage array controller"); + + if(inquiry.ACC) scsiOneValue.Add("Device contains an Access Control Coordinator"); + + if(inquiry.ThreePC) scsiOneValue.Add("Device supports third-party copy commands"); + + if(inquiry.Protect) scsiOneValue.Add("Device supports protection information"); + + if(inquiry.BQue) scsiOneValue.Add("Device supports basic queueing"); + + if(inquiry.EncServ) scsiOneValue.Add("Device contains an embedded enclosure services component"); + + if(inquiry.MultiP) scsiOneValue.Add("Multi-port device"); + + if(inquiry.MChngr) scsiOneValue.Add("Device contains or is attached to a medium changer"); + + if(inquiry.ACKREQQ) scsiOneValue.Add("Device supports request and acknowledge handshakes"); + + if(inquiry.Addr32) scsiOneValue.Add("Device supports 32-bit wide SCSI addresses"); + + if(inquiry.Addr16) scsiOneValue.Add("Device supports 16-bit wide SCSI addresses"); + + if(inquiry.RelAddr) scsiOneValue.Add("Device supports relative addressing"); + + if(inquiry.WBus32) scsiOneValue.Add("Device supports 32-bit wide data transfers"); + + if(inquiry.WBus16) scsiOneValue.Add("Device supports 16-bit wide data transfers"); + + if(inquiry.Sync) scsiOneValue.Add("Device supports synchronous data transfer"); + + if(inquiry.Linked) scsiOneValue.Add("Device supports linked commands"); + + if(inquiry.TranDis) scsiOneValue.Add("Device supports CONTINUE TASK and TARGET TRANSFER DISABLE commands"); + + if(inquiry.QAS) scsiOneValue.Add("Device supports Quick Arbitration and Selection"); + + if(inquiry.CmdQue) scsiOneValue.Add("Device supports TCQ queue"); + + if(inquiry.IUS) scsiOneValue.Add("Device supports information unit transfers"); + + if(inquiry.SftRe) scsiOneValue.Add("Device implements RESET as a soft reset"); + + switch((TGPSValues)inquiry.TPGS) + { + case TGPSValues.NotSupported: + scsiOneValue.Add("Device does not support asymmetrical access"); + + break; + case TGPSValues.OnlyImplicit: + scsiOneValue.Add("Device only supports implicit asymmetrical access"); + + break; + case TGPSValues.OnlyExplicit: + scsiOneValue.Add("Device only supports explicit asymmetrical access"); + + break; + case TGPSValues.Both: + scsiOneValue.Add("Device supports implicit and explicit asymmetrical access"); + + break; + default: + scsiOneValue.Add($"Unknown value in TPGS field 0x{inquiry.TPGS:X2}"); + + break; + } + + switch((SPIClocking)inquiry.Clocking) + { + case SPIClocking.ST: + scsiOneValue.Add("Device supports only ST clocking"); + + break; + case SPIClocking.DT: + scsiOneValue.Add("Device supports only DT clocking"); + + break; + case SPIClocking.Reserved: + scsiOneValue.Add("Reserved value 0x02 found in SPI clocking field"); + + break; + case SPIClocking.STandDT: + scsiOneValue.Add("Device supports ST and DT clocking"); + + break; + default: + scsiOneValue.Add($"Unknown value in SPI clocking field 0x{inquiry.Clocking:X2}"); + + break; + } + + if(inquiry.VersionDescriptors == null) return scsiOneValue; + + foreach(ushort versionDescriptor in inquiry.VersionDescriptors) + { + switch(versionDescriptor) + { + case 0xFFFF: + case 0x0000: + break; + case 0x0020: + scsiOneValue.Add("Device complies with SAM (no version claimed)"); + + break; + case 0x003B: + scsiOneValue.Add("Device complies with SAM T10/0994-D revision 18"); + + break; + case 0x003C: + scsiOneValue.Add("Device complies with SAM ANSI INCITS 270-1996"); + + break; + case 0x0040: + scsiOneValue.Add("Device complies with SAM-2 (no version claimed)"); + + break; + case 0x0054: + scsiOneValue.Add("Device complies with SAM-2 T10/1157-D revision 23"); + + break; + case 0x0055: + scsiOneValue.Add("Device complies with SAM-2 T10/1157-D revision 24"); + + break; + case 0x005C: + scsiOneValue.Add("Device complies with SAM-2 ANSI INCITS 366-2003"); + + break; + case 0x005E: + scsiOneValue.Add("Device complies with SAM-2 ISO/IEC 14776-412"); + + break; + case 0x0060: + scsiOneValue.Add("Device complies with SAM-3 (no version claimed)"); + + break; + case 0x0062: + scsiOneValue.Add("Device complies with SAM-3 T10/1561-D revision 7"); + + break; + case 0x0075: + scsiOneValue.Add("Device complies with SAM-3 T10/1561-D revision 13"); + + break; + case 0x0076: + scsiOneValue.Add("Device complies with SAM-3 T10/1561-D revision 14"); + + break; + case 0x0077: + scsiOneValue.Add("Device complies with SAM-3 ANSI INCITS 402-2005"); + + break; + case 0x0080: + scsiOneValue.Add("Device complies with SAM-4 (no version claimed)"); + + break; + case 0x0087: + scsiOneValue.Add("Device complies with SAM-4 T10/1683-D revision 13"); + + break; + case 0x008B: + scsiOneValue.Add("Device complies with SAM-4 T10/1683-D revision 14"); + + break; + case 0x0090: + scsiOneValue.Add("Device complies with SAM-4 ANSI INCITS 447-2008"); + + break; + case 0x0092: + scsiOneValue.Add("Device complies with SAM-4 ISO/IEC 14776-414"); + + break; + case 0x00A0: + scsiOneValue.Add("Device complies with SAM-5 (no version claimed)"); + + break; + case 0x00A2: + scsiOneValue.Add("Device complies with SAM-5 T10/2104-D revision 4"); + + break; + case 0x00A4: + scsiOneValue.Add("Device complies with SAM-5 T10/2104-D revision 20"); + + break; + case 0x00A6: + scsiOneValue.Add("Device complies with SAM-5 T10/2104-D revision 21"); + + break; + case 0x00C0: + scsiOneValue.Add("Device complies with SAM-6 (no version claimed)"); + + break; + case 0x0120: + scsiOneValue.Add("Device complies with SPC (no version claimed)"); + + break; + case 0x013B: + scsiOneValue.Add("Device complies with SPC T10/0995-D revision 11a"); + + break; + case 0x013C: + scsiOneValue.Add("Device complies with SPC ANSI INCITS 301-1997"); + + break; + case 0x0140: + scsiOneValue.Add("Device complies with MMC (no version claimed)"); + + break; + case 0x015B: + scsiOneValue.Add("Device complies with MMC T10/1048-D revision 10a"); + + break; + case 0x015C: + scsiOneValue.Add("Device complies with MMC ANSI INCITS 304-1997"); + + break; + case 0x0160: + scsiOneValue.Add("Device complies with SCC (no version claimed)"); + + break; + case 0x017B: + scsiOneValue.Add("Device complies with SCC T10/1047-D revision 06c"); + + break; + case 0x017C: + scsiOneValue.Add("Device complies with SCC ANSI INCITS 276-1997"); + + break; + case 0x0180: + scsiOneValue.Add("Device complies with SBC (no version claimed)"); + + break; + case 0x019B: + scsiOneValue.Add("Device complies with SBC T10/0996-D revision 08c"); + + break; + case 0x019C: + scsiOneValue.Add("Device complies with SBC ANSI INCITS 306-1998"); + + break; + case 0x01A0: + scsiOneValue.Add("Device complies with SMC (no version claimed)"); + + break; + case 0x01BB: + scsiOneValue.Add("Device complies with SMC T10/0999-D revision 10a"); + + break; + case 0x01BC: + scsiOneValue.Add("Device complies with SMC ANSI INCITS 314-1998"); + + break; + case 0x01BE: + scsiOneValue.Add("Device complies with SMC ISO/IEC 14776-351"); + + break; + case 0x01C0: + scsiOneValue.Add("Device complies with SES (no version claimed)"); + + break; + case 0x01DB: + scsiOneValue.Add("Device complies with SES T10/1212-D revision 08b"); + + break; + case 0x01DC: + scsiOneValue.Add("Device complies with SES ANSI INCITS 305-1998"); + + break; + case 0x01DD: + scsiOneValue + .Add("Device complies with SES T10/1212 revision 08b w/ Amendment ANSI INCITS.305/AM1-2000"); + + break; + case 0x01DE: + scsiOneValue + .Add("Device complies with SES ANSI INCITS 305-1998 w/ Amendment ANSI INCITS.305/AM1-2000"); + + break; + case 0x01E0: + scsiOneValue.Add("Device complies with SCC-2 (no version claimed)"); + + break; + case 0x01FB: + scsiOneValue.Add("Device complies with SCC-2 T10/1125-D revision 04"); + + break; + case 0x01FC: + scsiOneValue.Add("Device complies with SCC-2 ANSI INCITS 318-1998"); + + break; + case 0x0200: + scsiOneValue.Add("Device complies with SSC (no version claimed)"); + + break; + case 0x0201: + scsiOneValue.Add("Device complies with SSC T10/0997-D revision 17"); + + break; + case 0x0207: + scsiOneValue.Add("Device complies with SSC T10/0997-D revision 22"); + + break; + case 0x021C: + scsiOneValue.Add("Device complies with SSC ANSI INCITS 335-2000"); + + break; + case 0x0220: + scsiOneValue.Add("Device complies with RBC (no version claimed)"); + + break; + case 0x0238: + scsiOneValue.Add("Device complies with RBC T10/1240-D revision 10a"); + + break; + case 0x023C: + scsiOneValue.Add("Device complies with RBC ANSI INCITS 330-2000"); + + break; + case 0x0240: + scsiOneValue.Add("Device complies with MMC-2 (no version claimed)"); + + break; + case 0x0255: + scsiOneValue.Add("Device complies with MMC-2 T10/1228-D revision 11"); + + break; + case 0x025B: + scsiOneValue.Add("Device complies with MMC-2 T10/1228-D revision 11a"); + + break; + case 0x025C: + scsiOneValue.Add("Device complies with MMC-2 ANSI INCITS 333-2000"); + + break; + case 0x0260: + scsiOneValue.Add("Device complies with SPC-2 (no version claimed)"); + + break; + case 0x0267: + scsiOneValue.Add("Device complies with SPC-2 T10/1236-D revision 12"); + + break; + case 0x0269: + scsiOneValue.Add("Device complies with SPC-2 T10/1236-D revision 18"); + + break; + case 0x0275: + scsiOneValue.Add("Device complies with SPC-2 T10/1236-D revision 19"); + + break; + case 0x0276: + scsiOneValue.Add("Device complies with SPC-2 T10/1236-D revision 20"); + + break; + case 0x0277: + scsiOneValue.Add("Device complies with SPC-2 ANSI INCITS 351-2001"); + + break; + case 0x0278: + scsiOneValue.Add("Device complies with SPC-2 ISO/IEC 14776-452"); + + break; + case 0x0280: + scsiOneValue.Add("Device complies with OCRW (no version claimed)"); + + break; + case 0x029E: + scsiOneValue.Add("Device complies with OCRW ISO/IEC 14776-381"); + + break; + case 0x02A0: + scsiOneValue.Add("Device complies with MMC-3 (no version claimed)"); + + break; + case 0x02B5: + scsiOneValue.Add("Device complies with MMC-3 T10/1363-D revision 9"); + + break; + case 0x02B6: + scsiOneValue.Add("Device complies with MMC-3 T10/1363-D revision 10g"); + + break; + case 0x02B8: + scsiOneValue.Add("Device complies with MMC-3 ANSI INCITS 360-2002"); + + break; + case 0x02E0: + scsiOneValue.Add("Device complies with SMC-2 (no version claimed)"); + + break; + case 0x02F5: + scsiOneValue.Add("Device complies with SMC-2 T10/1383-D revision 5"); + + break; + case 0x02FC: + scsiOneValue.Add("Device complies with SMC-2 T10/1383-D revision 6"); + + break; + case 0x02FD: + scsiOneValue.Add("Device complies with SMC-2 T10/1383-D revision 7"); + + break; + case 0x02FE: + scsiOneValue.Add("Device complies with SMC-2 ANSI INCITS 382-2004"); + + break; + case 0x0300: + scsiOneValue.Add("Device complies with SPC-3 (no version claimed)"); + + break; + case 0x0301: + scsiOneValue.Add("Device complies with SPC-3 T10/1416-D revision 7"); + + break; + case 0x0307: + scsiOneValue.Add("Device complies with SPC-3 T10/1416-D revision 21"); + + break; + case 0x030F: + scsiOneValue.Add("Device complies with SPC-3 T10/1416-D revision 22"); + + break; + case 0x0312: + scsiOneValue.Add("Device complies with SPC-3 T10/1416-D revision 23"); + + break; + case 0x0314: + scsiOneValue.Add("Device complies with SPC-3 ANSI INCITS 408-2005"); + + break; + case 0x0316: + scsiOneValue.Add("Device complies with SPC-3 ISO/IEC 14776-453"); + + break; + case 0x0320: + scsiOneValue.Add("Device complies with SBC-2 (no version claimed)"); + + break; + case 0x0322: + scsiOneValue.Add("Device complies with SBC-2 T10/1417-D revision 5a"); + + break; + case 0x0324: + scsiOneValue.Add("Device complies with SBC-2 T10/1417-D revision 15"); + + break; + case 0x033B: + scsiOneValue.Add("Device complies with SBC-2 T10/1417-D revision 16"); + + break; + case 0x033D: + scsiOneValue.Add("Device complies with SBC-2 ANSI INCITS 405-2005"); + + break; + case 0x033E: + scsiOneValue.Add("Device complies with SBC-2 ISO/IEC 14776-322"); + + break; + case 0x0340: + scsiOneValue.Add("Device complies with OSD (no version claimed)"); + + break; + case 0x0341: + scsiOneValue.Add("Device complies with OSD T10/1355-D revision 0"); + + break; + case 0x0342: + scsiOneValue.Add("Device complies with OSD T10/1355-D revision 7a"); + + break; + case 0x0343: + scsiOneValue.Add("Device complies with OSD T10/1355-D revision 8"); + + break; + case 0x0344: + scsiOneValue.Add("Device complies with OSD T10/1355-D revision 9"); + + break; + case 0x0355: + scsiOneValue.Add("Device complies with OSD T10/1355-D revision 10"); + + break; + case 0x0356: + scsiOneValue.Add("Device complies with OSD ANSI INCITS 400-2004"); + + break; + case 0x0360: + scsiOneValue.Add("Device complies with SSC-2 (no version claimed)"); + + break; + case 0x0374: + scsiOneValue.Add("Device complies with SSC-2 T10/1434-D revision 7"); + + break; + case 0x0375: + scsiOneValue.Add("Device complies with SSC-2 T10/1434-D revision 9"); + + break; + case 0x037D: + scsiOneValue.Add("Device complies with SSC-2 ANSI INCITS 380-2003"); + + break; + case 0x0380: + scsiOneValue.Add("Device complies with BCC (no version claimed)"); + + break; + case 0x03A0: + scsiOneValue.Add("Device complies with MMC-4 (no version claimed)"); + + break; + case 0x03B0: + scsiOneValue.Add("Device complies with MMC-4 T10/1545-D revision 5"); + + break; + case 0x03B1: + scsiOneValue.Add("Device complies with MMC-4 T10/1545-D revision 5a"); + + break; + case 0x03BD: + scsiOneValue.Add("Device complies with MMC-4 T10/1545-D revision 3"); + + break; + case 0x03BE: + scsiOneValue.Add("Device complies with MMC-4 T10/1545-D revision 3d"); + + break; + case 0x03BF: + scsiOneValue.Add("Device complies with MMC-4 ANSI INCITS 401-2005"); + + break; + case 0x03C0: + scsiOneValue.Add("Device complies with ADC (no version claimed)"); + + break; + case 0x03D5: + scsiOneValue.Add("Device complies with ADC T10/1558-D revision 6"); + + break; + case 0x03D6: + scsiOneValue.Add("Device complies with ADC T10/1558-D revision 7"); + + break; + case 0x03D7: + scsiOneValue.Add("Device complies with ADC ANSI INCITS 403-2005"); + + break; + case 0x03E0: + scsiOneValue.Add("Device complies with SES-2 (no version claimed)"); + + break; + case 0x03E1: + scsiOneValue.Add("Device complies with SES-2 T10/1559-D revision 16"); + + break; + case 0x03E7: + scsiOneValue.Add("Device complies with SES-2 T10/1559-D revision 19"); + + break; + case 0x03EB: + scsiOneValue.Add("Device complies with SES-2 T10/1559-D revision 20"); + + break; + case 0x03F0: + scsiOneValue.Add("Device complies with SES-2 ANSI INCITS 448-2008"); + + break; + case 0x03F2: + scsiOneValue.Add("Device complies with SES-2 ISO/IEC 14776-372"); + + break; + case 0x0400: + scsiOneValue.Add("Device complies with SSC-3 (no version claimed)"); + + break; + case 0x0403: + scsiOneValue.Add("Device complies with SSC-3 T10/1611-D revision 04a"); + + break; + case 0x0407: + scsiOneValue.Add("Device complies with SSC-3 T10/1611-D revision 05"); + + break; + case 0x0409: + scsiOneValue.Add("Device complies with SSC-3 ANSI INCITS 467-2011"); + + break; + case 0x040B: + scsiOneValue.Add("Device complies with SSC-3 ISO/IEC 14776-333:2013"); + + break; + case 0x0420: + scsiOneValue.Add("Device complies with MMC-5 (no version claimed)"); + + break; + case 0x042F: + scsiOneValue.Add("Device complies with MMC-5 T10/1675-D revision 03"); + + break; + case 0x0431: + scsiOneValue.Add("Device complies with MMC-5 T10/1675-D revision 03b"); + + break; + case 0x0432: + scsiOneValue.Add("Device complies with MMC-5 T10/1675-D revision 04"); + + break; + case 0x0434: + scsiOneValue.Add("Device complies with MMC-5 ANSI INCITS 430-2007"); + + break; + case 0x0440: + scsiOneValue.Add("Device complies with OSD-2 (no version claimed)"); + + break; + case 0x0444: + scsiOneValue.Add("Device complies with OSD-2 T10/1729-D revision 4"); + + break; + case 0x0446: + scsiOneValue.Add("Device complies with OSD-2 T10/1729-D revision 5"); + + break; + case 0x0448: + scsiOneValue.Add("Device complies with OSD-2 ANSI INCITS 458-2011"); + + break; + case 0x0460: + scsiOneValue.Add("Device complies with SPC-4 (no version claimed)"); + + break; + case 0x0461: + scsiOneValue.Add("Device complies with SPC-4 T10/BSR INCITS 513 revision 16"); + + break; + case 0x0462: + scsiOneValue.Add("Device complies with SPC-4 T10/BSR INCITS 513 revision 18"); + + break; + case 0x0463: + scsiOneValue.Add("Device complies with SPC-4 T10/BSR INCITS 513 revision 23"); + + break; + case 0x0466: + scsiOneValue.Add("Device complies with SPC-4 T10/BSR INCITS 513 revision 36"); + + break; + case 0x0468: + scsiOneValue.Add("Device complies with SPC-4 T10/BSR INCITS 513 revision 37"); + + break; + case 0x0469: + scsiOneValue.Add("Device complies with SPC-4 T10/BSR INCITS 513 revision 37a"); + + break; + case 0x046C: + scsiOneValue.Add("Device complies with SPC-4 ANSI INCITS 513-2015"); + + break; + case 0x0480: + scsiOneValue.Add("Device complies with SMC-3 (no version claimed)"); + + break; + case 0x0482: + scsiOneValue.Add("Device complies with SMC-3 T10/1730-D revision 15"); + + break; + case 0x0484: + scsiOneValue.Add("Device complies with SMC-3 T10/1730-D revision 16"); + + break; + case 0x0486: + scsiOneValue.Add("Device complies with SMC-3 ANSI INCITS 484-2012"); + + break; + case 0x04A0: + scsiOneValue.Add("Device complies with ADC-2 (no version claimed)"); + + break; + case 0x04A7: + scsiOneValue.Add("Device complies with ADC-2 T10/1741-D revision 7"); + + break; + case 0x04AA: + scsiOneValue.Add("Device complies with ADC-2 T10/1741-D revision 8"); + + break; + case 0x04AC: + scsiOneValue.Add("Device complies with ADC-2 ANSI INCITS 441-2008"); + + break; + case 0x04C0: + scsiOneValue.Add("Device complies with SBC-3 (no version claimed)"); + + break; + case 0x04C3: + scsiOneValue.Add("Device complies with SBC-3 T10/BSR INCITS 514 revision 35"); + + break; + case 0x04C5: + scsiOneValue.Add("Device complies with SBC-3 T10/BSR INCITS 514 revision 36"); + + break; + case 0x04C8: + scsiOneValue.Add("Device complies with SBC-3 ANSI INCITS 514-2014"); + + break; + case 0x04E0: + scsiOneValue.Add("Device complies with MMC-6 (no version claimed)"); + + break; + case 0x04E3: + scsiOneValue.Add("Device complies with MMC-6 T10/1836-D revision 02b"); + + break; + case 0x04E5: + scsiOneValue.Add("Device complies with MMC-6 T10/1836-D revision 02g"); + + break; + case 0x04E6: + scsiOneValue.Add("Device complies with MMC-6 ANSI INCITS 468-2010"); + + break; + case 0x04E7: + scsiOneValue + .Add("Device complies with MMC-6 ANSI INCITS 468-2010 + MMC-6/AM1 ANSI INCITS 468-2010/AM 1"); + + break; + case 0x0500: + scsiOneValue.Add("Device complies with ADC-3 (no version claimed)"); + + break; + case 0x0502: + scsiOneValue.Add("Device complies with ADC-3 T10/1895-D revision 04"); + + break; + case 0x0504: + scsiOneValue.Add("Device complies with ADC-3 T10/1895-D revision 05"); + + break; + case 0x0506: + scsiOneValue.Add("Device complies with ADC-3 T10/1895-D revision 05a"); + + break; + case 0x050A: + scsiOneValue.Add("Device complies with ADC-3 ANSI INCITS 497-2012"); + + break; + case 0x0520: + scsiOneValue.Add("Device complies with SSC-4 (no version claimed)"); + + break; + case 0x0523: + scsiOneValue.Add("Device complies with SSC-4 T10/BSR INCITS 516 revision 2"); + + break; + case 0x0525: + scsiOneValue.Add("Device complies with SSC-4 T10/BSR INCITS 516 revision 3"); + + break; + case 0x0527: + scsiOneValue.Add("Device complies with SSC-4 ANSI INCITS 516-2013"); + + break; + case 0x0560: + scsiOneValue.Add("Device complies with OSD-3 (no version claimed)"); + + break; + case 0x0580: + scsiOneValue.Add("Device complies with SES-3 (no version claimed)"); + + break; + case 0x05A0: + scsiOneValue.Add("Device complies with SSC-5 (no version claimed)"); + + break; + case 0x05C0: + scsiOneValue.Add("Device complies with SPC-5 (no version claimed)"); + + break; + case 0x05E0: + scsiOneValue.Add("Device complies with SFSC (no version claimed)"); + + break; + case 0x05E3: + scsiOneValue.Add("Device complies with SFSC BSR INCITS 501 revision 01"); + + break; + case 0x0600: + scsiOneValue.Add("Device complies with SBC-4 (no version claimed)"); + + break; + case 0x0620: + scsiOneValue.Add("Device complies with ZBC (no version claimed)"); + + break; + case 0x0622: + scsiOneValue.Add("Device complies with ZBC BSR INCITS 536 revision 02"); + + break; + case 0x0640: + scsiOneValue.Add("Device complies with ADC-4 (no version claimed)"); + + break; + case 0x0820: + scsiOneValue.Add("Device complies with SSA-TL2 (no version claimed)"); + + break; + case 0x083B: + scsiOneValue.Add("Device complies with SSA-TL2 T10.1/1147-D revision 05b"); + + break; + case 0x083C: + scsiOneValue.Add("Device complies with SSA-TL2 ANSI INCITS 308-1998"); + + break; + case 0x0840: + scsiOneValue.Add("Device complies with SSA-TL1 (no version claimed)"); + + break; + case 0x085B: + scsiOneValue.Add("Device complies with SSA-TL1 T10.1/0989-D revision 10b"); + + break; + case 0x085C: + scsiOneValue.Add("Device complies with SSA-TL1 ANSI INCITS 295-1996"); + + break; + case 0x0860: + scsiOneValue.Add("Device complies with SSA-S3P (no version claimed)"); + + break; + case 0x087B: + scsiOneValue.Add("Device complies with SSA-S3P T10.1/1051-D revision 05b"); + + break; + case 0x087C: + scsiOneValue.Add("Device complies with SSA-S3P ANSI INCITS 309-1998"); + + break; + case 0x0880: + scsiOneValue.Add("Device complies with SSA-S2P (no version claimed)"); + + break; + case 0x089B: + scsiOneValue.Add("Device complies with SSA-S2P T10.1/1121-D revision 07b"); + + break; + case 0x089C: + scsiOneValue.Add("Device complies with SSA-S2P ANSI INCITS 294-1996"); + + break; + case 0x08A0: + scsiOneValue.Add("Device complies with SIP (no version claimed)"); + + break; + case 0x08BB: + scsiOneValue.Add("Device complies with SIP T10/0856-D revision 10"); + + break; + case 0x08BC: + scsiOneValue.Add("Device complies with SIP ANSI INCITS 292-1997"); + + break; + case 0x08C0: + scsiOneValue.Add("Device complies with FCP (no version claimed)"); + + break; + case 0x08DB: + scsiOneValue.Add("Device complies with FCP T10/0993-D revision 12"); + + break; + case 0x08DC: + scsiOneValue.Add("Device complies with FCP ANSI INCITS 269-1996"); + + break; + case 0x08E0: + scsiOneValue.Add("Device complies with SBP-2 (no version claimed)"); + + break; + case 0x08FB: + scsiOneValue.Add("Device complies with SBP-2 T10/1155-D revision 04"); + + break; + case 0x08FC: + scsiOneValue.Add("Device complies with SBP-2 ANSI INCITS 325-1998"); + + break; + case 0x0900: + scsiOneValue.Add("Device complies with FCP-2 (no version claimed)"); + + break; + case 0x0901: + scsiOneValue.Add("Device complies with FCP-2 T10/1144-D revision 4"); + + break; + case 0x0915: + scsiOneValue.Add("Device complies with FCP-2 T10/1144-D revision 7"); + + break; + case 0x0916: + scsiOneValue.Add("Device complies with FCP-2 T10/1144-D revision 7a"); + + break; + case 0x0917: + scsiOneValue.Add("Device complies with FCP-2 ANSI INCITS 350-2003"); + + break; + case 0x0918: + scsiOneValue.Add("Device complies with FCP-2 T10/1144-D revision 8"); + + break; + case 0x0920: + scsiOneValue.Add("Device complies with SST (no version claimed)"); + + break; + case 0x0935: + scsiOneValue.Add("Device complies with SST T10/1380-D revision 8b"); + + break; + case 0x0940: + scsiOneValue.Add("Device complies with SRP (no version claimed)"); + + break; + case 0x0954: + scsiOneValue.Add("Device complies with SRP T10/1415-D revision 10"); + + break; + case 0x0955: + scsiOneValue.Add("Device complies with SRP T10/1415-D revision 16a"); + + break; + case 0x095C: + scsiOneValue.Add("Device complies with SRP ANSI INCITS 365-2002"); + + break; + case 0x0960: + scsiOneValue.Add("Device complies with iSCSI (no version claimed)"); + + break; + case 0x0961: + case 0x0962: + case 0x0963: + case 0x0964: + case 0x0965: + case 0x0966: + case 0x0967: + case 0x0968: + case 0x0969: + case 0x096A: + case 0x096B: + case 0x096C: + case 0x096D: + case 0x096E: + case 0x096F: + case 0x0970: + case 0x0971: + case 0x0972: + case 0x0973: + case 0x0974: + case 0x0975: + case 0x0976: + case 0x0977: + case 0x0978: + case 0x0979: + case 0x097A: + case 0x097B: + case 0x097C: + case 0x097D: + case 0x097E: + case 0x097F: + scsiOneValue.Add($"Device complies with iSCSI revision {versionDescriptor & 0x1F}"); + + break; + case 0x0980: + scsiOneValue.Add("Device complies with SBP-3 (no version claimed)"); + + break; + case 0x0982: + scsiOneValue.Add("Device complies with SBP-3 T10/1467-D revision 1f"); + + break; + case 0x0994: + scsiOneValue.Add("Device complies with SBP-3 T10/1467-D revision 3"); + + break; + case 0x099A: + scsiOneValue.Add("Device complies with SBP-3 T10/1467-D revision 4"); + + break; + case 0x099B: + scsiOneValue.Add("Device complies with SBP-3 T10/1467-D revision 5"); + + break; + case 0x099C: + scsiOneValue.Add("Device complies with SBP-3 ANSI INCITS 375-2004"); + + break; + case 0x09C0: + scsiOneValue.Add("Device complies with ADP (no version claimed)"); + + break; + case 0x09E0: + scsiOneValue.Add("Device complies with ADT (no version claimed)"); + + break; + case 0x09F9: + scsiOneValue.Add("Device complies with ADT T10/1557-D revision 11"); + + break; + case 0x09FA: + scsiOneValue.Add("Device complies with ADT T10/1557-D revision 14"); + + break; + case 0x09FD: + scsiOneValue.Add("Device complies with ADT ANSI INCITS 406-2005"); + + break; + case 0x0A00: + scsiOneValue.Add("Device complies with FCP-3 (no version claimed)"); + + break; + case 0x0A07: + scsiOneValue.Add("Device complies with FCP-3 T10/1560-D revision 3f"); + + break; + case 0x0A0F: + scsiOneValue.Add("Device complies with FCP-3 T10/1560-D revision 4"); + + break; + case 0x0A11: + scsiOneValue.Add("Device complies with FCP-3 ANSI INCITS 416-2006"); + + break; + case 0x0A1C: + scsiOneValue.Add("Device complies with FCP-3 ISO/IEC 14776-223"); + + break; + case 0x0A20: + scsiOneValue.Add("Device complies with ADT-2 (no version claimed)"); + + break; + case 0x0A22: + scsiOneValue.Add("Device complies with ADT-2 T10/1742-D revision 06"); + + break; + case 0x0A27: + scsiOneValue.Add("Device complies with ADT-2 T10/1742-D revision 08"); + + break; + case 0x0A28: + scsiOneValue.Add("Device complies with ADT-2 T10/1742-D revision 09"); + + break; + case 0x0A2B: + scsiOneValue.Add("Device complies with ADT-2 ANSI INCITS 472-2011"); + + break; + case 0x0A40: + scsiOneValue.Add("Device complies with FCP-4 (no version claimed)"); + + break; + case 0x0A42: + scsiOneValue.Add("Device complies with FCP-4 T10/1828-D revision 01"); + + break; + case 0x0A44: + scsiOneValue.Add("Device complies with FCP-4 T10/1828-D revision 02"); + + break; + case 0x0A45: + scsiOneValue.Add("Device complies with FCP-4 T10/1828-D revision 02b"); + + break; + case 0x0A46: + scsiOneValue.Add("Device complies with FCP-4 ANSI INCITS 481-2012"); + + break; + case 0x0A60: + scsiOneValue.Add("Device complies with ADT-3 (no version claimed)"); + + break; + case 0x0AA0: + scsiOneValue.Add("Device complies with SPI (no version claimed)"); + + break; + case 0x0AB9: + scsiOneValue.Add("Device complies with SPI T10/0855-D revision 15a"); + + break; + case 0x0ABA: + scsiOneValue.Add("Device complies with SPI ANSI INCITS 253-1995"); + + break; + case 0x0ABB: + scsiOneValue.Add("Device complies with SPI T10/0855-D revision 15a with SPI Amnd revision 3a"); + + break; + case 0x0ABC: + scsiOneValue + .Add("Device complies with SPI ANSI INCITS 253-1995 with SPI Amnd ANSI INCITS 253/AM1-1998"); + + break; + case 0x0AC0: + scsiOneValue.Add("Device complies with Fast-20 (no version claimed)"); + + break; + case 0x0ADB: + scsiOneValue.Add("Device complies with Fast-20 T10/1071 revision 06"); + + break; + case 0x0ADC: + scsiOneValue.Add("Device complies with Fast-20 ANSI INCITS 277-1996"); + + break; + case 0x0AE0: + scsiOneValue.Add("Device complies with SPI-2 (no version claimed)"); + + break; + case 0x0AFB: + scsiOneValue.Add("Device complies with SPI-2 T10/1142-D revision 20b"); + + break; + case 0x0AFC: + scsiOneValue.Add("Device complies with SPI-2 ANSI INCITS 302-1999"); + + break; + case 0x0B00: + scsiOneValue.Add("Device complies with SPI-3 (no version claimed)"); + + break; + case 0x0B18: + scsiOneValue.Add("Device complies with SPI-3 T10/1302-D revision 10"); + + break; + case 0x0B19: + scsiOneValue.Add("Device complies with SPI-3 T10/1302-D revision 13a"); + + break; + case 0x0B1A: + scsiOneValue.Add("Device complies with SPI-3 T10/1302-D revision 14"); + + break; + case 0x0B1C: + scsiOneValue.Add("Device complies with SPI-3 ANSI INCITS 336-2000"); + + break; + case 0x0B20: + scsiOneValue.Add("Device complies with EPI (no version claimed)"); + + break; + case 0x0B3B: + scsiOneValue.Add("Device complies with EPI T10/1134 revision 16"); + + break; + case 0x0B3C: + scsiOneValue.Add("Device complies with EPI ANSI INCITS TR-23 1999"); + + break; + case 0x0B40: + scsiOneValue.Add("Device complies with SPI-4 (no version claimed)"); + + break; + case 0x0B54: + scsiOneValue.Add("Device complies with SPI-4 T10/1365-D revision 7"); + + break; + case 0x0B55: + scsiOneValue.Add("Device complies with SPI-4 T10/1365-D revision 9"); + + break; + case 0x0B56: + scsiOneValue.Add("Device complies with SPI-4 ANSI INCITS 362-2002"); + + break; + case 0x0B59: + scsiOneValue.Add("Device complies with SPI-4 T10/1365-D revision 10"); + + break; + case 0x0B60: + scsiOneValue.Add("Device complies with SPI-5 (no version claimed)"); + + break; + case 0x0B79: + scsiOneValue.Add("Device complies with SPI-5 T10/1525-D revision 3"); + + break; + case 0x0B7A: + scsiOneValue.Add("Device complies with SPI-5 T10/1525-D revision 5"); + + break; + case 0x0B7B: + scsiOneValue.Add("Device complies with SPI-5 T10/1525-D revision 6"); + + break; + case 0x0B7C: + scsiOneValue.Add("Device complies with SPI-5 ANSI INCITS 367-2003"); + + break; + case 0x0BE0: + scsiOneValue.Add("Device complies with SAS (no version claimed)"); + + break; + case 0x0BE1: + scsiOneValue.Add("Device complies with SAS T10/1562-D revision 01"); + + break; + case 0x0BF5: + scsiOneValue.Add("Device complies with SAS T10/1562-D revision 03"); + + break; + case 0x0BFA: + scsiOneValue.Add("Device complies with SAS T10/1562-D revision 04"); + + break; + case 0x0BFB: + scsiOneValue.Add("Device complies with SAS T10/1562-D revision 04"); + + break; + case 0x0BFC: + scsiOneValue.Add("Device complies with SAS T10/1562-D revision 05"); + + break; + case 0x0BFD: + scsiOneValue.Add("Device complies with SAS ANSI INCITS 376-2003"); + + break; + case 0x0C00: + scsiOneValue.Add("Device complies with SAS-1.1 (no version claimed)"); + + break; + case 0x0C07: + scsiOneValue.Add("Device complies with SAS-1.1 T10/1601-D revision 9"); + + break; + case 0x0C0F: + scsiOneValue.Add("Device complies with SAS-1.1 T10/1601-D revision 10"); + + break; + case 0x0C11: + scsiOneValue.Add("Device complies with SAS-1.1 ANSI INCITS 417-2006"); + + break; + case 0x0C12: + scsiOneValue.Add("Device complies with SAS-1.1 ISO/IEC 14776-151"); + + break; + case 0x0C20: + scsiOneValue.Add("Device complies with SAS-2 (no version claimed)"); + + break; + case 0x0C23: + scsiOneValue.Add("Device complies with SAS-2 T10/1760-D revision 14"); + + break; + case 0x0C27: + scsiOneValue.Add("Device complies with SAS-2 T10/1760-D revision 15"); + + break; + case 0x0C28: + scsiOneValue.Add("Device complies with SAS-2 T10/1760-D revision 16"); + + break; + case 0x0C2A: + scsiOneValue.Add("Device complies with SAS-2 ANSI INCITS 457-2010"); + + break; + case 0x0C40: + scsiOneValue.Add("Device complies with SAS-2.1 (no version claimed)"); + + break; + case 0x0C48: + scsiOneValue.Add("Device complies with SAS-2.1 T10/2125-D revision 04"); + + break; + case 0x0C4A: + scsiOneValue.Add("Device complies with SAS-2.1 T10/2125-D revision 06"); + + break; + case 0x0C4B: + scsiOneValue.Add("Device complies with SAS-2.1 T10/2125-D revision 07"); + + break; + case 0x0C4E: + scsiOneValue.Add("Device complies with SAS-2.1 ANSI INCITS 478-2011"); + + break; + case 0x0C4F: + scsiOneValue + .Add("Device complies with SAS-2.1 ANSI INCITS 478-2011 w/ Amnd 1 ANSI INCITS 478/AM1-2014"); + + break; + case 0x0C52: + scsiOneValue.Add("Device complies with SAS-2.1 ISO/IEC 14776-153"); + + break; + case 0x0C60: + scsiOneValue.Add("Device complies with SAS-3 (no version claimed)"); + + break; + case 0x0C63: + scsiOneValue.Add("Device complies with SAS-3 T10/BSR INCITS 519 revision 05a"); + + break; + case 0x0C65: + scsiOneValue.Add("Device complies with SAS-3 T10/BSR INCITS 519 revision 06"); + + break; + case 0x0C68: + scsiOneValue.Add("Device complies with SAS-3 ANSI INCITS 519-2014"); + + break; + case 0x0C80: + scsiOneValue.Add("Device complies with SAS-4 (no version claimed)"); + + break; + case 0x0D20: + scsiOneValue.Add("Device complies with FC-PH (no version claimed)"); + + break; + case 0x0D3B: + scsiOneValue.Add("Device complies with FC-PH ANSI INCITS 230-1994"); + + break; + case 0x0D3C: + scsiOneValue + .Add("Device complies with FC-PH ANSI INCITS 230-1994 with Amnd 1 ANSI INCITS 230/AM1-1996"); + + break; + case 0x0D40: + scsiOneValue.Add("Device complies with FC-AL (no version claimed)"); + + break; + case 0x0D5C: + scsiOneValue.Add("Device complies with FC-AL ANSI INCITS 272-1996"); + + break; + case 0x0D60: + scsiOneValue.Add("Device complies with FC-AL-2 (no version claimed)"); + + break; + case 0x0D61: + scsiOneValue.Add("Device complies with FC-AL-2 T11/1133-D revision 7.0"); + + break; + case 0x0D63: + scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with AM1-2003 & AM2-2006"); + + break; + case 0x0D64: + scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with Amnd 2 AM2-2006"); + + break; + case 0x0D65: + scsiOneValue.Add("Device complies with FC-AL-2 ISO/IEC 14165-122 with AM1 & AM2"); + + break; + case 0x0D7C: + scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999"); + + break; + case 0x0D7D: + scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with Amnd 1 AM1-2003"); + + break; + case 0x0D80: + scsiOneValue.Add("Device complies with FC-PH-3 (no version claimed)"); + + break; + case 0x0D9C: + scsiOneValue.Add("Device complies with FC-PH-3 ANSI INCITS 303-1998"); + + break; + case 0x0DA0: + scsiOneValue.Add("Device complies with FC-FS (no version claimed)"); + + break; + case 0x0DB7: + scsiOneValue.Add("Device complies with FC-FS T11/1331-D revision 1.2"); + + break; + case 0x0DB8: + scsiOneValue.Add("Device complies with FC-FS T11/1331-D revision 1.7"); + + break; + case 0x0DBC: + scsiOneValue.Add("Device complies with FC-FS ANSI INCITS 373-2003"); + + break; + case 0x0DBD: + scsiOneValue.Add("Device complies with FC-FS ISO/IEC 14165-251"); + + break; + case 0x0DC0: + scsiOneValue.Add("Device complies with FC-PI (no version claimed)"); + + break; + case 0x0DDC: + scsiOneValue.Add("Device complies with FC-PI ANSI INCITS 352-2002"); + + break; + case 0x0DE0: + scsiOneValue.Add("Device complies with FC-PI-2 (no version claimed)"); + + break; + case 0x0DE2: + scsiOneValue.Add("Device complies with FC-PI-2 T11/1506-D revision 5.0"); + + break; + case 0x0DE4: + scsiOneValue.Add("Device complies with FC-PI-2 ANSI INCITS 404-2006"); + + break; + case 0x0E00: + scsiOneValue.Add("Device complies with FC-FS-2 (no version claimed)"); + + break; + case 0x0E02: + scsiOneValue.Add("Device complies with FC-FS-2 ANSI INCITS 242-2007"); + + break; + case 0x0E03: + scsiOneValue + .Add("Device complies with FC-FS-2 ANSI INCITS 242-2007 with AM1 ANSI INCITS 242/AM1-2007"); + + break; + case 0x0E20: + scsiOneValue.Add("Device complies with FC-LS (no version claimed)"); + + break; + case 0x0E21: + scsiOneValue.Add("Device complies with FC-LS T11/1620-D revision 1.62"); + + break; + case 0x0E29: + scsiOneValue.Add("Device complies with FC-LS ANSI INCITS 433-2007"); + + break; + case 0x0E40: + scsiOneValue.Add("Device complies with FC-SP (no version claimed)"); + + break; + case 0x0E42: + scsiOneValue.Add("Device complies with FC-SP T11/1570-D revision 1.6"); + + break; + case 0x0E45: + scsiOneValue.Add("Device complies with FC-SP ANSI INCITS 426-2007"); + + break; + case 0x0E60: + scsiOneValue.Add("Device complies with FC-PI-3 (no version claimed)"); + + break; + case 0x0E62: + scsiOneValue.Add("Device complies with FC-PI-3 T11/1625-D revision 2.0"); + + break; + case 0x0E68: + scsiOneValue.Add("Device complies with FC-PI-3 T11/1625-D revision 2.1"); + + break; + case 0x0E6A: + scsiOneValue.Add("Device complies with FC-PI-3 T11/1625-D revision 4.0"); + + break; + case 0x0E6E: + scsiOneValue.Add("Device complies with FC-PI-3 ANSI INCITS 460-2011"); + + break; + case 0x0E80: + scsiOneValue.Add("Device complies with FC-PI-4 (no version claimed)"); + + break; + case 0x0E82: + scsiOneValue.Add("Device complies with FC-PI-4 T11/1647-D revision 8.0"); + + break; + case 0x0E88: + scsiOneValue.Add("Device complies with FC-PI-4 ANSI INCITS 450-2009"); + + break; + case 0x0EA0: + scsiOneValue.Add("Device complies with FC 10GFC (no version claimed)"); + + break; + case 0x0EA2: + scsiOneValue.Add("Device complies with FC 10GFC ANSI INCITS 364-2003"); + + break; + case 0x0EA3: + scsiOneValue.Add("Device complies with FC 10GFC ISO/IEC 14165-116"); + + break; + case 0x0EA5: + scsiOneValue.Add("Device complies with FC 10GFC ISO/IEC 14165-116 with AM1"); + + break; + case 0x0EA6: + scsiOneValue + .Add("Device complies with FC 10GFC ANSI INCITS 364-2003 with AM1 ANSI INCITS 364/AM1-2007"); + + break; + case 0x0EC0: + scsiOneValue.Add("Device complies with FC-SP-2 (no version claimed)"); + + break; + case 0x0EE0: + scsiOneValue.Add("Device complies with FC-FS-3 (no version claimed)"); + + break; + case 0x0EE2: + scsiOneValue.Add("Device complies with FC-FS-3 T11/1861-D revision 0.9"); + + break; + case 0x0EE7: + scsiOneValue.Add("Device complies with FC-FS-3 T11/1861-D revision 1.0"); + + break; + case 0x0EE9: + scsiOneValue.Add("Device complies with FC-FS-3 T11/1861-D revision 1.10"); + + break; + case 0x0EEB: + scsiOneValue.Add("Device complies with FC-FS-3 ANSI INCITS 470-2011"); + + break; + case 0x0F00: + scsiOneValue.Add("Device complies with FC-LS-2 (no version claimed)"); + + break; + case 0x0F03: + scsiOneValue.Add("Device complies with FC-LS-2 T11/2103-D revision 2.11"); + + break; + case 0x0F05: + scsiOneValue.Add("Device complies with FC-LS-2 T11/2103-D revision 2.21"); + + break; + case 0x0F07: + scsiOneValue.Add("Device complies with FC-LS-2 ANSI INCITS 477-2011"); + + break; + case 0x0F20: + scsiOneValue.Add("Device complies with FC-PI-5 (no version claimed)"); + + break; + case 0x0F27: + scsiOneValue.Add("Device complies with FC-PI-5 T11/2118-D revision 2.00"); + + break; + case 0x0F28: + scsiOneValue.Add("Device complies with FC-PI-5 T11/2118-D revision 3.00"); + + break; + case 0x0F2A: + scsiOneValue.Add("Device complies with FC-PI-5 T11/2118-D revision 6.00"); + + break; + case 0x0F2B: + scsiOneValue.Add("Device complies with FC-PI-5 T11/2118-D revision 6.10"); + + break; + case 0x0F2E: + scsiOneValue.Add("Device complies with FC-PI-5 ANSI INCITS 479-2011"); + + break; + case 0x0F40: + scsiOneValue.Add("Device complies with FC-PI-6 (no version claimed)"); + + break; + case 0x0F60: + scsiOneValue.Add("Device complies with FC-FS-4 (no version claimed)"); + + break; + case 0x0F80: + scsiOneValue.Add("Device complies with FC-LS-3 (no version claimed)"); + + break; + case 0x12A0: + scsiOneValue.Add("Device complies with FC-SCM (no version claimed)"); + + break; + case 0x12A3: + scsiOneValue.Add("Device complies with FC-SCM T11/1824DT revision 1.0"); + + break; + case 0x12A5: + scsiOneValue.Add("Device complies with FC-SCM T11/1824DT revision 1.1"); + + break; + case 0x12A7: + scsiOneValue.Add("Device complies with FC-SCM T11/1824DT revision 1.4"); + + break; + case 0x12AA: + scsiOneValue.Add("Device complies with FC-SCM INCITS TR-47 2012"); + + break; + case 0x12C0: + scsiOneValue.Add("Device complies with FC-DA-2 (no version claimed)"); + + break; + case 0x12C3: + scsiOneValue.Add("Device complies with FC-DA-2 T11/1870DT revision 1.04"); + + break; + case 0x12C5: + scsiOneValue.Add("Device complies with FC-DA-2 T11/1870DT revision 1.06"); + + break; + case 0x12C9: + scsiOneValue.Add("Device complies with FC-DA-2 INCITS TR-49 2012"); + + break; + case 0x12E0: + scsiOneValue.Add("Device complies with FC-DA (no version claimed)"); + + break; + case 0x12E2: + scsiOneValue.Add("Device complies with FC-DA T11/1513-DT revision 3.1"); + + break; + case 0x12E8: + scsiOneValue.Add("Device complies with FC-DA ANSI INCITS TR-36 2004"); + + break; + case 0x12E9: + scsiOneValue.Add("Device complies with FC-DA ISO/IEC 14165-341"); + + break; + case 0x1300: + scsiOneValue.Add("Device complies with FC-Tape (no version claimed)"); + + break; + case 0x1301: + scsiOneValue.Add("Device complies with FC-Tape T11/1315 revision 1.16"); + + break; + case 0x131B: + scsiOneValue.Add("Device complies with FC-Tape T11/1315 revision 1.17"); + + break; + case 0x131C: + scsiOneValue.Add("Device complies with FC-Tape ANSI INCITS TR-24 1999"); + + break; + case 0x1320: + scsiOneValue.Add("Device complies with FC-FLA (no version claimed)"); + + break; + case 0x133B: + scsiOneValue.Add("Device complies with FC-FLA T11/1235 revision 7"); + + break; + case 0x133C: + scsiOneValue.Add("Device complies with FC-FLA ANSI INCITS TR-20 1998"); + + break; + case 0x1340: + scsiOneValue.Add("Device complies with FC-PLDA (no version claimed)"); + + break; + case 0x135B: + scsiOneValue.Add("Device complies with FC-PLDA T11/1162 revision 2.1"); + + break; + case 0x135C: + scsiOneValue.Add("Device complies with FC-PLDA ANSI INCITS TR-19 1998"); + + break; + case 0x1360: + scsiOneValue.Add("Device complies with SSA-PH2 (no version claimed)"); + + break; + case 0x137B: + scsiOneValue.Add("Device complies with SSA-PH2 T10.1/1145-D revision 09c"); + + break; + case 0x137C: + scsiOneValue.Add("Device complies with SSA-PH2 ANSI INCITS 293-1996"); + + break; + case 0x1380: + scsiOneValue.Add("Device complies with SSA-PH3 (no version claimed)"); + + break; + case 0x139B: + scsiOneValue.Add("Device complies with SSA-PH3 T10.1/1146-D revision 05b"); + + break; + case 0x139C: + scsiOneValue.Add("Device complies with SSA-PH3 ANSI INCITS 307-1998"); + + break; + case 0x14A0: + scsiOneValue.Add("Device complies with IEEE 1394 (no version claimed)"); + + break; + case 0x14BD: + scsiOneValue.Add("Device complies with ANSI IEEE 1394-1995"); + + break; + case 0x14C0: + scsiOneValue.Add("Device complies with IEEE 1394a (no version claimed)"); + + break; + case 0x14E0: + scsiOneValue.Add("Device complies with IEEE 1394b (no version claimed)"); + + break; + case 0x15E0: + scsiOneValue.Add("Device complies with ATA/ATAPI-6 (no version claimed)"); + + break; + case 0x15FD: + scsiOneValue.Add("Device complies with ATA/ATAPI-6 ANSI INCITS 361-2002"); + + break; + case 0x1600: + scsiOneValue.Add("Device complies with ATA/ATAPI-7 (no version claimed)"); + + break; + case 0x1602: + scsiOneValue.Add("Device complies with ATA/ATAPI-7 T13/1532-D revision 3"); + + break; + case 0x161C: + scsiOneValue.Add("Device complies with ATA/ATAPI-7 ANSI INCITS 397-2005"); + + break; + case 0x161E: + scsiOneValue.Add("Device complies with ATA/ATAPI-7 ISO/IEC 24739"); + + break; + case 0x1620: + scsiOneValue.Add("Device complies with ATA/ATAPI-8 ATA8-AAM (no version claimed)"); + + break; + case 0x1621: + scsiOneValue + .Add("Device complies with ATA/ATAPI-8 ATA8-APT Parallel Transport (no version claimed)"); + + break; + case 0x1622: + scsiOneValue.Add("Device complies with ATA/ATAPI-8 ATA8-AST Serial Transport (no version claimed)"); + + break; + case 0x1623: + scsiOneValue + .Add("Device complies with ATA/ATAPI-8 ATA8-ACS ATA/ATAPI Command Set (no version claimed)"); + + break; + case 0x1628: + scsiOneValue.Add("Device complies with ATA/ATAPI-8 ATA8-AAM ANSI INCITS 451-2008"); + + break; + case 0x162A: + scsiOneValue.Add("Device complies with ATA/ATAPI-8 ATA8-ACS ANSI INCITS 452-2009 w/ Amendment 1"); + + break; + case 0x1728: + scsiOneValue.Add("Device complies with Universal Serial Bus Specification, Revision 1.1"); + + break; + case 0x1729: + scsiOneValue.Add("Device complies with Universal Serial Bus Specification, Revision 2.0"); + + break; + case 0x1730: + scsiOneValue.Add("Device complies with USB Mass Storage Class Bulk-Only Transport, Revision 1.0"); + + break; + case 0x1740: + scsiOneValue.Add("Device complies with UAS (no version claimed)"); + + break; + case 0x1743: + scsiOneValue.Add("Device complies with UAS T10/2095-D revision 02"); + + break; + case 0x1747: + scsiOneValue.Add("Device complies with UAS T10/2095-D revision 04"); + + break; + case 0x1748: + scsiOneValue.Add("Device complies with UAS ANSI INCITS 471-2010"); + + break; + case 0x1749: + scsiOneValue.Add("Device complies with UAS ISO/IEC 14776-251:2014"); + + break; + case 0x1761: + scsiOneValue.Add("Device complies with ACS-2 (no version claimed)"); + + break; + case 0x1762: + scsiOneValue.Add("Device complies with ACS-2 ANSI INCITS 482-2013"); + + break; + case 0x1765: + scsiOneValue.Add("Device complies with ACS-3 (no version claimed)"); + + break; + case 0x1780: + scsiOneValue.Add("Device complies with UAS-2 (no version claimed)"); + + break; + case 0x1EA0: + scsiOneValue.Add("Device complies with SAT (no version claimed)"); + + break; + case 0x1EA7: + scsiOneValue.Add("Device complies with SAT T10/1711-D revision 8"); + + break; + case 0x1EAB: + scsiOneValue.Add("Device complies with SAT T10/1711-D revision 9"); + + break; + case 0x1EAD: + scsiOneValue.Add("Device complies with SAT ANSI INCITS 431-2007"); + + break; + case 0x1EC0: + scsiOneValue.Add("Device complies with SAT-2 (no version claimed)"); + + break; + case 0x1EC4: + scsiOneValue.Add("Device complies with SAT-2 T10/1826-D revision 06"); + + break; + case 0x1EC8: + scsiOneValue.Add("Device complies with SAT-2 T10/1826-D revision 09"); + + break; + case 0x1ECA: + scsiOneValue.Add("Device complies with SAT-2 ANSI INCITS 465-2010"); + + break; + case 0x1EE0: + scsiOneValue.Add("Device complies with SAT-3 (no version claimed)"); + + break; + case 0x1EE2: + scsiOneValue.Add("Device complies with SAT-3 T10/BSR INCITS 517 revision 4"); + + break; + case 0x1EE4: + scsiOneValue.Add("Device complies with SAT-3 T10/BSR INCITS 517 revision 7"); + + break; + case 0x1EE8: + scsiOneValue.Add("Device complies with SAT-3 ANSI INCITS 517-2015"); + + break; + case 0x1F00: + scsiOneValue.Add("Device complies with SAT-4 (no version claimed)"); + + break; + case 0x20A0: + scsiOneValue.Add("Device complies with SPL (no version claimed)"); + + break; + case 0x20A3: + scsiOneValue.Add("Device complies with SPL T10/2124-D revision 6a"); + + break; + case 0x20A5: + scsiOneValue.Add("Device complies with SPL T10/2124-D revision 7"); + + break; + case 0x20A7: + scsiOneValue.Add("Device complies with SPL ANSI INCITS 476-2011"); + + break; + case 0x20A8: + scsiOneValue.Add("Device complies with SPL ANSI INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012"); + + break; + case 0x20AA: + scsiOneValue.Add("Device complies with SPL ISO/IEC 14776-261:2012"); + + break; + case 0x20C0: + scsiOneValue.Add("Device complies with SPL-2 (no version claimed)"); + + break; + case 0x20C2: + scsiOneValue.Add("Device complies with SPL-2 T10/BSR INCITS 505 revision 4"); + + break; + case 0x20C4: + scsiOneValue.Add("Device complies with SPL-2 T10/BSR INCITS 505 revision 5"); + + break; + case 0x20C8: + scsiOneValue.Add("Device complies with SPL-2 ANSI INCITS 505-2013"); + + break; + case 0x20E0: + scsiOneValue.Add("Device complies with SPL-3 (no version claimed)"); + + break; + case 0x20E4: + scsiOneValue.Add("Device complies with SPL-3 T10/BSR INCITS 492 revision 6"); + + break; + case 0x20E6: + scsiOneValue.Add("Device complies with SPL-3 T10/BSR INCITS 492 revision 7"); + + break; + case 0x20E8: + scsiOneValue.Add("Device complies with SPL-3 ANSI INCITS 492-2015"); + + break; + case 0x2100: + scsiOneValue.Add("Device complies with SPL-4 (no version claimed)"); + + break; + case 0x21E0: + scsiOneValue.Add("Device complies with SOP (no version claimed)"); + + break; + case 0x21E4: + scsiOneValue.Add("Device complies with SOP T10/BSR INCITS 489 revision 4"); + + break; + case 0x21E6: + scsiOneValue.Add("Device complies with SOP T10/BSR INCITS 489 revision 5"); + + break; + case 0x21E8: + scsiOneValue.Add("Device complies with SOP ANSI INCITS 489-2014"); + + break; + case 0x2200: + scsiOneValue.Add("Device complies with PQI (no version claimed)"); + + break; + case 0x2204: + scsiOneValue.Add("Device complies with PQI T10/BSR INCITS 490 revision 6"); + + break; + case 0x2206: + scsiOneValue.Add("Device complies with PQI T10/BSR INCITS 490 revision 7"); + + break; + case 0x2208: + scsiOneValue.Add("Device complies with PQI ANSI INCITS 490-2014"); + + break; + case 0x2220: + scsiOneValue.Add("Device complies with SOP-2 (no version claimed)"); + + break; + case 0x2240: + scsiOneValue.Add("Device complies with PQI-2 (no version claimed)"); + + break; + case 0xFFC0: + scsiOneValue.Add("Device complies with IEEE 1667 (no version claimed)"); + + break; + case 0xFFC1: + scsiOneValue.Add("Device complies with IEEE 1667-2006"); + + break; + case 0xFFC2: + scsiOneValue.Add("Device complies with IEEE 1667-2009"); + + break; + default: + scsiOneValue.Add($"Device complies with unknown standard code 0x{versionDescriptor:X4}"); + + break; + } + } + + return scsiOneValue; + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/ScsiMmcFeatures.cs b/Aaru.Server.Old/Core/ScsiMmcFeatures.cs new file mode 100644 index 00000000..5e3f60c6 --- /dev/null +++ b/Aaru.Server.Old/Core/ScsiMmcFeatures.cs @@ -0,0 +1,413 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ScsiMmcFeatures.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes SCSI MMC features from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Metadata; +using Aaru.CommonTypes.Structs.Devices.SCSI; + +namespace Aaru.Server.Old.Core; + +public static class ScsiMmcFeatures +{ + /// + /// Takes the MMC FEATURES part of a device report and prints it as a list of values to be sequenced by ASP.NET in + /// the rendering + /// + /// FEATURES part of the report + /// List to put the values on + public static void Report(MmcFeatures ftr, ref List mmcOneValue) + { + if(ftr.SupportsAACS && ftr.AACSVersion.HasValue) + mmcOneValue.Add($"Drive supports AACS version {ftr.AACSVersion}"); + else if(ftr.SupportsAACS) mmcOneValue.Add("Drive supports AACS"); + + if(ftr.AGIDs.HasValue) mmcOneValue.Add($"Drive supports {ftr.AGIDs} AGIDs concurrently"); + + if(ftr.CanGenerateBindingNonce) + { + mmcOneValue.Add("Drive supports generating the binding nonce"); + + if(ftr.BindingNonceBlocks.HasValue) + mmcOneValue.Add($"{ftr.BindingNonceBlocks} media blocks are required for the binding nonce"); + } + + if(ftr.BlocksPerReadableUnit > 1) + mmcOneValue.Add($"{ftr.BlocksPerReadableUnit} logical blocks per media writable unit"); + + if(ftr.BufferUnderrunFreeInDVD) mmcOneValue.Add("Drive supports zero loss linking writing DVDs"); + + if(ftr.BufferUnderrunFreeInSAO) mmcOneValue.Add("Drive supports zero loss linking in Session at Once Mode"); + + if(ftr.BufferUnderrunFreeInTAO) mmcOneValue.Add("Drive supports zero loss linking in Track at Once Mode"); + + if(ftr.CanAudioScan) mmcOneValue.Add("Drive supports the SCAN command"); + + if(ftr.CanEject) mmcOneValue.Add("Drive can eject media"); + + if(ftr.CanEraseSector) mmcOneValue.Add("Drive supports media that require erasing before writing"); + + if(ftr.CanExpandBDRESpareArea) mmcOneValue.Add("Drive can expand the spare area on a formatted BD-RE disc"); + + if(ftr.CanFormat) mmcOneValue.Add("Drive can format media into logical blocks"); + + if(ftr.CanFormatBDREWithoutSpare) mmcOneValue.Add("Drive can format BD-RE with no spares allocated"); + + if(ftr.CanFormatQCert) mmcOneValue.Add("Drive can format BD-RE discs with quick certification"); + + if(ftr.CanFormatCert) mmcOneValue.Add("Drive can format BD-RE discs with full certification"); + + if(ftr.CanFormatFRF) mmcOneValue.Add("Drive can fast re-format BD-RE discs"); + + if(ftr.CanFormatRRM) mmcOneValue.Add("Drive can format BD-R discs with RRM format"); + + if(ftr.CanLoad) mmcOneValue.Add("Drive can load media"); + + if(ftr.CanMuteSeparateChannels) mmcOneValue.Add("Drive is able to mute channels separately"); + + if(ftr.CanOverwriteSAOTrack) mmcOneValue.Add("Drive can overwrite a SAO track with another in CD-RWs"); + + if(ftr.CanOverwriteTAOTrack) mmcOneValue.Add("Drive can overwrite a TAO track with another in CD-RWs"); + + if(ftr.CanPlayCDAudio) mmcOneValue.Add("Drive has an analogue audio output"); + + if(ftr.CanPseudoOverwriteBDR) mmcOneValue.Add("Drive can write BD-R on Pseudo-OverWrite SRM mode"); + + if(ftr.CanReadAllDualR) mmcOneValue.Add("Drive can read DVD-R DL from all recording modes"); + + if(ftr.CanReadAllDualRW) mmcOneValue.Add("Drive can read DVD-RW DL from all recording modes"); + + if(ftr.CanReadBD) mmcOneValue.Add("Drive can read BD-ROM"); + + if(ftr.CanReadBDR) mmcOneValue.Add("Drive can read BD-R Ver.1"); + + if(ftr.CanReadBDRE1) mmcOneValue.Add("Drive can read BD-RE Ver.1"); + + if(ftr.CanReadBDRE2) mmcOneValue.Add("Drive can read BD-RE Ver.2"); + + if(ftr.CanReadBDROM) mmcOneValue.Add("Drive can read BD-ROM Ver.1"); + + if(ftr.CanReadBluBCA) mmcOneValue.Add("Drive can read BD's Burst Cutting Area"); + + if(ftr.CanReadCD) mmcOneValue.Add("Drive can read CD-ROM"); + + if(ftr.CanWriteCDMRW && ftr.CanReadDVDPlusMRW && ftr.CanWriteDVDPlusMRW) + mmcOneValue.Add("Drive can read and write CD-MRW and DVD+MRW"); + else if(ftr.CanReadDVDPlusMRW && ftr.CanWriteDVDPlusMRW) + mmcOneValue.Add("Drive can read and write DVD+MRW"); + else if(ftr.CanWriteCDMRW && ftr.CanReadDVDPlusMRW) + mmcOneValue.Add("Drive and read DVD+MRW and read and write CD-MRW"); + else if(ftr.CanWriteCDMRW) + mmcOneValue.Add("Drive can read and write CD-MRW"); + else if(ftr.CanReadDVDPlusMRW) + mmcOneValue.Add("Drive can read CD-MRW and DVD+MRW"); + else if(ftr.CanReadCDMRW) mmcOneValue.Add("Drive can read CD-MRW"); + + if(ftr.CanReadCPRM_MKB) mmcOneValue.Add("Drive supports reading Media Key Block of CPRM"); + + if(ftr.CanReadDDCD) mmcOneValue.Add("Drive can read DDCDs"); + + if(ftr.CanReadDVD) mmcOneValue.Add("Drive can read DVD"); + + if(ftr.CanWriteDVDPlusRW) + mmcOneValue.Add("Drive can read and write DVD+RW"); + else if(ftr.CanReadDVDPlusRW) mmcOneValue.Add("Drive can read DVD+RW"); + + if(ftr.CanWriteDVDPlusR) + mmcOneValue.Add("Drive can read and write DVD+R"); + else if(ftr.CanReadDVDPlusR) mmcOneValue.Add("Drive can read DVD+R"); + + if(ftr.CanWriteDVDPlusRDL) + mmcOneValue.Add("Drive can read and write DVD+R DL"); + else if(ftr.CanReadDVDPlusRDL) mmcOneValue.Add("Drive can read DVD+R DL"); + + if(ftr.CanReadDriveAACSCertificate) mmcOneValue.Add("Drive supports reading the Drive Certificate"); + + if(ftr.CanReadHDDVD && ftr.CanReadHDDVDR && ftr.CanReadHDDVDRAM) + mmcOneValue.Add("Drive can read HD DVD-ROM, HD DVD-RW, HD DVD-R and HD DVD-RAM"); + else if(ftr.CanReadHDDVD && ftr.CanReadHDDVDR) + mmcOneValue.Add("Drive can read HD DVD-ROM, HD DVD-RW and HD DVD-R"); + else if(ftr.CanReadHDDVD && ftr.CanReadHDDVDRAM) + mmcOneValue.Add("Drive can read HD DVD-ROM, HD DVD-RW and HD DVD-RAM"); + else if(ftr.CanReadHDDVD) mmcOneValue.Add("Drive can read HD DVD-ROM and HD DVD-RW"); + + if(ftr.CanReadLeadInCDText) mmcOneValue.Add("Drive can return CD-Text from Lead-In"); + + if(ftr.CanReadOldBDR) mmcOneValue.Add("Drive can read BD-R pre-1.0"); + + if(ftr.CanReadOldBDRE) mmcOneValue.Add("Drive can read BD-RE pre-1.0"); + + if(ftr.CanReadOldBDROM) mmcOneValue.Add("Drive can read BD-ROM pre-1.0"); + + if(ftr.CanReadSpareAreaInformation) mmcOneValue.Add("Drive can return Spare Area Information"); + + if(ftr.CanReportDriveSerial) mmcOneValue.Add("Drive is to report drive serial number"); + + if(ftr.CanReportMediaSerial) mmcOneValue.Add("Drive is to read media serial number"); + + if(ftr.CanTestWriteDDCDR) mmcOneValue.Add("Drive can do a test writing with DDCD-R"); + + if(ftr.CanTestWriteDVD) mmcOneValue.Add("Drive can do a test writing with DVDs"); + + if(ftr.CanTestWriteInSAO) mmcOneValue.Add("Drive can do a test writing in Session at Once Mode"); + + if(ftr.CanTestWriteInTAO) mmcOneValue.Add("Drive can do a test writing in Track at Once Mode"); + + if(ftr.CanUpgradeFirmware) mmcOneValue.Add("Drive supports Microcode Upgrade"); + + if(ftr.ErrorRecoveryPage) mmcOneValue.Add("Drive shall report Read/Write Error Recovery mode page"); + + if(ftr.Locked) mmcOneValue.Add("Drive can lock media"); + + if(ftr.LogicalBlockSize > 0) mmcOneValue.Add($"{ftr.LogicalBlockSize} bytes per logical block"); + + if(ftr.MultiRead) + mmcOneValue.Add("Drive claims capability to read all CD formats according to OSTA Multi-Read Specification"); + + if(ftr.PhysicalInterfaceStandard.HasValue) + { + switch(ftr.PhysicalInterfaceStandard) + { + case PhysicalInterfaces.Unspecified: + mmcOneValue.Add("Drive uses an unspecified physical interface"); + + break; + case PhysicalInterfaces.SCSI: + mmcOneValue.Add("Drive uses SCSI interface"); + + break; + case PhysicalInterfaces.ATAPI: + mmcOneValue.Add("Drive uses ATAPI interface"); + + break; + case PhysicalInterfaces.IEEE1394: + mmcOneValue.Add("Drive uses IEEE-1394 interface"); + + break; + case PhysicalInterfaces.IEEE1394A: + mmcOneValue.Add("Drive uses IEEE-1394A interface"); + + break; + case PhysicalInterfaces.FC: + mmcOneValue.Add("Drive uses Fibre Channel interface"); + + break; + case PhysicalInterfaces.IEEE1394B: + mmcOneValue.Add("Drive uses IEEE-1394B interface"); + + break; + case PhysicalInterfaces.SerialATAPI: + mmcOneValue.Add("Drive uses Serial ATAPI interface"); + + break; + case PhysicalInterfaces.USB: + mmcOneValue.Add("Drive uses USB interface"); + + break; + case PhysicalInterfaces.Vendor: + mmcOneValue.Add("Drive uses a vendor unique interface"); + + break; + default: + mmcOneValue.Add($"Drive uses an unknown interface with code {(uint)ftr.PhysicalInterfaceStandard}"); + + break; + } + } + + if(ftr.PreventJumper) mmcOneValue.Add("Drive power ups locked"); + + if(ftr.SupportsBusEncryption) mmcOneValue.Add("Drive supports bus encryption"); + + if(ftr.CanWriteBD) mmcOneValue.Add("Drive can write BD-R or BD-RE"); + + if(ftr.CanWriteBDR) mmcOneValue.Add("Drive can write BD-R Ver.1"); + + if(ftr.CanWriteBDRE1) mmcOneValue.Add("Drive can write BD-RE Ver.1"); + + if(ftr.CanWriteBDRE2) mmcOneValue.Add("Drive can write BD-RE Ver.2"); + + if(ftr.CanWriteBusEncryptedBlocks) mmcOneValue.Add("Drive supports writing with bus encryption"); + + if(ftr.CanWriteCDRW) mmcOneValue.Add("Drive can write CD-RW"); + + if(ftr.CanWriteCDRWCAV) mmcOneValue.Add("Drive can write High-Speed CD-RW"); + + if(ftr.CanWriteCDSAO && !ftr.CanWriteRaw) + mmcOneValue.Add("Drive can write CDs in Session at Once Mode:"); + else if(!ftr.CanWriteCDSAO && ftr.CanWriteRaw) + mmcOneValue.Add("Drive can write CDs in raw Mode:"); + else if(ftr.CanWriteCDSAO && ftr.CanWriteRaw) + mmcOneValue.Add("Drive can write CDs in Session at Once and in Raw Modes:"); + + if(ftr.CanWriteCDTAO) mmcOneValue.Add("Drive can write CDs in Track at Once Mode:"); + + if(ftr.CanWriteCSSManagedDVD) mmcOneValue.Add("Drive can write CSS managed DVDs"); + + if(ftr.CanWriteDDCDR) mmcOneValue.Add("Drive supports writing DDCD-R"); + + if(ftr.CanWriteDDCDRW) mmcOneValue.Add("Drive supports writing DDCD-RW"); + + if(ftr.CanWriteDVDPlusRWDL) + mmcOneValue.Add("Drive can read and write DVD+RW DL"); + else if(ftr.CanReadDVDPlusRWDL) mmcOneValue.Add("Drive can read DVD+RW DL"); + + if(ftr.CanWriteDVDR && ftr.CanWriteDVDRW && ftr.CanWriteDVDRDL) + mmcOneValue.Add("Drive supports writing DVD-R, DVD-RW and DVD-R DL"); + else if(ftr.CanWriteDVDR && ftr.CanWriteDVDRDL) + mmcOneValue.Add("Drive supports writing DVD-R and DVD-R DL"); + else if(ftr.CanWriteDVDR && ftr.CanWriteDVDRW) + mmcOneValue.Add("Drive supports writing DVD-R and DVD-RW"); + else if(ftr.CanWriteDVDR) mmcOneValue.Add("Drive supports writing DVD-R"); + + if(ftr.CanWriteHDDVDR && ftr.CanWriteHDDVDRAM) + mmcOneValue.Add("Drive can write HD DVD-RW, HD DVD-R and HD DVD-RAM"); + else if(ftr.CanWriteHDDVDR) + mmcOneValue.Add("Drive can write HD DVD-RW and HD DVD-R"); + else if(ftr.CanWriteHDDVDRAM) mmcOneValue.Add("Drive can write HD DVD-RW and HD DVD-RAM"); + + // TODO: Write HD DVD-RW + /* + else + mmcOneValue.Add("Drive can write HD DVD-RW"); + */ + if(ftr.CanWriteOldBDR) mmcOneValue.Add("Drive can write BD-R pre-1.0"); + + if(ftr.CanWriteOldBDRE) mmcOneValue.Add("Drive can write BD-RE pre-1.0"); + + if(ftr.CanWriteRWSubchannelInTAO) + { + mmcOneValue.Add("Drive can write user provided data in the R-W subchannels in Track at Once Mode"); + + if(ftr.CanWriteRawSubchannelInTAO) + mmcOneValue.Add("Drive accepts RAW R-W subchannel data in Track at Once Mode"); + + if(ftr.CanWritePackedSubchannelInTAO) + mmcOneValue.Add("Drive accepts Packed R-W subchannel data in Track at Once Mode"); + } + + if(ftr.CanWriteRWSubchannelInSAO) + mmcOneValue.Add("Drive can write user provided data in the R-W subchannels in Session at Once Mode"); + + if(ftr.CanWriteRaw && ftr.CanWriteRawMultiSession) + mmcOneValue.Add("Drive can write multi-session CDs in raw mode"); + + if(ftr.EmbeddedChanger) + { + mmcOneValue.Add("Drive contains an embedded changer"); + + if(ftr.ChangerIsSideChangeCapable) mmcOneValue.Add("Drive can change disc side"); + + if(ftr.ChangerSupportsDiscPresent) + mmcOneValue.Add("Drive is able to report slots contents after a reset or change"); + + mmcOneValue.Add($"Drive has {ftr.ChangerSlots + 1} slots"); + } + + if(ftr.SupportsCSS && ftr.CSSVersion.HasValue) + mmcOneValue.Add($"Drive supports DVD CSS/CPPM version {ftr.CSSVersion}"); + else if(ftr.SupportsCSS) mmcOneValue.Add("Drive supports DVD CSS/CPRM"); + + if(ftr.SupportsCPRM && ftr.CPRMVersion.HasValue) + mmcOneValue.Add($"Drive supports DVD CPRM version {ftr.CPRMVersion}"); + else if(ftr.SupportsCPRM) mmcOneValue.Add("Drive supports DVD CPRM"); + + if(ftr.DBML) mmcOneValue.Add("Drive reports Device Busy Class events during medium loading/unloading"); + + if(ftr.DVDMultiRead) mmcOneValue.Add("Drive conforms to DVD Multi Drive Read-only Specifications"); + + if(ftr.FirmwareDate.HasValue) mmcOneValue.Add($"Drive firmware is dated {ftr.FirmwareDate}"); + + if(ftr.SupportsC2) mmcOneValue.Add("Drive supports C2 Error Pointers"); + + if(ftr.SupportsDAP) mmcOneValue.Add("Drive supports the DAP bit in the READ CD and READ CD MSF commands"); + + if(ftr.SupportsDeviceBusyEvent) mmcOneValue.Add("Drive supports Device Busy events"); + + if(ftr.LoadingMechanismType.HasValue) + { + switch(ftr.LoadingMechanismType) + { + case 0: + mmcOneValue.Add("Drive uses media caddy"); + + break; + case 1: + mmcOneValue.Add("Drive uses a tray"); + + break; + case 2: + mmcOneValue.Add("Drive is pop-up"); + + break; + case 4: + mmcOneValue.Add("Drive is a changer with individually changeable discs"); + + break; + case 5: + mmcOneValue.Add("Drive is a changer using cartridges"); + + break; + default: + mmcOneValue.Add($"Drive uses unknown loading mechanism type {ftr.LoadingMechanismType}"); + + break; + } + } + + if(ftr.SupportsHybridDiscs) mmcOneValue.Add("Drive is able to access Hybrid discs"); + + if(ftr.SupportsModePage1Ch) + mmcOneValue.Add("Drive supports the Informational Exceptions Control mode page 1Ch"); + + if(ftr.SupportsOSSC) + mmcOneValue.Add("Drive supports the Trusted Computing Group Optical Security Subsystem Class"); + + if(ftr.SupportsPWP) mmcOneValue.Add("Drive supports set/release of PWP status"); + + if(ftr.SupportsSWPP) mmcOneValue.Add("Drive supports the SWPP bit of the Timeout and Protect mode page"); + + if(ftr.SupportsSecurDisc) mmcOneValue.Add("Drive supports SecurDisc"); + + if(ftr.SupportsSeparateVolume) mmcOneValue.Add("Drive supports separate volume per channel"); + + if(ftr.SupportsVCPS) mmcOneValue.Add("Drive supports VCPS"); + + if(ftr.VolumeLevels.HasValue) mmcOneValue.Add($"Drive has {ftr.VolumeLevels + 1} volume levels"); + + if(ftr.SupportsWriteProtectPAC) + mmcOneValue.Add("Drive supports reading/writing the Disc Write Protect PAC on BD-R/-RE media"); + + if(ftr.SupportsWriteInhibitDCB) mmcOneValue.Add("Drive supports writing the Write Inhibit DCB on DVD+RW media"); + + mmcOneValue.Sort(); + mmcOneValue.Add(""); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/ScsiMmcMode.cs b/Aaru.Server.Old/Core/ScsiMmcMode.cs new file mode 100644 index 00000000..e97e671b --- /dev/null +++ b/Aaru.Server.Old/Core/ScsiMmcMode.cs @@ -0,0 +1,199 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ScsiMmcMode.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes SCSI MODE PAGE 2Ah from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Structs.Devices.SCSI.Modes; + +namespace Aaru.Server.Old.Core; + +public static class ScsiMmcMode +{ + /// + /// Takes the MODE PAGE 2Ah part of a device report and prints it as a list of values to be sequenced by ASP.NET + /// in the rendering + /// + /// MODE PAGE 2Ah part of the report + /// List to put the values on + public static void Report(ModePage_2A mode, ref List mmcOneValue) + { + if(mode.AudioPlay) mmcOneValue.Add("Drive can play audio"); + + if(mode.Mode2Form1) mmcOneValue.Add("Drive can read sectors in Mode 2 Form 1 format"); + + if(mode.Mode2Form2) mmcOneValue.Add("Drive can read sectors in Mode 2 Form 2 format"); + + if(mode.MultiSession) mmcOneValue.Add("Drive supports multi-session discs and/or Photo-CD"); + + if(mode.CDDACommand) mmcOneValue.Add("Drive can read digital audio"); + + if(mode.AccurateCDDA) mmcOneValue.Add("Drive can continue from streaming loss"); + + if(mode.Subchannel) mmcOneValue.Add("Drive can read uncorrected and interleaved R-W subchannels"); + + if(mode.DeinterlaveSubchannel) mmcOneValue.Add("Drive can read, deinterleave and correct R-W subchannels"); + + if(mode.C2Pointer) mmcOneValue.Add("Drive supports C2 pointers"); + + if(mode.UPC) mmcOneValue.Add("Drive can read Media Catalogue Number"); + + if(mode.ISRC) mmcOneValue.Add("Drive can read ISRC"); + + switch(mode.LoadingMechanism) + { + case 0: + mmcOneValue.Add("Drive uses media caddy"); + + break; + case 1: + mmcOneValue.Add("Drive uses a tray"); + + break; + case 2: + mmcOneValue.Add("Drive is pop-up"); + + break; + case 4: + mmcOneValue.Add("Drive is a changer with individually changeable discs"); + + break; + case 5: + mmcOneValue.Add("Drive is a changer using cartridges"); + + break; + default: + mmcOneValue.Add($"Drive uses unknown loading mechanism type {mode.LoadingMechanism}"); + + break; + } + + if(mode.Lock) mmcOneValue.Add("Drive can lock media"); + + if(mode.PreventJumper) + { + mmcOneValue.Add("Drive power ups locked"); + + mmcOneValue.Add(mode.LockState + ? "Drive is locked, media cannot be ejected or inserted" + : "Drive is not locked, media can be ejected and inserted"); + } + else + { + mmcOneValue.Add(mode.LockState + ? "Drive is locked, media cannot be ejected, but if empty, can be inserted" + : "Drive is not locked, media can be ejected and inserted"); + } + + if(mode.Eject) mmcOneValue.Add("Drive can eject media"); + + if(mode.SeparateChannelMute) mmcOneValue.Add("Each channel can be muted independently"); + + if(mode.SeparateChannelVolume) mmcOneValue.Add("Each channel's volume can be controlled independently"); + + if(mode.SupportedVolumeLevels > 0) + mmcOneValue.Add($"Drive supports {mode.SupportedVolumeLevels} volume levels"); + + if(mode.BufferSize > 0) mmcOneValue.Add($"Drive has {mode.BufferSize} Kbyte of buffer"); + + if(mode.MaximumSpeed > 0) mmcOneValue.Add($"Drive's maximum reading speed is {mode.MaximumSpeed} Kbyte/sec."); + + if(mode.CurrentSpeed > 0) mmcOneValue.Add($"Drive's current reading speed is {mode.CurrentSpeed} Kbyte/sec."); + + if(mode.ReadCDR) + { + mmcOneValue.Add(mode.WriteCDR ? "Drive can read and write CD-R" : "Drive can read CD-R"); + + if(mode.Method2) mmcOneValue.Add("Drive supports reading CD-R packet media"); + } + + if(mode.ReadCDRW) mmcOneValue.Add(mode.WriteCDRW ? "Drive can read and write CD-RW" : "Drive can read CD-RW"); + + if(mode.ReadDVDROM) mmcOneValue.Add("Drive can read DVD-ROM"); + + if(mode.ReadDVDR) mmcOneValue.Add(mode.WriteDVDR ? "Drive can read and write DVD-R" : "Drive can read DVD-R"); + + if(mode.ReadDVDRAM) + mmcOneValue.Add(mode.WriteDVDRAM ? "Drive can read and write DVD-RAM" : "Drive can read DVD-RAM"); + + if(mode.Composite) mmcOneValue.Add("Drive can deliver a composite audio and video data stream"); + + if(mode.DigitalPort1) mmcOneValue.Add("Drive supports IEC-958 digital output on port 1"); + + if(mode.DigitalPort2) mmcOneValue.Add("Drive supports IEC-958 digital output on port 2"); + + if(mode.SDP) mmcOneValue.Add("Drive contains a changer that can report the exact contents of the slots"); + + if(mode.CurrentWriteSpeedSelected > 0) + { + if(mode.RotationControlSelected == 0) + mmcOneValue.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in CLV mode"); + else if(mode.RotationControlSelected == 1) + mmcOneValue.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in pure CAV mode"); + } + else + { + if(mode.MaxWriteSpeed > 0) + mmcOneValue.Add($"Drive's maximum writing speed is {mode.MaxWriteSpeed} Kbyte/sec."); + + if(mode.CurrentWriteSpeed > 0) + mmcOneValue.Add($"Drive's current writing speed is {mode.CurrentWriteSpeed} Kbyte/sec."); + } + + if(mode.WriteSpeedPerformanceDescriptors != null) + { + foreach(ModePage_2A_WriteDescriptor descriptor in mode.WriteSpeedPerformanceDescriptors.Where(descriptor => + descriptor.WriteSpeed > 0)) + { + if(descriptor.RotationControl == 0) + mmcOneValue.Add($"Drive supports writing at {descriptor.WriteSpeed} Kbyte/sec. in CLV mode"); + else if(descriptor.RotationControl == 1) + { + mmcOneValue + .Add($"Drive supports writing at is {descriptor.WriteSpeed} Kbyte/sec. in pure CAV mode"); + } + } + } + + if(mode.TestWrite) mmcOneValue.Add("Drive supports test writing"); + + if(mode.ReadBarcode) mmcOneValue.Add("Drive can read barcode"); + + if(mode.SCC) mmcOneValue.Add("Drive can read both sides of a disc"); + + if(mode.LeadInPW) mmcOneValue.Add("Drive an read raw R-W subchannel from the Lead-In"); + + if(mode.CMRSupported == 1) mmcOneValue.Add("Drive supports DVD CSS and/or DVD CPPM"); + + if(mode.BUF) mmcOneValue.Add("Drive supports buffer under-run free recording"); + + mmcOneValue.Sort(); + mmcOneValue.Add(""); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/ScsiModeSense.cs b/Aaru.Server.Old/Core/ScsiModeSense.cs new file mode 100644 index 00000000..f6fb6451 --- /dev/null +++ b/Aaru.Server.Old/Core/ScsiModeSense.cs @@ -0,0 +1,451 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ScsiModeSense.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes SCSI MODE PAGEs from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Metadata; +using Aaru.CommonTypes.Structs.Devices.SCSI; +using Aaru.Decoders.SCSI; + +namespace Aaru.Server.Old.Core; + +public static class ScsiModeSense +{ + /// + /// Takes the MODE PAGEs part of a device report and prints it as a list of values and another list of key=value + /// pairs to be sequenced by ASP.NET in the rendering + /// + /// MODE PAGEs part of a device report + /// SCSI vendor string + /// SCSI peripheral device type + /// List to put values on + /// List to put key=value pairs on + public static void Report(ScsiMode modeSense, string vendor, PeripheralDeviceTypes deviceType, + ref List scsiOneValue, ref Dictionary modePages) + { + if(modeSense.MediumType.HasValue) scsiOneValue.Add($"Medium type is {modeSense.MediumType:X2}h"); + + if(modeSense.WriteProtected) scsiOneValue.Add("Device is write protected."); + + if(modeSense.BlockDescriptors != null) + { + foreach(BlockDescriptor descriptor in modeSense.BlockDescriptors) + { + if(descriptor.Blocks.HasValue && descriptor.BlockLength.HasValue) + { + scsiOneValue + .Add($"Density code {descriptor.Density:X2}h has {descriptor.Blocks} blocks of {descriptor.BlockLength} bytes each"); + } + else + scsiOneValue.Add($"Density code {descriptor.Density:X2}h"); + } + } + + if(modeSense.DPOandFUA) scsiOneValue.Add("Drive supports DPO and FUA bits"); + + if(modeSense.BlankCheckEnabled) scsiOneValue.Add("Blank checking during write is enabled"); + + if(modeSense.BufferedMode.HasValue) + { + switch(modeSense.BufferedMode) + { + case 0: + scsiOneValue.Add("Device writes directly to media"); + + break; + case 1: + scsiOneValue.Add("Device uses a write cache"); + + break; + case 2: + scsiOneValue.Add("Device uses a write cache but doesn't return until cache is flushed"); + + break; + default: + scsiOneValue.Add($"Unknown buffered mode code 0x{modeSense.BufferedMode:X2}"); + + break; + } + } + + if(modeSense.ModePages == null) return; + + foreach(ScsiPage page in modeSense.ModePages) + { + switch(page.page) + { + case 0x00: + { + if(deviceType == PeripheralDeviceTypes.MultiMediaDevice && page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_00_SFF(page.value)); + else + { + modePages.Add(page.subpage != 0 + ? $"MODE page {page.page:X2}h subpage {page.subpage:X2}h" + : $"MODE page {page.page:X2}h", + "Unknown vendor mode page"); + } + + break; + } + case 0x01: + { + if(page.subpage == 0) + { + modePages.Add($"MODE page {page.page:X2}h", + deviceType == PeripheralDeviceTypes.MultiMediaDevice + ? Modes.PrettifyModePage_01_MMC(page.value) + : Modes.PrettifyModePage_01(page.value)); + } + else + goto default; + + break; + } + case 0x02: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_02(page.value)); + else + goto default; + + break; + } + case 0x03: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_03(page.value)); + else + goto default; + + break; + } + case 0x04: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_04(page.value)); + else + goto default; + + break; + } + case 0x05: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_05(page.value)); + else + goto default; + + break; + } + case 0x06: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_06(page.value)); + else + goto default; + + break; + } + case 0x07: + { + if(page.subpage == 0) + { + modePages.Add($"MODE page {page.page:X2}h", + deviceType == PeripheralDeviceTypes.MultiMediaDevice + ? Modes.PrettifyModePage_07_MMC(page.value) + : Modes.PrettifyModePage_07(page.value)); + } + else + goto default; + + break; + } + case 0x08: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_08(page.value)); + else + goto default; + + break; + } + case 0x0A: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0A(page.value)); + else if(page.subpage == 1) + { + modePages.Add($"MODE page {page.page:X2}h subpage {page.subpage:X2}h", + Modes.PrettifyModePage_0A_S01(page.value)); + } + else + goto default; + + break; + } + case 0x0B: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0B(page.value)); + else + goto default; + + break; + } + case 0x0D: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0D(page.value)); + else + goto default; + + break; + } + case 0x0E: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0E(page.value)); + else + goto default; + + break; + } + case 0x0F: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0F(page.value)); + else + goto default; + + break; + } + case 0x10: + { + if(page.subpage == 0) + { + modePages.Add($"MODE page {page.page:X2}h", + deviceType == PeripheralDeviceTypes.SequentialAccess + ? Modes.PrettifyModePage_10_SSC(page.value) + : Modes.PrettifyModePage_10(page.value)); + } + else + goto default; + + break; + } + case 0x11: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_11(page.value)); + else + goto default; + + break; + } + case 0x12: + case 0x13: + case 0x14: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_12_13_14(page.value)); + else + goto default; + + break; + } + case 0x1A: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1A(page.value)); + else if(page.subpage == 1) + { + modePages.Add($"MODE page {page.page:X2}h subpage {page.subpage:X2}h", + Modes.PrettifyModePage_1A_S01(page.value)); + } + else + goto default; + + break; + } + case 0x1B: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1B(page.value)); + else + goto default; + + break; + } + case 0x1C: + { + if(page.subpage == 0) + { + modePages.Add($"MODE page {page.page:X2}h", + deviceType == PeripheralDeviceTypes.MultiMediaDevice + ? Modes.PrettifyModePage_1C_SFF(page.value) + : Modes.PrettifyModePage_1C(page.value)); + } + else if(page.subpage == 1) + { + modePages.Add($"MODE page {page.page:X2}h subpage {page.subpage:X2}h", + Modes.PrettifyModePage_1C_S01(page.value)); + } + else + goto default; + + break; + } + case 0x1D: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1D(page.value)); + else + goto default; + + break; + } + case 0x21: + { + if(vendor == "CERTANCE") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyCertanceModePage_21(page.value)); + else + goto default; + + break; + } + case 0x22: + { + if(vendor == "CERTANCE") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyCertanceModePage_22(page.value)); + else + goto default; + + break; + } + case 0x24: + { + if(vendor == "IBM") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_24(page.value)); + else + goto default; + + break; + } + case 0x2A: + { + if(page.subpage == 0) + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_2A(page.value)); + else + goto default; + + break; + } + case 0x2F: + { + if(vendor == "IBM") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_2F(page.value)); + else + goto default; + + break; + } + case 0x30: + { + if(Modes.IsAppleModePage_30(page.value)) + modePages.Add("MODE page 30h", "Drive identifies as an Apple OEM drive"); + else + goto default; + + break; + } + case 0x3B: + { + if(vendor == "HP") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3B(page.value)); + else + goto default; + + break; + } + case 0x3C: + { + if(vendor == "HP") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3C(page.value)); + else + goto default; + + break; + } + case 0x3D: + { + if(vendor == "IBM") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_3D(page.value)); + else if(vendor == "HP") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3D(page.value)); + else + goto default; + + break; + } + case 0x3E: + { + if(vendor == "FUJITSU") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyFujitsuModePage_3E(page.value)); + else if(vendor == "HP") + modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3E(page.value)); + else + goto default; + + break; + } + default: + { + modePages.Add(page.subpage != 0 + ? $"MODE page {page.page:X2}h subpage {page.subpage:X2}h" + : $"MODE page {page.page:X2}h", + "Unknown mode page"); + } + + break; + } + } + + Dictionary newModePages = new(); + + foreach(KeyValuePair kvp in modePages) + { + newModePages.Add(kvp.Key, + string.IsNullOrWhiteSpace(kvp.Value) ? "Undecoded" : kvp.Value.Replace("\n", "
")); + } + + modePages = newModePages; + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/SscTestedMedia.cs b/Aaru.Server.Old/Core/SscTestedMedia.cs new file mode 100644 index 00000000..17104a6e --- /dev/null +++ b/Aaru.Server.Old/Core/SscTestedMedia.cs @@ -0,0 +1,71 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : SscTestedMedia.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes SCSI Streaming media tests from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Metadata; + +namespace Aaru.Server.Old.Core; + +public static class SscTestedMedia +{ + /// Takes the tested media from SCSI Streaming devices of a device report and prints it as a list of values + /// List to put values on + /// List of tested media + public static void Report(IEnumerable testedMedia, ref List mediaOneValue) + { + foreach(TestedSequentialMedia media in testedMedia) + { + if(!string.IsNullOrWhiteSpace(media.MediumTypeName)) + { + mediaOneValue.Add($"Information for medium named \"{media.MediumTypeName}\""); + + if(media.MediumType.HasValue) mediaOneValue.Add($"Medium type code: {media.MediumType:X2}h"); + } + else if(media.MediumType.HasValue) + mediaOneValue.Add($"Information for medium type {media.MediumType:X2}h"); + else + mediaOneValue.Add("Information for unknown medium type"); + + if(!string.IsNullOrWhiteSpace(media.Manufacturer)) + mediaOneValue.Add($"Medium manufactured by: {media.Manufacturer}"); + + if(!string.IsNullOrWhiteSpace(media.Model)) mediaOneValue.Add($"Medium model: {media.Model}"); + + if(media.Density.HasValue) mediaOneValue.Add($"Medium has density code {media.Density:X2}h"); + + if(media.CanReadMediaSerial == true) mediaOneValue.Add("Drive can read medium serial number."); + + if(media.MediaIsRecognized) mediaOneValue.Add("Drive recognizes this medium."); + + mediaOneValue.Add(""); + } + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/StatsConverter.cs b/Aaru.Server.Old/Core/StatsConverter.cs new file mode 100644 index 00000000..5f7b0376 --- /dev/null +++ b/Aaru.Server.Old/Core/StatsConverter.cs @@ -0,0 +1,586 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : StatsConverter.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Reads a statistics XML and stores it in the database context. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +using Aaru.CommonTypes.Metadata; +using Aaru.Server.Old.Database.Models; +using DbContext = Aaru.Server.Old.Database.DbContext; +using OperatingSystem = Aaru.Server.Old.Database.Models.OperatingSystem; +using Version = Aaru.Server.Old.Database.Models.Version; + +namespace Aaru.Server.Old.Core; + +public static class StatsConverter +{ + public static void Convert(Stats newStats) + { + var ctx = new DbContext(); + + if(newStats.Commands?.Analyze > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "fs-info"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Analyze, + Name = "fs-info" + }); + } + else + existing.Count += newStats.Commands.Analyze; + } + + if(newStats.Commands?.Benchmark > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "benchmark"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Benchmark, + Name = "benchmark" + }); + } + else + existing.Count += newStats.Commands.Benchmark; + } + + if(newStats.Commands?.Checksum > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "checksum"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Checksum, + Name = "checksum" + }); + } + else + existing.Count += newStats.Commands.Checksum; + } + + if(newStats.Commands?.Compare > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "compare"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Compare, + Name = "compare" + }); + } + else + existing.Count += newStats.Commands.Compare; + } + + if(newStats.Commands?.CreateSidecar > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "create-sidecar"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.CreateSidecar, + Name = "create-sidecar" + }); + } + else + existing.Count += newStats.Commands.CreateSidecar; + } + + if(newStats.Commands?.Decode > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "decode"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Decode, + Name = "decode" + }); + } + else + existing.Count += newStats.Commands.Decode; + } + + if(newStats.Commands?.DeviceInfo > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "device-info"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.DeviceInfo, + Name = "device-info" + }); + } + else + existing.Count += newStats.Commands.DeviceInfo; + } + + if(newStats.Commands?.DeviceReport > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "device-report"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.DeviceReport, + Name = "device-report" + }); + } + else + existing.Count += newStats.Commands.DeviceReport; + } + + if(newStats.Commands?.DumpMedia > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "dump-media"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.DumpMedia, + Name = "dump-media" + }); + } + else + existing.Count += newStats.Commands.DumpMedia; + } + + if(newStats.Commands?.Entropy > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "entropy"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Entropy, + Name = "entropy" + }); + } + else + existing.Count += newStats.Commands.Entropy; + } + + if(newStats.Commands?.Formats > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "formats"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Formats, + Name = "formats" + }); + } + else + existing.Count += newStats.Commands.Formats; + } + + if(newStats.Commands?.MediaInfo > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "media-info"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.MediaInfo, + Name = "media-info" + }); + } + else + existing.Count += newStats.Commands.MediaInfo; + } + + if(newStats.Commands?.MediaScan > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "media-scan"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.MediaScan, + Name = "media-scan" + }); + } + else + existing.Count += newStats.Commands.MediaScan; + } + + if(newStats.Commands?.PrintHex > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "printhex"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.PrintHex, + Name = "printhex" + }); + } + else + existing.Count += newStats.Commands.PrintHex; + } + + if(newStats.Commands?.Verify > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "verify"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Verify, + Name = "verify" + }); + } + else + existing.Count += newStats.Commands.Verify; + } + + if(newStats.Commands?.Ls > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "ls"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.Ls, + Name = "ls" + }); + } + else + existing.Count += newStats.Commands.Ls; + } + + if(newStats.Commands?.ExtractFiles > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "extract-files"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.ExtractFiles, + Name = "extract-files" + }); + } + else + existing.Count += newStats.Commands.ExtractFiles; + } + + if(newStats.Commands?.ListDevices > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "list-devices"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.ListDevices, + Name = "list-devices" + }); + } + else + existing.Count += newStats.Commands.ListDevices; + } + + if(newStats.Commands?.ListEncodings > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "list-encodings"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.ListEncodings, + Name = "list-encodings" + }); + } + else + existing.Count += newStats.Commands.ListEncodings; + } + + if(newStats.Commands?.ConvertImage > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "convert-image"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.ConvertImage, + Name = "convert-image" + }); + } + else + existing.Count += newStats.Commands.ConvertImage; + } + + if(newStats.Commands?.ImageInfo > 0) + { + Command existing = ctx.Commands.FirstOrDefault(c => c.Name == "image-info"); + + if(existing == null) + { + ctx.Commands.Add(new Command + { + Count = newStats.Commands.ImageInfo, + Name = "image-info" + }); + } + else + existing.Count += newStats.Commands.ImageInfo; + } + + if(newStats.OperatingSystems != null) + { + foreach(OsStats operatingSystem in newStats.OperatingSystems) + { + if(string.IsNullOrWhiteSpace(operatingSystem.name) || + string.IsNullOrWhiteSpace(operatingSystem.version)) + continue; + + OperatingSystem existing = + ctx.OperatingSystems.FirstOrDefault(c => c.Name == operatingSystem.name && + c.Version == operatingSystem.version); + + if(existing == null) + { + ctx.OperatingSystems.Add(new OperatingSystem + { + Count = operatingSystem.Value, + Name = operatingSystem.name, + Version = operatingSystem.version + }); + } + else + existing.Count += operatingSystem.Value; + } + } + else + { + OperatingSystem existing = ctx.OperatingSystems.FirstOrDefault(c => c.Name == "Linux" && c.Version == null); + + if(existing == null) + { + ctx.OperatingSystems.Add(new OperatingSystem + { + Count = 1, + Name = "Linux" + }); + } + else + existing.Count++; + } + + if(newStats.Versions != null) + { + foreach(NameValueStats nvs in newStats.Versions) + { + if(string.IsNullOrWhiteSpace(nvs.name)) continue; + + Version existing = ctx.Versions.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + ctx.Versions.Add(new Version + { + Count = nvs.Value, + Name = nvs.name + }); + } + else + existing.Count += nvs.Value; + } + } + else + { + Version existing = ctx.Versions.FirstOrDefault(c => c.Name == "previous"); + + if(existing == null) + { + ctx.Versions.Add(new Version + { + Count = 1, + Name = "previous" + }); + } + else + existing.Count++; + } + + if(newStats.Filesystems != null) + { + foreach(NameValueStats nvs in newStats.Filesystems) + { + if(string.IsNullOrWhiteSpace(nvs.name)) continue; + + Filesystem existing = ctx.Filesystems.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + ctx.Filesystems.Add(new Filesystem + { + Count = nvs.Value, + Name = nvs.name + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newStats.Partitions != null) + { + foreach(NameValueStats nvs in newStats.Partitions) + { + if(string.IsNullOrWhiteSpace(nvs.name)) continue; + + Partition existing = ctx.Partitions.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + ctx.Partitions.Add(new Partition + { + Count = nvs.Value, + Name = nvs.name + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newStats.MediaImages != null) + { + foreach(NameValueStats nvs in newStats.MediaImages) + { + if(string.IsNullOrWhiteSpace(nvs.name)) continue; + + MediaFormat existing = ctx.MediaFormats.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + ctx.MediaFormats.Add(new MediaFormat + { + Count = nvs.Value, + Name = nvs.name + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newStats.Filters != null) + { + foreach(NameValueStats nvs in newStats.Filters) + { + if(string.IsNullOrWhiteSpace(nvs.name)) continue; + + Filter existing = ctx.Filters.FirstOrDefault(c => c.Name == nvs.name); + + if(existing == null) + { + ctx.Filters.Add(new Filter + { + Count = nvs.Value, + Name = nvs.name + }); + } + else + existing.Count += nvs.Value; + } + } + + if(newStats.Devices != null) + { + foreach(DeviceStats device in newStats.Devices.Where(device => !string.IsNullOrWhiteSpace(device.Model)) + .Where(device => !ctx.DeviceStats.Any(c => c.Bus == device.Bus && + c.Manufacturer == device.Manufacturer && + c.Model == device.Model && + c.Revision == device.Revision))) + { + ctx.DeviceStats.Add(new DeviceStat + { + Bus = device.Bus, + Manufacturer = device.Manufacturer, + Model = device.Model, + Revision = device.Revision + }); + } + } + + if(newStats.Medias != null) + { + foreach(MediaStats media in newStats.Medias) + { + if(string.IsNullOrWhiteSpace(media.type)) continue; + + Media existing = ctx.Medias.FirstOrDefault(c => c.Type == media.type && c.Real == media.real); + + if(existing == null) + { + ctx.Medias.Add(new Media + { + Count = media.Value, + Real = media.real, + Type = media.type + }); + } + else + existing.Count += media.Value; + } + } + + ctx.SaveChanges(); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Core/TestedMedia.cs b/Aaru.Server.Old/Core/TestedMedia.cs new file mode 100644 index 00000000..6d5f135f --- /dev/null +++ b/Aaru.Server.Old/Core/TestedMedia.cs @@ -0,0 +1,412 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : TestedMedia.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru Server. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes media tests from reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2024 Natalia Portillo +// ****************************************************************************/ + +namespace Aaru.Server.Old.Core; + +public static class TestedMedia +{ + /// Takes the tested media from a device report and prints it as a list of values + /// List to put values on + /// List of tested media + public static void Report(List testedMedias, ref List mediaOneValue) + { + foreach(CommonTypes.Metadata.TestedMedia testedMedia in testedMedias) + { + if(!string.IsNullOrWhiteSpace(testedMedia.MediumTypeName)) + { + mediaOneValue.Add($"Information for medium named \"{testedMedia.MediumTypeName}\""); + + if(testedMedia.MediumType != null) mediaOneValue.Add($"Medium type code: {testedMedia.MediumType:X2}h"); + } + else if(testedMedia.MediumType != null) + mediaOneValue.Add($"Information for medium type {testedMedia.MediumType:X2}h"); + else + mediaOneValue.Add("Information for unknown medium type"); + + mediaOneValue.Add(testedMedia.MediaIsRecognized + ? "Drive recognizes this medium." + : "Drive does not recognize this medium."); + + if(!string.IsNullOrWhiteSpace(testedMedia.Manufacturer)) + mediaOneValue.Add($"Medium manufactured by: {testedMedia.Manufacturer}"); + + if(!string.IsNullOrWhiteSpace(testedMedia.Model)) mediaOneValue.Add($"Medium model: {testedMedia.Model}"); + + if(testedMedia.Density != null) mediaOneValue.Add($"Density code: {testedMedia.Density:X2}h"); + + if(testedMedia.BlockSize != null) mediaOneValue.Add($"Logical sector size: {testedMedia.BlockSize} bytes"); + + if(testedMedia.PhysicalBlockSize != null) + mediaOneValue.Add($"Physical sector size: {testedMedia.PhysicalBlockSize} bytes"); + + if(testedMedia.LongBlockSize != null) + mediaOneValue.Add($"READ LONG sector size: {testedMedia.LongBlockSize} bytes"); + + if(testedMedia.Blocks != null && testedMedia.BlockSize != null) + { + mediaOneValue.Add($"Medium has {testedMedia.Blocks} blocks of {testedMedia.BlockSize} bytes each"); + + if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000000) + { + mediaOneValue + .Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB"); + } + else if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000) + { + mediaOneValue + .Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB"); + } + else + { + mediaOneValue + .Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024:F2} MiB"); + } + } + + if(testedMedia.CHS != null && testedMedia.CurrentCHS != null) + { + int currentSectors = testedMedia.CurrentCHS.Cylinders * + testedMedia.CurrentCHS.Heads * + testedMedia.CurrentCHS.Sectors; + + mediaOneValue + .Add($"Cylinders: {testedMedia.CHS.Cylinders} max., {testedMedia.CurrentCHS.Cylinders} current"); + + mediaOneValue.Add($"Heads: {testedMedia.CHS.Heads} max., {testedMedia.CurrentCHS.Heads} current"); + + mediaOneValue + .Add($"Sectors per track: {testedMedia.CHS.Sectors} max., {testedMedia.CurrentCHS.Sectors} current"); + + mediaOneValue + .Add($"Sectors addressable in CHS mode: {testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors} max., {currentSectors} current"); + + mediaOneValue + .Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB"); + } + else if(testedMedia.CHS != null) + { + int currentSectors = testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors; + mediaOneValue.Add($"Cylinders: {testedMedia.CHS.Cylinders}"); + mediaOneValue.Add($"Heads: {testedMedia.CHS.Heads}"); + mediaOneValue.Add($"Sectors per track: {testedMedia.CHS.Sectors}"); + mediaOneValue.Add($"Sectors addressable in CHS mode: {currentSectors}"); + + mediaOneValue + .Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB"); + } + + if(testedMedia.LBASectors != null) + { + mediaOneValue.Add($"Sectors addressable in sectors in 28-bit LBA mode: {testedMedia.LBASectors}"); + + if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000000) + { + mediaOneValue + .Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB"); + } + else if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000) + { + mediaOneValue + .Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB"); + } + else + { + mediaOneValue + .Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB"); + } + } + + if(testedMedia.LBA48Sectors != null) + { + mediaOneValue.Add($"Sectors addressable in sectors in 48-bit LBA mode: {testedMedia.LBA48Sectors}"); + + if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000000) + { + mediaOneValue + .Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB"); + } + else if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000) + { + mediaOneValue + .Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB"); + } + else + { + mediaOneValue + .Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB"); + } + } + + if(testedMedia.NominalRotationRate != null && + testedMedia.NominalRotationRate != 0x0000 && + testedMedia.NominalRotationRate != 0xFFFF) + { + mediaOneValue.Add(testedMedia.NominalRotationRate == 0x0001 + ? "Medium does not rotate." + : $"Medium rotates at {testedMedia.NominalRotationRate} rpm"); + } + + if(testedMedia.BlockSize != null && + testedMedia.PhysicalBlockSize != null && + testedMedia.BlockSize.Value != testedMedia.PhysicalBlockSize.Value && + (testedMedia.LogicalAlignment & 0x8000) == 0x0000 && + (testedMedia.LogicalAlignment & 0x4000) == 0x4000) + { + mediaOneValue + .Add($"Logical sector starts at offset {testedMedia.LogicalAlignment & 0x3FFF} from physical sector"); + } + + if(testedMedia.SupportsReadSectors == true) + mediaOneValue.Add("Device can use the READ SECTOR(S) command in CHS mode with this medium"); + + if(testedMedia.SupportsReadRetry == true) + mediaOneValue.Add("Device can use the READ SECTOR(S) RETRY command in CHS mode with this medium"); + + if(testedMedia.SupportsReadDma == true) + mediaOneValue.Add("Device can use the READ DMA command in CHS mode with this medium"); + + if(testedMedia.SupportsReadDmaRetry == true) + mediaOneValue.Add("Device can use the READ DMA RETRY command in CHS mode with this medium"); + + if(testedMedia.SupportsReadLong == true) + mediaOneValue.Add("Device can use the READ LONG command in CHS mode with this medium"); + + if(testedMedia.SupportsReadLongRetry == true) + mediaOneValue.Add("Device can use the READ LONG RETRY command in CHS mode with this medium"); + + if(testedMedia.SupportsReadLba == true) + mediaOneValue.Add("Device can use the READ SECTOR(S) command in 28-bit LBA mode with this medium"); + + if(testedMedia.SupportsReadRetryLba == true) + { + mediaOneValue + .Add("Device can use the READ SECTOR(S) RETRY command in 28-bit LBA mode with this medium"); + } + + if(testedMedia.SupportsReadDmaLba == true) + mediaOneValue.Add("Device can use the READ DMA command in 28-bit LBA mode with this medium"); + + if(testedMedia.SupportsReadDmaRetryLba == true) + mediaOneValue.Add("Device can use the READ DMA RETRY command in 28-bit LBA mode with this medium"); + + if(testedMedia.SupportsReadLongLba == true) + mediaOneValue.Add("Device can use the READ LONG command in 28-bit LBA mode with this medium"); + + if(testedMedia.SupportsReadLongRetryLba == true) + mediaOneValue.Add("Device can use the READ LONG RETRY command in 28-bit LBA mode with this medium"); + + if(testedMedia.SupportsReadLba48 == true) + mediaOneValue.Add("Device can use the READ SECTOR(S) command in 48-bit LBA mode with this medium"); + + if(testedMedia.SupportsReadDmaLba48 == true) + mediaOneValue.Add("Device can use the READ DMA command in 48-bit LBA mode with this medium"); + + if(testedMedia.SupportsSeek == true) + mediaOneValue.Add("Device can use the SEEK command in CHS mode with this medium"); + + if(testedMedia.SupportsSeekLba == true) + mediaOneValue.Add("Device can use the SEEK command in 28-bit LBA mode with this medium"); + + if(testedMedia.SupportsReadCapacity == true) + mediaOneValue.Add("Device can use the READ CAPACITY (10) command with this medium"); + + if(testedMedia.SupportsReadCapacity16 == true) + mediaOneValue.Add("Device can use the READ CAPACITY (16) command with this medium"); + + if(testedMedia.SupportsRead6 == true) + mediaOneValue.Add("Device can use the READ (6) command with this medium"); + + if(testedMedia.SupportsRead10 == true) + mediaOneValue.Add("Device can use the READ (10) command with this medium"); + + if(testedMedia.SupportsRead12 == true) + mediaOneValue.Add("Device can use the READ (12) command with this medium"); + + if(testedMedia.SupportsRead16 == true) + mediaOneValue.Add("Device can use the READ (16) command with this medium"); + + if(testedMedia.SupportsReadLong == true) + mediaOneValue.Add("Device can use the READ LONG (10) command with this medium"); + + if(testedMedia.SupportsReadLong16 == true) + mediaOneValue.Add("Device can use the READ LONG (16) command with this medium"); + + if(testedMedia.SupportsReadCd == true) + mediaOneValue.Add("Device can use the READ CD command with LBA addressing with this medium"); + + if(testedMedia.SupportsReadCdMsf == true) + mediaOneValue.Add("Device can use the READ CD command with MM:SS:FF addressing with this medium"); + + if(testedMedia.SupportsReadCdRaw == true) + { + mediaOneValue + .Add("Device can use the READ CD command with LBA addressing with this medium to read raw sector"); + } + + if(testedMedia.SupportsReadCdMsfRaw == true) + { + mediaOneValue + .Add("Device can use the READ CD command with MM:SS:FF addressing with this medium read raw sector"); + } + + if(testedMedia.SupportsHLDTSTReadRawDVD == true) + mediaOneValue.Add("Device can use the HL-DT-ST vendor READ DVD (RAW) command with this medium"); + + if(testedMedia.SupportsLiteOnReadRawDVD == true) + mediaOneValue.Add("Device can use the Lite-On READ BUFFER (RAW) command with this medium"); + + if(testedMedia.SupportsNECReadCDDA == true) + mediaOneValue.Add("Device can use the NEC vendor READ CD-DA command with this medium"); + + if(testedMedia.SupportsPioneerReadCDDA == true) + mediaOneValue.Add("Device can use the PIONEER vendor READ CD-DA command with this medium"); + + if(testedMedia.SupportsPioneerReadCDDAMSF == true) + mediaOneValue.Add("Device can use the PIONEER vendor READ CD-DA MSF command with this medium"); + + if(testedMedia.SupportsPlextorReadCDDA == true) + mediaOneValue.Add("Device can use the PLEXTOR vendor READ CD-DA command with this medium"); + + if(testedMedia.SupportsPlextorReadRawDVD == true) + mediaOneValue.Add("Device can use the PLEXTOR vendor READ DVD (RAW) command with this medium"); + + if(testedMedia.CanReadAACS == true) + mediaOneValue.Add("Device can read the Advanced Access Content System from this medium"); + + if(testedMedia.CanReadADIP == true) + mediaOneValue.Add("Device can read the DVD ADress-In-Pregroove from this medium"); + + if(testedMedia.CanReadATIP == true) + mediaOneValue.Add("Device can read the CD Absolute-Time-In-Pregroove from this medium"); + + if(testedMedia.CanReadBCA == true) + mediaOneValue.Add("Device can read the Burst Cutting Area from this medium"); + + if(testedMedia.CanReadC2Pointers == true) + mediaOneValue.Add("Device can report the C2 pointers when reading from this medium"); + + if(testedMedia.CanReadCMI == true) + mediaOneValue.Add("Device can read the Copyright Management Information from this medium"); + + if(testedMedia.CanReadCorrectedSubchannel == true) + mediaOneValue.Add("Device can correct subchannels when reading from this medium"); + + if(testedMedia.CanReadCorrectedSubchannelWithC2 == true) + { + mediaOneValue + .Add("Device can correct subchannels and report the C2 pointers when reading from this medium"); + } + + if(testedMedia.CanReadDCB == true) + mediaOneValue.Add("Device can read the Disc Control Blocks from this medium"); + + if(testedMedia.CanReadDDS == true) + mediaOneValue.Add("Device can read the Disc Definition Structure from this medium"); + + if(testedMedia.CanReadDMI == true) + mediaOneValue.Add("Device can read the Disc Manufacturer Information from this medium"); + + if(testedMedia.CanReadDiscInformation == true) + mediaOneValue.Add("Device can read the Disc Information from this medium"); + + if(testedMedia.CanReadFullTOC == true) + mediaOneValue.Add("Device can read the Table of Contents from this medium, without processing it"); + + if(testedMedia.CanReadHDCMI == true) + mediaOneValue.Add("Device can read the HD DVD Copyright Management Information from this medium"); + + if(testedMedia.CanReadLayerCapacity == true) + mediaOneValue.Add("Device can read the layer capacity from this medium"); + + if(testedMedia.CanReadFirstTrackPreGap == true) + mediaOneValue.Add("Device can read the first track's pregap data"); + + if(testedMedia.CanReadLeadIn == true) mediaOneValue.Add("Device can read the Lead-In from this medium"); + + if(testedMedia.CanReadLeadOut == true) mediaOneValue.Add("Device can read the Lead-Out from this medium"); + + if(testedMedia.CanReadMediaID == true) mediaOneValue.Add("Device can read the Media ID from this medium"); + + if(testedMedia.CanReadMediaSerial == true) + mediaOneValue.Add("Device can read the Media Serial Number from this medium"); + + if(testedMedia.CanReadPAC == true) mediaOneValue.Add("Device can read the PAC from this medium"); + + if(testedMedia.CanReadPFI == true) + mediaOneValue.Add("Device can read the Physical Format Information from this medium"); + + if(testedMedia.CanReadPMA == true) + mediaOneValue.Add("Device can read the Power Management Area from this medium"); + + if(testedMedia.CanReadPQSubchannel == true) + mediaOneValue.Add("Device can read the P to Q subchannels from this medium"); + + if(testedMedia.CanReadPQSubchannelWithC2 == true) + mediaOneValue.Add("Device can read the P to Q subchannels from this medium reporting the C2 pointers"); + + if(testedMedia.CanReadPRI == true) + mediaOneValue.Add("Device can read the Pre-Recorded Information from this medium"); + + if(testedMedia.CanReadRWSubchannel == true) + mediaOneValue.Add("Device can read the R to W subchannels from this medium"); + + if(testedMedia.CanReadRWSubchannelWithC2 == true) + mediaOneValue.Add("Device can read the R to W subchannels from this medium reporting the C2 pointers"); + + if(testedMedia.CanReadRecordablePFI == true) + mediaOneValue.Add("Device can read the Physical Format Information from Lead-In from this medium"); + + if(testedMedia.CanReadSpareAreaInformation == true) + mediaOneValue.Add("Device can read the Spare Area Information from this medium"); + + if(testedMedia.CanReadTOC == true) + mediaOneValue.Add("Device can read the Table of Contents from this medium"); + + if(testedMedia.CanReadingIntersessionLeadIn == true) + mediaOneValue.Add("Device can read Lead-In between sessions"); + + if(testedMedia.CanReadingIntersessionLeadOut == true) + mediaOneValue.Add("Device can read Lead-Out between sessions"); + + if(testedMedia.CanReadCdScrambled == true) + mediaOneValue.Add("Device can read scrambled sectors using standard READ CD command"); + + if(testedMedia.CanReadF1_06 == true) + mediaOneValue.Add("Device can read from cache using F1h command with subcommand 06h"); + + if(testedMedia.CanReadF1_06LeadOut == true) + mediaOneValue.Add("Device can read Lead-Out from cache using F1h command with subcommand 06h"); + + mediaOneValue.Add(""); + } + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Globals.cs b/Aaru.Server.Old/Globals.cs new file mode 100644 index 00000000..868387a4 --- /dev/null +++ b/Aaru.Server.Old/Globals.cs @@ -0,0 +1,7 @@ +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Mvc; +global using Microsoft.EntityFrameworkCore; +global using System.Threading.Tasks; \ No newline at end of file diff --git a/Aaru.Server.Old/Program.cs b/Aaru.Server.Old/Program.cs new file mode 100644 index 00000000..7484fff1 --- /dev/null +++ b/Aaru.Server.Old/Program.cs @@ -0,0 +1,192 @@ +using Aaru.CommonTypes.Interop; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.HttpOverrides; +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Prometheus; +using DbContext = Aaru.Server.Old.Database.DbContext; +using Version = Aaru.CommonTypes.Interop.Version; + +namespace Aaru.Server.Old; + +public sealed class Program +{ + public static void Main(string[] args) + { + DateTime start; + DateTime end; + + System.Console.Clear(); + + System.Console.Write("\u001b[32m . ,,\n" + + "\u001b[32m ;,. '0d.\n" + + "\u001b[32m oc oWd \u001b[31m" + + @"__/\\\\\\\\\\\\_____/\\\\\\\\\\\________/\\\\\\\\\_ " + + "\n\u001b[0m" + + "\u001b[32m ;X. 'WN' \u001b[31m" + + @" _\/\\\////////\\\__\/////\\\///______/\\\////////__ " + + "\n\u001b[0m" + + "\u001b[32m oMo cMM: \u001b[31m" + + @" _\/\\\______\//\\\_____\/\\\_______/\\\/___________ " + + "\n\u001b[0m" + + "\u001b[32m ;MM. .MMM; \u001b[31m" + + @" _\/\\\_______\/\\\_____\/\\\______/\\\_____________ " + + "\n\u001b[0m" + + "\u001b[32m NMM WMMW \u001b[31m" + + @" _\/\\\_______\/\\\_____\/\\\_____\/\\\_____________ " + + "\n\u001b[0m" + + "\u001b[32m 'MMM MMMM; \u001b[31m" + + @" _\/\\\_______\/\\\_____\/\\\_____\//\\\____________ " + + "\n\u001b[0m" + + "\u001b[32m ,MMM: dMMMM: \u001b[31m" + + @" _\/\\\_______/\\\______\/\\\______\///\\\__________ " + + "\n\u001b[0m" + + "\u001b[32m .MMMW. :MMMMM. \u001b[31m" + + @" _\/\\\\\\\\\\\\/____/\\\\\\\\\\\____\////\\\\\\\\\_ " + + "\n\u001b[0m" + + "\u001b[32m XMMMW: .:xKNMMMMMMN0d, lMMMMMd \u001b[31m" + + @" _\////////////_____\///////////________\/////////__" + + "\n\u001b[0m" + + "\u001b[32m :MMMMMK; cWMNkl:;;;:lxKMXc .0MMMMMO\u001b[0m\n" + + "\u001b[32m ..KMMMMMMNo,. ,OMMMMMMW:,. \u001b[37;1m Aaru Website\u001b[0m\n" + + "\u001b[32m .;d0NMMMMMMMMMMMMMMW0d:' .;lOWMMMMMMMMMMMMMXkl. \u001b[37;1m Version \u001b[0m\u001b[33m{0}\u001b[37;1m-\u001b[0m\u001b[31m{1}\u001b[0m\n" + + "\u001b[32m :KMMMMMMMMMMMMMMMMMMMMMMMMc WMMMMMMMMMMMMMMMMMMMMMMWk'\u001b[0m\n" + + "\u001b[32m ;NMMMMWX0kkkkO0XMMMMMMMMMMM0' dNMMMMMMMMMMW0xl:;,;:oOWMMX; \u001b[37;1m Running under \u001b[35;1m{2}\u001b[37;1m, \u001b[35m{3}-bit\u001b[37;1m in \u001b[35m{4}-bit\u001b[37;1m mode.\u001b[0m\n" + + "\u001b[32m xMMWk:. .c0MMMMMW' OMMMMMM0c'.. .oNMO \u001b[37;1m Using \u001b[33;1m{5}\u001b[37;1m version \u001b[31;1m{6}\u001b[0m\n" + + "\u001b[32m OMNc .MNc oWMMk 'WMMNl. .MMK ;KX.\u001b[0m\n" + + "\u001b[32m xMO WMN ; ., , ': ,MMx lK\u001b[0m\n" + + "\u001b[32m ,Md cMMl .XMMMWWMMMO XMW. :\u001b[0m\n" + + "\u001b[32m Ok xMMl XMMMMMMMMc 0MW,\u001b[0m\n" + + "\u001b[32m 0 oMM0' lMMMMMMMM. :NMN'\u001b[0m\n" + + "\u001b[32m . .0MMKl ;MMMMMMMM oNMWd\u001b[0m\n" + + "\u001b[32m .dNW cMMMMMMMM, XKl\u001b[0m\n" + + "\u001b[32m 0MMMMMMMMK\u001b[0m\n" + + "\u001b[32m ;MMMMMMMMMMO \u001b[37;1m Proudly presented to you by:\u001b[0m\n" + + "\u001b[32m 'WMMMMKxMMMMM0 \u001b[34;1m Natalia Portillo\u001b[0m\n" + + "\u001b[32m oMMMMNc :WMMMMN:\u001b[0m\n" + + "\u001b[32m .dWMMM0; dWMMMMXl. \u001b[37;1m Thanks to all contributors, collaborators, translators, donators and friends.\u001b[0m\n" + + "\u001b[32m .......,cd0WMMNk: c0MMMMMWKkolc:clodc'\u001b[0m\n" + + "\u001b[32m .';loddol:'. ':oxkkOkkxoc,.\u001b[0m\n" + + "\u001b[0m\n", + Version.GetVersion(), +#if DEBUG + "DEBUG", +#else + "RELEASE", +#endif + DetectOS.GetPlatformName(DetectOS.GetRealPlatformID()), + Environment.Is64BitOperatingSystem ? 64 : 32, + Environment.Is64BitProcess ? 64 : 32, + DetectOS.IsMono ? "Mono" : ".NET Core", + DetectOS.IsMono ? Version.GetMonoVersion() : Version.GetNetCoreVersion()); + + System.Console.WriteLine("\u001b[31;1mBuilding web application...\u001b[0m"); + + WebApplicationBuilder builder = WebApplication.CreateBuilder(args); + + builder.Services.AddDbContext(options => options + .UseMySql(builder.Configuration + .GetConnectionString("DefaultConnection"), + new MariaDbServerVersion(new System.Version(10, + 4, + 0))) + .UseLazyLoadingProxies()); + + builder.Services.AddDefaultIdentity(options => + { + options.SignIn.RequireConfirmedAccount = true; + options.User.RequireUniqueEmail = true; + }) + .AddEntityFrameworkStores(); + + builder.Services.AddApplicationInsightsTelemetry(); + + builder.Services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0); + + WebApplication app = builder.Build(); + + app.UseForwardedHeaders(new ForwardedHeadersOptions + { + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto + }); + + app.UseHttpMetrics(); + + if(builder.Environment.IsDevelopment()) + app.UseDeveloperExceptionPage(); + else + { + app.UseExceptionHandler("/Home/Error"); + + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + + app.UseDefaultFiles(); + app.UseStaticFiles(); + + // Add other security headers + app.UseMiddleware(); + + app.UseRouting(); + + app.UseAuthentication(); + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllerRoute("areas", "{area}/{controller=Home}/{action=Index}/{id?}"); + endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}"); + endpoints.MapRazorPages(); + }); + + app.Map("/metrics", + metricsApp => + { + metricsApp.UseMiddleware("Aaru"); + + // We already specified URL prefix in .Map() above, no need to specify it again here. + metricsApp.UseMetricServer(""); + }); + + using(IServiceScope scope = app.Services.CreateScope()) + { + IServiceProvider services = scope.ServiceProvider; + + try + { + start = DateTime.Now; + System.Console.WriteLine("\u001b[31;1mUpdating database with Entity Framework...\u001b[0m"); + DbContext context = services.GetRequiredService(); + context.Database.Migrate(); + end = DateTime.Now; + + System.Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", + (end - start).TotalSeconds); + + start = DateTime.Now; + System.Console.WriteLine("\u001b[31;1mSeeding Identity...\u001b[0m"); + Seeder.Seed(context, services); + context.Database.Migrate(); + end = DateTime.Now; + + System.Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", + (end - start).TotalSeconds); + } + catch(Exception ex) + { + System.Console.WriteLine("\u001b[31;1mCould not open database...\u001b[0m"); +#if DEBUG + System.Console.WriteLine("\u001b[31;1mException: {0}\u001b[0m", ex.Message); +#endif + return; + } + } + + System.Console.WriteLine("\u001b[31;1mStarting web server...\u001b[0m"); + + app.Run(); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Properties/launchSettings.json b/Aaru.Server.Old/Properties/launchSettings.json new file mode 100644 index 00000000..b4b98767 --- /dev/null +++ b/Aaru.Server.Old/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:62005", + "sslPort": 44393 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Aaru.Server": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Aaru.Server.Old/SecurityHeadersMiddleware.cs b/Aaru.Server.Old/SecurityHeadersMiddleware.cs new file mode 100644 index 00000000..e9efaf5c --- /dev/null +++ b/Aaru.Server.Old/SecurityHeadersMiddleware.cs @@ -0,0 +1,67 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; + +namespace Aaru.Server.Old; + +public sealed class SecurityHeadersMiddleware +{ + readonly RequestDelegate _next; + + public SecurityHeadersMiddleware(RequestDelegate next) => _next = next; + + public Task Invoke(HttpContext context) + { + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy + // TODO Change the value depending of your needs + context.Response.Headers.Add("referrer-policy", new StringValues("strict-origin-when-cross-origin")); + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options + context.Response.Headers.Add("x-content-type-options", new StringValues("nosniff")); + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options + context.Response.Headers.Add("x-frame-options", new StringValues("DENY")); + + // https://security.stackexchange.com/questions/166024/does-the-x-permitted-cross-domain-policies-header-have-any-benefit-for-my-websit + context.Response.Headers.Add("X-Permitted-Cross-Domain-Policies", new StringValues("none")); + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection + context.Response.Headers.Add("x-xss-protection", new StringValues("1; mode=block")); + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy + // https://github.com/w3c/webappsec-feature-policy/blob/master/features.md + // https://developers.google.com/web/updates/2018/06/feature-policy + // TODO change the value of each rule and check the documentation to see if new features are available + /*context.Response.Headers.Add("Feature-Policy", + new StringValues("accelerometer 'none';" + "ambient-light-sensor 'none';" + + "autoplay 'none';" + "battery 'none';" + "camera 'none';" + + "display-capture 'none';" + "document-domain 'none';" + + "encrypted-media 'none';" + + "execution-while-not-rendered 'none';" + + "execution-while-out-of-viewport 'none';" + + "gyroscope 'none';" + "magnetometer 'none';" + + "microphone 'none';" + "midi 'none';" + + "navigation-override 'none';" + "payment 'none';" + + "picture-in-picture 'none';" + + "publickey-credentials-get 'none';" + "sync-xhr 'none';" + + "usb 'none';" + "wake-lock 'none';" + + "xr-spatial-tracking 'none';"));*/ + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + // TODO change the value of each rule and check the documentation to see if new rules are available + /*context.Response.Headers.Add("Content-Security-Policy", + new StringValues("base-uri 'none';" + "block-all-mixed-content;" + + "child-src 'none';" + "connect-src 'none';" + + "default-src 'none';" + "font-src 'none';" + + "form-action 'none';" + "frame-ancestors 'none';" + + "frame-src 'none';" + "img-src 'none';" + + "manifest-src 'none';" + "media-src 'none';" + + "object-src 'none';" + "sandbox;" + "script-src 'none';" + + "script-src-attr 'none';" + "script-src-elem 'none';" + + "style-src 'none';" + "style-src-attr 'none';" + + "style-src-elem 'none';" + "upgrade-insecure-requests;" + + "worker-src 'none';"));*/ + + return _next(context); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Seeder.cs b/Aaru.Server.Old/Seeder.cs new file mode 100644 index 00000000..7ca36295 --- /dev/null +++ b/Aaru.Server.Old/Seeder.cs @@ -0,0 +1,35 @@ +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.DependencyInjection; +using DbContext = Aaru.Server.Old.Database.DbContext; + +namespace Aaru.Server.Old; + +public static class Seeder +{ + public static void Seed(DbContext ctx, IServiceProvider serviceProvider) + { + var email = "claunia@claunia.com"; + var randChars = new char[16]; + UserManager userManager = serviceProvider.GetRequiredService>(); + var rnd = new Random(); + + for(var i = 0; i < randChars.Length; i++) randChars[i] = (char)rnd.Next(32, 126); + + string password = new(randChars); + + if(userManager.FindByEmailAsync(email).Result != null) return; + + var user = new IdentityUser + { + Email = email, + NormalizedEmail = email, + EmailConfirmed = true, + UserName = email, + NormalizedUserName = email + }; + + IdentityResult result = userManager.CreateAsync(user, password).Result; + + if(result.Succeeded) System.Console.WriteLine("Password is {0}, save it!", password); + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/Views/Report/View.cshtml b/Aaru.Server.Old/Views/Report/View.cshtml new file mode 100644 index 00000000..a3c40873 --- /dev/null +++ b/Aaru.Server.Old/Views/Report/View.cshtml @@ -0,0 +1,323 @@ +@using Aaru.CommonTypes.Metadata +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Aaru Device Report"; +} +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : View.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ Description ] ---------------------------------------------------------- + // + // Renders device report. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +
+ Aaru Report for + @ViewBag.lblManufacturer + @ViewBag.lblModel + @ViewBag.lblRevision + + @if(ViewBag.UsbItem != null) + { +
+
+ USB characteristics: +
+ Manufacturer: @ViewBag.UsbItem.Manufacturer +
+ Product: @ViewBag.UsbItem.Product +
+ Vendor ID: @ViewBag.UsbItem.VendorDescription +
+ Product ID: @ViewBag.UsbItem.ProductDescription +
+ } + + @if(ViewBag.FireWireItem != null) + { +
+
+ FireWire characteristics: +
+ Manufacturer: @ViewBag.FireWire.Manufacturer +
+ Product: @ViewBag.FireWire.Product +
+ Vendor ID: @ViewBag.FireWire.VendorDescription +
+ Product ID: @ViewBag.FireWire.ProductDescription +
+ } + + @if(ViewBag.PcmciaItem != null) + { +
+
+ PCMCIA characteristics: +
+ Manufacturer: @ViewBag.PcmciaItem.Manufacturer +
+ Product: @ViewBag.PcmciaItem.ProductName +
+ Manufacturer code: @ViewBag.PcmciaItem.VendorDescription +
+ Card code: @ViewBag.PcmciaItem.CardCode +
+ Compliance: @ViewBag.PcmciaItem.Compliance +
+ @if(ViewBag.repPcmciaTuples != null) + { + foreach(KeyValuePair kvp in ViewBag.repPcmciaTuples) + { + + @kvp.Key: @kvp.Value +
+ } + } +
+ } + + @if(ViewBag.AtaItem != null) + { +
+
+ + @ViewBag.AtaItem characteristics: + +
+ @ViewBag.lblAtaDeviceType +
+ @foreach(KeyValuePair kvp in ViewBag.repAtaTwo) + { + + @kvp.Key: @kvp.Value +
+ } +
+ @foreach(string item in ViewBag.repAtaOne) + { + @Html.Raw(item) +
+ } +
+ } + @if(ViewBag.repScsi != null) + { +
+
+ SCSI characteristics: +
+ Vendor: @ViewBag.lblScsiVendor +
+ Product: @ViewBag.lblScsiProduct +
+ Revision: @ViewBag.lblScsiRevision +
+ @foreach(string item in ViewBag.repScsi) + { + @Html.Raw(item) +
+ } + @if(ViewBag.repModeSense != null) + { +
+
+ SCSI mode sense pages: + + + + + + @foreach(KeyValuePair kvp in ViewBag.repModeSense) + { + + + + + } +
ModeContents
+ @kvp.Key + + @Html.Raw(kvp.Value) +
+
+ } + @if(ViewBag.repEvpd != null) + { +
+
+ SCSI extended vital product data pages: + + + + + + @foreach(KeyValuePair kvp in ViewBag.repEvpd) + { + + + + + } +
EVPDContents
+ @kvp.Key + + @Html.Raw(kvp.Value) +
+
+ } + @if(ViewBag.repScsiMmcMode != null) + { +
+
+ SCSI CD-ROM capabilities: +
+ @foreach(string item in ViewBag.repScsiMmcMode) + { + @Html.Raw(item) +
+ } +
+ } + @if(ViewBag.repScsiMmcFeatures != null) + { +
+
+ SCSI MMC features: +
+ @foreach(string item in ViewBag.repScsiMmcFeatures) + { + @Html.Raw(item) +
+ } +
+ } + @if(ViewBag.divScsiSscVisible == true) + { +
+
+ SCSI Streaming device capabilities: +
+ Block size granularity: @ViewBag.lblScsiSscGranularity +
+ Maximum block length: @ViewBag.lblScsiSscMaxBlock bytes +
+ Minimum block length: @ViewBag.lblScsiSscMinBlock bytes +
+ @if(ViewBag.repScsiSscDensities != null) + { + foreach(SupportedDensity density in ViewBag.repScsiSscDensities) + { + +
+ + Information for supported density with primary code @($"{density.PrimaryCode:X2}h") and secondary code @($"{density.SecondaryCode:X2}h") + +
+ Drive can write this density: @density.Writable +
+ Duplicate density: @density.Duplicate +
+ Default density: @density.DefaultDensity +
+ Density has @density.BitsPerMm bits per mm, with @density.Tracks tracks in a @density.Width mm width tape + Name: @density.Name +
+ Organization: @density.Organization +
+ Description: @density.Description +
+ Maximum capacity: @density.Capacity megabytes +
+
+ } + } + @if(ViewBag.repScsiSscMedias != null) + { + foreach(SscSupportedMedia media in ViewBag.repScsiSscMedias) + { + +
+ + Information for supported media with type code @($"{media.MediumType:X2}h") + +
+ Media is @media.Length m long in a @media.Width mm width tape + Name: @media.Name +
+ Organization: @media.Organization +
+ Description: @media.Description +
+
+ } + } +
+ } +
+ } + @if(ViewBag.repTestedMedia != null) + { +
+
+ Tested media: +
+ @foreach(string item in ViewBag.repTestedMedia) + { + @Html.Raw(item) +
+ } +
+ } + @if(ViewBag.repMMC != null) + { +
+
+ MultiMediaCard device: +
+ @foreach(string item in ViewBag.repMMC) + { + @Html.Raw(item) +
+ } +
+ } + @if(ViewBag.repSD != null) + { +
+
+ SecureDigital device: +
+ @foreach(string item in ViewBag.repSD) + { + @Html.Raw(item) +
+ } +
+ } +
\ No newline at end of file diff --git a/Aaru.Server.Old/Views/Shared/Error.cshtml b/Aaru.Server.Old/Views/Shared/Error.cshtml new file mode 100644 index 00000000..da913ec1 --- /dev/null +++ b/Aaru.Server.Old/Views/Shared/Error.cshtml @@ -0,0 +1,27 @@ +@model Aaru.Server.Database.Models.ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} +

Error.

+

An error occurred while processing your request.

+@if(Model.ShowRequestId) +{ +

+ Request ID: + @Model.RequestId +

+} +

Development Mode

+

+ Swapping to + Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the + Development environment by setting the + ASPNETCORE_ENVIRONMENT environment variable to + Development + and restarting the app. +

\ No newline at end of file diff --git a/Aaru.Server.Old/Views/Shared/_CookieConsentPartial.cshtml b/Aaru.Server.Old/Views/Shared/_CookieConsentPartial.cshtml new file mode 100644 index 00000000..9aaf3286 --- /dev/null +++ b/Aaru.Server.Old/Views/Shared/_CookieConsentPartial.cshtml @@ -0,0 +1,25 @@ +@using Microsoft.AspNetCore.Http.Features +@{ + ITrackingConsentFeature consentFeature = Context.Features.Get(); + bool showBanner = !consentFeature?.CanTrack ?? false; + string cookieString = consentFeature?.CreateConsentCookie(); +} + +@if(showBanner) +{ + + +} \ No newline at end of file diff --git a/Aaru.Server.Old/Views/Shared/_Layout.cshtml b/Aaru.Server.Old/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000..b58c835b --- /dev/null +++ b/Aaru.Server.Old/Views/Shared/_Layout.cshtml @@ -0,0 +1,65 @@ +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : _Layout.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ Description ] ---------------------------------------------------------- + // + // Contains layout. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} + + + + + + + + @ViewBag.Title + + + + @Html.Raw(JavaScriptSnippet.FullScript) + + +@RenderBody() +
+ © 2011-2024 Natalia Portillo +
+@RenderSection("Scripts", false) + + + + + \ No newline at end of file diff --git a/Aaru.Server.Old/Views/Shared/_ValidationScriptsPartial.cshtml b/Aaru.Server.Old/Views/Shared/_ValidationScriptsPartial.cshtml new file mode 100644 index 00000000..660f00c3 --- /dev/null +++ b/Aaru.Server.Old/Views/Shared/_ValidationScriptsPartial.cshtml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Aaru.Server.Old/Views/Stats/Index.cshtml b/Aaru.Server.Old/Views/Stats/Index.cshtml new file mode 100644 index 00000000..f1da7f00 --- /dev/null +++ b/Aaru.Server.Old/Views/Stats/Index.cshtml @@ -0,0 +1,643 @@ +@using Aaru.CommonTypes.Metadata +@using Aaru.Server.Old.Database.Models +@{ + // /*************************************************************************** + // Aaru Data Preservation Suite + // ---------------------------------------------------------------------------- + // + // Filename : Index.cshtml + // Author(s) : Natalia Portillo + // + // Component : Aaru Server. + // + // --[ Description ] ---------------------------------------------------------- + // + // Renders statistics. + // + // --[ License ] -------------------------------------------------------------- + // + // This library is free software; you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as + // published by the Free Software Foundation; either version 2.1 of the + // License, or (at your option) any later version. + // + // This library is distributed in the hope that it will be useful, but + // WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public + // License along with this library; if not, see . + // + // ---------------------------------------------------------------------------- + // Copyright © 2011-2024 Natalia Portillo + // ****************************************************************************/ +} +@{ + ViewBag.Title = "Aaru Statistics"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} +
+ Welcome to + + + Aaru + + Server version @ViewBag.Version +
+
+@if(ViewBag.repOperatingSystems != null) +{ +
+ +
+
+
+

+ +

+
+
+
+ + @foreach(NameValueStats os in ViewBag.repOperatingSystems) + { + + + + } +
+ Aaru has run on + @os.name @os.Value times. +
+
+
+
+
+
+
+} +@if(ViewBag.repVersions != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + @foreach(NameValueStats version in ViewBag.repVersions) + { + + + + } +
+ Aaru version + @version.name has been used @version.Value times. +
+
+
+
+
+
+
+} +@if(ViewBag.repCommands != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + @foreach(Command command in ViewBag.repCommands) + { + + + + } +
+ @command.Name has been run @command.Count times. +
+
+
+
+
+
+
+} +@if(ViewBag.repFilters != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + + + + + @foreach(Filter filter in ViewBag.repFilters) + { + + + + + } +
FilterTimes
+ @filter.Name + + @($"{filter.Count}") +
+
+
+
+
+
+} +@if(ViewBag.repMediaImages != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + + + + + @foreach(MediaFormat format in ViewBag.repMediaImages) + { + + + + + } +
Media image formatTimes
+ @format.Name + + @($"{format.Count}") +
+
+
+
+
+
+} +@if(ViewBag.repPartitions != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + + + + + @foreach(Partition partition in ViewBag.repPartitions) + { + + + + + } +
Partitioning schemeTimes
+ @partition.Name + + @($"{partition.Count}") +
+
+
+
+
+
+} +@if(ViewBag.repFilesystems != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + + + + + @foreach(Filesystem filesystem in ViewBag.repFilesystems) + { + + + + + } +
Filesystem nameTimes
+ @filesystem.Name + + @($"{filesystem.Count}") +
+
+
+
+
+
+} +@if(ViewBag.repVirtualMedia != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + + + + + + @foreach(MediaItem media in ViewBag.repVirtualMedia) + { + + + + + + } +
Physical typeLogical typeTimes
+ @media.Type + + @media.SubType + + @($"{media.Count}") +
+
+
+
+
+
+} +@if(ViewBag.repRealMedia != null) +{ +
+
+ +
+
+
+
+

+ +

+
+
+
+ + + + + + + @foreach(MediaItem media in ViewBag.repRealMedia) + { + + + + + + } +
Physical typeLogical typeTimes
+ @media.Type + + @media.SubType + + @($"{media.Count}") +
+
+
+
+
+
+} +@if(ViewBag.repDevices != null) +{ +
+ +
+
+
+ All devices found... +
+
+
+ + + + + + + + + @foreach(DeviceItem device in ViewBag.repDevices) + { + + + + + + + + } +
ManufacturerModelRevisionBusReport
+ @device.Manufacturer + + @device.Model + + @device.Revision + + @device.Bus + + @if(device.ReportId != 0) + { + @Html.ActionLink("Yes", + "View", + "Report", + new + { + id = device.ReportId + }, + new + { + target = "_blank" + }) + } + else + { + No + } +
+
+
+
+} +
+ + \ No newline at end of file diff --git a/Aaru.Server.Old/Views/_ViewImports.cshtml b/Aaru.Server.Old/Views/_ViewImports.cshtml new file mode 100644 index 00000000..6fe656ec --- /dev/null +++ b/Aaru.Server.Old/Views/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@using Aaru.Server.Old +@using Microsoft.ApplicationInsights.AspNetCore +@inject JavaScriptSnippet JavaScriptSnippet +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers \ No newline at end of file diff --git a/Aaru.Server.Old/Views/_ViewStart.cshtml b/Aaru.Server.Old/Views/_ViewStart.cshtml new file mode 100644 index 00000000..1af6e494 --- /dev/null +++ b/Aaru.Server.Old/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} \ No newline at end of file diff --git a/Aaru.Server.Old/aaru-server.service b/Aaru.Server.Old/aaru-server.service new file mode 100644 index 00000000..7866df4b --- /dev/null +++ b/Aaru.Server.Old/aaru-server.service @@ -0,0 +1,16 @@ +[Unit] +Description=Aaru Server + +[Service] +WorkingDirectory=/var/www/aaru-server +ExecStart=/var/www/aaru-server/Aaru.Server --urls "http://*:5000" +Restart=always +# Restart service after 10 seconds if the dotnet service crashes: +RestartSec=10 +KillSignal=SIGINT +SyslogIdentifier=aaru-server +User=www-data +Environment=ASPNETCORE_ENVIRONMENT=Production + +[Install] +WantedBy=multi-user.target diff --git a/Aaru.Server.Old/appsettings.Development.json b/Aaru.Server.Old/appsettings.Development.json new file mode 100644 index 00000000..0cbef074 --- /dev/null +++ b/Aaru.Server.Old/appsettings.Development.json @@ -0,0 +1,16 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "server=zeus.claunia.com;port=3306;database=discimagechef;uid=dic;password=dicpass" + }, + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + }, + "MetricsAuthentication": { + "Username": "user", + "Password": "password" + } +} diff --git a/Aaru.Server.Old/appsettings.json b/Aaru.Server.Old/appsettings.json new file mode 100644 index 00000000..59c30016 --- /dev/null +++ b/Aaru.Server.Old/appsettings.json @@ -0,0 +1,12 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "ConnectionStrings": { + "AaruServerContextConnection": "Server=(localdb)\\mssqllocaldb;Database=Aaru.Server;Trusted_Connection=True;MultipleActiveResultSets=true" + } +} \ No newline at end of file diff --git a/Aaru.Server.Old/docs/CODE_OF_CONDUCT.md b/Aaru.Server.Old/docs/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..918ab68c --- /dev/null +++ b/Aaru.Server.Old/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,60 @@ +# Contributor Covenant Code of Conduct for Aaru + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making +participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, +disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take +appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, +issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the +project or its community. Examples of representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed representative at an online or offline +event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team +at [claunia@claunia.com](mailto:claunia@claunia.com). All complaints will be reviewed and investigated and will result +in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain +confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be +posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent +repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available +at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/Aaru.Server.Old/docs/CONTRIBUTING.md b/Aaru.Server.Old/docs/CONTRIBUTING.md new file mode 100644 index 00000000..d4e7aec6 --- /dev/null +++ b/Aaru.Server.Old/docs/CONTRIBUTING.md @@ -0,0 +1,300 @@ +# Contributing to Aaru + +:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: + +The following is a set of guidelines for contributing to Aaru and its modules. These are mostly guidelines, not rules. +Use your best judgment, and feel free to propose changes to this document in a pull request. + +#### Table Of Contents + +[Code of Conduct](#code-of-conduct) + +[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question) + +[What should I know before I get started?](#what-should-i-know-before-i-get-started) + +* [Aaru and modules](#aaru-and-modules) + +[How Can I Contribute?](#how-can-i-contribute) + +* [Reporting Devices](#reporting-devices) +* [Reporting Bugs](#reporting-bugs) +* [Suggesting Enhancements](#suggesting-enhancements) +* [Your First Code Contribution](#your-first-code-contribution) +* [Pull Requests](#pull-requests) +* [Patronizing us](#patronizing) +* [Donating hardware to test](#donating) +* [Providing information](#needed-information) + +[Styleguides](#styleguides) + +* [Git Commit Messages](#git-commit-messages) +* [Code Styleguide](#code-styleguide) + +## Code of Conduct + +This project and everyone participating in it is governed by the +[Aaru Code of Conduct](.github/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please +report unacceptable behavior to [claunia@claunia.com](mailto:claunia@claunia.com). + +## I don't want to read this whole thing I just have a question!!! + +> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below. + +You can join our IRC channel on chat.freenode.net at channel #Aaru + +## What should I know before I get started? + +### Aaru and modules + +Aaru is a large open source project — it's made up of 18 modules. When you initially consider contributing to +Aaru, you might be unsure about which of those modules implements the functionality you want to change or report a bug +for. This section should help you with that. + +Aaru is intentionally very modular. Here's a list of them: + +* [Claunia.RsrcFork](https://github.com/claunia/Claunia.RsrcFork) - This library includes code for handling Mac OS + resource forks, and decoding them, so any code related to Mac OS resource forks should be added here. +* [Claunia.Encoding](https://github.com/claunia/Claunia.Encoding) - This library includes code for converting codepages + not supported by .NET, like those used by ancient operating systems, to/from UTF-8. +* [plist-cil](https://github.com/claunia/plist-cil) - This library includes code for handling Apple property lists. +* [SharpCompress](https://github.com/adamhathcock/sharpcompress) - This library includes code for handling compression + algorithms and compressed archives. Any need you have of compression or decompression should be handled with this + library, and any new algorithm should be added here. +* [Aaru](https://github.com/aaru-dps/Aaru/tree/master/Aaru) - This module contains the command line interface. In the + future a GUI will be added. +* [AaruRemote](https://github.com/aaru-dps/aaruremote) - Standalone small application designed to run on older machines + where Aaru does not run to allow device commands to be executed remotely. +* [Aaru.Checksums](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Checksums) - This module contains the checksum, + hashing and error correction algorithms. +* [Aaru.CommonTypes](https://github.com/aaru-dps/Aaru.CommonTypes) - This module contains interfaces, structures and + enumerations needed by more than one of the other modules. +* [Aaru.Console](https://github.com/aaru-dps/Aaru.Console) - This module abstracts consoles used by other modules to + output information, so they can be redirected to a CLI or to a GUI output. +* [Aaru.Core](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Core) - This module contains the implementation of the + functions and commands that are called by the user interface itself. +* [Aaru.Decoders](https://github.com/aaru-dps/Aaru.Decoders) - This module contains internal disk, drive and protocol + structures as well as code to marshal, decode and print them. +* [Aaru.Devices](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Devices) - This module contains code to talk with + hardware devices in different platforms. Each platform has lowlevel calls in its own folder, and each device protocol + has highlevel calls in its own folder. Device commands are separated by protocol standard, or vendor name. +* [Aaru.Device.Report](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Device.Report) - This is a separate application + in C89 designed to create device reports on enviroments where you can't run .NET or Mono but can run Linux. +* [Aaru.DiscImages](https://github.com/aaru-dps/Aaru/tree/master/Aaru.DiscImages) - This module provides reading + capabilities for the disk/disc images, one per file. +* [Aaru.DiscImages](https://github.com/aaru-dps/Aaru.Dto) - This module provides common structures between Aaru and + Aaru.Server. +* [Aaru.Filesystems](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Filesystems) - This module provides the + filesystem support. If only identification is implemented a single file should be used. For full read-only support, a + folder should be used. +* [Aaru.Filters](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Filters) - A filter is a modification of the data + before it can be passed to the disk image module + (compression, fork union, etc), and this module provides support for them. If a image is compressed, say in gzip, or + encoded, say in AppleDouble, a filter is the responsible of decompressing or decoding it on-the-fly. +* [Aaru.Helpers](https://github.com/aaru-dps/Aaru.Helpers) - This module contains a collection of helpers for array + manipulation, big-endian marshalling, datetime conversion, hexadecimal printing, string manipulation and byte + swapping. +* [Aaru.Partitions](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Partitions) - This module contains code for + reading partition schemes. +* [Aaru.Server](https://github.com/aaru-dps/Aaru.Server) - This module contains the server-side code that's running + at https://www.aaru.app +* [Aaru.Settings](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Settings) - This module contains code for handling + Aaru settings. +* [Aaru.Tests](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Tests) - This module contains the unit tests for the + rest of the modules. You should add new unit tests here but cannot run all of them because the test images they + require amount to more than 100GiB. +* [Aaru.Tests.Devices](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Tests.Devices) - This module presents a menu + driven interface to send commands to devices, as a way to test the Core module, as those tests cannot be automated. It + can be used to debug drive responses. + +## How Can I Contribute? + +### Reporting Devices + +Aaru tries to be as universal as possible. However some devices do not behave in the expected ways, some media is +unknown and needs to be known prior to enabling dumping of it, etc. + +For that reason, Aaru includes +the [device-report command](https://github.com/aaru-dps/Aaru/wiki/Reporting-physical-device-capabilities). Using this +command will guide you thru a series of questions about the device, and if it contains removable media, for you to +insert the different media you have, and create a report of its abilities. The report will automatically be sent to our +server and saved on your computer. Please note that we do not store any personal information and when possible remove +the drive serial numbers from the report. + +If you have a drive attached to a computer that you cannot run the full Aaru on it but can compile a C89 application, +you can use [AaruRemote](https://github.com/aaru-dps/aaruremote) +and an ethernet connection between that machine and a machine that can run the full Aaru. + +### Reporting Bugs + +This section guides you through submitting a bug report for Aaru. Following these guidelines helps maintainers and the +community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports : +mag_right:. + +Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you +don't need to create one. When you are creating a bug report, please +[include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out +[the required template](.github/ISSUE_TEMPLATE.md), the information it asks for helps us resolve issues faster. + +> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new +> issue and include a link to the original issue in the body of your new one. + +#### Before Submitting A Bug Report + +* **Check the [wiki](https://github.com/aaru-dps/Aaru/wiki)** for a list of common questions and problems. +* **Determine [which module the problem should be reported in](#aaru-and-modules)**. +* **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Aclaunia)** + to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the + existing issue instead of opening a new one. + +#### How Do I Submit A (Good) Bug Report? + +Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've +determined [which module](#aaru-and-modules) your bug is related to, create an issue on that repository and provide the +following information by filling in +[the template](.github/ISSUE_TEMPLATE.md). + +Explain the problem and include additional details to help maintainers reproduce the problem: + +* **Use a clear and descriptive title** for the issue to identify the problem. +* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by + explaining how you started Aaru, e.g. which command exactly you used in the terminal. Also note that some device + commands requires you to have administrative privileges, be in a specific group, or be the root user, so try it again + with escalated privileges. +* **Provide specific examples to demonstrate the steps**. Include links to media images, reports of the devices, or the + output of using [Aaru.Tests.Devices](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Tests.Devices). +* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that + behavior. +* **Explain which behavior you expected to see instead and why.** +* **Include a copy of the output in the terminal** enabling both verbose, using the `-v` + command line parameter, and debug, using the `-d` command line parameter, outputs. +* **If you're reporting that Aaru crashed**, try doing the same with the debug version and include a crash report with a + stack trace. Include the crash report in the issue in + a [code block](https://help.github.com/articles/markdown-basics/#multiple-lines), a + [file attachment](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/), or put it in + a [gist](https://gist.github.com/) and provide link to that gist. +* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and + share more information using the guidelines below. + +Include details about your configuration and environment: + +* **Which version of Aaru are you using?** +* **What's the name and version of the OS you're using**? +* **Are you running Aaru in a virtual machine?** If so, which VM software are you using and which operating systems and + versions are used for the host and the guest? +* **Are you trying to execute a device command?** If so, who manufactured the device, which model is it, and how is it + connected to the computer? + +### Suggesting Enhancements + +This section guides you through submitting an enhancement suggestion for Aaru, including completely new features and +minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand +your suggestion :pencil: and find related suggestions :mag_right:. + +Before creating enhancement suggestions, +please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill +in [the template](.github/ISSUE_TEMPLATE.md), including the steps that you imagine you would take if the feature you're +requesting existed. + +#### How Do I Submit A (Good) Enhancement Suggestion? + +Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've +determined [which module](#aaru-and-modules) your enhancement suggestion is related to, create an issue on that +repository and provide the following information: + +* **Use a clear and descriptive title** for the issue to identify the suggestion. +* **Provide a step-by-step description of the suggested enhancement** in as many details as possible. +* **Provide specific examples to demonstrate the steps**. If the feature is about a media image, filesystem, + partitioning scheme, or filter, please include as many test files as possible, and if applicable which software + created them. +* **Describe the current behavior** and **explain which behavior you expected to see instead** and why. +* **List some other applications where this enhancement exists.** +* **Specify which version of Aaru you're using.** +* **Specify the name and version of the OS you're using.** + +### Your First Code Contribution + +Unsure where to begin contributing to Aaru? You can start by looking through these `beginner` and `help-wanted` issues: + +* [Beginner issues][beginner] - issues which should only require a few lines of code, and a test or two. +* [Help wanted issues][help-wanted] - issues which should be a bit more involved than `beginner` issues. + +Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for +impact a given change will have. + +If you want to read about using Aaru, the [wiki](https://github.com/aaru-dps/Aaru/wiki) is available. + +Do not modify the interfaces. If you need or want to, comment in an issue how and why you want to change it and we'll +discuss it. Same applies for creating new interfaces. + +Aaru uses C# 7 language features (inline declaration, Tuples, etc.) so it can only be compiled +with [VisualStudio](http://www.visualstudio.com) 2017 or higher, [Xamarin Studio](https://www.xamarin.com/download) +7 or higher, [MonoDevelop](http://www.monodevelop.com) 7 or higher, +or [JetBrains Rider](https://www.jetbrains.com/rider/) 2017.2 or higher. + +### Pull Requests + +* Fill in [the required template](.github/PULL_REQUEST_TEMPLATE.md) +* Do not include issue numbers in the PR title +* Follow the [code styleguide](#code-styleguide). +* Include test files as applicable, that do not have software under copyright inside them, if possible. +* Document new code based using XML documentation wherever possible. +* DO NOT end files with a newline. +* Avoid platform-dependent code, unless absolutely needed. Any call to a part of the .NET framework that doesn't start + with `System.` is probably platform-dependent. +* Do not call libraries external to .NET. Only Interop calls to the operating system kernel + (that is `KERNEL32.DLL` in Windows and `libc` in others) will be accepted. If you need to talk with a USB devices your + pull request must implement calls both to `WinUsb` and `libusb`. + +### Patronizing + +If you want to donate money you can become a patron at https://www.patreon.com/claunia + +### Donating + +You may donate us one of the [devices we need](NEEDED.md). + +### Needed information + +If you have test images, imaging applications that generate formats we do not support, or documentation about media dump +formats, filesystems or partitioning schemes we do not support, you can provide us with that information to add support +for them. + +## Styleguides + +### Git Commit Messages + +* Use the present tense ("Add feature" not "Added feature") +* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") +* Limit the first line to 72 characters or less +* Reference issues and pull requests liberally after the first line + +### Code Style Guide + +- Braces are unindented at next line (BSD style). +- Braces with no content should be opened and closed in the same line. +- Constants should be ALL_UPPER_CASE. +- Do not use braces for statements that don't need them. +- Do not use more than one blank line. +- Do not use spaces before or after parentheses. +- Do not use `var` ever. +- `else`, `while`, `catch` and `finally` should be on a new line. +- If you know C apply a simple rule: Be as C as and as less C# or C++ as possible. +- If you will only store variables, use a struct. If you need it to be nullable, use a nullable struct if applicable. +- Indent statements and cases. +- Indent using 4 spaces (soft tab). +- Instace and static fields should be lowerCamelCase. +- Public fields should be UpperCamelCase. +- Separate attributes. +- Use 120 columns margins. +- Use built-in keywords: `uint` instead of `UInt32`. +- Use expression bodies only for properties, indexes and events. For the rest use block bodies. +- Use implicit modifiers. +- Use inline variable declaration. +- Use struct implicit constructor. +- Use UNIX (`\n`) endline character. + +> Note: There is an included editorconfig file that sets the appropriate code style. + +> Note: Aaru is quite low-level so unneeded object-oriented abstractions +(e.g. using classes when a struct suffices) will be rejected. LINQ is accepted. \ No newline at end of file diff --git a/Aaru.Server.Old/docs/Changelog.md b/Aaru.Server.Old/docs/Changelog.md new file mode 100644 index 00000000..e78e8791 --- /dev/null +++ b/Aaru.Server.Old/docs/Changelog.md @@ -0,0 +1,1820 @@ +# [5.2.0.3330] - 2020-12-03 + +## Added + +### - Aaru Image Format + +- Enable checksums by default when writing. + +### - Alcohol 120% disc image + +- Support writing PhotoCD. + +### - cdrdao disc image + +- Support writing PhotoCD. + +### - CDRWin cuesheet disc image + +- Support writing PhotoCD. + +### - CloneCD disc image + +- Support writing PhotoCD. + +### - Device report + +- Check DVD-RAM if the drive claims to be able to read any DVD based format. +- Use features to see MMC drives read capabilities. + +### - ISO9660 filesystem + +- Support a block size different from 2048 bytes. + +### - Media detection + +- Handle calculating blank sectors when environment does not support MEDIUM SCAN command (consider all written and trim + later). + +### - Media information + +- Add detection of 44Mb Bernoulli Box II disks. +- Add detection of 150Mb Bernoulli Box II disks. +- Add detection of ECMA-322 / ISO/IEC 22092 1024bps magneto-optical disks. +- Add detection of ISO/IEC 10089 1024bps magneto-optical disks. +- Add detection of ISO/IEC 14517 512bps and 1024bps magneto-optical disks. +- Add detection of ISO/IEC 15286 2048bps and 1024bps media disks. +- Add detection of SyQuest SQ400 disks. + +## Fixed + +### - Aaru Image Format + +- Fix reporting track flags and ISRCs on non-CD media. +- Fix resuming subchannel and other CD structures. +- Fix when writing subchannel that doesn't belong to any track. +- Load more structures when resuming. +- Remove check for track crossing when writing. + +### - AaruRemote + +- Catch when host is already an IP address. +- Cover closing remote connection when socket is disposed. +- Remove trailing slash on remote device command. + +### - AppleSingle filter + +- Do not try to open non-existing file. + +### - BlindWrite 4 disc image + +- Fix images that contain sectors 150 sectors of first track pregap. +- Fix off by one track ends. +- Fix track file offsets in BlindWrite 4 disc images. +- If any track has subchannel, the subchannel sidecar file contains them for all tracks. + +### - BlindWrite 5/6 disc image + +- Add sessions. +- Fix cross track detection. +- Fix disc size calculation. +- Fix length of tracks. +- Fix negative index. +- Fix setting track session. + +### - cdrdao disc image + +- Prevent empty ISRC from being added. + +### - CDRWin cuesheet disc image + +- Prevent empty ISRC from being added. + +### - CloneCD disc image + +- Fix indexes. + +### - DiscJuggler disc image + +- Do not try to read descriptors if there are none. +- Fix cross track detection. + +### - Dumping + +- Add classifying rw full off 0xFF as being empty +- Check MMC drive profile when dumping. +- Consider RW subchannels as ok if some are all 0s and some are all 1s. +- Consider the last sector of all the tracks on a DVD or Blu-ray as the last block on disc even if drive tells + otherwise. +- Continue printing SCSI sense buffer in error log even if we have an operating system error. +- Disable FUA to fix reading from old SCSI disks. +- Do not generate subchannels if aborted. +- Do not recalculate logical track size when DVD drive returns a negative start. +- Do not try to find SCSI read command if the medium is not written. +- Ensure only unique bad blocks are saved in resume file. +- Fix decoding of last digit of MCN subcode. +- Fix detecting XGD3. +- Fix log message when trimming found a blank block. +- Fix MEDIUM SCAN SCSI command. +- Fix retrieving CD drive offsets from database when model or manufacturer contains a slash. +- Get back tracks, indexes, MCN and ISRCs from resumed file. +- Guard against some firmware bugs when getting DVD/BD track number and length. +- Handle calculating blank sectors when environment does not support MEDIUM SCAN command (consider all written and trim + later). +- Hardcode read command and blocks to read if we cannot calculate them for magneto-opticals. +- If device returns "corrected error", consider it as a good read. +- Use image capabilities when dumping CDs. + +### - FAT filesystem + +- Fix reading volume name from incorrect implementations that fill it with NULs. + +### - ISO9660 filesystem + +- Fix extended attributes. +- Reject processing a path table that doesn't start with the root directory. + +### - MacBinary filter + +- Do not try to open non-existing file. + +### - Media detection + +- Do not decode invalid ATIP data. +- Fix detection of CD-i Ready discs when negative offset and drive cannot read negative sectors. +- Fix detection of dual layer DVDs. +- Fix detection of hidden data track mode when drive returns it scrambled. +- Fix detection of version 3 and upper DVD-RW and DVD-RW DL. +- Fix negative offset calculating when detecting scrambled CD-i Ready. + +### - XZ filter + +- Fix crashing when file is too small. + +### - RAW (sector by sector) disk image + +- Fix capabilities. + +## Changes + +- Add new issue templates. +- Add support for dumping CDs to images that only support cooked user data. +- Allow to dump the video partition of XGD discs when forced is enable. +- Allow user to choose maximum number of block to read at once when dumping media. +- Change how pregap starting with 0 is calculated dumping versus converting. +- Change method of reading subchannels in Plextor drives. +- Continue trying filters when one raises an exception. +- Do not dump multi-session CDs in Plextor drives connected to a USB bridge until it is fixed. +- If there is an OS error only print the sense buffer if it contains data. +- Mark FreeBSD code as obsolete. Pending removal. +- Reverse used SCSI READ command, as some USB devices claim to support a later one but don't properly. +- Scan blank blocks in magneto-optical disks before dumping, and do not treat them as errors. +- Use track 1's first sector to check readability of CompactDisc media. + +# [5.1.0.3214] - 2020-07-25 + +## Added + +### - Aaru Image Format + +- Save Compact Disc track indexes in. +- Support reading mode2 subheaders. +- Support writing multi-session DVD/Blu-ray in Aaru Image Format and CDRWin. + +### - BlindWrite 4 disc image + +- Add reading subchannels. + +### - CDRWin cuesheet disc image + +- Support Redump GD-ROM variant. +- Support writing multi-session DVD/Blu-ray in Aaru Image Format and CDRWin. +- Write proper Lead-Out entry on CDRWin images. + +### - Device report + +- Add MediaTek command F1h subcommand 06h to device report. +- Add test for reading Lead-Out using a trap disc. +- Support creating device reports of MiniDisc Data drives. + +### - Devices + +- Add ATA commands for lock, unlock and eject. +- Add READ TRACK INFORMATION command from SCSI MMC. + +### - Dumping + +- Add dumping MD DATA discs. +- Add floptical detection. +- Add list of files for media dump command. +- Add option to eject media after a dump completes. +- Add option to fix subchannel position. +- Add option to fix subchannels. +- Add option to retry bad subchannel sectors. +- Add option to use list of output files when dumping media. +- Detect disc type when dumping non-CD MMC devices. +- Dump sessions and tracks on non-CD optical discs. +- Enable accessing generic SCSI node in Linux. +- Read SD/MMC devices one block at a time, as READ MULTIPLE is timing out, pending investigation. +- Report and stop dump if pregaps cannot be preserved, unless forced. +- Save error log on dump. +- Save indexes on dump. +- Support dumping CD-i Ready when drive returns data sectors as audio. +- Use subchannel, if available, to set ISRC. +- Use subchannel, if available, to set MCN. +- Write subchannel log when dumping Compact Disc media. + +### - Image analysis + +- Print track indexes in image info. + +### - Image conversion + +- Add option to fix subchannels on image conversion. +- Add option to generate subchannels. + +### - ISO9660 filesystem + +- Add interpretation of timezone offsets. +- Check if PVD points to the real root directory, if not check path table, if neither do not mount. +- Expose MODE2 subheaders as extended attributes. + +### - Media image formats + +- Add generation of RAW CD sectors from images that do only contains them cooked. + +### - Media information + +- Add detection of CD32 and CDTV discs. +- Add detection of China Video Disc. +- Add detection of HiFD floppies. +- Add detection of Neo Geo CD discs. +- Add detection of PhotoCD. +- Add detection of Sony PlayStation Compact Disc. +- Add detection of VideoCD and Super Video CD. +- Add support for MD DATA drives. +- Calculate all pregaps in media info. +- Detect CD-i Ready when the drive returns data scrambled. +- Implement detection of CD+G, CD+EG and CD+MIDI. +- Show the reasons while a media type has been chosen on detection. + +### - Media types + +- Add China Video Disc media type. + +### - Metadata sidecar + +- Add media catalogue number, track isrc, flag and indexes. + +## Fixed + +### - Aaru Image Format + +- Clarify error message in case of corrupted prefix/suffix data. +- Ensure FLAC buffer is finished correctly. +- Fix marking CD track flags and ISRCs as present. +- Fix setting indexes from track start and pregap. +- Sectors with no entry in the DDTs to be considered not dumped. + +### - Acorn Advanced Disc Filing System + +- Fix identification of some variants. + +### - Alcohol 120% disc image + +- Fix message about incorrect images showing with correct images. +- Fix saving proper pregap, length and offset. +- Fix writing multi-session images. +- Write extra field in Alcohol for tracks that don't have it (POINT>=A0h). + +### - BlindWrite 4 disc image + +- Fixed track offsets and pregaps in BlindWrite 4 images. + +### - BlindWrite 5/6 disc image + +- Fix identifying BlindWrite 5 vs 6. +- Fix images that contain a non existent data file. +- Fix multi-session images. +- Fix reading ATIP. +- Fix reading subchannels. + +### - cdrdao disc image + +- Fix writing indexes. + +### - CDRWin cuesheet disc image + +- Fix reading images that do not have track mode in all caps. +- Fix reading multi-session images. +- Fix writing indexes. + +### - CloneCD disc image + +- Fix reading multi-session images. +- Fix subchannels. +- Fix track solving. +- Fix writing multi-session images. +- Fix writing pregap mode. + +### - Database + +- Ensure not adding duplicate seen devices to database. + +### - Device report + +- Correctly handle report of pregap and Lead-in readability. +- On device report try only a few sectors from track 1 pregap. + +### - Devices + +- Add SCSI MEDIUM SCAN command. +- Do not show information about CD offsets in device info when device is not an MMC class device. Fixes #357 +- Fix getting serial from USB or FireWire. + +### - DiscJuggler disc image + +- Fix incorrect mode2 handling. +- Fix indexes and track starts. +- Fix partition calculations. +- Fix session sequence in tracks. + +### - Dumping + +- Do not cross Lead-out in data tracks. +- Do not show speed burst if they have not been set. +- Fix calculating offset using scrambled read as audio when device is in database. +- Fix detecting indexes in track 1. +- Fix dumping when read subchannel is PQ only. +- Fix infinite loop failing to cross Lead-Out dumping CDs. +- Fix infinite loop on some CD track mode changes while dumping. +- Fix not exiting when an image cannot be appended. +- Fix opening SecureDigital / MultiMediaCard devices. +- Fix pregap calculation in track mode changes when pregap ends in 0. +- Fix reading OCR from newer versions of Linux sysfs. +- Fix re-setting track pregap when a read subchannel indicates a different value. +- Fix reversing list of bad blocks only if we're retrying backwards. +- Fix setting track pregaps from subchannel. +- Fix setting track subchannel type to the desired type. +- Handle discs that have pregap ending in LBA 1 instead of ending in LBA 0. +- If block 0 can not be read, try another random block before deciding media cannot be read, for SBC and ATA. +- If track mode can not be guessed, try again after pregap. +- Make pregap calculation faster in some drive/disc combinations. +- On errors when dumping with INSITE floptical drives, always stop, as these drives have a SCSI bus quirk that makes + them need a reset on modern software stacks after an error has been found. +- Trim as audio when we know it is an audio sector, fixes some firmware bugs in audio pregap after a data track. +- Update the pregap while dumping if found to be bigger than known one. +- Use SCSI MEDIUM SCAN to find the first readable block. + +### - FAT filesystem + +- Do not try to read EAs from FAT16 directory entry field when it is a FAT32 volume. +- Fix false positive in FAT identification. + +### - Image analysis + +- Do not calculate pregaps on non-CD optical disc images. + +### - Image conversion + +- Fix overwriting flags and isrc in all CD writable image formats. + +### - ISO9660 filesystem + +- Fix files of size 0. +- Fix listing extended attributes for empty files. +- Fix reading directories that span more than a sector when detecting media type. +- Fix swapping location of big-endian path table in debug mode. +- If use path table option is indicated, use it also for the root directory. + +### - MAME Compressed Hunks of Data + +- Disable support for CHD v5 until it can be fixed properly. +- Fix indexes and pregap. + +### - Media information + +- Discard PMA without descriptors. +- Display media sizes in international system units. + +### - Metadata sidecar + +- Disable trying to checksum between sessions, as all images throw an exception here. +- Fix creating sidecar when a track's index 0 is negative. + +### - Nero Burning ROM disc image + +- Fix off by one error reading. +- Fix reading multi-session images. + +### - Statistics + +- Fix sending media formats statistics. + +## Changes + +- Change database name to be more inclusive. +- Move common subchannel code to decoders. +- Optimize speed when reading subchannels. +- Read with subchannel even if not supported by image or not asked by user. +- Send statistics at program end, not start. + +# [5.0.1.2884] - 2020-04-23 + +## Fixed + +### - Aaru Image Format + +- Fixes data loss on certain Compact Disc audio tracks when dumping in Aaru Format with compression enabled. + +# [5.0.0.2879] - 2020-03-15 + +- First and most importantly, we got a rename. We're now Aaru, part of the Aaru Data Preservation Suite, that + encompasses Aaru (previously DiscImageChef), + Aaru.Server (previously DiscImageChef.Server), aaruformat (previously dicformat) and aaruremote. +- This release is dedicated to the loving memory of Facunda "Tata" Suárez Domínguez, R.I.P. 2019/07/24. + +## Added + +### - Aaru Image Format + +- Add ".aif" as a supported extension. +- Add CD Mode 2 sector reconstruction. +- Claunia Subchannel Transform algorithm. Makes subchannel compress 100% faster and 25% better. +- Compress VideoNow discs as data not audio. +- Support for CD-i Ready. +- Support for skipping storing CD prefixes and suffixes that are correct. +- Support writing logically block addressable tapes. +- Update template with block addressable tape types. + +### - CDRWin cuesheet disc image + +- Save metadata in CDRWin cuesheet. + +### - Database + +- Add entities for USB vendor and product IDs. +- Add entry for optimal count of sectors for multiple read in devices. +- Added new database system +- Enhance support and tweaks for devices depending on the parameters in the database +- Fill CompactDisc read offsets from AccurateRip list. +- Store and retrieve USB IDs from databases. +- Store device reports in the database instead of XML files +- Store statistics on database +- Submit pending statistics in background. + +### - Device report + +- Add check for Nintendo discs. +- Add new CompactDisc and Blu-ray variants. +- Add test for inter-session reading in multi-session discs. +- Change device report entry for Lead-in to first track pre-gap and add a new entry for proper Lead-in +- Check if data CDs can be read scrambled by READ CD command. +- Check sector 16 for MMC discs, as 0 is usually empty. +- Clear ATA IDENTIFY DEVICE private fields. +- Clear serial numbers. +- Create new more extensible device report format in JSON. +- Do not allow to be run without administrative privileges. +- Eject SCSI DirectAccess devices if removable. +- Save data when not in debug mode. +- Store not only default, but current and changeable modes in SCSI. +- Store read results in report and database. +- Support iomega REV disks. + +### - Dumping + +- Add default value for writable image options. +- Add option to not store paths and serial numbers when dumping. +- Add support for CD-i Ready. +- Add support for dumping MemoryStick from USB attached PlayStation Portable with CFW installed. +- Add support for dumping UMD from USB attached PlayStation Portable with CFW installed. +- Allow to abort anywhere +- Change --no-metadata to --metadata and --no-trim to --trim. +- Prevent dumping XGD without administrative privileges. +- Show error message if unsupported dump is tried. +- Show more information when dumping an XGD. +- Support fixing Compact Disc audio tracks offset using scrambled read commands and database. +- Support iomega REV disks. +- Support PD650 discs. + +### - Filesystems + +- Full read-only implementation of Xbox and Xbox 360 FAT filesystems + +### - FAT filesystem + +- Full read-only implementation. +- Support for Microsoft FASTFAT long file names. +- Support for OS/2 Extended Attributes. +- Support for OS/2 WorkPlace Shell long file names. +- Support for PCExchange filenames. +- Support for PCExchange Resource Fork. +- Support for Sharp X68000 extended filenames. + +### - ISO9660 filesystem + +- Full read-only implementation for CD-i filesystem. +- Full read-only implementation for High Sierra Format. +- Full read-only implementation for ISO 9660 (up to level 4). +- Support for AAIP. +- Support for Amiga RRIP. +- Support for Apple Extensions. +- Support for eXtended Architecture (XA). +- Support for Joliet extensions. +- Support for Rock Ridge Interchange Protocol. +- Support for Romeo variant. + +### - Media image formats + +- Add support for DataPackRat's f2d/d2f disk images. +- Full read/write support for CopyTape tape images. + +### - Media information + +- Add another value for Mitsubishi Chemical ATIP frame number. (97:34:22) +- Detect 3DO discs. +- Detect Atari Jaguar CD discs. +- Detect audio MiniDisc. +- Detect Bandai Playdia discs. +- Detect Castlewood Orb 2.2Gb. +- Detect CD-i Ready. +- Detect EZFlyer 230MB. +- Detect Fujitsu FM-Towns discs. +- Detect Hasbro VideoNow Color detection. +- Detect Hi-MD formatted 60 minutes MiniDisc. +- Detect Hi-MD formatted 74 minutes MiniDisc. +- Detect iomega REV, REV70 and REV120. +- Detect media types also in ATA. +- Detect NEC PC-Engine discs. +- Detect NEC PC-FX discs. +- Detect Sega CD / Mega CD. +- Detect Sega Dreamcast GD-ROM. +- Detect Sega MilCD discs. +- Detect Sega Saturn CD. +- Detect Sony PlayStation 2 discs (CD and DVD). +- Detect Sony PlayStation 3 discs (DVD and Blu-ray). +- Detect Sony PlayStation 4 Blu-ray discs. +- Detect SparQ carts in SCSI devices. +- Detect SparQ media in ATA drive. +- Detect SyQuest SQ2000 and SQ800. +- Detect SyQuest SQ310. +- Detect TR-4 and TR-5. + +### - Media types + +- Add Amiga CD32 +- Add Amiga CDTV. +- Add another DDS1 SCSI medium type. +- Add Bandai Pippin. +- Add Bandai Playdia +- Add CD-i Ready. +- Add dimensions for Iomega REV. +- Add Fujitsu FM-Towns. +- Add Hasbro VideoNow. +- Add HP codes for DDS. +- Add Nuon +- Add PD650. +- Add SEAGATE code for DDS-2. +- Add Sega MilCD. + +### - Metadata sidecar + +- List and hash filesystem contents when creating a sidecar. + +### - Opera filesystem + +- Full read-only implementation. + +### - SCSI response decoders + +- Add encoder for ATA IDENTIFY (PACKET) DEVICE. +- Add encoder for SCSI INQUIRY. +- Add encoder for SCSI MODE PAGE 2Ah. + +## Fixed + +### - Aaru Image Format + +- Don't initialize LZMA when compression is disabled. +- Ensure all LZMA allocations are freed when closed. +- Fix double negation options +- Fix reading MODE2 sectors with incorrect EDC/ECC correctly. + +### - Alcohol 120% disc image + +- Fix media size calculation when reading Alcohol images with several pregaps. + +### - Apple Hierarchical File System + +- Fix interpretation of the Apple boot block. + +### - CDRWin cuesheet disc image + +- Fix pregap reading in CDRWin format. +- Fix pregap writing in CDRWin format. + +### - Checksum + +- Optimize SpamSum + +### - CPCEMU Disk-File and Extended CPC Disk-File disk image + +- Fix images not recognized as such. + +### - CP/M File System + +- Fix the CPM filesystem detection and file listing + +### - Device report + +- Allow ASC 28h in streaming device report. +- Eject media once reported. +- Fix SCSI Streaming Command device reporting. +- On streaming device report do not LOAD as the tape is already in loaded state once inserted in the drive, and some old + drives get confused. +- Retry 50 times as tapes can take long to be ready. + +### - Devices + +- Allow opening read-only devices on Linux. +- Allows opening some devices in non-administrator mode. +- Close device when finished command execution. +- Correct detection of errors sending ATA commands. +- Correct detection of Plextor features. +- Correct showing EVPD page number. +- Do not search for floppy mode page when mode sense returned no pages. +- Get serial number using MMC GET CONFIGURATION for optical drives. +- In Windows, close the device handle, to prevent an exception being raised. + +### - Dreamcast GDI disc image + +- Fix reading pregap in GDI images. + +### - Dumping + +- Check which LOCATE version is supported regardless of the next block on resume. +- Correct device not ready error messages on dumping SCSI. +- Fix Compact Disc type detection +- Fix detecting tape block size when tape reports a lower minimum size. +- Fix printing of sense in SSC dump. +- Fix speed calculation on. +- Handle errors when dumping SSC. +- Handle when SSC drive does not report block size for first block. +- Prevent showing option to dump first pregap on FreeBSD where it crashes the system. +- Save tape files when dumping SSC media. +- Save tape partitions when dumping SSC media. +- Set image's tape mode when dumping SSC. +- Show message indicating that audio MiniDisc cannot be dumped. +- Store MODE responses from SSC dumping in output image. +- Support resume in SSC dumping. +- Try to detect if the Kreon drive has not locked correctly, and try to use cold values if they look as possibly valid. +- Use output plugin when dumpìng SSC. +- When SCSI device is becoming ready, wait more, as tapes can take a long time to become ready. + +### - Filesystems + +- Fix extracting file from filesystems with subdirectories. +- Fix listing files walking thru subdirectories. +- Stylize output when listing files. + +### - IBM Journaled File System + +- Fix decoding of volume label. + +### - Image analysis + +- Fix crash in partitions enumeration. +- Treat tape files as partitions. + +### - Image comparison + +- Do not compare metadata between two images. + +### - Image conversion + +- Checking if input tracks is null when converting image. +- Fix showing sector where conversion fails. + +### - Image filters + +- Fix bzip2 initialization. + +### - Image verification + +- Fix verify command when image can represent optical media, but doesn't. + +### - ISO9660 filesystem + +- Do not set ISO identifiers in XML metadata if they are empty. +- Fix reading application identifier from ISO9660. +- Fix trimming of null character and spaces in Joliet volume descriptor. + +### - Macintosh File System + +- Correct behaviour when path starts with directory separator. +- Fix interpretation of the Apple boot block. + +### - Media information + +- Fix media type detection from SBC devices. +- Fix support for 128Mb 3.5" magneto optical. + +### - Metadata sidecar + +- Calculate tape hashes in smaller chunks as tapes can have huge blocks. +- Fix error creating sidecar with DVD's CMI. +- Fix media type sidecar on DVD based console discs. +- Fix setting application identifier for metadata sidecar. +- Fix when USB descriptors are null at sidecar creation after dump. + +### - Nero Burning ROM disc image + +- Fix offset by 1 that prevented reading the last sector of every track. + +### - RAW (sector by sector) disk image + +- Do not allow CDs with more than one tracks, or non-mode1 tracks to be written as raw images (.iso). +- Fix dumping CDs in raw image format (.iso). + +### - SCSI response decoders + +- Protect against null mode pages. + +### - SecureDigital devices + +- Fix overflow on SecureDigital CSD v2.0 size calculation. + +### - VirtualPC disk image + +- Conversion optimizations make opening images up to 38 times faster. + +## Changes + +- Add binary packages for major targets. +- Add mime database file for Linux systems to correctly recognize aaruformat images. +- Add support to use devices remotely with Aaruremote. +- Change command line to a cleaner and more natural system. +- Complete CompactDisc dumping rewrite, allowing fixing audio tracks offset, more correct audio track dumping, + workarounds firmware bugs from several common drives and gives more preservation-quality dumps. +- Deprecate Mono and .NET Framework. +- Fix null reference exception on verify. +- Fix overflow with small sectors in Apple Partition Map. +- Fix overflow with small sectors in BSD disklabel. +- Fix progress crashing when terminal window changes size. +- Get device information from database when dumping Compact Disc. +- Hide device commands on unsupported platforms. +- Remove RIPEMD160. +- Separate CRC16 IBM and CRC16 CCITT contexts, use cached tables. +- Use .NET Core. + +# [4.5.1.1692] - 2018-07-19 + +## Fixed + +### - Alcohol 120% disc image + +- Correct writing images of Compact Disc >= 60 min +- Correct writing MODE2 tracks to image +- Correct writing TOC to image +- Generation of multisession images +- Generation of pregaps changing tracks + +# [4.5.0.1663] - 2018-06-24 + +## Added + +### - Alcohol 120% disc image + +- 010editor template. +- Support for creating images. + +### - Apple New Disk Image Format + +- Support RLE compressed images. + +### - Blindwrite 4 disc image + +- 010editor template. +- Information about why this format cannot support writing. + +### - Blindwrite 5 disc image + +- 010editor template. +- Information about why this format cannot support writing. + +### - DART disk image + +- Support RLE compressed images. + +### - Decoders + +- Added Blu-ray DI decoders. +- Support decoding 2048 bytes PFI. + +### - Devices + +- On Linux try to open in read/write and exclusive mode, if not retry in readonly. +- On Linux use direct SG_IO. +- Workaround some Blu-ray drives not reporting correct size on READ DISC STRUCTURE. + +### - DiscJuggler disc image + +- Information about why this format cannot support writing. + +### - Dumping + +- Added support for CD drives that don't return a TOC. +- Added support for CD drives that don't support READ CD command. +- Added support for Compact Disc that don't report tracks. +- Add support for dumping media in any of the now supported writable formats. +- Dump ISRC. +- Dump MCN. +- Fix reading PW subchannels. +- Separate trimming from error retry. +- When dumping CDs in persistent mode, try disabling L-EC check if drive doesn't support TB bit, or doesn't return data + with TB bit enabled. +- When dumping, print bad sectors to dump log. + +### - FAT filesystem + +- Add list of known boot sector hashes. +- Support Human68k FAT16 BPB. + +### - Filesystems + +- Detecting High Performance Optical File System (HPOFS). +- Detecting Microsoft Resilient filesystem (ReFS). +- Detecting PC-FX executable tracks. +- Detecting Xia filesystem. + +### - Apple 2IMG disk image + +- Support for creating images. + +### - Anex86 disk image + +- Support for creating images. + +### - Apple II interleaved disk image + +- Support for creating images. + +### - Apple Universal Disk Image Format + +- Support for creating images. +- Support RLE compressed images. + +### - Apridisk disk image + +- Support for creating images. + +### - Basic Lisa Utility disk image + +- Support for creating images. + +### - cdrdao disc image + +- Support for creating images. + +### - CDRWin cuesheet disc image + +- Support for creating images. + +### - CisCopy disk image + +- Support for creating images. + +### - CloneCD disc image + +- Support for creating images. + +### - Digital Research DISKCOPY disk image + +- Support for creating images. + +### - DiskCopy 4.2 disk image + +- Support for creating images. + +### - IBM SaveDskF disk image + +- Support for creating images. + +### - MaxiDisk disk image + +- Support for creating images. + +### - NHDr0 disk image + +- Support for creating images. + +### - Parallels disk image + +- Support for creating images. + +### - QEMU Copy-On-Write disk image + +- Support for creating images. + +### - QEMU Copy-On-Write v2 disk image + +- Support for creating images. + +### - QEMU Enhanced Disk image + +- Support for creating images. + +### - RAW (sector by sector) disk image + +- Added geometry and size for ZIP100 and ZIP250. +- Support 2448 bytes/sector and 2352 bytes/sector CD images. +- Support media tags. + +### - Ray Arachelian's disk image + +- Support for creating images. + +### - RS-IDE disk image + +- Support for creating images. + +### - T98 Hard Disk Image + +- Support for creating images. + +### - Virtual98 disk image + +- Support for creating images. + +### - VirtualBox disk image + +- Added image type and flags. +- Support for creating images. + +### - VirtualPC disk image + +- Support for creating images. + +### - VMware disk image + +- Support for creating images. + +## Fixes + +### - Apple DOS filesystem + +- Use Apple II character set encoding. + +### - Apple ProDOS filesystem + +- Use Apple IIc character set encoding. + +### - BlindWrite 4 disc image + +- Fix incorrect pregap calculation preventing images from showing correct data. + +### - CICM metadata + +- Can now get dump hardware information from images. + +### - cdrdao disc image + +- Fix audio track endian. +- Fix when disc catalog number uses whole ASCII and not only numeric digits. + +### - CDRWin disc image + +- Fix when disc catalog number uses whole ASCII and not only numeric digits. + +### - CloneCD disc image + +- Fix when disc catalog number uses whole ASCII and not only numeric digits. + +### - Checksums + +- Correct CD ECC. +- Correct CD EDC. +- Fix CRC16 returning a 32-bit value. +- Fix CRC64 endian. +- Fix Fletcher-16. +- Fix Fletcher-32. + +### - Create sidecar + +- Add filesystems only to the appropriate partition and track. +- Fix CD first track pregap, TOC and XGD tags. +- Fix diameter setting. +- Fix SCSI MODE SENSE. +- Fix USB descriptors. + +### - DART disk image + +- Fixed endian. + +### - Devices + +- Fix sending READ LONG commands to ATA devices. +- Fixed crashing with some rogue SCSI MMC firmwares. + +### - Dumping + +- Correctly detect CD-i, CD+ and CD-ROM XA. +- Correctly detect Mode 2 Form 1 and Form 2. +- Do not retry when retry passes are zero. +- Do not try to read multisession lead-out/lead-in as they result in errors that are not really there. +- Get correct track flags. +- Retry only the number of times requested. +- Return drive to previous error correction status. +- Send error recovery MODE before retrying sectors. + +### - HDCopy disk image + +- Fix sector calculation. + +### - Image comparison + +- Fix when sessions are null. + +### - Image verification + +- Corrected status printing. + +### - ISO9660 filesystem + +- Do not try to read past partition if El Torito indicates image goes beyond limits. +- Fix when root directory is outside of device. +- Skip null terminated strings in ISO9660 fields. + +### - Lisa filesystem + +- Corrected character set encoding. + +### - Macintosh filesystem + +- Corrected character set encoding. + +### - PC-98 Partition Table + +- Prevent some FAT BPBs to false positive as PC-98 partition tables. + +### - RT-11 filesystem + +- Use Radix-50 character set encoding. + +### - System V filesystem + +- Fix partition bounds. + +### - VirtualPC disk image + +- Corrected reading non-allocated blocks. + +## Changes + +- Added command to convert disc images. +- Added command to get information about an image and its contents. +- Added D/CAS-25, D/CAS-85 and D/CAS-103 formats. +- Added IRC notifications for Travis CI. +- Added measured dimensions from an UMD. +- Added media types for NEO GEO CD, PC-FX. +- Added new image format designed to store as much information about media as a drive returns: dicformat. +- Added numeric values to media types. +- Added project to create test filesystems on 16-bit OS/2. +- Added project to create test filesystems on 32-bit OS/2. +- Added project to create test filesystems on DOS. +- Added project to create test filesystems on Mac OS. +- Added size of 640MiB magneto-optical disk. +- Added support for writing disc images. +- Compliant with GDPR. +- Corrected floptical geometry to data according to IRIX. +- Do not assume pointers are 32-bit in several Windows device calls. +- Fixed when statistics settings are null. +- Minimum .NET Framework version is now 4.6.1. +- Sort verbs list. +- Support newest XDG Base Directory Specification for Linux. + +# [4.0.1.0] - 2018-01-06 + +## Fixes + +### Apple DOS and ProDOS interleaved disk images + +- Fixed interleaving values. + +### Apple Nibble disk image + +- Fixed detection of DOS vs ProDOS sector order. + +### Apple 2IMG disk image + +- Fixed deinterleaving of DOS and ProDOS sector order. +- Fixed denibblizing images. + +### Apple ProDOS filesystem + +- Fixed detection on Apple II disks. + +### UCSD Pascal filesystem + +- Added support for Apple II variants (two physical sectors per logical sector and little endian fields). + +# [4.0.0.0] - 2017-12-25 + +## Added + +### - Advanced Disc Filing System + +- Added support for ADFS-S, ADFS-M, ADFS-L, ADFS-D, ADFS-E, ADFS-E+, ADFS-F, ADFS-F+ and ADFS-G. + +### - Apple Partition Map + +- Added support for decoding Driver Description Map. +- Added support for maps without Driver Description Map. +- Added support for old partition table. + +### - Commands + +- Added separate application to debug commands sent to devices. +- list-devices: Lists devices that can be used for device dependent commands. +- list-encodings: Lists supported character encodings. + +### - Create Sidecar command + +- Added support for hashing DiscFerret flux images. +- Added support for hashing KryoFlux STREAM flux images. +- Added support for hashing SuperCardPro flux images. +- Added support for tape dumps where each tape-file is a separate dumped file. +- Calculate checksum of contents not only of image file. +- Consider each optical disc track as a separate partition. +- Store superblock modification time on sidecar. +- Support tracks. +- Use dump drive information from images that support it. + +### - Decoders + +- Xbox DMI. +- Xbox Security Sectors. + +### - Devices + +- MMC. +- PCMCIA block devices. +- SCSI Streaming Devices (aka "tapes"). +- SecureDigital. + +### - Device commands + +- Add ATA and SCSI commands support for FreeBSD. +- Add ATA commands support for Windows. +- Add retrieval of USB information on Windows. +- Add SecureDigital/MMC commands support for Windows. + +### - Disc images. + +- Alcohol 120%. +- Anex86. +- Apple DOS interleaved (.do). +- Apple New Disk Image Format (aka NDIF, aka img, aka DiskCopy 6). +- Apple Nibble (aka NIB). +- Apple ProDOS interleaved (.po). +- Apple Universal Disk Image Format (aka UDIF, aka dmg). +- BlindWrite 4. +- BlindWrite 5. +- CisCopy (aka DC-File or DCF). +- CloneCD. +- CopyQM. +- CPCEMU Disk File. +- CPCEMU Extended Disk File. +- D64. +- D71. +- D81. +- Digital Research's DiskCopy. +- DiscJuggler. +- HD-Copy. +- IBM SaveDskF. +- IMD. +- MAME Compressed Hunks of Data (aka CHD). +- Parallels Hard Disk Image (aka HDD). +- Partclone disk images +- Partimage disk images +- QEMU Copy-On-Write (aka QCOW). +- QEMU Copy-On-Write v2. +- QEMU Enhanced Disk (aka QED). +- Quasi88 (.D77/.D88). +- Ray Arachelian's Disk IMage (.DIM). +- RS-IDE hard disk images. +- Spectrum floppy disk image (.FDI) +- T98. +- VHDX. +- Virtual98. +- VMware. +- X68k .DIM. + +### - DiskCopy 4.2 disk image + +- Added support for invalid images that use little-endian values. +- Added support for images created by macOS that don't have a format byte set. +- Use resource fork to get DiskCopy version used to create them. + +### - Dumping + +- Added the ability to resume a partially done dump, even on a separate drive. +- Added the ability to skip dumping the Lead-in. +- Allow creation of a separate subchannel file. +- Create dump log. +- Dumping optical media creates an Alcohol 120% descriptor file. +- Raw dump of DVD with Matshita recorders. +- XGD with Kreon drives. + +### - ext2/3/4 filesystem + +- Added new superblock fields. +- Added support for devices with sectors bigger than 512 bytes. + +### - FAT filesystem + +- Added DEC Rainbow's hard-wired BPB. +- Added support for volumes with 256 bytes/sector. +- Added support for ACT Apricot BPB. +- Gets volume label, creation time and modification time from root directory if available. + +### - Filesystems + +- Apple DOS. +- CP/M. +- Detecting AO-DOS. +- Detecting AtheOS. +- Detecting CD-i. +- Detecting Commodore 1540/1541/1571/1581. +- Detecting cram. +- Detecting Cray UNICOS. +- Detecting dump(8) (Old historic BSD, AIX, UFS and UFS2 types). +- Detecting ECMA-67. +- Detecting exFAT. +- Detecting Extent File System (aka SGI EFS). +- Detecting F2FS. +- Detecting FAT+. +- Detecting fossil. +- Detecting HAMMER. +- Detecting High Sierra Format. +- Detecting HP Logical Interchange Format. +- Detecting IBM JFS. +- Detecting Locus. +- Detecting MicroDOS file system. +- Detecting NILFS2. +- Detecting OS-9 Random Block File (aka RBF). +- Detecting Professional File System (aka PFS). +- Detecting QNX 4. +- Detecting QNX 6. +- Detecting Reiser. +- Detecting Reiser4. +- Detecting RT-11. +- Detecting SmartFileSystem (aka SFS, aka Standard File System). +- Detecting Squash. +- Detecting Universal Disk Format (aka UDF). +- Detecting Veritas. +- Detecting VMware. +- Detecting Xbox. +- Detecting XFS. +- Detecting Zettabyte File System (aka ZFS). +- UCSD Pascal. + +### - Filters + +- AppleDouble. +- Apple PCExchange. +- AppleSingle. +- BZIP2. +- GZIP. +- LZIP. +- MacBinary. +- XZ. + +### - GUID Partition Table + +- New type GUIDs. + +### - ISO9660 filesystem + +- Added detection of AAIP extensions. +- Added detection of Apple extensions. +- Added detection of EFI Platform ID for El Torito. +- Added detection of RRIP extensions. +- Added detection of SUSP extensions. +- Added detection of XA extensions. +- Added detection of ziso extensions. + +### - Lisa filesystem + +- Full read-only support. + +### - Media types + +- DDS, DDS-2, DDS-3, DDS-4. +- HiFD. +- IOMEGA Clik! (aka PocketZip). +- IOMEGA JAZ. +- LS-120, LS-240, FD32MB. +- NEC floppies. +- Old DEC hard disks +- SHARP floppies. +- XGD3. + +### - Partitions + +- Acorn FileCore. +- ACT Apricot. +- BSD disklabels. +- DEC disklabels. +- DragonFly BSD. +- Human68k. +- MINIX subpartitions. +- NEC PC-9800. +- Plan9 partition table. +- Rio Karma. +- SGI Disk Volume Headers. +- UNIX hardwired partition tables. +- UNIX VTOC. +- XENIX partition table. + +### - SCSI decoding + +- Handling of EVPDs smaller than length field. +- Handling of modes 02h, 04h and 1Ch smaller than expected. +- Prettyfying of mode 0Bh. + +### - SmartFileSystem + +- Added support for version 2. + +### - Statistics + +- Added version and operating system statistics. + +### - Sun disklabel + +- Added bound checks. +- Added support for 16-entries VTOC. +- Added support for pre-VTOC disklabels. +- Corrected structures for 8-entries VTOC. + +### - System V filesystem + +- Added COHERENT offsets. +- Check for it starting on second cylinder. +- Corrected cluster size calculation. +- Corrected detection between Release 2 and Release 4. +- Corrected Release 2 superblock parameters. +- Enlarged NICFREE for Version 7. + +### TeleDisk images + +- Added support for Advanced Compression. +- Added support for floppy lead-out. +- Added variable sectors per track support. + +## Fixes + +### - AmigaDOS filesystem + +- Corrected checksum calculation. +- Corrected cluster size calculation. +- Corrected root block location. +- Corrected support for AROS i386 variant that has a PC bootblock before the AmigaDOS bootblock itself. +- Detection on hard disks or with clusters bigger than 1 sector. +- Tested FFS2. + +### - Apple Partition Map + +- Added bound checks. +- Added support for decoding Driver Description Map. +- Added support for maps without Driver Description Map. +- Added support for old partition table. +- Corrected partition start when map it's not on start of device. +- Corrected support for misaligned maps, like on CDs. +- Cut partitions that span outside the device. + +### - cdrdao + +- Audio track matching. +- Corrected images that start with comments. +- Prevent reading binary files. + +### - CDRWin + +- CD-Text detection. +- CD+G data return. +- Fixed composer parsing. +- Prevent reading binary files. + +### - CP/M filesystem + +- Corrected cluster count calculation. +- Corrected directory location on CP/M-86. +- Corrected sector reading. +- Skip media types that were never used as a CP/M disk. + +### - Create Sidecar command + +- Corrected creation when path is absolute. + +### - Device commands + +- Do not send SCSI INQUIRY to non-SCSI paths on Linux. + +### - Device reports + +- Call ATA READ LONG last, as it confuses some drives. +- Try SCSI READ LONG (10) until max block size (65535). + +### - DiskCopy 4.2 + +- Corrected track order for Lisa and Macintosh Twiggy. + +### - Dreamcast GDI images + +- Prevent reading binary files. + +### - Dumping + +- Calculation of streaming device dumping speed. +- Corrected dumping CD-R and CD-RW. +- Optical media with 2048 bytes/sector now get ".iso" file extension. +- Retry when SCSI devices return reset status. +- Streaming Devices now store block size changes in metadata sidecar. +- Wait for SCSI devices to exit ASC 28h (MEDIUM CHANGE) status. + +### - ext2/3/4 filesystem + +- Use os type as XML system identifier. + +### - FAT filesystem + +- Behaviour with some non-compliant media descriptors. +- Corrected 5.25" MD1DD detection. +- Corrected boot code detection. +- Corrected misaligned volumes on optical media. +- Rewritten to better detect Atari, MSX, *-DOS and ANDOS variants. +- Use OEM name as XML system identifier. + +### - Guid Partition Table + +- Added bound checks. +- Corrected misaligned tables on optical media. +- Corrected when table is smaller than one sector. + +### - HFS filesystem + +- Corrected detection of a PowerPC only bootable volume (no boot sector). +- Corrected misaligned volumes on optical media. +- Corrected volume serial number case. + +### - HFS+ filesystem + +- Corrected misaligned volumes on optical media. +- Corrected misalignment of fields in Volume Header. +- Use last mount version as XML system identifier. + +### - HPFS filesystem + +- Corrected cluster size. +- Detect boot code. +- Show NT flags. +- Use OEM name as XML system identifier. + +### - ISO9660 filesystem + +- Complete rewrite. +- Check that date fields start with a number. + +### - Master Boot Record partitioning scheme + +- Check real presence of a GPT. +- Corrected infinite looping on extended partitions. +- Remove disklabels support. +- Support misaligned MBRs on optical media. +- Support NEC extensions. +- Support OnTrack extensions. + +### - MINIX filesystem + +- Added support for v1 and v2 created on MINIX 3. +- Corrected misaligned volumes on optical media. + +### - Nero Burning ROM + +- Corrected track handling. +- Corrected typo on parsing v2 images. +- Disc types. +- Do not identify positively if footer version is unknown. +- Lead-In handling. +- Mode2 RAW sectors. +- Session count. + +### - NeXT partition table + +- Added missing fields. +- Corrected offsets. +- Cut partitions that span outside the device. + +### - ODS filesystem + +- Corrected cluster size calculation. +- Corrected misaligned volumes on optical media. + +### - ProDOS filesystem + +- Corrected cluster size calculation. +- Corrected misaligned volumes on optical media. +- Volume size. + +### - Rigid Disk Block partition scheme + +- Corrected AMIX mappings. + +### - SCSI decoding + +- Handling of EVPDs smaller than length field. +- Handling of modes 02h, 04h and 1Ch smaller than expected. +- Prevented overflow on MMC FEATURES decoding. +- Prevented overflow on SCSI MODE PAGE decoding. + +### - SmartFileSystem + +- Added support for version 2. + +### - Sun disklabel + +- Added bound checks. +- Corrected structures for 8-entries VTOC. + +### - System V filesystem + +- Check for it starting on second cylinder. +- Corrected cluster size calculation. +- Corrected detection between Release 2 and Release 4. +- Corrected Release 2 superblock parameters. +- Enlarged NICFREE for Version 7. + +### - UFS filesystem + +- Corrected superblock locations. +- Move superblock to a single structure and marshal it, corrects detection of several variants. + +## Changes + +- Added a public changelog. +- Added a side application to create device reports under Linux without a .NET environment. +- Added operating system version statistics. +- Added partitioning scheme name to partition structures. +- Added several internal tests to prevent regression on changes. +- Added support for different character encodings. +- Added support for filters. +- Added support for nested partitioning schemes. +- Added support for propagating disk geometry, needed by PC-98 partitions and old MBRs. +- Better support for decoding multibyte encodings from C, Pascal and space-padded strings. +- Changed handling of compressed files, using temporary files and caching. +- Corrected casting on big-endian marshalling that was failing on some .NET Framework versions. +- Corrected filter list reuse. +- Disabled EDC check on CDs because it is not working (TODO). +- Filesystems now have access to full partition structure. +- Filters no longer return their own extension when requested for filename. +- Moved Claunia.RsrcFork to NuGet. +- Priam tags. +- Support drive firmware inside disc images. +- Support subchannel with only Q channel. + +# [3.0.0.0] - 2016-07-19 + +## Added + +### - Commands + +- benchmark: Tests speed for checksum algorithms. +- create-sidecar: Creates an XML sidecar with metadata. +- decode: Decodes and prints a disk tag present on the image. +- device-info: Prints device information. +- dump-media: Dumps media to a disk image. +- entropy: Calculates disk entropy. +- media-info: Prints media information. +- scan-media: Scans media for errors. + +### - Checksums + +- Adler-32 +- SpamSum + +### - Devices + +- ATA on Linux. +- ATA on Windows (untested). +- FireWire on Linux. +- SCSI on Linux. +- SCSI on Windows (untested). +- USB on Linux. + +### - Disc images + +- Apple 2IMG. +- CDRDAO. +- Dreamcast GDI. +- VirtualPC. + +### - Fast File System (FFS) + +- Atari UNIX variant. + +### - Filesystems + +- Acorn ADFS. +- AmigaDOS. +- Apple File System, aka APFS. +- Apple ProDOS. +- btrfs. +- Nintendo Gamecube. +- Nintendo Wii. + +### - Partitions + +- Amiga Rigid Disk Block (aka RDB). +- Atari. +- Sun. +- (U)EFI GPT. + +## Changes + +### - PrintHex command + +- Allow to print several sectors. + +## Fixes + +### - Be filesystem + +- Endianness. +- Support for Be CDs. + +### - CDRWin disk image + +- Behaviour on .NET Framework. +- Detection of CD-ROM XA. +- Flags. +- Partition calculations. + +### - Fast File System (FFS) + +- False positives with 7th Edition. + +### - ISO9660 + +- Dreamcast IP.BIN decoding. +- Sega CD IP.BIN decoding. + +### - System V Filesystem + +- Big endian support + +# [2.20] - 2014-08-28 + +## Added + +### - Checksums + +- Reed Solomon. + +## Fixes + +### - Apple Partition Map + +- Disks with 2048 bytes/sector but a 512 bytes/sector map. + +### - HFS + +- Disks with 2048 bytes/sector but a 512 bytes/sector filesystem. + +# [2.10] - 2014-08-25 + +## Added + +### - Checksums + +- CD EDC and ECC. +- CRC16. + +### - Commands + +- Verify: Verifies disk image contents, if supported. + +### - Disc images + +- Nero Burning ROM. + +# [2.0] - 2014-07-03 + +## Added + +### - Commands + +- analyze: Gives information about disk image contents as well as detecting partitions and filesystems. +- checksum: Generates CRC32, CRC64, RIPEMD160, MD5, SHA1, SHA256, SHA384 and SHA512 checksums of disk image contents. +- compare: Compares two media images. +- printhex: Prints a hexadecimal output of a sector. + +### - Disc images + +- RAW (sector by sector). + +### - Media types + +- BD-R. +- BD-RE XL. +- FDFORMAT. + +## Fixes + +### - FAT filesystem + +- Workaround FAT12 without BIOS Parameter Block. + +### - MBR partitions + +- Do not search for them on disks with less than 512 bytes/sector. + +### - ODS-11 filesystem + +- Do not search for them on disks with less than 512 bytes/sector. + +# [1.10] - 2014-04-21 + +## Added + +### - Disc images + +- Sydex TeleDisk. + +# [1.0] - 2014-04-17 + +## Added + +### - Filesystems + +- Detecting BeFS. +- Detecting ext. +- Detecting ext2. +- Detecting ext3. +- Detecting ext4. +- Detecting FAT12. +- Detecting FAT16. +- Detecting FAT32. +- Detecting FFS. +- Detecting HFS+. +- Detecting HFS. +- Detecting HPFS. +- Detecting ISO9660. +- Detecting LisaFS. +- Detecting MFS. +- Detecting MinixFS. +- Detecting NTFS. +- Detecting ODS-11. +- Detecting Opera. +- Detecting PCEngine. +- Detecting SolarFS. +- Detecting System V. +- Detecting UFS. +- Detecting UFS2. +- Detecting UnixWare boot. + +### - Disc images + +- Apple DiskCopy 4.2. +- CDRWin. + +### - Partitions + +- Apple Partition Map (aka APM). +- Master Boot Record (aka MBR). +- NeXT disklabels. + +[5.2.0.3330]: https://github.com/aaru-dps/Aaru/releases/tag/v5.2.0.3330 + +[5.1.0.3214]: https://github.com/aaru-dps/Aaru/releases/tag/v5.1.0.3214 + +[5.0.1.2884]: https://github.com/aaru-dps/Aaru/releases/tag/v5.0.1.2884 + +[5.0.0.2879]: https://github.com/aaru-dps/Aaru/releases/tag/v5.0.0.2879 + +[4.5.1.1692]: https://github.com/aaru-dps/Aaru/releases/tag/v4.5.1.1692 + +[4.5.0.1663]: https://github.com/aaru-dps/Aaru/releases/tag/v4.5.0.1663 + +[4.0.1.0]: https://github.com/aaru-dps/Aaru/releases/tag/v4.0.1.0 + +[4.0.0.0]: https://github.com/aaru-dps/Aaru/releases/tag/v4.0.0.0 + +[3.0.0.0]: https://github.com/aaru-dps/Aaru/releases/tag/v3.0.0.0 + +[2.20]: https://github.com/aaru-dps/Aaru/releases/tag/v2.2 + +[2.10]: https://github.com/aaru-dps/Aaru/releases/tag/v2.1 + +[2.0]: https://github.com/aaru-dps/Aaru/releases/tag/v2.0 diff --git a/Aaru.Server.Old/docs/ISSUE_TEMPLATE.md b/Aaru.Server.Old/docs/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..4a0ac63e --- /dev/null +++ b/Aaru.Server.Old/docs/ISSUE_TEMPLATE.md @@ -0,0 +1,53 @@ +### Prerequisites + +* [ ] Are you running the latest version? +* [ ] Can you reproduce the problem in the debug version? + +### Check and fill as appropriate: + +* [ ] I was running Aaru under Windows [version here]... +* [ ] I was running Aaru under Linux [version here]... +* [ ] I was running Aaru under FreeBSD [version here]... +* [ ] I was running Aaru under macOS [version here]... +* [ ] ...using .NET Framework [version here]... +* [ ] ...using .NET Core [version here]... +* [ ] ...using Mono [version here]... +* [ ] ...in 32-bit +* [ ] ...in 64-bit + +### Description + +[Description of the bug or feature] + +### Exact command line used: + +`Aaru [command] [parameters]` + +### Expected behavior: + +[What you expected to happen] + +### Actual behavior: + +[What actually happened] + +### If command was expected to work with a device fill this out: + +* **Manufacturer**: +* **Model**: +* **Bus**: + * [ ] Parallel ATA + * [ ] Serial ATA + * [ ] SCSI (any) + * [ ] ATAPI (mark above if parallel or serial) + * [ ] USB + * [ ] FireWire + * [ ] PCMCIA + * [ ] SecureDigital + * [ ] MultiMediaCard + +### Output of command execution with debug output enabled + +``` +Paste the whole output of the executed command when you append '-d' to your command line parameters here +``` \ No newline at end of file diff --git a/Aaru.Server.Old/docs/NEEDED.md b/Aaru.Server.Old/docs/NEEDED.md new file mode 100644 index 00000000..e8853cdc --- /dev/null +++ b/Aaru.Server.Old/docs/NEEDED.md @@ -0,0 +1,141 @@ +This is a list of hardware, software, and general information needed to expand and better support various unique +hardware and software configurations for Aaru. We accept donation of this hardware, or loans: paying for shipping is +greatly appreciated, but can make other arrangements depending on cost. For media, we do accept loans, but please be +aware that due to it’s age, there is no guarantee it will still be working after it is returned and thus donations are +preferred. + +Drives +====== +This is a list of drives. The reason we need these drives is because it is the only way to add enhanced support for +them (e.g. media detection, ECC support, raw dumping, etc.). Also some drives depart from the specifications and need +special workarounds. If a drive is listed here, but the media it uses is not listed below, we already have media for it. +Drives are preferred in ATA/ATAPI, SCSI, USB or FireWire buses. Parallel port drives require a larger amount of work, +and there is no guarantee it can work, at all, with other drives. If in doubt, please contact us. + +- 5.25" magneto-optical (preferibly the 9.6Gb supporting one) +- 8" shugart floppy drive (preferibly the 240VAC one) +- ADR tape drive +- AIT tape drive +- Apple FileWare "twiggy" +- Caleb UHD144 +- Castlewood Orb 5.7 +- DLT tape drive +- DiscFerret +- Host-aware and host-controlled SAS and SATA zoned hard disks +- Iomega Ditto tape drive +- LD-ROM +- LTO 1, 3, 4, 6, 7 +- LV-ROM +- Mammoth tape +- Plasmon UDO 2 +- SLR tape drive +- Stringy floppy drive +- Syquest Quest drive +- Syquest SQ2542 drive +- Syquest SQ306RD drive +- Syquest SQ312RD drive +- Syquest SQ5110 drive +- Syquest SQ555 drive +- T9840, T9940, T10000 tape drives +- Travan tape drive +- Triton drive +- VXA tape drive + +Media +===== +This is the media for the drives listed above, or media for drives we do have, but lack and thus cannot test the actual +hardware. + +- 5.25" magneto-optical media: 128MiB +- ADR tapes +- AIT tapes +- Apple FileWare "twiggy" floppies +- Caleb UHD144 floppy +- Castlewood Orb 5.7 +- DLTtape, DLTtapeII, DLTtapeIII +- Rewritable HD-DVD +- Iomega Ditto drive and tapes +- LD-ROM +- LTO 3, 4, 6, 7 tapes +- LV-ROM +- Mammoth tapes +- Plasmon UDO 2 +- SLR tapes +- Stringy floppy +- Syquest Quest media +- Syquest SQ2542 media +- Syquest SQ100 media +- Syquest SQ200 media +- Syquest SQ300 media +- T9840, T9940, T10000 tapes +- Travan tapes +- Triton media +- VXA tapes + +Software +================== +This is a list of software whose physical media has some characteristics that needs to be investigated to allow correct +dumping of such characteristics. Usually those are copy protections. + +- CD-i Ready + - Accelerator + - Alien Gate + - Beyond Limits + - Escape + - Lucky Luke + - Louis Armstrong + - Dark Fables of Aesop + - More Dark Fables of Aesop + - Mozart + - Opera Imaginaire + - Pavarotti + - Steel Machine + - The Apprentice + - Dimo's Quest + - The Worlds of... +- SafeDisc + - Beowulf + - Black & White 2 + - Brothers in Arms: Road to Hill 30 + - Carmageddon II: Carpocalypse Now + - Close Combat: Invasion Normandy + - Codename: Eagle +- SecuROM + - Arabian Nights + - Arcania: Gothic 4 + - Boiling Point: Road to Hell + - Cars 2 + - Colin McRae Rally 04 + - Colin McRae Rally 2.0 + - Colin McRae Rally 3 + - Command & Conquer: Red Alert 3 - Uprising + - Devil May Cry 4 + - Die Hard: Nakatomi Plaza + - Disney Planes +- StarForce + - Black Mirror 3 + - BloodRayne 2 + - Chronostorm: Siberian Border + - Codename: Outbreak + - Dead to Rights + - Disciples III: Renaissance + - Mount & Blade + - Pac-Man World 2 +- Tages + - Anno 1701 + - Darkstar One + - Faery: Legends of Avalon + - Helldorado + - Nostradamus: The Last Prophecy + - Silverfall +- Solidshield + - A-Train 8 + - Anno 2070 + - Assassin's Creed: Brotherhood + - Dead Mountaineer's Hotel + - Dead Space 2 + - Helldorado + - I Am Alive + - ObsCure II + - Shift 2 Unleashed + - Warfare \ No newline at end of file diff --git a/Aaru.Server.Old/docs/NEEDINFO.md b/Aaru.Server.Old/docs/NEEDINFO.md new file mode 100644 index 00000000..7a1b6804 --- /dev/null +++ b/Aaru.Server.Old/docs/NEEDINFO.md @@ -0,0 +1,11 @@ +Information and test data +========================= + +This is a list of information I need, including test disk images. + +- DiscFerret stream images +- Information about the KenCode compression algorithm, or an implementation in C or Pascal +- Information about the structure and compression algorithm for XPACK disk images, or an implementation in C +- KryoFlux stream images +- NetWare 286 license and installation media for adding support to its filesystem +- NetWare 386 license and installation media for adding support to its filesystem \ No newline at end of file diff --git a/Aaru.Server.Old/docs/PULL_REQUEST_TEMPLATE.md b/Aaru.Server.Old/docs/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..02daa28b --- /dev/null +++ b/Aaru.Server.Old/docs/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Types of changes + + + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] New filesystem, test images in [url] +- [ ] New disc image, test images in [url] +- [ ] New partition scheme, test images in [url] +- [ ] Breaking change (fix or feature that would cause existing functionality to change) +- [ ] I have read the **CONTRIBUTING** document. +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed. \ No newline at end of file diff --git a/Aaru.Server.Old/docs/README.md b/Aaru.Server.Old/docs/README.md new file mode 100644 index 00000000..7d008893 --- /dev/null +++ b/Aaru.Server.Old/docs/README.md @@ -0,0 +1,274 @@ +Aaru Data Preservation Suite v5.2.99.3380 + +Aaru + +Copyright © 2011-2024 Natalia Portillo + +[![Build Status](https://dev.azure.com/Aaru-dps/aaru/_apis/build/status/aaru-dps.Aaru?branchName=master)](https://dev.azure.com/Aaru-dps/aaru/_build/latest?definitionId=7&branchName=master) +[![Build Status](https://travis-ci.org/aaru-dps/Aaru.svg?branch=master)](https://travis-ci.org/github/aaru-dps/Aaru) +[![Build status](https://ci.appveyor.com/api/projects/status/vim4c8h028pn5oys?svg=true)](https://ci.appveyor.com/project/claunia/aaru) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fclaunia%2FDiscImageChef.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fclaunia%2FDiscImageChef?ref=badge_shield) + +You can see statistics and device reports [here](https://www.aaru.app/Stats) + +Aaru is a fully featured media dump management solution. You usually know media dumps as disc images, disk images, tape +images, etc. + +With Aaru you can identify a media dump, extract files from it (for supported filesystems), compare two of them, create +them from real media using the appropriate drive, create a sidecar metadata with information about the media dump, and a +lot of other features that commonly would require you to use separate applications. + +To see last changes, check the [changelog](Changelog.md). To see list of pending things to do, check +the [list of issues](https://github.com/aaru-dps/Aaru/issues). + +If you want to contribute in any way please read the [contributing guide](CONTRIBUTING.md). + +Stable releases in [Github](https://github.com/aaru-dps/Aaru/releases). + + +System requirements +=================== +Aaru is created using .NET Core 3.1 and can be compiled with all the major IDEs. To run it you require to use one of the +stable releases, or build it yourself. + +Usage +===== + +aaru.exe + +And read help. + +Or read the [documentation](https://github.com/aaru-dps/Aaru.Documentation/blob/master/5.0/README.md). + +Features +======== + +* Identifies a disk image getting information about the disk itself and shows information about partitions and + filesystems inside them +* Can checksum the disks (and if optical disc, separate tracks) user-data (tags and metadata coming soon) +* Can compare two disk images, even different formats, for different sectors and/or metadata +* Can list and extract contents from supported filesystems +* Can read several disk image formats. +* Can read several known sector by sector formats with variable bytes per sector. +* Can read standard sector by sector copies for optical and magnetic discs with constant bytes per sector. +* Can verify sectors or disk images if supported by the underlying format +* Can dump media from ATA, ATAPI, SCSI, USB, FireWire and SDHCI drives (magnetic disks, optical discs, magnetoptical + disks, flash devices, memory cards and tapes) to several supported image formats. +* Can convert between image formats. +* Includes an open-source archival image format with compression and deduplication. +* Can create standard open XML metadata from existing images. +* Can measure readability and speed of media (same that can be dumped, MHDD style) +* Has an online database with drive capabilities, and can report the capabilities of any drive. +* Works on any operating system and architecture where .NET Core is supported (drive access requires Windows, Linux or + FreeBSD). +* Has a graphical interface (work in progress) + +Supported disk image formats (read-only) +======================================== + +* Apple Disk Archival/Retrieval Tool (DART) +* Apple II nibble images (NIB) +* BlindWrite 4 TOC files (.BWT/.BWI/.BWS) +* BlindWrite 5/6 TOC files (.B5T/.B5I and .B6T/.B6I) +* CopyQM +* CPCEMU Disk file and Extended Disk File +* Dave Dunfield IMD +* DiscJuggler images +* Dreamcast GDI +* HD-Copy disk images +* MAME Compressed Hunks of Data (CHD) +* Microsoft VHDX +* Nero Burning ROM (both image formats) +* Partclone disk images +* Partimage disk images +* Quasi88 disk images (.D77/.D88) +* Spectrum floppy disk image (.FDI) +* TeleDisk +* X68k DIM disk image files (.DIM) + +Supported disk image formats (read and write) +============================================= + +* Alcohol 120% Media Descriptor Structure (.MDS/.MDF) +* Anex86 disk images (.FDI for floppies, .HDI for hard disks) +* Any 512 bytes/sector disk image format (sector by sector copy, aka raw) +* Apple 2IMG (used with Apple // emulators) +* Apple DiskCopy 4.2 +* Apple ][ Interleaved Disk Image +* Apple Universal Disk Image Format (UDIF), including obsolete (previous than DiskCopy 6) versions +* Apridisk disk image formats (for ACT Apricot disks) +* Basic Lisa Utility +* CDRDAO TOC sheets +* CDRWin cue/bin cuesheets, including ones with ISOBuster extensions +* CisCopy disk image (aka DC-File, .DCF) +* CloneCD +* CopyTape +* DataPackRat's d2f/f2d disk image format ("WC DISK IMAGE") +* Digital Research DiskCopy +* Aaru Format +* IBM SaveDskF +* MAXI Disk disk images (HDK) +* Most known sector by sector copies of floppies with 128, 256, 319 and 1024 bytes/sector. +* Most known sector by sector copies with different bytes/sector on track 0. +* Parallels Hard Disk Image (HDD) version 2 +* QEMU Copy-On-Write versions 1, 2 and 3 (QCOW and QCOW2) +* QEMU Enhanced Disk (QED) +* Ray Arachelian's Disk IMage (.DIM) +* RS-IDE hard disk images +* Sector by sector copies of Microsoft's DMF floppies +* T98 hard disk images (.THD) +* T98-Next hard disk images (.NHD) +* Virtual98 disk images +* VirtualBox Disk Image (VDI) +* Virtual PC fixed size, dynamic size and differencing (undo) disk images +* VMware VMDK and COWD images +* XDF disk images (as created by IBM's XDFCOPY) + +Supported partitioning schemes +============================== + +* Acorn Linux and RISCiX partitions +* ACT Apricot partitions +* Amiga Rigid Disk Block (RDB) +* Apple Partition Map +* Atari AHDI and ICDPro +* BSD disklabels +* BSD slices inside MBR +* DEC disklabels +* DragonFly BSD 64-bit disklabel +* EFI GUID Partition Table (GPT) +* Human68k (Sharp X68000) partitions table +* Microsoft/IBM/Intel Master Boot Record (MBR) +* Minix subpartitions inside MBR +* NEC PC9800 partitions +* NeXT disklabel +* Plan9 partition table +* Rio Karma partitions +* SGI volume headers +* Solaris slices inside MBR +* Sun disklabel +* UNIX VTOC and disklabel +* UNIX VTOC inside MBR +* Xbox 360 hard coded partitions +* XENIX partition table + +Supported file systems for read-only operations +=============================================== + +* 3DO Opera file system +* Apple DOS file system +* Apple Lisa file system +* Apple Macintosh File System (MFS) +* CD-i file system +* CP/M file system +* High Sierra Format +* ISO9660, including Apple, Amiga, Rock Ridge, Joliet and Romeo extensions +* Microsoft 12-bit File Allocation Table (FAT12), including Atari ST extensions +* Microsoft 16-bit File Allocation Table (FAT16) +* Microsoft 32-bit File Allocation Table (FAT32), including FAT+ extension +* U.C.S.D Pascal file system +* Xbox filesystems + +Supported file systems for identification and information only +============================================================== + +* Acorn Advanced Disc Filing System +* Alexander Osipov DOS (AO-DOS for Electronika BK-0011) file system +* Amiga Fast File System v2, untested +* Amiga Fast File System, with international characters, directory cache and multi-user patches +* Amiga Original File System, with international characters, directory cache and multi-user patches +* Apple File System (preliminary detection until on-disk layout is stable) +* Apple Hierarchical File System (HFS) +* Apple Hierarchical File System+ (HFS+) +* Apple ProDOS / SOS file system +* AtheOS file system +* BeOS filesystem +* BSD Fast File System (FFS) / Unix File System (UFS) +* BSD Unix File System 2 (UFS2) +* B-tree file system (btrfs) +* Coherent UNIX file system +* Commodore 1540/1541/1571/1581 filesystems +* Cram file system +* DEC Files-11 (only checked with On Disk Structure 2, ODS-2) +* DEC RT-11 file system +* dump(8) (Old historic BSD, AIX, UFS and UFS2 types) +* ECMA-67: 130mm Flexible Disk Cartridge Labelling and File Structure for Information Interchange +* Flash-Friendly File System (F2FS) +* Fossil file system (from Plan9) +* HAMMER file system +* High Performance Optical File System (HPOFS) +* HP Logical Interchange Format +* IBM Journaling File System (JFS) +* Linux extended file system +* Linux extended file system 2 +* Linux extended file system 3 +* Linux extended file system 4 +* Locus file system +* MicroDOS file system +* Microsoft Extended File Allocation Table (exFAT) +* Microsoft/IBM High Performance File System (HPFS) +* Microsoft New Technology File System (NTFS) +* Microsoft Resilient File System (ReFS) +* Minix v2 file system +* Minix v3 file system +* NEC PC-Engine executable +* NEC PC-FX executable +* NILFS2 +* Nintendo optical filesystems (GameCube and Wii) +* OS-9 Random Block File +* Professional File System +* QNX4 and QNX6 filesystems +* Reiser file systems +* SGI Extent File System (EFS) +* SGI XFS +* SmartFileSystem +* SolarOS file system +* Squash file system +* UNICOS file system +* Universal Disk Format (UDF) +* UNIX System V file system +* UNIX Version 7 file system +* UnixWare boot file system +* Veritas file system +* VMware file system (VMFS) +* Xenix file system +* Xia filesystem +* Zettabyte File System (ZFS) + +Supported checksums +=================== + +* Adler-32 +* CRC-16 +* CRC-32 +* CRC-64 +* Fletcher-16 +* Fletcher-32 +* MD5 +* SHA-1 +* SHA-2 (256, 384 and 512 bits) +* SpamSum (fuzzy hashing) + +Supported filters +================= + +* Apple PCExchange (FINDER.DAT & RESOURCE.FRK) +* AppleDouble +* AppleSingle +* BZip2 +* GZip +* LZip +* MacBinary I, II, III +* XZ + +Partially supported disk image formats +====================================== +These disk image formats cannot be read, but their contents can be checksummed on sidecar creation + +* DiscFerret +* KryoFlux STREAM +* SuperCardPro + +License +======= +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fclaunia%2FDiscImageChef.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fclaunia%2FDiscImageChef?ref=badge_large) diff --git a/Aaru.Server.Old/package-lock.json b/Aaru.Server.Old/package-lock.json new file mode 100644 index 00000000..645f4dad --- /dev/null +++ b/Aaru.Server.Old/package-lock.json @@ -0,0 +1,36 @@ +{ + "name": "Aaru.Server", + "version": "4.5.99.1663", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "Aaru.Server", + "version": "4.5.99.1663", + "license": "LGPL", + "dependencies": { + "bootstrap": "^4.3.1" + } + }, + "node_modules/bootstrap": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz", + "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jquery": "1.9.1 - 3", + "popper.js": "^1.14.7" + } + } + }, + "dependencies": { + "bootstrap": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz", + "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==", + "requires": {} + } + } +} diff --git a/Aaru.Server.Old/package.json b/Aaru.Server.Old/package.json new file mode 100644 index 00000000..16df5651 --- /dev/null +++ b/Aaru.Server.Old/package.json @@ -0,0 +1,13 @@ +{ + "name": "Aaru.Server", + "version": "4.5.99.1663", + "description": "Server component for Aaru Data Preservation Suite", + "private": true, + "author": "Natalia Portillo ", + "homepage": "https://www.aaru.app", + "license": "LGPL", + "repository": "github:aaru-dps/Aaru.Server", + "dependencies": { + "bootstrap": "^4.3.1" + } +}