The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

194 lines
9.4 KiB

@model Teknik.Areas.Upload.ViewModels.UploadViewModel
@using Teknik.Areas.Vault.Models
@{
long maxUploadSize = Config.UploadConfig.MaxUploadSize;
if (User.Identity.IsAuthenticated)
{
maxUploadSize = Config.UploadConfig.MaxUploadSizeBasic;
//if (User.Info.AccountType == AccountType.Premium)
//{
// maxUploadSize = Config.UploadConfig.MaxUploadSizePremium;
//}
}
}
<script>
var encScriptSrc = '@Url.FullURL("~/js/cryptoWorker.min.js")';
var aesScriptSrc = '@Url.FullURL("~/js/crypto.min.js")';
var uploadFileURL = '@Url.SubRouteUrl(Model.CurrentSub, "Upload.Action", new { action = "Upload" })';
var maxUploadSize = @maxUploadSize;
var chunkSize = @Config.UploadConfig.ChunkSize;
var keySize = @Config.UploadConfig.KeySize;
var blockSize = @Config.UploadConfig.BlockSize;
var shortenURL = '@Url.SubRouteUrl("shorten", "Shortener.Action", new { action = "ShortenUrl" })';
var createVaultURL = '@Url.SubRouteUrl("vault", "Vault.NewVaultFromService", new { type = "Upload" })';
</script>
<bundle src="css/upload.min.css" append-version="true" />
<div class="container">
<div class="row text-center">
<div class="col-sm-10 col-sm-offset-1">
<div class="row text-center">
<div class="well well-lg text-center" id="uploadButton" style="cursor: pointer">
<div class="row">
<div class="col-sm-12">
<h1>Drop your files here</h1>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h2>Or paste them</h2>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h3>Or click</h3>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#uploadSettings"><i class="fa fa-gear"></i></button>
</div>
</div>
<div class="row" id="upload-action-buttons" style="display: none">
<div class="col-sm-12">
<div class="btn-group pull-right" role="group">
<button type="button" class="btn btn-default btn-sm" id="copy-all" data-toggle="popover" data-trigger="manual" data-placement="top" data-content="Copied to Clipboard" data-container="body"><i class="fa fa-clipboard"></i>&nbsp;Copy All Links</button>
<button type="button" class="btn btn-default btn-sm" id="create-vault"><i class="fa fa-folder"></i>&nbsp;Create Vault</button>
@if (User.Identity.IsAuthenticated && Model.Vaults != null && Model.Vaults.Any())
{
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i>&nbsp;Add to Vault <span class="caret"></span></button>
<ul class="dropdown-menu" id="add-to-vault-menu">
@foreach (Vault item in Model.Vaults)
{
<li><a href="#" class="add-to-vault" data-add-to-vault-url="@Url.SubRouteUrl("vault", "Vault.EditVault", new { url = item.Url, type = "Upload" })">@item.Title</a></li>
}
</ul>
}
</div>
</div>
</div>
<div class="container" id="upload-links">
</div>
<br />
<div class="well text-center">
<p>
The maximum file size per upload is <b>@StringHelper.GetBytesReadable(maxUploadSize)</b>
</p>
<p>
Each file is encrypted after upload using an AES-256-CTR cipher. You can encrypt it within your browser for extra security by setting the option <strong>Encrypt in Browser</strong> in the options pane.
</p>
</div>
<div class="text-center">
Useful Tools: <a href="@Url.SubRouteUrl("help", "Help.Tools")">Upload Scripts and Utilities</a>
</div>
</div>
<div class="modal fade" id="uploadSettings" tabindex="-1" role="dialog" aria-labelledby="uploadSettingsLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<div class="row">
<div class="col-sm-12 text-center">
<h4 class="text-center">Encrypt in Browser</h4>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<input type="checkbox" class="center-block" name="encrypt" id="encrypt" @(Model.Encrypt ? "checked" : string.Empty) />
</div>
</div>
</div>
@if (User.Identity.IsAuthenticated)
{
<div class="col-sm-6">
<div class="row">
<div class="col-sm-12 text-center">
<h4 class="text-center">Expiration</h4>
</div>
</div>
<div class="row">
<div class="col-sm-4 hidden" id="length-div">
<input type="number" min="1" step="1" class="form-control" name="expirelength" id="expirelength" value="@Model.ExpirationLength">
</div>
<div class="col-sm-12" id="unit-div">
<select class="form-control" name="expireunit" id="expireunit">
@foreach (ExpirationUnit unit in Enum.GetValues(typeof(ExpirationUnit)))
{
<!option value="@unit" @(Model.ExpirationUnit == unit ? "selected" : string.Empty)>@unit.ToString()</!option>
}
</select>
</div>
</div>
</div>
}
</div>
</div>
</div>
</div>
</div>
<div id="templates" style="display: none">
<div class="row" id="upload-template">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading text-center" id="upload-header">
<div class="row">
<div class="col-sm-10 col-sm-offset-1" id="upload-title"></div>
<div class="col-sm-1">
<button type="button" class="close pull-right" id="upload-close"><i class="fa fa-times-circle"></i></button>
</div>
</div>
</div>
<div class="panel-body" id="upload-details">
<div class="row" id="upload-link-panel">
<input type="hidden" id="upload-url" />
<div class="col-sm-8">
<dl class="dl-horizontal" style="margin-bottom: 0;">
<dt>Url</dt>
<dd><a href="#" id="upload-link" target="_blank" class="alert-link"></a></dd>
<dt>Content-Type</dt>
<dd id="upload-contentType"></dd>
<dt>File Size</dt>
<dd id="upload-contentLength"></dd>
<dt>Expiration</dt>
<dd id="upload-expiration"></dd>
</dl>
</div>
<div class="col-sm-4">
<div class="btn-group pull-right" role="group">
<button type="button" class="btn btn-default btn-sm" id="shortenUrl"><i class="fa fa-link"></i>&nbsp;Shorten</button>
<button type="button" class="btn btn-default btn-sm" id="delete-link"><i class="fa fa-trash"></i>&nbsp;Deletion Link</button>
</div>
</div>
</div>
<div class="row" id="upload-progress-panel">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12 text-center">
<div class="progress" id="progress">
<div id="progress-bar" class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-10 col-sm-offset-1 text-center">
<span id="progress-info"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<bundle src="js/upload.min.js" append-version="true" />