mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
108 lines
4.0 KiB
Plaintext
108 lines
4.0 KiB
Plaintext
@model ViewFilesViewModel
|
|
@{
|
|
ViewData.SetActivePageAndTitle(ServerNavPages.Files, "File Storage");
|
|
}
|
|
|
|
<h2 class="mb-4">@ViewData["PageTitle"]</h2>
|
|
|
|
@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/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/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", "Server", 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.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="Storage" asp-route-fileId="@fileId" target="_blank">
|
|
@Url.Action("GetFile", "Storage", 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.StorageConfigured)
|
|
{
|
|
<form asp-action="CreateFiles" method="post" enctype="multipart/form-data">
|
|
<h4 class="mt-5 mb-3">Upload Files</h4>
|
|
<input multiple type="file" class="form-control mb-3" name="files" id="files" required>
|
|
<button class="btn btn-primary" role="button"><span class="fa fa-plus"></span> Upload files</button>
|
|
</form>
|
|
}
|