mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Improving navigation between files and storage services and rewording info text
This commit is contained in:
@@ -30,13 +30,14 @@ namespace BTCPayServer.Controllers
|
|||||||
{
|
{
|
||||||
var fileUrl = string.IsNullOrEmpty(fileId) ? null : await _FileService.GetFileUrl(Request.GetAbsoluteRootUri(), fileId);
|
var fileUrl = string.IsNullOrEmpty(fileId) ? null : await _FileService.GetFileUrl(Request.GetAbsoluteRootUri(), fileId);
|
||||||
|
|
||||||
return View(new ViewFilesViewModel()
|
var model = new ViewFilesViewModel()
|
||||||
{
|
{
|
||||||
Files = await _StoredFileRepository.GetFiles(),
|
Files = await _StoredFileRepository.GetFiles(),
|
||||||
SelectedFileId = string.IsNullOrEmpty(fileUrl) ? null : fileId,
|
SelectedFileId = string.IsNullOrEmpty(fileUrl) ? null : fileId,
|
||||||
DirectFileUrl = fileUrl,
|
DirectFileUrl = fileUrl,
|
||||||
StorageConfigured = (await _SettingsRepository.GetSettingAsync<StorageSettings>()) != null
|
StorageConfigured = (await _SettingsRepository.GetSettingAsync<StorageSettings>()) != null
|
||||||
});
|
};
|
||||||
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("server/files/{fileId}/delete")]
|
[HttpGet("server/files/{fileId}/delete")]
|
||||||
|
|||||||
@@ -5,48 +5,64 @@
|
|||||||
|
|
||||||
<h2 class="mb-4">@ViewData["PageTitle"]</h2>
|
<h2 class="mb-4">@ViewData["PageTitle"]</h2>
|
||||||
|
|
||||||
<p>
|
@if (!Model.StorageConfigured)
|
||||||
Change your <a asp-action="Services" asp-route-returnurl="@ViewData["ReturnUrl"]">external storage service</a> provider.
|
|
||||||
<a href="https://docs.btcpayserver.org/FAQ/FAQ-ServerSettings/#how-to-upload-files-to-btcpay" target="_blank">
|
|
||||||
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
@if (Model.Files.Any())
|
|
||||||
{
|
{
|
||||||
<table class="table table-sm table-responsive-md">
|
<p>
|
||||||
<thead>
|
Before being able to upload you first need to
|
||||||
<tr>
|
<a asp-action="storage" asp-route-forceChoice="true" asp-route-returnurl="@ViewData["ReturnUrl"]">
|
||||||
<th>Name</th>
|
choose your external storage service provider
|
||||||
<th>Timestamp</th>
|
</a>.
|
||||||
<th>User</th>
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-ServerSettings/#how-to-upload-files-to-btcpay" target="_blank">
|
||||||
<th></th>
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
||||||
</tr>
|
</a>
|
||||||
</thead>
|
</p>
|
||||||
<tbody>
|
|
||||||
@foreach (var file in Model.Files)
|
|
||||||
{
|
|
||||||
<tr>
|
|
||||||
<td>@file.FileName</td>
|
|
||||||
<td>@file.Timestamp.ToBrowserDate()</td>
|
|
||||||
<td>@file.ApplicationUser.UserName</td>
|
|
||||||
<td>
|
|
||||||
<a asp-action="Files" asp-route-fileId="@file.Id">Get Link</a>
|
|
||||||
- <a asp-action="CreateTemporaryFileUrl" asp-route-fileId="@file.Id">Get Temp Link</a>
|
|
||||||
- <a asp-action="DeleteFile" asp-route-fileId="@file.Id">Remove</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<p class="text-secondary mt-3">
|
<p>
|
||||||
There are no files yet.
|
Change your <a asp-action="storage" asp-route-forceChoice="true" asp-route-returnurl="@ViewData["ReturnUrl"]">external storage service</a> provider.
|
||||||
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-ServerSettings/#how-to-upload-files-to-btcpay" target="_blank">
|
||||||
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@if (Model.Files.Any())
|
||||||
|
{
|
||||||
|
<table class="table table-sm table-responsive-md">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Timestamp</th>
|
||||||
|
<th>User</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach (var file in Model.Files)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>@file.FileName</td>
|
||||||
|
<td>@file.Timestamp.ToBrowserDate()</td>
|
||||||
|
<td>@file.ApplicationUser.UserName</td>
|
||||||
|
<td>
|
||||||
|
<a asp-action="Files" asp-route-fileId="@file.Id">Get Link</a>
|
||||||
|
- <a asp-action="CreateTemporaryFileUrl" asp-route-fileId="@file.Id">Get Temp Link</a>
|
||||||
|
- <a asp-action="DeleteFile" asp-route-fileId="@file.Id">Remove</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<p class="text-secondary mt-3">
|
||||||
|
There are no files yet.
|
||||||
|
</p>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(Model.SelectedFileId))
|
@if (!string.IsNullOrEmpty(Model.SelectedFileId))
|
||||||
{
|
{
|
||||||
var file = Model.Files.Single(storedFile => storedFile.Id.Equals(Model.SelectedFileId, StringComparison.InvariantCultureIgnoreCase));
|
var file = Model.Files.Single(storedFile => storedFile.Id.Equals(Model.SelectedFileId, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|||||||
Reference in New Issue
Block a user