2019-04-22 09:41:20 +02:00
|
|
|
@model ViewFilesViewModel
|
|
|
|
@{
|
2021-12-16 11:17:02 +01:00
|
|
|
ViewData.SetActivePage(ServerNavPages.Files, "File Storage");
|
2019-04-22 09:41:20 +02:00
|
|
|
}
|
|
|
|
|
2024-06-19 15:23:10 +02:00
|
|
|
<div class="sticky-header">
|
|
|
|
<h2>@ViewData["Title"]</h2>
|
|
|
|
<a asp-action="storage" asp-route-forceChoice="true" asp-route-returnurl="@ViewData["ReturnUrl"]" class="btn btn-secondary d-flex align-items-center">
|
|
|
|
<vc:icon symbol="settings" />
|
|
|
|
<span class="ms-1">Settings</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<partial name="_StatusMessage" />
|
2023-06-20 08:58:28 +02:00
|
|
|
|
2024-06-19 15:23:10 +02:00
|
|
|
@if (!Model.StorageConfigured)
|
|
|
|
{
|
|
|
|
<p>
|
|
|
|
Before being able to upload you first need to
|
|
|
|
<a asp-action="storage" asp-route-forceChoice="true" asp-route-returnurl="@ViewData["ReturnUrl"]">choose your file storage service provider</a>.
|
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/ServerSettings/#how-to-upload-files-to-btcpay" target="_blank" rel="noreferrer noopener" title="More information...">
|
|
|
|
<vc:icon symbol="info" />
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p>
|
|
|
|
Change your <a asp-action="storage" asp-route-forceChoice="true" asp-route-returnurl="@ViewData["ReturnUrl"]">file storage service</a> provider.
|
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/ServerSettings/#how-to-upload-files-to-btcpay" target="_blank" rel="noreferrer noopener" title="More information...">
|
|
|
|
<vc:icon symbol="info" />
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
@if (Model.DirectUrlByFiles is { Count: > 0 })
|
|
|
|
{
|
|
|
|
foreach (var fileUrlPair in Model.DirectUrlByFiles)
|
2022-01-28 00:23:34 -08:00
|
|
|
{
|
2024-06-19 15:23:10 +02:00
|
|
|
var fileId = fileUrlPair.Key;
|
|
|
|
var file = Model.Files.Single(storedFile => storedFile.Id.Equals(fileId, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
var url = Url.Action("GetFile", "UIStorage", new { fileId }, Context.Request.Scheme, Context.Request.Host.ToString());
|
|
|
|
<div class="border border-light rounded bg-tile mt-3">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12 col-md-4">
|
|
|
|
<div class="input-group">
|
|
|
|
<div class="form-floating">
|
|
|
|
<input id="@fileId-name" class="form-control-plaintext" readonly="readonly" value="@file.FileName">
|
|
|
|
<label>File name</label>
|
2023-06-20 08:58:28 +02:00
|
|
|
</div>
|
2024-06-19 15:23:10 +02:00
|
|
|
<button type="button" class="btn btn-link" data-clipboard="@file.FileName">
|
|
|
|
<vc:icon symbol="actions-copy" />
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12 col-md-4 ">
|
|
|
|
<div class="input-group ">
|
|
|
|
<div class="form-floating">
|
|
|
|
<input id="@fileId" class="form-control-plaintext" readonly="readonly" value="@fileId">
|
|
|
|
<label>File Id</label>
|
2023-06-20 08:58:28 +02:00
|
|
|
</div>
|
2024-06-19 15:23:10 +02:00
|
|
|
<button type="button" class="btn btn-link" data-clipboard="@fileId">
|
|
|
|
<vc:icon symbol="actions-copy" />
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class=" col-sm-12 col-md-4">
|
|
|
|
<div class="input-group">
|
|
|
|
<div class="form-floating">
|
|
|
|
<input id="@fileId-url" class="form-control-plaintext" readonly="readonly" value="@url">
|
|
|
|
<label>Permanent Url</label>
|
2023-06-20 08:58:28 +02:00
|
|
|
</div>
|
2024-06-19 15:23:10 +02:00
|
|
|
<button type="button" class="btn btn-link" data-clipboard="@url">
|
|
|
|
<vc:icon symbol="actions-copy" />
|
|
|
|
</button>
|
2023-06-20 08:58:28 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-06-19 15:23:10 +02:00
|
|
|
<button type="button" class="btn btn-link" data-clipboard="@url">
|
|
|
|
<vc:icon symbol="copy" />
|
|
|
|
</button>
|
2023-06-20 08:58:28 +02:00
|
|
|
</div>
|
2024-06-19 15:23:10 +02:00
|
|
|
</div>
|
2022-01-28 00:23:34 -08:00
|
|
|
}
|
2024-06-19 15:23:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@if (Model.Files.Any())
|
|
|
|
{
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Timestamp</th>
|
|
|
|
<th>Uploaded By</th>
|
|
|
|
<th class="text-end">Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var file in Model.Files)
|
|
|
|
{
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a asp-action="Files" asp-route-fileIds="@file.Id">@file.FileName</a>
|
|
|
|
</td>
|
|
|
|
<td>@file.Timestamp.ToBrowserDate()</td>
|
|
|
|
<td>@file.ApplicationUser.UserName</td>
|
|
|
|
<td class="text-end">
|
|
|
|
<a href="@Url.Action("Files", "UIServer", new {fileIds = new [] { file.Id }})" class="text-nowrap">Get Link</a>
|
|
|
|
- <a asp-action="DeleteFile" asp-route-fileId="@file.Id">Remove</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p class="text-secondary mt-3">There are no files yet.</p>
|
|
|
|
}
|
|
|
|
}
|