]> insang Git - ZipProject.git/commitdiff
파샬변수 데이터 세션에 저장하도록 변경 및 여러가지
authorjocloud <dhkq92@icloud.com>
Thu, 21 May 2020 15:22:46 +0000 (15:22 +0000)
committerjocloud <dhkq92@icloud.com>
Thu, 21 May 2020 15:22:46 +0000 (15:22 +0000)
14 files changed:
ZipProject/Controllers/WebZipController.cs
ZipProject/Models/ZipModel.cs
ZipProject/Views/Shared/_Layout.cshtml
ZipProject/Views/WebZip/Index.cshtml
ZipProject/Views/WebZip/partial_zip.cshtml
ZipProject/Views/WebZip/partial_zip_help.cshtml
ZipProject/Views/_ViewImports.cshtml
ZipProject/Views/_ViewStart.cshtml
ZipProject/wwwroot/Language/en.json
ZipProject/wwwroot/Language/kr.json
ZipProject/wwwroot/css/site.css
ZipProject/wwwroot/js/Zip/partial_zip.js
nohup.out [deleted file]
release_publish

index b37a0be55464aaed8d96a116497cdf715cb08f4f..1df58838a01d1c366506afb4956681a69669eafc 100644 (file)
@@ -25,17 +25,13 @@ namespace ZipProject.Controllers
     }
 
     // GET: /<controller>/
-    public IActionResult Index(string partial_name)
+    public IActionResult Index()
     {
       if (string.IsNullOrEmpty(HttpContext.Session.GetString("lang")))
       {
         session.SetString("lang", "kr");
       }
 
-      if (string.IsNullOrEmpty(partial_name))
-        ViewData["partial_page"] = "partial_zip";
-      else
-        ViewData["partial_page"] = partial_name;
       return View();
     }
 
@@ -51,12 +47,18 @@ namespace ZipProject.Controllers
       return Redirect("/");
     }
 
+    public IActionResult SetPartial(string partial_name)
+    {
+      session.SetString("partial", partial_name);
+      return Redirect("/");
+    }
+
     //파일업로드 사이즈 3GB (3(GB) * 1024(MB) * 1024(KB) * 1024(byte))
     [RequestSizeLimit(3221225472)]
     public ActionResult FileUpload(string dirList, List<IFormFile> files, string fileKeyPair, string format, string uuid)
     {
       JObject keyPair_FileDir = JObject.Parse(fileKeyPair);
-      Console.WriteLine(dirList);
+      // Console.WriteLine(dirList);
       Dictionary<string, object> data = new Dictionary<string, object>();
       ZipModel zipModel = new ZipModel();
 
@@ -65,7 +67,7 @@ namespace ZipProject.Controllers
       string[] listDir = dirList.Split(',');
       string filename = listDir[0] + "." + format;
 
-      zipModel.SetParam(keyPair_FileDir, listDir, files, uuid, uuid);
+      zipModel.SetParam(keyPair_FileDir, listDir, files, uuid);
       zipModel.MakeZip();
 
       return Json("");
index 5b58381987203916044ff2080f62dee074479e00..02cb861bd10d24e92d4a05832cd0741dfe18e48c 100644 (file)
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -22,14 +22,12 @@ namespace ZipProject {
     private List<IFormFile> files;
     double nows;
     double per;
-    private string zipname;
     public ZipModel () { }
 
-    public void SetParam (JObject keypair, string[] dirList, List<IFormFile> files, string zipname, string uuid) {
+    public void SetParam (JObject keypair, string[] dirList, List<IFormFile> files, string uuid) {
       this.keypair = keypair;
       this.dirList = dirList;
       this.files = files;
-      this.zipname = zipname;
       this.uuid = uuid;
     }
 
@@ -37,8 +35,14 @@ namespace ZipProject {
       byte[] b = null;
       string filename = null;
       string dir = null;
-      string path = Environment.CurrentDirectory + "/wwwroot/zipfiles/" + zipname + ".zip";
+      string path;
 
+#if !DEBUG
+      path = Environment.CurrentDirectory + "/release/netcoreapp2.1/publish/wwwroot/zipfiles/";
+#else
+      path = Environment.CurrentDirectory + "/wwwroot/zipfiles/";
+#endif
+      
       using (var zip = new ZipFile (Encoding.UTF8)) {
         foreach (IFormFile file in files) {
           zip.SaveProgress += SaveProgress;
@@ -54,10 +58,13 @@ namespace ZipProject {
           zip.AddEntry (dir + filename, file.OpenReadStream ());
         }
 
-        if (!Directory.Exists (Environment.CurrentDirectory + "/wwwroot/zipfiles/")) {
-          Directory.CreateDirectory (Environment.CurrentDirectory + "/wwwroot/zipfiles/");
+        Console.WriteLine("here:"+path);
+        if (!Directory.Exists (path)) {
+          Directory.CreateDirectory (path);
         }
 
+        path += uuid + ".zip";
+
         zip.Save (path);
       }
     }
index 6e2fea8159e53f26644fc17cdc527efd55de72f1..1d8bc6e34c4009c2d90725e596547c4ebbc0549d 100644 (file)
@@ -47,6 +47,9 @@
 \r
   <!-- language section -->\r
   <script>\r
+    if((window.location+"").split('?').length != 0){\r
+      history.pushState(null, null, "/");\r
+    }\r
     var lang= "@ViewData["lang"]";\r
     var _Language;\r
     $.ajax({\r
index 0edb0f537002c101d0ea4fb16e00e0fd51e87443..0899ae6c9ba1e5a1b4c0f6c544d81616002d28f3 100644 (file)
@@ -14,7 +14,7 @@
 \r
   <div class="col-sm-12 webzip-howtouse">\r
     <div class="col-sm-12" style="text-align: left;">\r
-      <partial name="@ViewData["partial_page"]_help" />\r
+      <partial name="@ViewData["partial"]_help" />\r
     </div>\r
   </div>\r
 \r
@@ -22,7 +22,7 @@
 \r
   <div class="webzip-section-zipbutton">\r
     <div class="btn-group btn-group-toggle" data-toggle="buttons">\r
-      <label class="btn btn-danger btn-secondary" id="partial_zip" \r
+      <label class="btn btn-danger btn-secondary" id="partial_zip"\r
             style="outline: none; width: 115px; color: black; background-color: #e5e5e5;\r
             border: 1.5px solid #e5e5e5; font-weight: bold; font-size: 16px; border-top-left-radius: 10px; border-bottom-left-radius: 10px;">\r
         <input type="radio" name="options" autocomplete="off" /> @LanguagePack.GetText(lang, "zip")\r
         <input type="radio" name="options" autocomplete="off" /> @LanguagePack.GetText(lang, "unzip")\r
       </label> \r
     </div>\r
-    <form action="/webzip" method="post" id="frm1" name="frm1" style="display: none;">\r
+    <form action="/webzip/setpartial" method="post" id="frm1" name="frm1" style="display: none;">\r
       <input name="partial_name" value="" id="partial_name" />\r
     </form>\r
   </div>\r
   <div class="webzip-section-zip" id="section_zip">\r
-    <partial name="@ViewData["partial_page"]" />\r
+    <partial name="@ViewData["partial"]" />\r
   </div>\r
 \r
 </div>\r
 @section Scripts{\r
 \r
 <script>\r
-    var partial_page= "@ViewData["partial_page"]";\r
+    var partial_page= "@ViewData["partial"]";\r
 </script>\r
   \r
   <script src="/static/js:Zip:Index.js" asp-append-version="true"></script>\r
       var nY= e.changedTouches[0].pageY;\r
       var nTime= e.timeStamp;\r
 \r
-      if ((htDragInfo.startY - nY <= 10 && htDragInfo.startY - nY >= -10) && htDragInfo.startX - nX < -30){\r
+      if ((htDragInfo.startY - nY <= 9 && htDragInfo.startY - nY >= -9) && htDragInfo.startX - nX < -30){\r
         var menuX= parseInt($("#zipExplore").offset().top) + parseInt($("#toolbar_zipExplore").height()) + 5;\r
-        var menuY= parseInt($("#zipExplore").offset().left) + parseInt($("#zipExplore").width()) * 0.5;\r
+        var menuY= parseInt($("#zipExplore").offset().left) + parseInt($("#zipExplore").width()) -100;\r
         HideContextmenu();\r
         event.preventDefault();\r
         HideContextmenu();\r
         $(GetMenu("mobile"))\r
           .appendTo("body")\r
-          .css({ top: menuX + "px", left: menuY + "px", 'z-index': '99999999' });\r
+          .css({ top: menuX + "px", left: menuY + "px", 'z-index': '999' });\r
       }\r
 \r
       if(bStartEvent && !bMoveEvent) {\r
index d20bdc6bbd5b0584fc82f00f37ded5b040c36806..056e8082dfc1e45164679b76cf12519ea49b821e 100644 (file)
@@ -68,7 +68,7 @@
 <div class="col-sm-12 webzip-section-sidezip webzip-section-explore" id="zipExplore"\r
      style="border: 0px solid lightgray; overflow-x: auto; white-space: nowrap; text-align: left; padding: 0; background-color: #f9f9f9f9;\r
      border-radius: 10px;">\r
-  <div style="background-color: lightgray; padding-left: 10px; padding-right: 10px; height: 25px; line-height: 2; margin-bottom: 5px; position: sticky; top: 0px;" id="toolbar_zipExplore">\r
+  <div style="background-color: lightgray; padding-left: 10px; padding-right: 10px; height: 25px; line-height: 2; margin-bottom: 5px; position: sticky; top: 0px; z-index:1" id="toolbar_zipExplore">\r
     <i class="fas fa-dot-circle" style="color: rgb(251, 64, 65);"></i>\r
     <i class="fas fa-circle" style="color: rgb(223, 181, 33);"></i>\r
     <i class="fas fa-circle" style="color: rgb(70, 186, 33);"></i>\r
index 72347714b08c5f354000cf9810a7f39aed9ce5e4..53fdd18aa54753dc181e14f3ba8d03938bf34eb4 100644 (file)
@@ -10,8 +10,6 @@
   </li>
   <li>
     @LanguagePack.GetText(lang, "guide2")
-    <br>
-    @LanguagePack.GetText(lang, "guide2-1")
   </li>
   <li>
     @LanguagePack.GetText(lang, "guide3")
@@ -19,4 +17,7 @@
   <li>
     @LanguagePack.GetText(lang, "guide4")
   </li>
+  <li>
+    @LanguagePack.GetText(lang, "guide5")
+  </li>
 </ul>
\ No newline at end of file
index 54d8fd7258728cd3dcd1963510d91588825ed2c1..bcc12f5422853dd325427198719d4868175204fd 100644 (file)
@@ -1,4 +1,4 @@
-@using ZipProject\r
+@using ZipProject\r
 @using ZipProject.Models\r
 @using Microsoft.AspNetCore.Http\r
 @using Microsoft.AspNetCore.Mvc\r
index ea5c55148359db0e40fd37ee69dd7288552ea9b3..f7e17471c999f66ee2ce20b4898fc50871d20469 100644 (file)
@@ -1,5 +1,6 @@
-@inject IHttpContextAccessor httpContextAccesor\r
+@inject IHttpContextAccessor httpContextAccesor\r
 @{\r
     Layout = "_Layout";\r
     ViewData["lang"] = httpContextAccesor.HttpContext.Session.GetString("lang");\r
+    ViewData["partial"] = String.IsNullOrEmpty(httpContextAccesor.HttpContext.Session.GetString("partial")) ? "partial_zip" : httpContextAccesor.HttpContext.Session.GetString("partial");\r
 }\r
index 2d1574af9b3feb87931f6a4f41874dfeb2ffd82f..66ca49bfe8a9aa145bb6124da3dc9802148c2808 100644 (file)
   "usersguide": "User's Guide",
   "guide1": "1. Click on the file to select it.",
   "guide2": "2. The file can be dragged into the folder. <br> ",
-  "guide2-1": " * When you export to the top-level directory, drag it to the top-level label.",
   "guide3": "3. Folder is folded when double-clicked and opens when double-clicking again.",
   "guide4": "4. Right-click contextmenu appears.",
+  "guide5": "5. For mobile users, the directory function is not possible, and the menu is dragged to the right.",
   "complate": "Complate",
   "pleasewait": "Compressing files Please wait.",
   "iscompress": "proceed with compression? FileSize: ",
   "toolargesize": "The capacity of the files exceeds the maximum file size of 2 GB and can not proceed.",
   "nofilesadded": "No files added.",
-  "footIntroduce": "Easy and convenient file compression! Please find NiceZip."
+  "footIntroduce": "Easy and convenient file compression! Please find NiceZip.",
+  "removefilefolder": "remove file,directory"
 }
index 59142bfeb256c9e94384dcbe2ae88f7adf1d9733..888eccc00ca66785c14b2ad2feb6cef84c4a934c 100644 (file)
   "renameDir": "폴더이름변경",
   "renameZip": "압축파일이름변경",
   "usersguide": "사용설명서",
-  "guide1": "1. 파일은 클릭하셔서 선택하실 수 있습니다.",
+  "guide1": "1. 파일은 클릭하셔서 선택하실 수 있습니다",
   "guide2": "2. 파일은 폴더 속으로 드래그시킬 수 있습니다",
-  "guide2-1": " * 최상위 디렉토리로 꺼낼땐 최상위 라벨에 드래그해야합니다.",
-  "guide3": "3. 폴더는 더블클릭시 접히며 다시 더블클릭할시 열립니다.",
-  "guide4": "4. 우클릭시 메뉴가 나타납니다.",
+  "guide3": "3. 폴더는 더블클릭시 접히며 다시 더블클릭할시 열립니다",
+  "guide4": "4. 우클릭시 메뉴가 나타납니다",
+  "guide5": "5. 모바일사용자는 디렉토리이동은 불가하며, 메뉴는 오른쪽으로 드래그하시면 나옵니다",
   "complate": "완료",
   "pleasewait": "압축중입니다 잠시만 기다려주세요.",
   "iscompress": "압축을 진행하시겠습니까? FileSize: ",
   "toolargesize": "파일들의 용량이 최대파일크기인 2GB를 넘어가서 진행할 수 없습니다.",
   "nofilesadded": "추가된 파일이 없습니다.",
-  "footIntroduce": "쉽고 편리한 압축! NiceZip을 찾아주세요."
+  "footIntroduce": "쉽고 편리한 압축! NiceZip을 찾아주세요.",
+  "removefilefolder": "파일,폴더 제거"
 }
index 09ab4d5e7f484e58f9d19001741a9b5d89ec29be..51f94d0c7f47bfccb0d8d55fc9c896dd9c68ffbb 100644 (file)
@@ -56,6 +56,7 @@ body {
 \r
 .body-content {\r
   margin-top: 11px;\r
+  margin-bottom: 60px;\r
 }\r
 \r
 .webzip-bodycontainer {\r
@@ -242,8 +243,8 @@ ul {
   margin-right: 5px; \r
   position: relative; \r
   text-align: center;\r
-  top: 375px;\r
-  right: 20px;\r
+  top: 5px;\r
+  right: 5px;\r
 }\r
 .webzip-btn-complate div {\r
   background-color: rgb(255, 100, 100);\r
@@ -266,4 +267,11 @@ ul {
     position: absolute;\r
     top: -1px;\r
   }\r
+}\r
+\r
+footer {\r
+  position: fixed;\r
+  bottom: 0px;\r
+  width: 100%;\r
+  z-index: 9999;\r
 }
\ No newline at end of file
index cba1557e5f9ce5d1f0980ce4fcbc067f6b896815..8d0bc6ec64291ca14589697cef0a331ecaeda799 100644 (file)
@@ -435,14 +435,18 @@ function GetMenu(gubun) {
     '<div class="webzip-btn" onclick="ClickChooseFiles();HideContextmenu();">' +
     _Language["addFile"] +
     "</div>";
-  var rename =
-    '<div class="webzip-btn" onclick="NameFormToggle();HideContextmenu();">';
-    if (selected_nameChange != undefined && selected_nameChange.prev().attr('is') == 'zip'){
-      rename += _Language["renameZip"];
-    } else {
-      rename += _Language["renameDir"];
-    }
-    rename += "</div>";
+  var remove =
+    '<div class="webzip-btn" onclick="alert('+_Language["comingsoon"]+');HideContextmenu();">' +
+    _Language["removefilefolder"] +
+    "</div>";
+  var rename = ''
+  // rename= '<div class="webzip-btn" onclick="NameFormToggle();HideContextmenu();">';
+  // if (selected_nameChange != undefined && selected_nameChange.prev().attr('is') == 'zip'){
+  //   rename += _Language["renameZip"];
+  // } else {
+  //   rename += _Language["renameDir"];
+  // }
+  // rename += "</div>";
 
 
 
diff --git a/nohup.out b/nohup.out
deleted file mode 100644 (file)
index 1a5b7e6..0000000
--- a/nohup.out
+++ /dev/null
@@ -1,5 +0,0 @@
-Could not execute because the specified command or file was not found.\r
-Possible reasons for this include:\r
-  * You misspelled a built-in dotnet command.\r
-  * You intended to execute a .NET Core program, but dotnet-release/netcoreapp2.1/ZipProject.dll does not exist.\r
-  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
index 105be8c70507a189b0888c340711e6b0918abefb..cf986a694e47f8ac40f69adf68d402052bca5211 100755 (executable)
@@ -1,5 +1,5 @@
 
-cd ZipProject
+cd ~/.publish/nicezip/sources/ZipProject
 dotnet publish --configuration ../../../release
 cd ../../
 ./runserver