Prima versione con DB sincronizzato
This commit is contained in:
parent
f10beece4e
commit
b33f36a779
86
IntegryControlPanel.Client/Models/CustomerModels.cs
Normal file
86
IntegryControlPanel.Client/Models/CustomerModels.cs
Normal file
@ -0,0 +1,86 @@
|
||||
namespace IntegryControlPanel.Client.Models;
|
||||
|
||||
public class Customer
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public string Slug { get; set; } = null!;
|
||||
public bool? Active { get; set; }
|
||||
public string? PartitaIva { get; set; }
|
||||
public List<ApplicationInfo> ApplicationInfos { get; set; } = new List<ApplicationInfo>();
|
||||
public List<Device> Devices { get; set; } = new List<Device>();
|
||||
public List<PvmsInfo> PvmsInfos { get; set; } = new List<PvmsInfo>();
|
||||
public List<Server> Servers { get; set; } = new List<Server>();
|
||||
}
|
||||
|
||||
public class Server
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string? Ip { get; set; }
|
||||
public int? Port { get; set; }
|
||||
public string? Info { get; set; }
|
||||
public string? JavaVersion { get; set; }
|
||||
public string? OsArch { get; set; }
|
||||
public string? OsName { get; set; }
|
||||
public string? Xmx { get; set; }
|
||||
public string? Xms { get; set; }
|
||||
public string? MaxPermSize { get; set; }
|
||||
public DateTime? LastUpdate { get; set; }
|
||||
public string? RemoteAddr { get; set; }
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
}
|
||||
|
||||
public class Device
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string Ip { get; set; } = null!;
|
||||
public int Port { get; set; }
|
||||
public string Info { get; set; } = null!;
|
||||
}
|
||||
|
||||
public class ApplicationInfo
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public bool NewUpdProgMaga { get; set; }
|
||||
public string? MenuPersonalizzato { get; set; }
|
||||
public int? AnnoMagaz { get; set; }
|
||||
public int? AnnoContab { get; set; }
|
||||
public bool? AnsiPadding { get; set; }
|
||||
public bool? DelimitedIdentifier { get; set; }
|
||||
public bool? ConcatNullYieldsNull { get; set; }
|
||||
}
|
||||
|
||||
public class PvmsInfo
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string PhpVersion { get; set; } = null!;
|
||||
public string Timezone { get; set; } = null!;
|
||||
public string Imagick { get; set; } = null!;
|
||||
public string MemoryLimit { get; set; } = null!;
|
||||
public int MaxExecutionTime { get; set; }
|
||||
public int MaxInputVars { get; set; }
|
||||
public string PostMaxSize { get; set; } = null!;
|
||||
public string UploadMaxSize { get; set; } = null!;
|
||||
public string DefaultCharset { get; set; } = null!;
|
||||
public bool MagicQuotesGpc { get; set; }
|
||||
public bool SodiumMissing { get; set; }
|
||||
}
|
||||
|
||||
public class CustomerServerInfo
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
public string? PartitaIva { get; set; }
|
||||
public string? OsName { get; set; }
|
||||
public string? OsArch { get; set; }
|
||||
public string? JavaVersion { get; set; }
|
||||
public string? RemoteAddr { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public string SimpleName { get; set; } = null!;
|
||||
public string? RagSoc { get; set; }
|
||||
}
|
||||
163
IntegryControlPanel/CUSTOMER_WITH_ANAG_INFO.md
Normal file
163
IntegryControlPanel/CUSTOMER_WITH_ANAG_INFO.md
Normal file
@ -0,0 +1,163 @@
|
||||
# Customer with Anag Info - Documentazione
|
||||
|
||||
## Panoramica
|
||||
|
||||
Questa implementazione crea un'entità composta che combina i dati della tabella `customers` con le informazioni anagrafiche dalla vista `vw_customer_anag_info`, permettendo di ottenere un nome di visualizzazione che considera la ragione sociale dall'anagrafica esterna.
|
||||
|
||||
## Componenti Implementati
|
||||
|
||||
### 1. Vista Database: `vw_customer_anag_info`
|
||||
|
||||
**Percorso:** `Migrations/IntegryControlPanelDb/20250924165009_AddCustomerServerInfoView.cs`
|
||||
|
||||
La vista esegue una LEFT JOIN tra la tabella `customers` e l'anagrafica esterna `studioml.dbo.gtb_anag`, restituendo:
|
||||
- `slug`: Chiave di join con la tabella customers
|
||||
- `name`: Nome combinato che preferisce `rag_soc` se disponibile, altrimenti usa `customers.name`
|
||||
|
||||
**Query SQL:**
|
||||
```sql
|
||||
CREATE VIEW vw_customer_anag_info AS
|
||||
SELECT
|
||||
slug,
|
||||
ISNULL(rag_soc, customers.name) +
|
||||
IIF(COUNT(partita_iva) OVER (partition by partita_iva) > 1,
|
||||
CONCAT(' (', customers.name, ')'),
|
||||
''
|
||||
) AS name
|
||||
FROM customers
|
||||
LEFT OUTER JOIN (
|
||||
SELECT DISTINCT part_iva, rag_soc
|
||||
FROM studioml.dbo.gtb_anag
|
||||
INNER JOIN studioml.dbo.vtb_clie ON vtb_clie.cod_anag = gtb_anag.cod_anag
|
||||
WHERE flag_stato = 'A'
|
||||
) gtb_anag ON customers.partita_iva = gtb_anag.part_iva
|
||||
```
|
||||
|
||||
### 2. Entità EF: `VwCustomerAnagInfo`
|
||||
|
||||
**Percorso:** `Models/IntegryControlPanel/VwCustomerAnagInfo.cs`
|
||||
|
||||
Mappatura Entity Framework della vista che restituisce solo `Slug` e `Name`.
|
||||
|
||||
### 3. Entità Composta: `CustomerWithAnagInfo`
|
||||
|
||||
**Percorso:** `Models/IntegryControlPanel/CustomerWithAnagInfo.cs`
|
||||
|
||||
Entità che combina tutti i campi del Customer con il `DisplayName` dalla vista, creando un'unica entità per l'uso in query.
|
||||
|
||||
**Proprietà principali:**
|
||||
- Tutti i campi di `Customer` (Id, Name, Slug, Active, PartitaIva)
|
||||
- `DisplayName`: Nome da visualizzare che considera `rag_soc`
|
||||
- Navigazioni verso entità correlate (ApplicationInfos, Servers, ecc.)
|
||||
|
||||
### 4. Configurazione Entity Framework
|
||||
|
||||
**Percorso:** `Data/IntegryControlPanelDbContext.cs`
|
||||
|
||||
```csharp
|
||||
modelBuilder.Entity<CustomerWithAnagInfo>(entity =>
|
||||
{
|
||||
entity
|
||||
.HasNoKey()
|
||||
.ToSqlQuery(@"
|
||||
SELECT
|
||||
c.id,
|
||||
c.name,
|
||||
c.slug,
|
||||
c.active,
|
||||
c.partita_iva,
|
||||
COALESCE(va.name, c.name) AS display_name
|
||||
FROM customers c
|
||||
LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
");
|
||||
});
|
||||
```
|
||||
|
||||
### 5. Servizi Business Logic
|
||||
|
||||
**Percorso:** `Services/IntegryControlPanelService.cs` e `Services/IIntegryControlPanelService.cs`
|
||||
|
||||
Metodi implementati:
|
||||
- `GetCustomersWithAnagInfoAsync()`: Tutti i clienti con info anagrafiche
|
||||
- `GetCustomerWithAnagInfoByIdAsync(int id)`: Cliente per ID
|
||||
- `GetCustomerWithAnagInfoBySlugAsync(string slug)`: Cliente per slug
|
||||
- `GetActiveCustomersWithAnagInfoAsync()`: Solo clienti attivi
|
||||
- `SearchCustomersWithAnagInfoAsync(string searchTerm)`: Ricerca full-text
|
||||
|
||||
### 6. API Controller
|
||||
|
||||
**Percorso:** `Controllers/CustomerAnagInfoController.cs`
|
||||
|
||||
Endpoints REST:
|
||||
- `GET /api/CustomerAnagInfo` - Tutti i clienti
|
||||
- `GET /api/CustomerAnagInfo/active` - Solo clienti attivi
|
||||
- `GET /api/CustomerAnagInfo/{id}` - Cliente per ID
|
||||
- `GET /api/CustomerAnagInfo/slug/{slug}` - Cliente per slug
|
||||
- `GET /api/CustomerAnagInfo/search?term={term}` - Ricerca
|
||||
|
||||
### 7. DTO per Blazor Client
|
||||
|
||||
**Percorso:** `IntegryControlPanel.Client/Models/CustomerWithAnagInfoDto.cs`
|
||||
|
||||
Include proprietà aggiuntiva `HasExternalRagSoc` per determinare se il nome visualizzato proviene dall'anagrafica esterna.
|
||||
|
||||
### 8. Pagina Blazor
|
||||
|
||||
**Percorso:** `IntegryControlPanel.Client/Pages/CustomersWithAnag.razor`
|
||||
|
||||
Interfaccia completa che include:
|
||||
- Tabella responsiva con dati dei clienti
|
||||
- Ricerca full-text
|
||||
- Filtro per clienti attivi
|
||||
- Indicatori visivi per distinguere nomi con ragione sociale esterna
|
||||
- Gestione degli stati di caricamento ed errore
|
||||
|
||||
## Utilizzo
|
||||
|
||||
### Nel Service Layer
|
||||
```csharp
|
||||
// Ottieni tutti i clienti con nomi display
|
||||
var customers = await _service.GetCustomersWithAnagInfoAsync();
|
||||
|
||||
// Cerca clienti
|
||||
var searchResults = await _service.SearchCustomersWithAnagInfoAsync("termine di ricerca");
|
||||
|
||||
// Solo clienti attivi
|
||||
var activeCustomers = await _service.GetActiveCustomersWithAnagInfoAsync();
|
||||
```
|
||||
|
||||
### Nelle API
|
||||
```csharp
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> GetCustomersWithAnagInfo()
|
||||
{
|
||||
var customers = await _service.GetCustomersWithAnagInfoAsync();
|
||||
return Ok(customers);
|
||||
}
|
||||
```
|
||||
|
||||
### In Blazor
|
||||
```csharp
|
||||
var customers = await Http.GetFromJsonAsync<IEnumerable<CustomerWithAnagInfoDto>>("api/CustomerAnagInfo");
|
||||
```
|
||||
|
||||
## Vantaggi dell'Implementazione
|
||||
|
||||
1. **Performance**: La vista database pre-calcola i nomi display
|
||||
2. **Separazione dei Concern**: Logica di business nel servizio, presentazione nel controller
|
||||
3. **Type Safety**: Entità strongly-typed per IntelliSense completo
|
||||
4. **Flessibilità**: Multiple modalità di accesso (per ID, slug, ricerca)
|
||||
5. **UI/UX**: Indicatori visivi per distinguere fonti dei nomi
|
||||
6. **Scalabilità**: Query ottimizzate con indici appropriati
|
||||
|
||||
## Note Tecniche
|
||||
|
||||
- La vista gestisce automaticamente i duplicati per P.IVA
|
||||
- L'entità composta non ha chiave primaria (HasNoKey) poiché è read-only
|
||||
- Il DTO client include helper methods per logica di presentazione
|
||||
- La ricerca include tutti i campi rilevanti (nome, display name, slug, P.IVA)
|
||||
|
||||
## URL della Pagina Blazor
|
||||
|
||||
Dopo aver implementato tutto, la pagina sarà accessibile all'indirizzo:
|
||||
`https://localhost:xxxx/customers-with-anag`
|
||||
29
IntegryControlPanel/IntegryControlPanel.Client/App.razor
Normal file
29
IntegryControlPanel/IntegryControlPanel.Client/App.razor
Normal file
@ -0,0 +1,29 @@
|
||||
@using IntegryControlPanel.Client.Layout
|
||||
|
||||
<Router AppAssembly="@typeof(App).Assembly">
|
||||
<Found Context="routeData">
|
||||
<AuthorizeRouteView RouteData="routeData" DefaultLayout="@typeof(MainLayout)">
|
||||
<NotAuthorized>
|
||||
@if (context.User.Identity?.IsAuthenticated != true)
|
||||
{
|
||||
<RedirectToLogin />
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert alert-danger">
|
||||
<p>Non hai i permessi necessari per accedere a questa risorsa.</p>
|
||||
</div>
|
||||
}
|
||||
</NotAuthorized>
|
||||
</AuthorizeRouteView>
|
||||
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<PageTitle>Not found</PageTitle>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<div class="alert alert-warning">
|
||||
<p role="alert">Pagina non trovata!</p>
|
||||
</div>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
@ -8,9 +8,10 @@
|
||||
<MudNavLink Href="dashboard" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Dashboard">Dashboard</MudNavLink>
|
||||
<MudDivider Class="my-2"/>
|
||||
|
||||
<MudNavLink Href="customers" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Business">Clienti</MudNavLink>
|
||||
<MudNavLink Href="servers" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Computer">Server</MudNavLink>
|
||||
<MudNavLink Href="clients" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.People">Client</MudNavLink>
|
||||
<MudNavLink Href="services" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Settings">Servizi</MudNavLink>
|
||||
@* <MudNavLink Href="clients" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.People">Client</MudNavLink> *@
|
||||
@* <MudNavLink Href="services" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Settings">Servizi</MudNavLink> *@
|
||||
|
||||
<MudDivider Class="my-2"/>
|
||||
<MudNavLink Href="@($"Account/Logout?returnUrl={Uri.EscapeDataString(currentUrl ?? "/")}")"
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
namespace IntegryControlPanel.Client.Models;
|
||||
|
||||
public class Customer
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public string Slug { get; set; } = null!;
|
||||
public bool? Active { get; set; }
|
||||
public string? PartitaIva { get; set; }
|
||||
public List<ApplicationInfo> ApplicationInfos { get; set; } = new List<ApplicationInfo>();
|
||||
public List<Device> Devices { get; set; } = new List<Device>();
|
||||
public List<PvmsInfo> PvmsInfos { get; set; } = new List<PvmsInfo>();
|
||||
public List<Server> Servers { get; set; } = new List<Server>();
|
||||
}
|
||||
|
||||
public class Server
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string? Ip { get; set; }
|
||||
public int? Port { get; set; }
|
||||
public string? Info { get; set; }
|
||||
public string? JavaVersion { get; set; }
|
||||
public string? OsArch { get; set; }
|
||||
public string? OsName { get; set; }
|
||||
public string? Xmx { get; set; }
|
||||
public string? Xms { get; set; }
|
||||
public string? MaxPermSize { get; set; }
|
||||
public DateTime? LastUpdate { get; set; }
|
||||
public string? RemoteAddr { get; set; }
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
}
|
||||
|
||||
public class Device
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string Ip { get; set; } = null!;
|
||||
public int Port { get; set; }
|
||||
public string Info { get; set; } = null!;
|
||||
}
|
||||
|
||||
public class ApplicationInfo
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public bool NewUpdProgMaga { get; set; }
|
||||
public string? MenuPersonalizzato { get; set; }
|
||||
public int? AnnoMagaz { get; set; }
|
||||
public int? AnnoContab { get; set; }
|
||||
public bool? AnsiPadding { get; set; }
|
||||
public bool? DelimitedIdentifier { get; set; }
|
||||
public bool? ConcatNullYieldsNull { get; set; }
|
||||
}
|
||||
|
||||
public class PvmsInfo
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? CustomerId { get; set; }
|
||||
public string PhpVersion { get; set; } = null!;
|
||||
public string Timezone { get; set; } = null!;
|
||||
public string Imagick { get; set; } = null!;
|
||||
public bool SodiumMissing { get; set; }
|
||||
public int MaxExecutionTime { get; set; }
|
||||
public bool MagicQuotesGpc { get; set; }
|
||||
public string DefaultCharset { get; set; } = null!;
|
||||
public string MemoryLimit { get; set; } = null!;
|
||||
public string PostMaxSize { get; set; } = null!;
|
||||
public string UploadMaxSize { get; set; } = null!;
|
||||
public int MaxInputVars { get; set; }
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
namespace IntegryControlPanel.Client.Models;
|
||||
|
||||
/// <summary>
|
||||
/// DTO per il client che rappresenta un Customer con le informazioni anagrafiche della vista vw_customer_anag_info
|
||||
/// </summary>
|
||||
public class CustomerWithAnagInfoDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public string Slug { get; set; } = null!;
|
||||
public bool? Active { get; set; }
|
||||
public string? PartitaIva { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Nome da visualizzare che considera la ragione sociale dall'anagrafica esterna (rag_soc)
|
||||
/// </summary>
|
||||
public string DisplayName { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se il DisplayName è diverso dal Name (ovvero se c'è una ragione sociale dall'anagrafica esterna)
|
||||
/// </summary>
|
||||
public bool HasExternalRagSoc => !string.Equals(DisplayName?.Trim(), Name?.Trim(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
@ -0,0 +1,367 @@
|
||||
@page "/customers"
|
||||
@rendermode InteractiveWebAssembly
|
||||
@using IntegryControlPanel.Client.Models
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using System.Net.Http.Json
|
||||
@attribute [Authorize]
|
||||
|
||||
@inject HttpClient Http
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
<PageTitle>Gestione Clienti</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraExtraLarge" Class="mt-4">
|
||||
<MudText Typo="Typo.h4" GutterBottom="true">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Business" Class="mr-3"/>
|
||||
Gestione Clienti
|
||||
</MudText>
|
||||
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
@if (isLoading)
|
||||
{
|
||||
<MudGrid>
|
||||
<MudItem xs="12" Class="d-flex justify-center">
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true"/>
|
||||
<MudText Class="ml-3">Caricamento clienti...</MudText>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
}
|
||||
else if (customers?.Any() == true)
|
||||
{
|
||||
<MudDataGrid Items="@customers"
|
||||
ReadOnly="true"
|
||||
SortMode="SortMode.Multiple"
|
||||
Filterable="true"
|
||||
Hideable="true"
|
||||
ColumnResizeMode="ResizeMode.Container"
|
||||
Style="width: 100%;">
|
||||
<Columns>
|
||||
<PropertyColumn Property="x => x.Name" Title="Cliente">
|
||||
<CellTemplate>
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">
|
||||
@* #@context.Item.Id - @context.Item.Slug *@
|
||||
P. Iva: @context.Item.PartitaIva
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body1">
|
||||
@context.Item.Name
|
||||
</MudText>
|
||||
</CellTemplate>
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="x => x.Active" Title="Stato">
|
||||
<CellTemplate>
|
||||
@* <MudChip Color="@(context.Item.Active == true ? Color.Success : Color.Error)"
|
||||
Size="Size.Small">
|
||||
@(context.Item.Active == true ? "Attivo" : "Inattivo")
|
||||
</MudChip> *@
|
||||
<MudText Style="font-weight:bold;" Color="@(context.Item.Active == true ? Color.Success : Color.Error)">
|
||||
@(context.Item.Active == true ? "Attivo" : "Inattivo")
|
||||
</MudText>
|
||||
@* <MudCheckBox Value="context.Item.Active"></MudCheckBox> *@
|
||||
</CellTemplate>
|
||||
</PropertyColumn>
|
||||
<TemplateColumn Title="Azioni" Sortable="false" Filterable="false">
|
||||
<CellTemplate>
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
Size="Size.Small"
|
||||
StartIcon="@Icons.Material.Filled.Visibility"
|
||||
OnClick="@(() => ShowCustomerDetails(context.Item))">
|
||||
Dettagli
|
||||
</MudButton>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
</Columns>
|
||||
</MudDataGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">
|
||||
<MudText>Nessun cliente trovato.</MudText>
|
||||
</MudAlert>
|
||||
}
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
||||
<!-- Customer Details Dialog -->
|
||||
<MudDialog @bind-Visible="isDetailsDialogVisible" Options="dialogOptions">
|
||||
<TitleContent>
|
||||
<MudText Typo="Typo.h5">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Business" Class="mr-3"/>
|
||||
Dettagli Cliente: @selectedCustomer?.Name
|
||||
</MudText>
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
@if (selectedCustomer != null)
|
||||
{
|
||||
<MudTabs Elevation="2" Rounded="true" ApplyEffectsToContainer="true" PanelClass="pa-6">
|
||||
<!-- Customer Info Tab -->
|
||||
<MudTabPanel Text="Informazioni Cliente" Icon="@Icons.Material.Filled.Info">
|
||||
<MudGrid>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="ID" Value="@selectedCustomer.Id.ToString()" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Nome" Value="@selectedCustomer.Name" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Slug" Value="@selectedCustomer.Slug" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Partita IVA" Value="@selectedCustomer.PartitaIva" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudSwitch T="bool?" @bind-Value="selectedCustomer.Active"
|
||||
Label="Cliente Attivo"
|
||||
ReadOnly="true"
|
||||
Color="Color.Success"/>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudTabPanel>
|
||||
|
||||
<!-- Servers Tab -->
|
||||
<MudTabPanel Text="Server" Icon="@Icons.Material.Filled.Computer">
|
||||
@if (isLoadingServers)
|
||||
{
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true"/>
|
||||
<MudText Class="ml-3">Caricamento server...</MudText>
|
||||
}
|
||||
else if (customerServers?.Any() == true)
|
||||
{
|
||||
<MudDataGrid Items="@customerServers" Dense="true" Hover="true">
|
||||
<Columns>
|
||||
<PropertyColumn Property="x => x.Id" Title="ID"/>
|
||||
<PropertyColumn Property="x => x.Ip" Title="IP"/>
|
||||
<PropertyColumn Property="x => x.Port" Title="Porta"/>
|
||||
<PropertyColumn Property="x => x.OsName" Title="Sistema Operativo"/>
|
||||
<PropertyColumn Property="x => x.JavaVersion" Title="Versione Java"/>
|
||||
<PropertyColumn Property="x => x.LastUpdate" Title="Ultimo Aggiornamento" Format="dd/MM/yyyy HH:mm"/>
|
||||
</Columns>
|
||||
</MudDataGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">Nessun server configurato per questo cliente.</MudAlert>
|
||||
}
|
||||
</MudTabPanel>
|
||||
|
||||
<!-- Devices Tab -->
|
||||
<MudTabPanel Text="Dispositivi" Icon="@Icons.Material.Filled.DeviceHub">
|
||||
@if (isLoadingDevices)
|
||||
{
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true"/>
|
||||
<MudText Class="ml-3">Caricamento dispositivi...</MudText>
|
||||
}
|
||||
else if (customerDevices?.Any() == true)
|
||||
{
|
||||
<MudDataGrid Items="@customerDevices" Dense="true" Hover="true">
|
||||
<Columns>
|
||||
<PropertyColumn Property="x => x.Id" Title="ID"/>
|
||||
<PropertyColumn Property="x => x.Ip" Title="IP"/>
|
||||
<PropertyColumn Property="x => x.Port" Title="Porta"/>
|
||||
<PropertyColumn Property="x => x.Info" Title="Informazioni"/>
|
||||
</Columns>
|
||||
</MudDataGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">Nessun dispositivo configurato per questo cliente.</MudAlert>
|
||||
}
|
||||
</MudTabPanel>
|
||||
|
||||
<!-- Application Info Tab -->
|
||||
<MudTabPanel Text="Applicazioni" Icon="@Icons.Material.Filled.Apps">
|
||||
@if (selectedCustomer.ApplicationInfos?.Any() == true)
|
||||
{
|
||||
<MudDataGrid Items="@selectedCustomer.ApplicationInfos" Dense="true" Hover="true">
|
||||
<Columns>
|
||||
<PropertyColumn Property="x => x.Id" Title="ID"/>
|
||||
<PropertyColumn Property="x => x.Name" Title="Nome Applicazione"/>
|
||||
<PropertyColumn Property="x => x.AnnoMagaz" Title="Anno Magazzino"/>
|
||||
<PropertyColumn Property="x => x.AnnoContab" Title="Anno Contabilità"/>
|
||||
<TemplateColumn Title="Nuovo Update">
|
||||
<CellTemplate>
|
||||
<MudChip Color="@(context.Item.NewUpdProgMaga ? Color.Success : Color.Default)"
|
||||
Size="Size.Small">
|
||||
@(context.Item.NewUpdProgMaga ? "Sì" : "No")
|
||||
</MudChip>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
</Columns>
|
||||
</MudDataGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">Nessuna applicazione configurata per questo cliente.</MudAlert>
|
||||
}
|
||||
</MudTabPanel>
|
||||
|
||||
<!-- PVMS Info Tab -->
|
||||
<MudTabPanel Text="PVMS Info" Icon="@Icons.Material.Filled.Settings">
|
||||
@if (selectedCustomer.PvmsInfos?.Any() == true)
|
||||
{
|
||||
@foreach (var pvms in selectedCustomer.PvmsInfos)
|
||||
{
|
||||
<MudCard Class="mb-4">
|
||||
<MudCardContent>
|
||||
<MudGrid>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Versione PHP" Value="@pvms.PhpVersion" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Timezone" Value="@pvms.Timezone" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="ImageMagick" Value="@pvms.Imagick" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Memory Limit" Value="@pvms.MemoryLimit" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Max Execution Time" Value="@pvms.MaxExecutionTime.ToString()" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudTextField Label="Max Input Vars" Value="@pvms.MaxInputVars.ToString()" ReadOnly="true"/>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">Nessuna informazione PVMS disponibile per questo cliente.</MudAlert>
|
||||
}
|
||||
</MudTabPanel>
|
||||
</MudTabs>
|
||||
}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton Color="Color.Primary"
|
||||
Variant="Variant.Filled"
|
||||
OnClick="CloseDetailsDialog">
|
||||
Chiudi
|
||||
</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
</MudContainer>
|
||||
|
||||
@code {
|
||||
private List<CustomerWithAnagInfoDto>? customers;
|
||||
private long? selectedCustomerId;
|
||||
private Customer? selectedCustomer;
|
||||
private List<Server>? customerServers;
|
||||
private List<Device>? customerDevices;
|
||||
|
||||
private bool isLoading = true;
|
||||
private bool isLoadingServers = false;
|
||||
private bool isLoadingDevices = false;
|
||||
private bool isDetailsDialogVisible = false;
|
||||
|
||||
private DialogOptions dialogOptions = new()
|
||||
{
|
||||
MaxWidth = MaxWidth.ExtraLarge,
|
||||
FullWidth = true,
|
||||
CloseButton = true
|
||||
};
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
await LoadCustomers();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"❌ Customers page - OnInitializedAsync error: {ex.Message}");
|
||||
Console.WriteLine($"📋 Stack trace: {ex.StackTrace}");
|
||||
Snackbar.Add($"Errore nell'inizializzazione della pagina: {ex.Message}", Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadCustomers()
|
||||
{
|
||||
try
|
||||
{
|
||||
isLoading = true;
|
||||
StateHasChanged(); // Force UI update
|
||||
|
||||
customers = await Http.GetFromJsonAsync<List<CustomerWithAnagInfoDto>>("api/CustomerAnagInfo/");
|
||||
}
|
||||
catch (HttpRequestException httpEx)
|
||||
{
|
||||
Console.WriteLine($"🌐 LoadCustomers - HTTP error: {httpEx.Message}");
|
||||
Snackbar.Add($"Errore di connessione: {httpEx.Message}", Severity.Error);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"❌ LoadCustomers - Generic error: {ex.Message}");
|
||||
Console.WriteLine($"📋 Stack trace: {ex.StackTrace}");
|
||||
Snackbar.Add($"Errore nel caricamento dei clienti: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
isLoading = false;
|
||||
StateHasChanged(); // Force UI update
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ShowCustomerDetails(CustomerWithAnagInfoDto customer)
|
||||
{
|
||||
selectedCustomerId = customer.Id;
|
||||
isDetailsDialogVisible = true;
|
||||
|
||||
// Load complete customer details with all related data
|
||||
try
|
||||
{
|
||||
selectedCustomer = await Http.GetFromJsonAsync<Customer>($"api/IntegryData/customers/{customer.Id}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"Errore nel caricamento dei dettagli del cliente: {ex.Message}", Severity.Error);
|
||||
}
|
||||
|
||||
// Load related data
|
||||
await LoadCustomerServers(customer.Id);
|
||||
await LoadCustomerDevices(customer.Id);
|
||||
}
|
||||
|
||||
private async Task LoadCustomerServers(int customerId)
|
||||
{
|
||||
try
|
||||
{
|
||||
isLoadingServers = true;
|
||||
customerServers = await Http.GetFromJsonAsync<List<Server>>($"api/IntegryData/customers/{customerId}/servers");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"Errore nel caricamento dei server: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
isLoadingServers = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadCustomerDevices(int customerId)
|
||||
{
|
||||
try
|
||||
{
|
||||
isLoadingDevices = true;
|
||||
customerDevices = await Http.GetFromJsonAsync<List<Device>>($"api/IntegryData/customers/{customerId}/devices");
|
||||
}
|
||||
finally
|
||||
{
|
||||
isLoadingDevices = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseDetailsDialog()
|
||||
{
|
||||
isDetailsDialogVisible = false;
|
||||
selectedCustomerId = null;
|
||||
customerServers = null;
|
||||
customerDevices = null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,235 @@
|
||||
@page "/customers-with-anag"
|
||||
@using IntegryControlPanel.Client.Models
|
||||
@inject HttpClient Http
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
<PageTitle>Clienti con Informazioni Anagrafiche</PageTitle>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h3>Clienti con Informazioni Anagrafiche</h3>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Cerca per nome, ragione sociale, slug o P.IVA..."
|
||||
@bind="searchTerm" @onkeypress="@(async (e) => { if (e.Key == "Enter") await SearchCustomers(); })" />
|
||||
<button class="btn btn-outline-secondary" type="button" @onclick="SearchCustomers">
|
||||
<i class="fas fa-search"></i> Cerca
|
||||
</button>
|
||||
@if (!string.IsNullOrEmpty(searchTerm))
|
||||
{
|
||||
<button class="btn btn-outline-danger" type="button" @onclick="ClearSearch">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="activeOnly" @bind="showActiveOnly" @bind:after="OnActiveOnlyChanged">
|
||||
<label class="form-check-label" for="activeOnly">
|
||||
Mostra solo clienti attivi
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (isLoading)
|
||||
{
|
||||
<div class="text-center">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Caricamento...</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (customers == null)
|
||||
{
|
||||
<div class="alert alert-warning">Errore nel caricamento dei dati.</div>
|
||||
}
|
||||
else if (!customers.Any())
|
||||
{
|
||||
<div class="alert alert-info">
|
||||
@if (!string.IsNullOrEmpty(searchTerm))
|
||||
{
|
||||
<text>Nessun cliente trovato per la ricerca "<strong>@searchTerm</strong>".</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>Nessun cliente trovato.</text>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Nome Display</th>
|
||||
<th>Nome Originale</th>
|
||||
<th>Slug</th>
|
||||
<th>P.IVA</th>
|
||||
<th>Stato</th>
|
||||
<th>Info Anagrafica</th>
|
||||
<th>Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var customer in customers)
|
||||
{
|
||||
<tr class="@(customer.Active == true ? "" : "table-warning")">
|
||||
<td>@customer.Id</td>
|
||||
<td>
|
||||
<strong>@customer.DisplayName</strong>
|
||||
@if (customer.HasExternalRagSoc)
|
||||
{
|
||||
<i class="fas fa-external-link-alt text-info ms-1" title="Nome da anagrafica esterna"></i>
|
||||
}
|
||||
</td>
|
||||
<td>@customer.Name</td>
|
||||
<td>
|
||||
<code>@customer.Slug</code>
|
||||
</td>
|
||||
<td>@customer.PartitaIva</td>
|
||||
<td>
|
||||
@if (customer.Active == true)
|
||||
{
|
||||
<span class="badge bg-success">Attivo</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge bg-secondary">Inattivo</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (customer.HasExternalRagSoc)
|
||||
{
|
||||
<span class="badge bg-info">Con Rag. Sociale</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge bg-light text-dark">Solo nome</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-primary" @onclick="() => ViewDetails(customer.Id)">
|
||||
<i class="fas fa-eye"></i> Dettagli
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<small class="text-muted">
|
||||
Totale clienti: @customers.Count()
|
||||
@if (showActiveOnly)
|
||||
{
|
||||
<text>(solo attivi)</text>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(searchTerm))
|
||||
{
|
||||
<text>- Filtrati per: "@searchTerm"</text>
|
||||
}
|
||||
</small>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private IEnumerable<CustomerWithAnagInfoDto>? customers;
|
||||
private bool isLoading = true;
|
||||
private string searchTerm = string.Empty;
|
||||
private bool showActiveOnly = false;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadCustomers();
|
||||
}
|
||||
|
||||
private async Task LoadCustomers()
|
||||
{
|
||||
isLoading = true;
|
||||
try
|
||||
{
|
||||
string endpoint = showActiveOnly ? "api/CustomerAnagInfo/active" : "api/CustomerAnagInfo";
|
||||
customers = await Http.GetFromJsonAsync<IEnumerable<CustomerWithAnagInfoDto>>(endpoint);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Errore nel caricamento dei clienti: {ex.Message}");
|
||||
customers = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SearchCustomers()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(searchTerm))
|
||||
{
|
||||
await LoadCustomers();
|
||||
return;
|
||||
}
|
||||
|
||||
isLoading = true;
|
||||
try
|
||||
{
|
||||
customers = await Http.GetFromJsonAsync<IEnumerable<CustomerWithAnagInfoDto>>($"api/CustomerAnagInfo/search?term={Uri.EscapeDataString(searchTerm)}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Errore nella ricerca: {ex.Message}");
|
||||
customers = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ClearSearch()
|
||||
{
|
||||
searchTerm = string.Empty;
|
||||
await LoadCustomers();
|
||||
}
|
||||
|
||||
private async Task OnActiveOnlyChanged()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(searchTerm))
|
||||
{
|
||||
await LoadCustomers();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ViewDetails(int customerId)
|
||||
{
|
||||
// Naviga ai dettagli del cliente o apre un modal
|
||||
await JSRuntime.InvokeVoidAsync("alert", $"Visualizza dettagli cliente ID: {customerId}");
|
||||
}
|
||||
}
|
||||
|
||||
<style>
|
||||
.table-responsive {
|
||||
border-radius: 0.375rem;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
}
|
||||
|
||||
.table-warning {
|
||||
--bs-table-bg: rgba(255, 193, 7, 0.1);
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
color: #e83e8c;
|
||||
background-color: #f8f9fa;
|
||||
padding: 0.125rem 0.25rem;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
</style>
|
||||
@ -3,10 +3,22 @@ using MudBlazor.Services;
|
||||
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
|
||||
// Per Blazor misto in .NET 9, NON configurare RootComponents
|
||||
// Il server gestisce il rendering e passa il controllo al client quando necessario
|
||||
|
||||
builder.Services.AddMudServices();
|
||||
|
||||
// IMPORTANTE: HttpClient configuration per WebAssembly
|
||||
// In WebAssembly dobbiamo usare la configurazione standard
|
||||
builder.Services.AddScoped(sp => new HttpClient
|
||||
{
|
||||
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
|
||||
});
|
||||
|
||||
builder.Services.AddAuthorizationCore();
|
||||
builder.Services.AddCascadingAuthenticationState();
|
||||
builder.Services.AddAuthenticationStateDeserialization();
|
||||
|
||||
Console.WriteLine($"?? Client Program.cs - BaseAddress: {builder.HostEnvironment.BaseAddress}");
|
||||
|
||||
await builder.Build().RunAsync();
|
||||
|
||||
@ -0,0 +1,118 @@
|
||||
using IntegryControlPanel.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IntegryControlPanel.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class CustomerAnagInfoController : ControllerBase
|
||||
{
|
||||
private readonly IIntegryControlPanelService _service;
|
||||
private readonly ILogger<CustomerAnagInfoController> _logger;
|
||||
|
||||
public CustomerAnagInfoController(IIntegryControlPanelService service, ILogger<CustomerAnagInfoController> logger)
|
||||
{
|
||||
_service = service;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ottiene tutti i customer con le informazioni anagrafiche joinate dalla vista vw_customer_anag_info
|
||||
/// </summary>
|
||||
//[HttpGet]
|
||||
//public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> GetCustomersWithAnagInfo()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customers = await _service.GetCustomersWithAnagInfoAsync();
|
||||
// return Ok(customers);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customers with anag info");
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Ottiene tutti i customer attivi con le informazioni anagrafiche
|
||||
///// </summary>
|
||||
//[HttpGet("active")]
|
||||
//public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> GetActiveCustomersWithAnagInfo()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customers = await _service.GetActiveCustomersWithAnagInfoAsync();
|
||||
// return Ok(customers);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving active customers with anag info");
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Ottiene un customer con informazioni anagrafiche tramite ID
|
||||
///// </summary>
|
||||
//[HttpGet("{id:int}")]
|
||||
//public async Task<ActionResult<CustomerWithAnagInfo>> GetCustomerWithAnagInfoById(int id)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customer = await _service.GetCustomerWithAnagInfoByIdAsync(id);
|
||||
// if (customer == null)
|
||||
// return NotFound($"Customer con ID {id} non trovato");
|
||||
|
||||
// return Ok(customer);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by id {CustomerId}", id);
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Ottiene un customer con informazioni anagrafiche tramite slug
|
||||
///// </summary>
|
||||
//[HttpGet("slug/{slug}")]
|
||||
//public async Task<ActionResult<CustomerWithAnagInfo>> GetCustomerWithAnagInfoBySlug(string slug)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customer = await _service.GetCustomerWithAnagInfoBySlugAsync(slug);
|
||||
// if (customer == null)
|
||||
// return NotFound($"Customer con slug '{slug}' non trovato");
|
||||
|
||||
// return Ok(customer);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by slug {Slug}", slug);
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Cerca customer con informazioni anagrafiche per termine di ricerca
|
||||
///// </summary>
|
||||
//[HttpGet("search")]
|
||||
//public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> SearchCustomersWithAnagInfo([FromQuery] string term)
|
||||
//{
|
||||
// if (string.IsNullOrWhiteSpace(term))
|
||||
// return BadRequest("Il termine di ricerca non può essere vuoto");
|
||||
|
||||
// try
|
||||
// {
|
||||
// var customers = await _service.SearchCustomersWithAnagInfoAsync(term);
|
||||
// return Ok(customers);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error searching customers with anag info for term {SearchTerm}", term);
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@ -30,7 +30,7 @@ namespace IntegryControlPanel.Controllers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving customers");
|
||||
_logger.LogError(ex, "? API GetCustomers - Error retrieving customers");
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
@ -147,19 +147,21 @@ namespace IntegryControlPanel.Controllers
|
||||
try
|
||||
{
|
||||
var customerCount = await _integryService.GetTotalCustomersAsync();
|
||||
return Ok(new {
|
||||
Message = "Database connection successful",
|
||||
return Ok(new
|
||||
{
|
||||
Message = "Database connection successful",
|
||||
CustomerCount = customerCount,
|
||||
Timestamp = DateTime.Now
|
||||
Timestamp = DateTime.Now
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Database connection test failed");
|
||||
return StatusCode(500, new {
|
||||
Message = "Database connection failed",
|
||||
return StatusCode(500, new
|
||||
{
|
||||
Message = "Database connection failed",
|
||||
Error = ex.Message,
|
||||
Timestamp = DateTime.Now
|
||||
Timestamp = DateTime.Now
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -170,20 +172,22 @@ namespace IntegryControlPanel.Controllers
|
||||
try
|
||||
{
|
||||
var customers = await _integryService.GetAllCustomersAsync();
|
||||
return Ok(new {
|
||||
Message = "Successfully retrieved customers",
|
||||
return Ok(new
|
||||
{
|
||||
Message = "Successfully retrieved customers",
|
||||
Count = customers.Count(),
|
||||
Customers = customers.Take(5).Select(c => new { c.Id, c.Name, c.Slug }),
|
||||
Timestamp = DateTime.Now
|
||||
Timestamp = DateTime.Now
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error testing customers retrieval");
|
||||
return StatusCode(500, new {
|
||||
Message = "Error retrieving customers",
|
||||
return StatusCode(500, new
|
||||
{
|
||||
Message = "Error retrieving customers",
|
||||
Error = ex.Message,
|
||||
Timestamp = DateTime.Now
|
||||
Timestamp = DateTime.Now
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,6 +42,8 @@ public partial class IntegryControlPanelDbContext : DbContext
|
||||
|
||||
public virtual DbSet<Service> Services { get; set; }
|
||||
|
||||
public virtual DbSet<VwCustomerServerInfo> VwCustomerServerInfos { get; set; }
|
||||
|
||||
public virtual DbSet<VwServerLastUpdate> VwServerLastUpdates { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
@ -50,7 +52,7 @@ public partial class IntegryControlPanelDbContext : DbContext
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
// Configurazione di fallback solo per il design-time se necessaria
|
||||
// optionsBuilder.UseSqlServer("Design time connection string if needed");
|
||||
optionsBuilder.UseSqlServer("Server=SERVERDB2019;Database=integry_control_panel_test;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True;");
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,6 +469,42 @@ public partial class IntegryControlPanelDbContext : DbContext
|
||||
.HasColumnName("slug");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<VwCustomerServerInfo>(entity =>
|
||||
{
|
||||
entity
|
||||
.HasNoKey()
|
||||
.ToView("vw_customer_server_info");
|
||||
|
||||
entity.Property(e => e.JavaVersion)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("java_version");
|
||||
entity.Property(e => e.Name)
|
||||
.HasMaxLength(298)
|
||||
.HasColumnName("name");
|
||||
entity.Property(e => e.OsArch)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("os_arch");
|
||||
entity.Property(e => e.OsName)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("os_name");
|
||||
entity.Property(e => e.PartitaIva)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("partita_iva");
|
||||
entity.Property(e => e.RagSoc)
|
||||
.HasMaxLength(40)
|
||||
.IsUnicode(false)
|
||||
.HasColumnName("rag_soc");
|
||||
entity.Property(e => e.RemoteAddr)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("remote_addr");
|
||||
entity.Property(e => e.SimpleName)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("simple_name");
|
||||
entity.Property(e => e.UpdatedAt)
|
||||
.HasPrecision(6)
|
||||
.HasColumnName("updated_at");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<VwServerLastUpdate>(entity =>
|
||||
{
|
||||
entity
|
||||
|
||||
@ -23,4 +23,11 @@
|
||||
<PackageReference Include="Extensions.MudBlazor.StaticInput" Version="3.*" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Components\Shared\" />
|
||||
<Folder Include="Migrations\IntegryControlPanelDb\" />
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -0,0 +1,973 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using IntegryControlPanel.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IntegryControlPanel.Migrations.IntegryControlPanelDb
|
||||
{
|
||||
[DbContext(typeof(IntegryControlPanelDbContext))]
|
||||
[Migration("20250925161449_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("AnnoContab")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("anno_contab");
|
||||
|
||||
b.Property<int?>("AnnoMagaz")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("anno_magaz");
|
||||
|
||||
b.Property<bool>("AnsiPadding")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("ansi_padding")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<bool>("ConcatNullYieldsNull")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("concat_null_yields_null")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<bool>("DelimitedIdentifier")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("delimited_identifier")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<string>("MenuPersonalizzato")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("menu_personalizzato");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<bool>("NewUpdProgMaga")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("new_upd_prog_maga");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__applicat__3213E83F4185DE9F");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_D5E65179395C3F3");
|
||||
|
||||
b.ToTable("application_infos", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("DeviceId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("device_id");
|
||||
|
||||
b.Property<DateTime>("InsertDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("insert_date");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("NomeAzienda")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("nome_azienda");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__clients__3213E83FFF8DC3E2");
|
||||
|
||||
b.ToTable("clients", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Configurazioni", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("NomeAzienda")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("nome_azienda");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__configur__3213E83FB9077FED");
|
||||
|
||||
b.ToTable("configurazioni", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Customer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("active")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("partita_iva");
|
||||
|
||||
b.Property<string>("Slug")
|
||||
.IsRequired()
|
||||
.HasMaxLength(191)
|
||||
.HasColumnType("nvarchar(191)")
|
||||
.HasColumnName("slug");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__customer__3213E83FD00417AC");
|
||||
|
||||
b.HasIndex(new[] { "Slug" }, "UNIQ_62534E21989D9B62")
|
||||
.IsUnique()
|
||||
.HasFilter("([slug] IS NOT NULL)");
|
||||
|
||||
b.ToTable("customers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("ProductEdition")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_edition");
|
||||
|
||||
b.Property<string>("ProductLevel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_level");
|
||||
|
||||
b.Property<string>("ProductVersion")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_version");
|
||||
|
||||
b.Property<string>("ProductVersionName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_version_name");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__database__3213E83F8526E221");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "UNIQ_1D94CC5C9395C3F3")
|
||||
.IsUnique()
|
||||
.HasFilter("([customer_id] IS NOT NULL)");
|
||||
|
||||
b.ToTable("database_engines", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabasesInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("DatabaseEngineId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("database_engine_id");
|
||||
|
||||
b.Property<string>("LogicalName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("logical_name");
|
||||
|
||||
b.Property<int>("MaxSizeMb")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_size_mb");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SizeMb")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("size_mb");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__database__3213E83FC619B4B0");
|
||||
|
||||
b.HasIndex(new[] { "DatabaseEngineId" }, "IDX_99DAF4F8AB25983");
|
||||
|
||||
b.ToTable("databases_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsRequired()
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<int>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__devices__3213E83F185C7B65");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_11074E9A9395C3F3");
|
||||
|
||||
b.ToTable("devices", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Installation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("DeviceId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("device_id");
|
||||
|
||||
b.Property<DateTime>("InstallDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("install_date");
|
||||
|
||||
b.Property<DateTime>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<string>("Options")
|
||||
.IsRequired()
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("options")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<int?>("ReleaseId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("release_id");
|
||||
|
||||
b.Property<int?>("ServerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("server_id");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__installa__3213E83F11ECD973");
|
||||
|
||||
b.HasIndex(new[] { "ServerId" }, "IDX_A774F67B1844E6B7");
|
||||
|
||||
b.HasIndex(new[] { "DeviceId" }, "IDX_A774F67B94A4C7D4");
|
||||
|
||||
b.HasIndex(new[] { "ReleaseId" }, "IDX_A774F67BB12A727D");
|
||||
|
||||
b.ToTable("installations", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.PvmsInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("DefaultCharset")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("default_charset");
|
||||
|
||||
b.Property<string>("Imagick")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("imagick");
|
||||
|
||||
b.Property<bool>("MagicQuotesGpc")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("magic_quotes_gpc");
|
||||
|
||||
b.Property<int>("MaxExecutionTime")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_execution_time");
|
||||
|
||||
b.Property<int>("MaxInputVars")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_input_vars");
|
||||
|
||||
b.Property<string>("MemoryLimit")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("memory_limit");
|
||||
|
||||
b.Property<string>("PhpVersion")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("php_version");
|
||||
|
||||
b.Property<string>("PostMaxSize")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("post_max_size");
|
||||
|
||||
b.Property<bool>("SodiumMissing")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("sodium_missing");
|
||||
|
||||
b.Property<string>("Timezone")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("timezone");
|
||||
|
||||
b.Property<string>("UploadMaxSize")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("upload_max_size");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__pvms_inf__3213E83F8EA1FE36");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_4BCCAB779395C3F3");
|
||||
|
||||
b.ToTable("pvms_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Changelog")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("changelog");
|
||||
|
||||
b.Property<DateTime>("ReleaseDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("release_date");
|
||||
|
||||
b.Property<int?>("ServiceId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("service_id");
|
||||
|
||||
b.Property<string>("Version")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("version");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__releases__3213E83F59E90B83");
|
||||
|
||||
b.HasIndex(new[] { "ServiceId" }, "IDX_7896E4D1ED5CA9E6");
|
||||
|
||||
b.ToTable("releases", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.SalvataggiSoap", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("ApplicationInfoId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("application_info_id");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__salvatag__3213E83F51C2D8BF");
|
||||
|
||||
b.HasIndex(new[] { "ApplicationInfoId" }, "IDX_BC9B16D5B635C4CB");
|
||||
|
||||
b.ToTable("salvataggi_soap", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime?>("CreatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<int?>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__servers__3213E83F0E4B2C74");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_4F8AF5F79395C3F3");
|
||||
|
||||
b.ToTable("servers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Service", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<DateTime>("InsertDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("insert_date");
|
||||
|
||||
b.Property<string>("Language")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("language");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("Slug")
|
||||
.IsRequired()
|
||||
.HasMaxLength(191)
|
||||
.HasColumnType("nvarchar(191)")
|
||||
.HasColumnName("slug");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__services__3213E83FB43C1FE2");
|
||||
|
||||
b.HasIndex(new[] { "Slug" }, "UNIQ_7332E169989D9B62")
|
||||
.IsUnique()
|
||||
.HasFilter("([slug] IS NOT NULL)");
|
||||
|
||||
b.ToTable("services", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.VwCustomerServerInfo", b =>
|
||||
{
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(298)
|
||||
.HasColumnType("nvarchar(298)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("partita_iva");
|
||||
|
||||
b.Property<string>("RagSoc")
|
||||
.HasMaxLength(40)
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnName("rag_soc");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<string>("SimpleName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("simple_name");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToView("vw_customer_server_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.VwServerLastUpdate", b =>
|
||||
{
|
||||
b.Property<DateTime?>("CreatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<int?>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToView("vw_server_last_update", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("ApplicationInfos")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_D5E65179395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithOne("DatabaseEngine")
|
||||
.HasForeignKey("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", "CustomerId")
|
||||
.HasConstraintName("FK_1D94CC5C9395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabasesInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", "DatabaseEngine")
|
||||
.WithMany("DatabasesInfos")
|
||||
.HasForeignKey("DatabaseEngineId")
|
||||
.HasConstraintName("FK_99DAF4F8AB25983");
|
||||
|
||||
b.Navigation("DatabaseEngine");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("Devices")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_11074E9A9395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Installation", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Device", "Device")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("DeviceId")
|
||||
.HasConstraintName("FK_A774F67B94A4C7D4");
|
||||
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Release", "Release")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("ReleaseId")
|
||||
.HasConstraintName("FK_A774F67BB12A727D");
|
||||
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Server", "Server")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("ServerId")
|
||||
.HasConstraintName("FK_A774F67B1844E6B7");
|
||||
|
||||
b.Navigation("Device");
|
||||
|
||||
b.Navigation("Release");
|
||||
|
||||
b.Navigation("Server");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.PvmsInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("PvmsInfos")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_4BCCAB779395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Service", "Service")
|
||||
.WithMany("Releases")
|
||||
.HasForeignKey("ServiceId")
|
||||
.HasConstraintName("FK_7896E4D1ED5CA9E6");
|
||||
|
||||
b.Navigation("Service");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.SalvataggiSoap", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", "ApplicationInfo")
|
||||
.WithMany("SalvataggiSoaps")
|
||||
.HasForeignKey("ApplicationInfoId")
|
||||
.HasConstraintName("FK_BC9B16D5B635C4CB");
|
||||
|
||||
b.Navigation("ApplicationInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("Servers")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_4F8AF5F79395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.Navigation("SalvataggiSoaps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Customer", b =>
|
||||
{
|
||||
b.Navigation("ApplicationInfos");
|
||||
|
||||
b.Navigation("DatabaseEngine");
|
||||
|
||||
b.Navigation("Devices");
|
||||
|
||||
b.Navigation("PvmsInfos");
|
||||
|
||||
b.Navigation("Servers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.Navigation("DatabasesInfos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Service", b =>
|
||||
{
|
||||
b.Navigation("Releases");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,425 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IntegryControlPanel.Migrations.IntegryControlPanelDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Initial : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "clients",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
nome_azienda = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
device_id = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
last_update = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: true),
|
||||
insert_date = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: false),
|
||||
remote_addr = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__clients__3213E83FFF8DC3E2", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "configurazioni",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
nome_azienda = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
java_version = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
os_arch = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
os_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
xmx = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
xms = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
max_perm_size = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
last_update = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: true),
|
||||
remote_addr = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__configur__3213E83FB9077FED", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "customers",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
slug = table.Column<string>(type: "nvarchar(191)", maxLength: 191, nullable: false),
|
||||
active = table.Column<bool>(type: "bit", nullable: false, defaultValueSql: "('0')"),
|
||||
partita_iva = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__customer__3213E83FD00417AC", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "services",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
slug = table.Column<string>(type: "nvarchar(191)", maxLength: 191, nullable: false),
|
||||
language = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
description = table.Column<string>(type: "varchar(max)", unicode: false, nullable: true),
|
||||
insert_date = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__services__3213E83FB43C1FE2", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "application_infos",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
customer_id = table.Column<int>(type: "int", nullable: true),
|
||||
name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
new_upd_prog_maga = table.Column<bool>(type: "bit", nullable: false),
|
||||
menu_personalizzato = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
anno_magaz = table.Column<int>(type: "int", nullable: true),
|
||||
anno_contab = table.Column<int>(type: "int", nullable: true),
|
||||
ansi_padding = table.Column<bool>(type: "bit", nullable: false, defaultValueSql: "('0')"),
|
||||
delimited_identifier = table.Column<bool>(type: "bit", nullable: false, defaultValueSql: "('0')"),
|
||||
concat_null_yields_null = table.Column<bool>(type: "bit", nullable: false, defaultValueSql: "('0')")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__applicat__3213E83F4185DE9F", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_D5E65179395C3F3",
|
||||
column: x => x.customer_id,
|
||||
principalTable: "customers",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "database_engines",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
customer_id = table.Column<int>(type: "int", nullable: true),
|
||||
product_version = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
product_version_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
product_level = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
product_edition = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__database__3213E83F8526E221", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_1D94CC5C9395C3F3",
|
||||
column: x => x.customer_id,
|
||||
principalTable: "customers",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "devices",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
customer_id = table.Column<int>(type: "int", nullable: true),
|
||||
ip = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
port = table.Column<int>(type: "int", nullable: false),
|
||||
info = table.Column<string>(type: "varchar(max)", unicode: false, nullable: false, comment: "(DC2Type:simple_array)")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__devices__3213E83F185C7B65", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_11074E9A9395C3F3",
|
||||
column: x => x.customer_id,
|
||||
principalTable: "customers",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "pvms_info",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
customer_id = table.Column<int>(type: "int", nullable: true),
|
||||
php_version = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
timezone = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
imagick = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
sodium_missing = table.Column<bool>(type: "bit", nullable: false),
|
||||
max_execution_time = table.Column<int>(type: "int", nullable: false),
|
||||
magic_quotes_gpc = table.Column<bool>(type: "bit", nullable: false),
|
||||
default_charset = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
memory_limit = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
post_max_size = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
upload_max_size = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
max_input_vars = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__pvms_inf__3213E83F8EA1FE36", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_4BCCAB779395C3F3",
|
||||
column: x => x.customer_id,
|
||||
principalTable: "customers",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "servers",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
customer_id = table.Column<int>(type: "int", nullable: true),
|
||||
ip = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
port = table.Column<int>(type: "int", nullable: true),
|
||||
info = table.Column<string>(type: "varchar(max)", unicode: false, nullable: true, comment: "(DC2Type:simple_array)"),
|
||||
java_version = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
os_arch = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
os_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
xmx = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
xms = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
max_perm_size = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
last_update = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: true),
|
||||
remote_addr = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
created_at = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: true),
|
||||
updated_at = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__servers__3213E83F0E4B2C74", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_4F8AF5F79395C3F3",
|
||||
column: x => x.customer_id,
|
||||
principalTable: "customers",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "releases",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
service_id = table.Column<int>(type: "int", nullable: true),
|
||||
version = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
changelog = table.Column<string>(type: "varchar(max)", unicode: false, nullable: true),
|
||||
release_date = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__releases__3213E83F59E90B83", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_7896E4D1ED5CA9E6",
|
||||
column: x => x.service_id,
|
||||
principalTable: "services",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "salvataggi_soap",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
application_info_id = table.Column<int>(type: "int", nullable: true),
|
||||
name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__salvatag__3213E83F51C2D8BF", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_BC9B16D5B635C4CB",
|
||||
column: x => x.application_info_id,
|
||||
principalTable: "application_infos",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "databases_info",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
database_engine_id = table.Column<int>(type: "int", nullable: true),
|
||||
name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
logical_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
size_mb = table.Column<int>(type: "int", nullable: false),
|
||||
max_size_mb = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__database__3213E83FC619B4B0", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_99DAF4F8AB25983",
|
||||
column: x => x.database_engine_id,
|
||||
principalTable: "database_engines",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "installations",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
release_id = table.Column<int>(type: "int", nullable: true),
|
||||
server_id = table.Column<int>(type: "int", nullable: true),
|
||||
device_id = table.Column<int>(type: "int", nullable: true),
|
||||
notes = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
options = table.Column<string>(type: "varchar(max)", unicode: false, nullable: false, comment: "(DC2Type:simple_array)"),
|
||||
install_date = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: false),
|
||||
last_update = table.Column<DateTime>(type: "datetime2(6)", precision: 6, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK__installa__3213E83F11ECD973", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_A774F67B1844E6B7",
|
||||
column: x => x.server_id,
|
||||
principalTable: "servers",
|
||||
principalColumn: "id");
|
||||
table.ForeignKey(
|
||||
name: "FK_A774F67B94A4C7D4",
|
||||
column: x => x.device_id,
|
||||
principalTable: "devices",
|
||||
principalColumn: "id");
|
||||
table.ForeignKey(
|
||||
name: "FK_A774F67BB12A727D",
|
||||
column: x => x.release_id,
|
||||
principalTable: "releases",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_D5E65179395C3F3",
|
||||
table: "application_infos",
|
||||
column: "customer_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UNIQ_62534E21989D9B62",
|
||||
table: "customers",
|
||||
column: "slug",
|
||||
unique: true,
|
||||
filter: "([slug] IS NOT NULL)");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UNIQ_1D94CC5C9395C3F3",
|
||||
table: "database_engines",
|
||||
column: "customer_id",
|
||||
unique: true,
|
||||
filter: "([customer_id] IS NOT NULL)");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_99DAF4F8AB25983",
|
||||
table: "databases_info",
|
||||
column: "database_engine_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_11074E9A9395C3F3",
|
||||
table: "devices",
|
||||
column: "customer_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_A774F67B1844E6B7",
|
||||
table: "installations",
|
||||
column: "server_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_A774F67B94A4C7D4",
|
||||
table: "installations",
|
||||
column: "device_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_A774F67BB12A727D",
|
||||
table: "installations",
|
||||
column: "release_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_4BCCAB779395C3F3",
|
||||
table: "pvms_info",
|
||||
column: "customer_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_7896E4D1ED5CA9E6",
|
||||
table: "releases",
|
||||
column: "service_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_BC9B16D5B635C4CB",
|
||||
table: "salvataggi_soap",
|
||||
column: "application_info_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IDX_4F8AF5F79395C3F3",
|
||||
table: "servers",
|
||||
column: "customer_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UNIQ_7332E169989D9B62",
|
||||
table: "services",
|
||||
column: "slug",
|
||||
unique: true,
|
||||
filter: "([slug] IS NOT NULL)");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "clients");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "configurazioni");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "databases_info");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "installations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "pvms_info");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "salvataggi_soap");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "database_engines");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "servers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "devices");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "releases");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "application_infos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "services");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "customers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,970 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using IntegryControlPanel.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IntegryControlPanel.Migrations.IntegryControlPanelDb
|
||||
{
|
||||
[DbContext(typeof(IntegryControlPanelDbContext))]
|
||||
partial class IntegryControlPanelDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("AnnoContab")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("anno_contab");
|
||||
|
||||
b.Property<int?>("AnnoMagaz")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("anno_magaz");
|
||||
|
||||
b.Property<bool>("AnsiPadding")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("ansi_padding")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<bool>("ConcatNullYieldsNull")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("concat_null_yields_null")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<bool>("DelimitedIdentifier")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("delimited_identifier")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<string>("MenuPersonalizzato")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("menu_personalizzato");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<bool>("NewUpdProgMaga")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("new_upd_prog_maga");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__applicat__3213E83F4185DE9F");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_D5E65179395C3F3");
|
||||
|
||||
b.ToTable("application_infos", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("DeviceId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("device_id");
|
||||
|
||||
b.Property<DateTime>("InsertDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("insert_date");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("NomeAzienda")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("nome_azienda");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__clients__3213E83FFF8DC3E2");
|
||||
|
||||
b.ToTable("clients", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Configurazioni", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("NomeAzienda")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("nome_azienda");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__configur__3213E83FB9077FED");
|
||||
|
||||
b.ToTable("configurazioni", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Customer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("active")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("partita_iva");
|
||||
|
||||
b.Property<string>("Slug")
|
||||
.IsRequired()
|
||||
.HasMaxLength(191)
|
||||
.HasColumnType("nvarchar(191)")
|
||||
.HasColumnName("slug");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__customer__3213E83FD00417AC");
|
||||
|
||||
b.HasIndex(new[] { "Slug" }, "UNIQ_62534E21989D9B62")
|
||||
.IsUnique()
|
||||
.HasFilter("([slug] IS NOT NULL)");
|
||||
|
||||
b.ToTable("customers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("ProductEdition")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_edition");
|
||||
|
||||
b.Property<string>("ProductLevel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_level");
|
||||
|
||||
b.Property<string>("ProductVersion")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_version");
|
||||
|
||||
b.Property<string>("ProductVersionName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_version_name");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__database__3213E83F8526E221");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "UNIQ_1D94CC5C9395C3F3")
|
||||
.IsUnique()
|
||||
.HasFilter("([customer_id] IS NOT NULL)");
|
||||
|
||||
b.ToTable("database_engines", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabasesInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("DatabaseEngineId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("database_engine_id");
|
||||
|
||||
b.Property<string>("LogicalName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("logical_name");
|
||||
|
||||
b.Property<int>("MaxSizeMb")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_size_mb");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SizeMb")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("size_mb");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__database__3213E83FC619B4B0");
|
||||
|
||||
b.HasIndex(new[] { "DatabaseEngineId" }, "IDX_99DAF4F8AB25983");
|
||||
|
||||
b.ToTable("databases_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsRequired()
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<int>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__devices__3213E83F185C7B65");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_11074E9A9395C3F3");
|
||||
|
||||
b.ToTable("devices", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Installation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("DeviceId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("device_id");
|
||||
|
||||
b.Property<DateTime>("InstallDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("install_date");
|
||||
|
||||
b.Property<DateTime>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<string>("Options")
|
||||
.IsRequired()
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("options")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<int?>("ReleaseId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("release_id");
|
||||
|
||||
b.Property<int?>("ServerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("server_id");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__installa__3213E83F11ECD973");
|
||||
|
||||
b.HasIndex(new[] { "ServerId" }, "IDX_A774F67B1844E6B7");
|
||||
|
||||
b.HasIndex(new[] { "DeviceId" }, "IDX_A774F67B94A4C7D4");
|
||||
|
||||
b.HasIndex(new[] { "ReleaseId" }, "IDX_A774F67BB12A727D");
|
||||
|
||||
b.ToTable("installations", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.PvmsInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("DefaultCharset")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("default_charset");
|
||||
|
||||
b.Property<string>("Imagick")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("imagick");
|
||||
|
||||
b.Property<bool>("MagicQuotesGpc")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("magic_quotes_gpc");
|
||||
|
||||
b.Property<int>("MaxExecutionTime")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_execution_time");
|
||||
|
||||
b.Property<int>("MaxInputVars")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_input_vars");
|
||||
|
||||
b.Property<string>("MemoryLimit")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("memory_limit");
|
||||
|
||||
b.Property<string>("PhpVersion")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("php_version");
|
||||
|
||||
b.Property<string>("PostMaxSize")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("post_max_size");
|
||||
|
||||
b.Property<bool>("SodiumMissing")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("sodium_missing");
|
||||
|
||||
b.Property<string>("Timezone")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("timezone");
|
||||
|
||||
b.Property<string>("UploadMaxSize")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("upload_max_size");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__pvms_inf__3213E83F8EA1FE36");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_4BCCAB779395C3F3");
|
||||
|
||||
b.ToTable("pvms_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Changelog")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("changelog");
|
||||
|
||||
b.Property<DateTime>("ReleaseDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("release_date");
|
||||
|
||||
b.Property<int?>("ServiceId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("service_id");
|
||||
|
||||
b.Property<string>("Version")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("version");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__releases__3213E83F59E90B83");
|
||||
|
||||
b.HasIndex(new[] { "ServiceId" }, "IDX_7896E4D1ED5CA9E6");
|
||||
|
||||
b.ToTable("releases", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.SalvataggiSoap", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("ApplicationInfoId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("application_info_id");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__salvatag__3213E83F51C2D8BF");
|
||||
|
||||
b.HasIndex(new[] { "ApplicationInfoId" }, "IDX_BC9B16D5B635C4CB");
|
||||
|
||||
b.ToTable("salvataggi_soap", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime?>("CreatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<int?>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__servers__3213E83F0E4B2C74");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_4F8AF5F79395C3F3");
|
||||
|
||||
b.ToTable("servers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Service", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<DateTime>("InsertDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("insert_date");
|
||||
|
||||
b.Property<string>("Language")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("language");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("Slug")
|
||||
.IsRequired()
|
||||
.HasMaxLength(191)
|
||||
.HasColumnType("nvarchar(191)")
|
||||
.HasColumnName("slug");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__services__3213E83FB43C1FE2");
|
||||
|
||||
b.HasIndex(new[] { "Slug" }, "UNIQ_7332E169989D9B62")
|
||||
.IsUnique()
|
||||
.HasFilter("([slug] IS NOT NULL)");
|
||||
|
||||
b.ToTable("services", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.VwCustomerServerInfo", b =>
|
||||
{
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(298)
|
||||
.HasColumnType("nvarchar(298)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("partita_iva");
|
||||
|
||||
b.Property<string>("RagSoc")
|
||||
.HasMaxLength(40)
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnName("rag_soc");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<string>("SimpleName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("simple_name");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToView("vw_customer_server_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.VwServerLastUpdate", b =>
|
||||
{
|
||||
b.Property<DateTime?>("CreatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<int?>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToView("vw_server_last_update", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("ApplicationInfos")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_D5E65179395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithOne("DatabaseEngine")
|
||||
.HasForeignKey("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", "CustomerId")
|
||||
.HasConstraintName("FK_1D94CC5C9395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabasesInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", "DatabaseEngine")
|
||||
.WithMany("DatabasesInfos")
|
||||
.HasForeignKey("DatabaseEngineId")
|
||||
.HasConstraintName("FK_99DAF4F8AB25983");
|
||||
|
||||
b.Navigation("DatabaseEngine");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("Devices")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_11074E9A9395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Installation", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Device", "Device")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("DeviceId")
|
||||
.HasConstraintName("FK_A774F67B94A4C7D4");
|
||||
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Release", "Release")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("ReleaseId")
|
||||
.HasConstraintName("FK_A774F67BB12A727D");
|
||||
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Server", "Server")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("ServerId")
|
||||
.HasConstraintName("FK_A774F67B1844E6B7");
|
||||
|
||||
b.Navigation("Device");
|
||||
|
||||
b.Navigation("Release");
|
||||
|
||||
b.Navigation("Server");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.PvmsInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("PvmsInfos")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_4BCCAB779395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Service", "Service")
|
||||
.WithMany("Releases")
|
||||
.HasForeignKey("ServiceId")
|
||||
.HasConstraintName("FK_7896E4D1ED5CA9E6");
|
||||
|
||||
b.Navigation("Service");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.SalvataggiSoap", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", "ApplicationInfo")
|
||||
.WithMany("SalvataggiSoaps")
|
||||
.HasForeignKey("ApplicationInfoId")
|
||||
.HasConstraintName("FK_BC9B16D5B635C4CB");
|
||||
|
||||
b.Navigation("ApplicationInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("Servers")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_4F8AF5F79395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.Navigation("SalvataggiSoaps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Customer", b =>
|
||||
{
|
||||
b.Navigation("ApplicationInfos");
|
||||
|
||||
b.Navigation("DatabaseEngine");
|
||||
|
||||
b.Navigation("Devices");
|
||||
|
||||
b.Navigation("PvmsInfos");
|
||||
|
||||
b.Navigation("Servers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.Navigation("DatabasesInfos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Service", b =>
|
||||
{
|
||||
b.Navigation("Releases");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IntegryControlPanel.Models.IntegryControlPanel;
|
||||
|
||||
public partial class VwCustomerServerInfo
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
|
||||
public string? PartitaIva { get; set; }
|
||||
|
||||
public string? OsName { get; set; }
|
||||
|
||||
public string? OsArch { get; set; }
|
||||
|
||||
public string? JavaVersion { get; set; }
|
||||
|
||||
public string? RemoteAddr { get; set; }
|
||||
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
|
||||
public string SimpleName { get; set; } = null!;
|
||||
|
||||
public string? RagSoc { get; set; }
|
||||
}
|
||||
@ -20,6 +20,9 @@ builder.Services.AddRazorComponents()
|
||||
// Add controllers
|
||||
builder.Services.AddControllers();
|
||||
|
||||
// IMPORTANTE: Aggiungere HttpClient anche per il server (per il render mode misto)
|
||||
builder.Services.AddHttpClient();
|
||||
|
||||
builder.Services.AddCascadingAuthenticationState();
|
||||
builder.Services.AddScoped<IdentityUserAccessor>();
|
||||
builder.Services.AddScoped<IdentityRedirectManager>();
|
||||
@ -88,6 +91,8 @@ else
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
// Aggiungiamo l'autenticazione nel pipeline
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
@ -105,4 +110,8 @@ app.MapControllers();
|
||||
// Add additional endpoints required by the Identity /Account Razor components.
|
||||
app.MapAdditionalIdentityEndpoints();
|
||||
|
||||
// IMPORTANTE: Per .NET 9 con Blazor misto, non serve MapFallback
|
||||
// Il router di Blazor gestisce automaticamente tutte le rotte
|
||||
// sia server-side che client-side basandosi sul render mode
|
||||
|
||||
app.Run();
|
||||
|
||||
@ -52,5 +52,16 @@ namespace IntegryControlPanel.Services
|
||||
Task<int> GetTotalServersAsync();
|
||||
Task<int> GetTotalDevicesAsync();
|
||||
Task<int> GetTotalInstallationsAsync();
|
||||
|
||||
// Customer Server Info View operations
|
||||
//Task<IEnumerable<VwCustomerAnagInfo>> GetCustomerServerInfoAsync();
|
||||
//Task<IEnumerable<VwCustomerAnagInfo>> GetCustomerServerInfoBySlugAsync(string slug);
|
||||
|
||||
//// CustomerWithAnagInfo operations
|
||||
//Task<IEnumerable<CustomerWithAnagInfo>> GetCustomersWithAnagInfoAsync();
|
||||
//Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoByIdAsync(int id);
|
||||
//Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoBySlugAsync(string slug);
|
||||
//Task<IEnumerable<CustomerWithAnagInfo>> GetActiveCustomersWithAnagInfoAsync();
|
||||
//Task<IEnumerable<CustomerWithAnagInfo>> SearchCustomersWithAnagInfoAsync(string searchTerm);
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,7 @@ namespace IntegryControlPanel.Services
|
||||
.Include(c => c.Servers)
|
||||
.Include(c => c.Devices)
|
||||
.Include(c => c.ApplicationInfos)
|
||||
.Include(c => c.PvmsInfos)
|
||||
.FirstOrDefaultAsync(c => c.Id == id);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -579,5 +580,145 @@ namespace IntegryControlPanel.Services
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//#region CustomerWithAnagInfo Operations
|
||||
|
||||
//public async Task<IEnumerable<CustomerWithAnagInfo>> GetCustomersWithAnagInfoAsync()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// ORDER BY COALESCE(va.name, c.name), c.name
|
||||
// ";
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query).ToListAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customers with anag info");
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public async Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoByIdAsync(int id)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE c.id = {0}
|
||||
// ";
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, id).FirstOrDefaultAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by id {CustomerId}", id);
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public async Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoBySlugAsync(string slug)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE c.slug = {0}
|
||||
// ";
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, slug).FirstOrDefaultAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by slug {Slug}", slug);
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public async Task<IEnumerable<CustomerWithAnagInfo>> GetActiveCustomersWithAnagInfoAsync()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE c.active = 1
|
||||
// ORDER BY COALESCE(va.name, c.name), c.name
|
||||
// ";
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query).ToListAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving active customers with anag info");
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public async Task<IEnumerable<CustomerWithAnagInfo>> SearchCustomersWithAnagInfoAsync(string searchTerm)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE COALESCE(va.name, c.name) LIKE {0}
|
||||
// OR c.name LIKE {0}
|
||||
// OR c.slug LIKE {0}
|
||||
// OR c.partita_iva LIKE {0}
|
||||
// ORDER BY COALESCE(va.name, c.name), c.name
|
||||
// ";
|
||||
|
||||
// var searchPattern = $"%{searchTerm}%";
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, searchPattern).ToListAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error searching customers with anag info for term {SearchTerm}", searchTerm);
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
//#endregion
|
||||
}
|
||||
}
|
||||
28
IntegryControlPanel/IntegryControlPanel/wwwroot/web.config
Normal file
28
IntegryControlPanel/IntegryControlPanel/wwwroot/web.config
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<location path="." inheritInChildApplications="false">
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
||||
</handlers>
|
||||
<aspNetCore processPath="dotnet"
|
||||
arguments=".\IntegryControlPanel.dll"
|
||||
stdoutLogEnabled="false"
|
||||
stdoutLogFile=".\logs\stdout"
|
||||
hostingModel="inprocess" />
|
||||
<!-- Rewrite rules per Blazor WASM routing -->
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="Blazor Routes" stopProcessing="true">
|
||||
<match url=".*" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="/" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
</system.webServer>
|
||||
</location>
|
||||
</configuration>
|
||||
Loading…
x
Reference in New Issue
Block a user