From: jocloud Date: Thu, 21 May 2020 15:22:46 +0000 (+0000) Subject: 파샬변수 데이터 세션에 저장하도록 변경 및 여러가지 X-Git-Url: https://git.insang.kr/gitweb/?a=commitdiff_plain;h=0111d8f270e26d533ce5704947817c26529a8cc9;p=ZipProject.git 파샬변수 데이터 세션에 저장하도록 변경 및 여러가지 --- diff --git a/ZipProject/Controllers/WebZipController.cs b/ZipProject/Controllers/WebZipController.cs index b37a0be..1df5883 100644 --- a/ZipProject/Controllers/WebZipController.cs +++ b/ZipProject/Controllers/WebZipController.cs @@ -25,17 +25,13 @@ namespace ZipProject.Controllers } // GET: // - 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 files, string fileKeyPair, string format, string uuid) { JObject keyPair_FileDir = JObject.Parse(fileKeyPair); - Console.WriteLine(dirList); + // Console.WriteLine(dirList); Dictionary data = new Dictionary(); 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(""); diff --git a/ZipProject/Models/ZipModel.cs b/ZipProject/Models/ZipModel.cs index 5b58381..02cb861 100644 --- a/ZipProject/Models/ZipModel.cs +++ b/ZipProject/Models/ZipModel.cs @@ -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 files; double nows; double per; - private string zipname; public ZipModel () { } - public void SetParam (JObject keypair, string[] dirList, List files, string zipname, string uuid) { + public void SetParam (JObject keypair, string[] dirList, List 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); } } diff --git a/ZipProject/Views/Shared/_Layout.cshtml b/ZipProject/Views/Shared/_Layout.cshtml index 6e2fea8..1d8bc6e 100644 --- a/ZipProject/Views/Shared/_Layout.cshtml +++ b/ZipProject/Views/Shared/_Layout.cshtml @@ -47,6 +47,9 @@ @@ -133,15 +133,15 @@ var nY= e.changedTouches[0].pageY; var nTime= e.timeStamp; - if ((htDragInfo.startY - nY <= 10 && htDragInfo.startY - nY >= -10) && htDragInfo.startX - nX < -30){ + if ((htDragInfo.startY - nY <= 9 && htDragInfo.startY - nY >= -9) && htDragInfo.startX - nX < -30){ var menuX= parseInt($("#zipExplore").offset().top) + parseInt($("#toolbar_zipExplore").height()) + 5; - var menuY= parseInt($("#zipExplore").offset().left) + parseInt($("#zipExplore").width()) * 0.5; + var menuY= parseInt($("#zipExplore").offset().left) + parseInt($("#zipExplore").width()) -100; HideContextmenu(); event.preventDefault(); HideContextmenu(); $(GetMenu("mobile")) .appendTo("body") - .css({ top: menuX + "px", left: menuY + "px", 'z-index': '99999999' }); + .css({ top: menuX + "px", left: menuY + "px", 'z-index': '999' }); } if(bStartEvent && !bMoveEvent) { diff --git a/ZipProject/Views/WebZip/partial_zip.cshtml b/ZipProject/Views/WebZip/partial_zip.cshtml index d20bdc6..056e808 100644 --- a/ZipProject/Views/WebZip/partial_zip.cshtml +++ b/ZipProject/Views/WebZip/partial_zip.cshtml @@ -68,7 +68,7 @@
-
+
diff --git a/ZipProject/Views/WebZip/partial_zip_help.cshtml b/ZipProject/Views/WebZip/partial_zip_help.cshtml index 7234771..53fdd18 100644 --- a/ZipProject/Views/WebZip/partial_zip_help.cshtml +++ b/ZipProject/Views/WebZip/partial_zip_help.cshtml @@ -10,8 +10,6 @@
  • @LanguagePack.GetText(lang, "guide2") -
    - @LanguagePack.GetText(lang, "guide2-1")
  • @LanguagePack.GetText(lang, "guide3") @@ -19,4 +17,7 @@
  • @LanguagePack.GetText(lang, "guide4")
  • +
  • + @LanguagePack.GetText(lang, "guide5") +
  • \ No newline at end of file diff --git a/ZipProject/Views/_ViewImports.cshtml b/ZipProject/Views/_ViewImports.cshtml index 54d8fd7..bcc12f5 100644 --- a/ZipProject/Views/_ViewImports.cshtml +++ b/ZipProject/Views/_ViewImports.cshtml @@ -1,4 +1,4 @@ -@using ZipProject +@using ZipProject @using ZipProject.Models @using Microsoft.AspNetCore.Http @using Microsoft.AspNetCore.Mvc diff --git a/ZipProject/Views/_ViewStart.cshtml b/ZipProject/Views/_ViewStart.cshtml index ea5c551..f7e1747 100644 --- a/ZipProject/Views/_ViewStart.cshtml +++ b/ZipProject/Views/_ViewStart.cshtml @@ -1,5 +1,6 @@ -@inject IHttpContextAccessor httpContextAccesor +@inject IHttpContextAccessor httpContextAccesor @{ Layout = "_Layout"; ViewData["lang"] = httpContextAccesor.HttpContext.Session.GetString("lang"); + ViewData["partial"] = String.IsNullOrEmpty(httpContextAccesor.HttpContext.Session.GetString("partial")) ? "partial_zip" : httpContextAccesor.HttpContext.Session.GetString("partial"); } diff --git a/ZipProject/wwwroot/Language/en.json b/ZipProject/wwwroot/Language/en.json index 2d1574a..66ca49b 100644 --- a/ZipProject/wwwroot/Language/en.json +++ b/ZipProject/wwwroot/Language/en.json @@ -24,13 +24,14 @@ "usersguide": "User's Guide", "guide1": "1. Click on the file to select it.", "guide2": "2. The file can be dragged into the folder.
    ", - "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" } diff --git a/ZipProject/wwwroot/Language/kr.json b/ZipProject/wwwroot/Language/kr.json index 59142bf..888eccc 100644 --- a/ZipProject/wwwroot/Language/kr.json +++ b/ZipProject/wwwroot/Language/kr.json @@ -22,15 +22,16 @@ "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": "파일,폴더 제거" } diff --git a/ZipProject/wwwroot/css/site.css b/ZipProject/wwwroot/css/site.css index 09ab4d5..51f94d0 100644 --- a/ZipProject/wwwroot/css/site.css +++ b/ZipProject/wwwroot/css/site.css @@ -56,6 +56,7 @@ body { .body-content { margin-top: 11px; + margin-bottom: 60px; } .webzip-bodycontainer { @@ -242,8 +243,8 @@ ul { margin-right: 5px; position: relative; text-align: center; - top: 375px; - right: 20px; + top: 5px; + right: 5px; } .webzip-btn-complate div { background-color: rgb(255, 100, 100); @@ -266,4 +267,11 @@ ul { position: absolute; top: -1px; } +} + +footer { + position: fixed; + bottom: 0px; + width: 100%; + z-index: 9999; } \ No newline at end of file diff --git a/ZipProject/wwwroot/js/Zip/partial_zip.js b/ZipProject/wwwroot/js/Zip/partial_zip.js index cba1557..8d0bc6e 100644 --- a/ZipProject/wwwroot/js/Zip/partial_zip.js +++ b/ZipProject/wwwroot/js/Zip/partial_zip.js @@ -435,14 +435,18 @@ function GetMenu(gubun) { '
    ' + _Language["addFile"] + "
    "; - var rename = - '
    '; - if (selected_nameChange != undefined && selected_nameChange.prev().attr('is') == 'zip'){ - rename += _Language["renameZip"]; - } else { - rename += _Language["renameDir"]; - } - rename += "
    "; + var remove = + '
    ' + + _Language["removefilefolder"] + + "
    "; + var rename = '' + // rename= '
    '; + // if (selected_nameChange != undefined && selected_nameChange.prev().attr('is') == 'zip'){ + // rename += _Language["renameZip"]; + // } else { + // rename += _Language["renameDir"]; + // } + // rename += "
    "; diff --git a/nohup.out b/nohup.out deleted file mode 100644 index 1a5b7e6..0000000 --- a/nohup.out +++ /dev/null @@ -1,5 +0,0 @@ -Could not execute because the specified command or file was not found. -Possible reasons for this include: - * You misspelled a built-in dotnet command. - * You intended to execute a .NET Core program, but dotnet-release/netcoreapp2.1/ZipProject.dll does not exist. - * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. diff --git a/release_publish b/release_publish index 105be8c..cf986a6 100755 --- a/release_publish +++ b/release_publish @@ -1,5 +1,5 @@ -cd ZipProject +cd ~/.publish/nicezip/sources/ZipProject dotnet publish --configuration ../../../release cd ../../ ./runserver