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
|
|
|
}
|
|
|
|
|
2022-01-28 00:23:34 -08:00
|
|
|
<div class="row">
|
2022-06-15 14:06:16 +02:00
|
|
|
<div class="col">
|
|
|
|
<div class="d-flex align-items-center justify-content-between mt-n1 mb-4">
|
|
|
|
<h3 class="mb-0">@ViewData["Title"]</h3>
|
|
|
|
<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>
|
|
|
|
|
2022-01-28 00:23:34 -08: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>.
|
2023-02-13 00:25:24 -08:00
|
|
|
<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" />
|
2022-01-28 00:23:34 -08:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p>
|
|
|
|
Change your <a asp-action="storage" asp-route-forceChoice="true" asp-route-returnurl="@ViewData["ReturnUrl"]">file storage service</a> provider.
|
2023-02-13 00:25:24 -08:00
|
|
|
<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" />
|
2022-01-28 00:23:34 -08:00
|
|
|
</a>
|
|
|
|
</p>
|
2021-11-01 08:49:12 -07:00
|
|
|
|
2022-01-28 00:23:34 -08:00
|
|
|
@if (Model.StorageConfigured)
|
|
|
|
{
|
|
|
|
<form asp-action="CreateFiles" method="post" enctype="multipart/form-data">
|
|
|
|
<div class="d-flex">
|
|
|
|
<input multiple type="file" class="form-control mb-3" name="files" id="files" required>
|
|
|
|
<button class="btn btn-primary mb-3 ms-3" role="button">Upload</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
}
|
2019-04-22 09:41:20 +02:00
|
|
|
|
2022-01-28 00:23:34 -08:00
|
|
|
@if (Model.Files.Any())
|
|
|
|
{
|
|
|
|
<table class="table table-hover table-responsive-md">
|
|
|
|
<thead>
|
2022-06-15 14:06:16 +02:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Timestamp</th>
|
|
|
|
<th>User</th>
|
|
|
|
<th class="text-end">Actions</th>
|
|
|
|
</tr>
|
2022-01-28 00:23:34 -08:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2022-06-15 14:06:16 +02:00
|
|
|
@foreach (var file in Model.Files)
|
|
|
|
{
|
|
|
|
<tr>
|
|
|
|
<td>@file.FileName</td>
|
|
|
|
<td>@file.Timestamp.ToBrowserDate()</td>
|
|
|
|
<td>@file.ApplicationUser.UserName</td>
|
|
|
|
<td class="text-end">
|
|
|
|
<a href="@Url.Action("Files", "UIServer", new { fileIds = new string[] { file.Id } })">Get Link</a>
|
|
|
|
- <a asp-action="DeleteFile" asp-route-fileId="@file.Id">Remove</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
2022-01-28 00:23:34 -08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p class="text-secondary mt-3">
|
|
|
|
There are no files yet.
|
|
|
|
</p>
|
|
|
|
}
|
|
|
|
}
|
2021-08-09 20:10:55 +05:30
|
|
|
|
2022-01-28 00:23:34 -08:00
|
|
|
@if (Model.DirectUrlByFiles != null && Model.DirectUrlByFiles.Count > 0)
|
|
|
|
{
|
|
|
|
foreach (KeyValuePair<string, string> fileUrlPair in Model.DirectUrlByFiles)
|
|
|
|
{
|
|
|
|
var fileId = fileUrlPair.Key;
|
|
|
|
var file = Model.Files.Single(storedFile => storedFile.Id.Equals(fileId, StringComparison.InvariantCultureIgnoreCase));
|
2019-04-22 09:41:20 +02:00
|
|
|
|
2022-01-28 00:23:34 -08:00
|
|
|
<div class="card mb-2">
|
|
|
|
<div class="card-text">
|
|
|
|
<ul class="list-group list-group-flush">
|
|
|
|
<li class="list-group-item">
|
|
|
|
@file.FileName
|
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
|
|
|
<strong>URL:</strong>
|
|
|
|
<a asp-action="GetFile" asp-controller="UIStorage" asp-route-fileId="@fileId" target="_blank">
|
|
|
|
@Url.Action("GetFile", "UIStorage", new
|
2022-06-15 14:06:16 +02:00
|
|
|
{
|
|
|
|
fileId = fileId
|
|
|
|
}, Context.Request.Scheme, Context.Request.Host.ToString())
|
2022-01-28 00:23:34 -08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|