Initial commit

This commit is contained in:
Janus C. H. Knudsen 2026-02-03 00:17:08 +01:00
commit 77d35ff965
51 changed files with 5591 additions and 0 deletions

View file

@ -0,0 +1,63 @@
namespace PlanTempusAdmin.Models;
public class AzureContainer
{
public string Name { get; set; } = string.Empty;
public DateTimeOffset? LastModified { get; set; }
public long TotalSize { get; set; }
public int BlobCount { get; set; }
}
public class AzureBlob
{
public string Name { get; set; } = string.Empty;
public string? ContentType { get; set; }
public long Size { get; set; }
public DateTimeOffset? LastModified { get; set; }
public DateTimeOffset? CreatedOn { get; set; }
public string? AccessTier { get; set; }
public BlobType BlobType { get; set; }
// Computed
public string FileName => Name.Contains('/') ? Name.Substring(Name.LastIndexOf('/') + 1) : Name;
public string? Directory => Name.Contains('/') ? Name.Substring(0, Name.LastIndexOf('/')) : null;
public bool IsBackup => Name.EndsWith(".tar.gz") || Name.EndsWith(".sql.gz") || Name.EndsWith(".zip") || Name.EndsWith(".bak");
}
public enum BlobType
{
Block,
Page,
Append
}
public class AzureStorageDashboard
{
public bool IsConnected { get; set; }
public string AccountName { get; set; } = string.Empty;
// Stats
public int TotalContainers { get; set; }
public long TotalSize { get; set; }
public int TotalBlobs { get; set; }
// Containers
public List<AzureContainer> Containers { get; set; } = new();
// Recent blobs
public List<AzureBlob> RecentBlobs { get; set; } = new();
// Backup specific
public int BackupFileCount { get; set; }
public long BackupTotalSize { get; set; }
public DateTimeOffset? LastBackupUpload { get; set; }
}
public class ContainerDetails
{
public string Name { get; set; } = string.Empty;
public long TotalSize { get; set; }
public int BlobCount { get; set; }
public List<AzureBlob> Blobs { get; set; } = new();
public List<string> Prefixes { get; set; } = new(); // Virtual directories
}