mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
files update
This commit is contained in:
parent
7c0999ac9f
commit
37b1e9037f
@ -5,101 +5,105 @@
|
||||
|
||||
<h3 class="mb-4">@ViewData["Title"]</h3>
|
||||
|
||||
@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">
|
||||
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
||||
</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">
|
||||
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
||||
</a>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-xl-8 col-xxl-constrain">
|
||||
|
||||
@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>
|
||||
}
|
||||
@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">
|
||||
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
||||
</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">
|
||||
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@if (Model.Files.Any())
|
||||
{
|
||||
<table class="table table-hover table-responsive-md">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Timestamp</th>
|
||||
<th>User</th>
|
||||
<th class="text-end">Actions</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 class="text-end">
|
||||
<a href="@Url.Action("Files", "UIServer", new { fileIds = new string[] { 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 (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>
|
||||
}
|
||||
|
||||
@if (Model.DirectUrlByFiles != null && Model.DirectUrlByFiles.Count > 0)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> fileUrlPair in Model.DirectUrlByFiles)
|
||||
{
|
||||
var fileId = fileUrlPair.Key;
|
||||
var fileUrl = fileUrlPair.Value;
|
||||
var file = Model.Files.Single(storedFile => storedFile.Id.Equals(fileId, StringComparison.InvariantCultureIgnoreCase));
|
||||
@if (Model.Files.Any())
|
||||
{
|
||||
<table class="table table-hover table-responsive-md">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Timestamp</th>
|
||||
<th>User</th>
|
||||
<th class="text-end">Actions</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 class="text-end">
|
||||
<a href="@Url.Action("Files", "UIServer", new { fileIds = new string[] { 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>
|
||||
}
|
||||
}
|
||||
|
||||
<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
|
||||
{
|
||||
fileId = fileId
|
||||
}, Context.Request.Scheme, Context.Request.Host.ToString())
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<strong>Direct URL:</strong>
|
||||
<a href="@fileUrl" target="_blank" rel="noreferrer noopener">@fileUrl</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@if (Model.DirectUrlByFiles != null && Model.DirectUrlByFiles.Count > 0)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> fileUrlPair in Model.DirectUrlByFiles)
|
||||
{
|
||||
var fileId = fileUrlPair.Key;
|
||||
var fileUrl = fileUrlPair.Value;
|
||||
var file = Model.Files.Single(storedFile => storedFile.Id.Equals(fileId, StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
<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
|
||||
{
|
||||
fileId = fileId
|
||||
}, Context.Request.Scheme, Context.Request.Host.ToString())
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<strong>Direct URL:</strong>
|
||||
<a href="@fileUrl" target="_blank" rel="noreferrer noopener">@fileUrl</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user