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.

Index.cshtml 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @model Teknik.Areas.Upload.ViewModels.UploadViewModel
  2. @using Teknik.Utilities
  3. <script>
  4. var encScriptSrc = '@Scripts.Url("~/bundles/cryptoWorker")';
  5. var aesScriptSrc = '@Scripts.Url("~/bundles/crypto")';
  6. var generateDeleteKeyURL = '@Url.SubRouteUrl(Model.CurrentSub, "Upload.Action", new { action= "GenerateDeleteKey" })';
  7. var saveKeyToServerURL = '@Url.SubRouteUrl(Model.CurrentSub, "Upload.Action", new { action= "SaveFileKey" })';
  8. var removeKeyFromServerURL = '@Url.SubRouteUrl(Model.CurrentSub, "Upload.Action", new { action= "RemoveFileKey" })';
  9. var uploadFileURL = '@Url.SubRouteUrl(Model.CurrentSub, "Upload.Action", new { action = "Upload" })';
  10. var maxUploadSize = @Model.Config.UploadConfig.MaxUploadSize;
  11. var chunkSize = @Model.Config.UploadConfig.ChunkSize;
  12. var keySize = @Model.Config.UploadConfig.KeySize;
  13. var blockSize = @Model.Config.UploadConfig.BlockSize;
  14. var shortenURL = '@Url.SubRouteUrl("shorten", "Shortener.Action", new { action= "ShortenUrl" })';
  15. </script>
  16. @Styles.Render("~/Content/upload")
  17. <div class="container">
  18. <div class="row text-center">
  19. <div class="col-sm-8 col-sm-offset-2">
  20. <div class="row text-center">
  21. <div class="well well-lg text-center" id="uploadButton" style="cursor: pointer">
  22. <div class="row">
  23. <div class="col-sm-12">
  24. <h1>Drop your files here</h1>
  25. </div>
  26. </div>
  27. <div class="row">
  28. <div class="col-sm-12">
  29. <h2>Or just click here</h2>
  30. </div>
  31. </div>
  32. <div class="row">
  33. <div class="col-sm-12">
  34. <h3>Your Choice</h3>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="col-sm-2">
  41. <div class="row">
  42. <div class="col-sm-12">
  43. <label for="encrypt">Encrypt in Browser</label>
  44. <input type="checkbox" name="encrypt" id="encrypt" @(Model.Encrypt ? "checked" : string.Empty) />
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="row" id="copy-all-button" style="display: none">
  50. <div class="col-sm-12">
  51. <button type="button" class="btn btn-default btn-sm pull-right" id="copy-all"><i class="fa fa-clipboard"></i>&nbsp;Copy All Uploads</button>
  52. </div>
  53. </div>
  54. <div class="container" id="upload-links">
  55. </div>
  56. <br />
  57. <div class="well text-center">
  58. <p>
  59. Each file is encrypted on upload using an AES-256-CTR cipher.
  60. </p>
  61. <p>
  62. To view the file decrypted, you must use the direct Teknik link in a javascript enabled browser.
  63. </p>
  64. <p>
  65. The maximum file size per upload is <b>@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSize)</b>
  66. </p>
  67. </div>
  68. <div class="text-center">
  69. Useful Tools: <a href="@Url.SubRouteUrl("help", "Help.Tools")">Upload Scripts and Utilities</a>
  70. </div>
  71. </div>
  72. <div id="templates" style="display: none">
  73. <div class="row" id="upload-template">
  74. <div class="col-sm-12">
  75. <div class="panel panel-default">
  76. <div class="panel-heading text-center" id="upload-header">
  77. <div class="row">
  78. <div class="col-sm-10 col-sm-offset-1" id="upload-title"></div>
  79. <div class="col-sm-1">
  80. <button type="button" class="close pull-right" id="upload-close"><i class="fa fa-times-circle"></i></button>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="panel-body" id="upload-details">
  85. <div class="row" id="upload-link-panel">
  86. <div class="col-sm-8">
  87. <dl class="dl-horizontal">
  88. <dt>Url</dt>
  89. <dd><a href="#" id="upload-link" target="_blank" class="alert-link"></a></dd>
  90. <dt>Content-Type</dt>
  91. <dd id="upload-contentType"></dd>
  92. <dt>File Size</dt>
  93. <dd id="upload-contentLength"></dd>
  94. </dl>
  95. </div>
  96. <div class="col-sm-4">
  97. <div class="btn-group pull-right" role="group">
  98. <button type="button" class="btn btn-default btn-sm" id="shortenUrl"><i class="fa fa-link"></i>&nbsp;Shorten</button>
  99. <button type="button" class="btn btn-default btn-sm" id="generate-delete-link"><i class="fa fa-trash"></i>&nbsp;Deletion URL</button>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="row" id="upload-progress-panel">
  104. <div class="col-sm-12">
  105. <div class="row">
  106. <div class="col-sm-12 text-center">
  107. <div class="progress" id="progress">
  108. <div id="progress-bar" class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="row">
  113. <div class="col-sm-10 col-sm-offset-1 text-center">
  114. <span id="progress-info"></span>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. @Scripts.Render("~/bundles/upload")