Files
marechai/Marechai/Pages/Admin/Details/Machine.razor

674 lines
26 KiB
Plaintext
Raw Normal View History

2020-05-26 02:41:55 +01:00
@{
2020-12-20 21:34:13 +00:00
/******************************************************************************
2020-05-26 02:41:55 +01:00
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
}
@page "/admin/machines/details/{Id:int}"
2020-05-27 14:24:47 +01:00
@page "/admin/machines/edit/{Id:int}"
2020-05-28 02:57:49 +01:00
@page "/admin/machines/create"
@using Marechai.Database.Models
2020-12-20 21:34:13 +00:00
@using Marechai.Database
2020-05-26 02:41:55 +01:00
@inherits OwningComponentBase<MachinesService>
@inject IStringLocalizer<MachinesService> L
@inject CompaniesService CompaniesService
@inject MachineFamiliesService MachineFamiliesService
2020-05-27 14:24:47 +01:00
@inject NavigationManager NavigationManager
2020-05-29 02:45:06 +01:00
@inject GpusByMachineService GpusByMachineService
@inject GpusService GpusService
@inject SoundSynthsByMachineService SoundSynthsByMachineService
@inject SoundSynthsService SoundSynthsService
@inject ProcessorsByMachineService ProcessorsByMachineService
@inject ProcessorsService ProcessorsService
@inject MemoriesByMachineService MemoriesByMachineService
@inject StorageByMachineService StorageByMachineService
@inject ScreensByMachineService ScreensByMachineService
@inject ScreensService ScreensService
@inject MachinePhotosService MachinePhotosService
2020-12-20 21:34:13 +00:00
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
2020-05-26 02:41:55 +01:00
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Machine details"]</h3>
<hr />
2020-12-20 21:34:13 +00:00
@if(!_loaded)
2020-05-26 02:41:55 +01:00
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_model.CompanyId" Disabled="!_editing" @TValue="int">
@foreach(var company in _companies)
2020-05-26 02:41:55 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int" Value="@company.Id">@company.Name</SelectItem>
}
2020-05-26 02:41:55 +01:00
</Select>
</Field>
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
2020-05-27 14:24:47 +01:00
<Validation Validator="@ValidateName">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
2020-05-27 14:24:47 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-05-26 02:41:55 +01:00
</Field>
<Field>
<FieldLabel>@L["Type"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@Type" Disabled="!_editing" @TValue="int">
@foreach(int type in Enum.GetValues(typeof(MachineType)))
2020-05-26 02:41:55 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int" Value="@type">@(((MachineType)type).ToString())</SelectItem>
}
2020-05-26 02:41:55 +01:00
</Select>
</Field>
2020-12-20 21:34:13 +00:00
@if(_editing || _model.Model != null)
2020-05-26 02:41:55 +01:00
{
<Field>
2020-05-27 14:24:47 +01:00
<FieldLabel>@L["Model code"]</FieldLabel>
2020-12-20 21:34:13 +00:00
@if(_editing)
2020-05-27 14:24:47 +01:00
{
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownModel" @TValue="bool">@L["Unknown (model)"]</Check>
}
@if(!_editing ||
!_unknownModel)
2020-05-27 14:24:47 +01:00
{
<Validation Validator="@ValidateModel">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_model.Model" Disabled="!_editing">
2020-05-27 14:24:47 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid model."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-05-26 02:41:55 +01:00
</Field>
2020-12-20 21:34:13 +00:00
}
@if(_editing || _model.Introduced.HasValue)
2020-05-26 02:41:55 +01:00
{
<Field>
<FieldLabel>@L["Introduced (public release)"]</FieldLabel>
2020-12-20 21:34:13 +00:00
@if(_editing)
2020-05-26 02:41:55 +01:00
{
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownIntroduced" Disabled="_prototype" @TValue="bool">@L["Unknown (introduction date)"]</Check>
<Check @bind-Checked="@_prototype" Disabled="_unknownIntroduced" @TValue="bool">@L["Prototype"]</Check>
}
@if(!_editing ||
!_prototype && !_unknownIntroduced)
2020-05-26 02:41:55 +01:00
{
2020-05-27 14:24:47 +01:00
<Validation Validator="@ValidateIntroduced">
2020-12-20 21:34:13 +00:00
<DateEdit @bind-Date="@_model.Introduced" Disabled="!_editing" @TValue="DateTime?">
2020-05-27 14:24:47 +01:00
<Feedback>
<ValidationError>@L["Please enter an introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
</Field>
}
@if(_editing || _model.FamilyId != null)
2020-05-26 02:41:55 +01:00
{
<Field>
<FieldLabel>@L["Family"]</FieldLabel>
2020-12-20 21:34:13 +00:00
@if(_editing)
2020-05-27 14:24:47 +01:00
{
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_noFamily" @TValue="bool">@L["No family"]</Check>
}
@if(!_editing ||
!_noFamily)
2020-05-27 14:24:47 +01:00
{
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_model.FamilyId" Disabled="!_editing" @TValue="int?">
@foreach(var family in _families)
2020-05-27 14:24:47 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@family.Id">@family.Name</SelectItem>
}
2020-05-27 14:24:47 +01:00
</Select>
2020-12-20 21:34:13 +00:00
}
2020-05-26 02:41:55 +01:00
</Field>
2020-12-20 21:34:13 +00:00
}
2020-05-26 02:41:55 +01:00
</div>
<div>
2020-12-20 21:34:13 +00:00
@if(!_editing)
2020-05-27 14:24:47 +01:00
{
2020-12-20 21:34:13 +00:00
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
2020-05-27 14:24:47 +01:00
else
{
2020-12-20 21:34:13 +00:00
<Button Clicked="@OnSaveClicked" Color="Color.Success">@L["Save"]</Button>
<Button Clicked="@OnCancelClicked" Color="Color.Danger">@L["Cancel"]</Button>
}
<a class="btn btn-secondary" href="/admin/machines">@L["Back to list"]</a>
</div>
2020-12-20 21:34:13 +00:00
@if(!_editing)
{
<hr />
<h3>@L["Graphical processing units belonging to this machine"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddGpuClick" Color="Color.Success" Disabled="_addingGpu">@L["Add new (gpu by machine)"]</Button>
@if(_addingGpu)
{
<div>
<Field>
<FieldLabel>@L["Graphical processing units"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingGpuId" Disabled="_savingGpu" @TValue="int?">
@foreach(var gpu in _gpus)
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@gpu.Id">@gpu.Company - @gpu.Name</SelectItem>
}
</Select>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddGpu" Color="Color.Primary" Disabled="@_savingGpu">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddGpu" Color="Color.Success" Disabled="@_savingGpu">@L["Add"]</Button>
</Field>
</div>
}
2020-12-20 21:34:13 +00:00
@if(_machineGpus?.Count > 0)
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Company"]
</th>
<th>
@L["Name"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _machineGpus)
{
<tr>
<td>
@item.CompanyName
</td>
<td>
@item.Name
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowGpuDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingGpu">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
<hr />
<h3>@L["Sound synthesizers belonging to this machine"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddSoundClick" Color="Color.Success" Disabled="_addingSound">@L["Add new (sound by machine)"]</Button>
@if(_addingSound)
{
<div>
<Field>
<FieldLabel>@L["Sound synthesizers"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingSoundId" Disabled="_savingSound" @TValue="int?">
@foreach(var soundSynth in _soundSynths)
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@soundSynth.Id">@soundSynth.CompanyName - @soundSynth.Name</SelectItem>
}
</Select>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddSound" Color="Color.Primary" Disabled="@_savingSound">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddSound" Color="Color.Success" Disabled="@_savingSound">@L["Add"]</Button>
</Field>
</div>
}
2020-12-20 21:34:13 +00:00
@if(_machineSound?.Count > 0)
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Company"]
</th>
<th>
@L["Name"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _machineSound)
{
<tr>
<td>
@item.CompanyName
</td>
<td>
@item.Name
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowSoundDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingSound">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
<hr />
<h3>@L["Processors belonging to this machine"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddCpuClick" Color="Color.Success" Disabled="_addingCpu">@L["Add new (processor by machine)"]</Button>
@if(_addingCpu)
{
<div>
<Field>
<FieldLabel>@L["Processors"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingCpuId" Disabled="_savingCpu" @TValue="int?">
@foreach(var cpu in _cpus)
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@cpu.Id">@cpu.CompanyName - @cpu.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Nominal speed (MHz)"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownProcessorSpeed" @TValue="bool">@L["Unknown (processor by machine speed)"]</Check>
@if(!_unknownProcessorSpeed)
{
<Validation Validator="@ValidateProcessorSpeed">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_addingProcessorSpeed" Decimals="3" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid speed for this processor."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddCpu" Color="Color.Primary" Disabled="@_savingCpu">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddCpu" Color="Color.Success" Disabled="@_savingCpu">@L["Add"]</Button>
</div>
}
2020-12-20 21:34:13 +00:00
@if(_machineCpus?.Count > 0)
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Company"]
</th>
<th>
@L["Name"]
</th>
<th>
@L["Speed"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _machineCpus)
{
<tr>
<td>
@item.CompanyName
</td>
<td>
@item.Name
</td>
<td>
@string.Format(L["{0:F3} MHz"], item.Speed)
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowCpuDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingCpu">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
<hr />
<h3>@L["Memory belonging to this machine"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddMemoryClick" Color="Color.Success" Disabled="_addingMemory">@L["Add new (memory by machine)"]</Button>
@if(_addingMemory)
{
<div>
<Field>
<FieldLabel>@L["Memory type"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingMemoryType" @TValue="int">
@foreach(int type in Enum.GetValues(typeof(MemoryType)))
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int" Value="@type">@(((MemoryType)type).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Memory usage"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingMemoryUsage" @TValue="int">
@foreach(int usage in Enum.GetValues(typeof(MemoryUsage)))
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int" Value="@usage">@(((MemoryUsage)usage).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Nominal speed (Hz)"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownMemorySpeed" @TValue="bool">@L["Unknown (memory by machine speed)"]</Check>
@if(!_unknownMemorySpeed)
{
<Validation Validator="@ValidateMemorySpeed">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_addingMemorySpeed" Decimals="3" @TValue="double?">
<Feedback>
<ValidationError>@L["Please enter a valid speed for this memory."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
</Field>
<Field>
<FieldLabel>@L["Memory size (bytes)"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownMemorySize" @TValue="bool">@L["Unknown (memory by machine size)"]</Check>
@if(!_unknownMemorySize)
{
<Validation Validator="@ValidateMemorySize">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_addingMemorySize" Decimals="0" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid size for this memory."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddMemory" Color="Color.Primary" Disabled="@_savingMemory">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddMemory" Color="Color.Success" Disabled="@_savingMemory">@L["Add"]</Button>
</div>
}
2020-12-20 21:34:13 +00:00
@if(_machineMemories?.Count > 0)
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Type"]
</th>
<th>
@L["Usage"]
</th>
<th>
@L["Size"]
</th>
<th>
@L["Speed"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _machineMemories)
{
<tr>
<td>
@item.Type
</td>
<td>
@item.Usage
</td>
<td>
2020-12-20 21:34:13 +00:00
@if(item.Size.HasValue)
{
@string.Format(L["{0} bytes"], item.Size)
}
else
{
@L["Unknown (memory by machine size)"]
}
</td>
<td>
2020-12-20 21:34:13 +00:00
@if(item.Speed.HasValue)
{
@string.Format(L["{0:F3} Hz"], item.Speed)
}
else
{
@L["Unknown (memory by machine speed)"]
}
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowMemoryDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingMemory">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
<hr />
<h3>@L["Storage belonging to this machine"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddStorageClick" Color="Color.Success" Disabled="_addingStorage">@L["Add new (storage by machine)"]</Button>
@if(_addingStorage)
{
<div>
<Field>
<FieldLabel>@L["Storage type"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingStorageType" @TValue="int">
@foreach(int type in Enum.GetValues(typeof(StorageType)))
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int" Value="@type">@(((StorageType)type).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Storage interface"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingStorageInterface" @TValue="int">
@foreach(int usage in Enum.GetValues(typeof(StorageInterface)))
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int" Value="@usage">@(((StorageInterface)usage).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Nominal capacity (bytes)"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownStorageSize" @TValue="bool">@L["Unknown or empty (storage by machine nominal capacity)"]</Check>
@if(!_unknownStorageSize)
{
<Validation Validator="@ValidateStorageSize">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_addingStorageSize" Decimals="0" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid size for this storage."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddStorage" Color="Color.Primary" Disabled="@_savingStorage">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddStorage" Color="Color.Success" Disabled="@_savingStorage">@L["Add"]</Button>
</div>
}
2020-12-20 21:34:13 +00:00
@if(_machineStorage?.Count > 0)
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Type"]
</th>
<th>
@L["Interface"]
</th>
<th>
@L["Nominal capacity"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _machineStorage)
{
<tr>
<td>
@item.Type
</td>
<td>
@item.Interface
</td>
<td>
2020-12-20 21:34:13 +00:00
@if(item.Capacity.HasValue)
{
@string.Format(L["{0} bytes"], item.Capacity)
}
else
{
@L["Unknown or empty (storage by machine nominal capacity)"]
}
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowStorageDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingStorage">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
<hr />
<h3>@L["Screens attached to this machine"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddScreenClick" Color="Color.Success" Disabled="_addingScreen">@L["Add new (screen by machine)"]</Button>
@if(_addingScreen)
{
<div>
<Field>
<FieldLabel>@L["Screens"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingScreenId" Disabled="_savingScreen" @TValue="int?">
@foreach(var screen in _screens)
{
2020-12-20 21:34:13 +00:00
if(_machineScreens.All(s => s.ScreenId != screen.Id))
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@screen.Id">@string.Format(L["{0}\" with a native resolution of {1}"], screen.Diagonal, screen.NativeResolution)</SelectItem>
}
}
</Select>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddScreen" Color="Color.Primary" Disabled="@_savingScreen">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddScreen" Color="Color.Success" Disabled="@_savingScreen">@L["Add"]</Button>
</Field>
</div>
}
2020-12-20 21:34:13 +00:00
@if(_machineScreens?.Count > 0)
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Diagonal"]
</th>
<th>
@L["Width"]
</th>
<th>
@L["Height"]
</th>
<th>
@L["Type"]
</th>
<th>
@L["Effective colors"]
</th>
<th>
@L["Native resolution"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _machineScreens)
{
<tr>
<td>
@item.Screen.Diagonal
</td>
<td>
@item.Screen.Width
</td>
<td>
@item.Screen.Height
</td>
<td>
@item.Screen.Type
</td>
<td>
@item.Screen.EffectiveColors
</td>
<td>
@item.Screen.NativeResolution
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowScreenDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingScreen">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
2020-12-20 21:34:13 +00:00
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@_deleteTitle</ModalTitle>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
2020-12-20 21:34:13 +00:00
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
2020-05-31 05:51:06 +01:00
@if(_photos.Count > 0)
{
2020-12-20 21:34:13 +00:00
foreach(var photo in _photos)
2020-05-31 05:51:06 +01:00
{
<div class="col-md-2">
<figure class="figure">
<picture>
2020-12-20 21:34:13 +00:00
<source srcset="/assets/photos/machines/thumbs/avif/hd/@(photo).avif, /assets/photos/machines/thumbs/avif/1440p/@(photo).avif 2x, /assets/photos/machines/thumbs/avif/4k/@(photo).avif 3x" type="image/avif">
<source srcset="/assets/photos/machines/thumbs/heif/hd/@(photo).heic, /assets/photos/machines/thumbs/heif/1440p/@(photo).heic 2x, /assets/photos/machines/thumbs/heif/4k/@(photo).heic 3x" type="image/heic">
<source srcset="/assets/photos/machines/thumbs/webp/hd/@(photo).webp, /assets/photos/machines/thumbs/webp/1440p/@(photo).webp 2x, /assets/photos/machines/thumbs/webp/4k/@(photo).webp 3x" type="image/webp">
<source srcset="/assets/photos/machines/thumbs/jp2k/hd/@(photo).jp2, /assets/photos/machines/thumbs/jp2k/1440p/@(photo).jp2 2x, /assets/photos/machines/thumbs/jp2k/4k/@(photo).jp2 3x" type="image/jp2">
<img alt="" class="figure-img img-fluid rounded" height="auto" src="/assets/photos/machines/thumbs/jpeg/hd/@(photo).jpg" srcset="/assets/photos/machines/thumbs/jpeg/hd/@(photo).jpg, /assets/photos/machines/thumbs/jpeg/1440p/@(photo).jpg 2x, /assets/photos/machines/thumbs/jpeg/4k/@(photo).jpg 3x" style="max-height: 256px; max-width: 256px" width="auto" />
2020-05-31 05:51:06 +01:00
</picture>
<figcaption class="figure-caption">
2020-12-20 21:34:13 +00:00
<a href="/admin/machines/photo/details/@photo" target="_blank">@L["Details"]</a>
</figcaption>
2020-05-31 05:51:06 +01:00
</figure>
</div>
}
}
}