From 5c70a5c39ca9b13feb65c53f6d2365f303d6d605 Mon Sep 17 00:00:00 2001 From: nouffer Date: Fri, 13 Aug 2021 11:04:47 +0530 Subject: [PATCH] update upload file check --- build/asset-manifest.json | 10 +++++----- build/index.html | 2 +- build/static/js/8.5b8eaf50.chunk.js.map | 1 - .../js/{8.5b8eaf50.chunk.js => 8.717aeff9.chunk.js} | 4 ++-- build/static/js/8.717aeff9.chunk.js.map | 1 + ...ntime-main.62598ad5.js => runtime-main.b31c46f0.js} | 4 ++-- ...in.62598ad5.js.map => runtime-main.b31c46f0.js.map} | 2 +- src/views/Uploader/index.js | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 build/static/js/8.5b8eaf50.chunk.js.map rename build/static/js/{8.5b8eaf50.chunk.js => 8.717aeff9.chunk.js} (70%) create mode 100644 build/static/js/8.717aeff9.chunk.js.map rename build/static/js/{runtime-main.62598ad5.js => runtime-main.b31c46f0.js} (56%) rename build/static/js/{runtime-main.62598ad5.js.map => runtime-main.b31c46f0.js.map} (99%) diff --git a/build/asset-manifest.json b/build/asset-manifest.json index 45f77a5..402ae6a 100644 --- a/build/asset-manifest.json +++ b/build/asset-manifest.json @@ -8,8 +8,8 @@ "main.css": "./static/css/main.12e98d00.chunk.css", "main.js": "./static/js/main.c02dc652.chunk.js", "main.js.map": "./static/js/main.c02dc652.chunk.js.map", - "runtime-main.js": "./static/js/runtime-main.62598ad5.js", - "runtime-main.js.map": "./static/js/runtime-main.62598ad5.js.map", + "runtime-main.js": "./static/js/runtime-main.b31c46f0.js", + "runtime-main.js.map": "./static/js/runtime-main.b31c46f0.js.map", "static/js/4.2aecef49.chunk.js": "./static/js/4.2aecef49.chunk.js", "static/js/4.2aecef49.chunk.js.map": "./static/js/4.2aecef49.chunk.js.map", "static/css/5.ecdd39c8.chunk.css": "./static/css/5.ecdd39c8.chunk.css", @@ -19,8 +19,8 @@ "static/js/6.bba51257.chunk.js.map": "./static/js/6.bba51257.chunk.js.map", "static/js/7.7a5be647.chunk.js": "./static/js/7.7a5be647.chunk.js", "static/js/7.7a5be647.chunk.js.map": "./static/js/7.7a5be647.chunk.js.map", - "static/js/8.5b8eaf50.chunk.js": "./static/js/8.5b8eaf50.chunk.js", - "static/js/8.5b8eaf50.chunk.js.map": "./static/js/8.5b8eaf50.chunk.js.map", + "static/js/8.717aeff9.chunk.js": "./static/js/8.717aeff9.chunk.js", + "static/js/8.717aeff9.chunk.js.map": "./static/js/8.717aeff9.chunk.js.map", "static/js/9.311e2cfe.chunk.js": "./static/js/9.311e2cfe.chunk.js", "static/js/9.311e2cfe.chunk.js.map": "./static/js/9.311e2cfe.chunk.js.map", "static/js/10.1aee78b2.chunk.js": "./static/js/10.1aee78b2.chunk.js", @@ -46,7 +46,7 @@ "static/js/6.bba51257.chunk.js.LICENSE.txt": "./static/js/6.bba51257.chunk.js.LICENSE.txt" }, "entrypoints": [ - "static/js/runtime-main.62598ad5.js", + "static/js/runtime-main.b31c46f0.js", "static/js/4.2aecef49.chunk.js", "static/css/main.12e98d00.chunk.css", "static/js/main.c02dc652.chunk.js" diff --git a/build/index.html b/build/index.html index e229fc8..dabfb81 100644 --- a/build/index.html +++ b/build/index.html @@ -1 +1 @@ -FBS Admin tool
\ No newline at end of file +FBS Admin tool
\ No newline at end of file diff --git a/build/static/js/8.5b8eaf50.chunk.js.map b/build/static/js/8.5b8eaf50.chunk.js.map deleted file mode 100644 index 084b6e7..0000000 --- a/build/static/js/8.5b8eaf50.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["views/Uploader/index.js"],"names":["Uploader","useState","file","setFile","row","md","htmlFor","xs","type","onChange","e","target","files","id","name","onClick","data","FormData","append","axios","post","then","res","statusText","alert","size","color"],"mappings":"mPAsFeA,UArEf,WAEI,MAAwBC,mBAAS,MAAjC,mBAAOC,EAAP,KAAaC,EAAb,KA6BA,OAAS,8BAEL,eACA,IADA,WAEA,cACA,IADA,oDAFA,IAKc,eACd,IADc,WAEd,eACA,IADA,CACWC,KAAG,EADd,UAEA,eACA,IADA,CACKC,GAAK,IADV,UAEA,cACA,IADA,CACOC,QAAU,aADjB,wIAFA,OAFA,IAMO,cACP,IADO,CACFC,GAAK,KACVF,GAAK,IAFE,SAGP,cACA,IADA,CACWG,KAAO,OAClBC,SA/CJ,SAAyBC,GACrBP,EAAQO,EAAEC,OAAOC,MAAM,KA+CvBC,GAAK,aACLC,KAAO,iBAbP,OAiBA,eAAC,IAAD,WACA,eAAC,IAAD,CAASN,KAAO,SAChBO,QAnDJ,SAAwBL,GACpB,IAAMM,EAAO,IAAIC,SACjBD,EAAKE,OAAO,OAAQhB,GACH,kDAAdA,EAAKY,MAA4C,8DAAdZ,EAAKY,KAEzCK,IAAMC,KAAK,oCAAqCJ,EAAM,IAEnDK,MAAK,SAAAC,GAEoB,MAAlBA,EAAIC,YACNC,MAAM,2FAKdA,MAAM,2EAAiBtB,EAAKY,KAAO,wPAqCrCW,KAAO,KACPC,MAAQ,UAHR,cAGoB,cAAE,IAAF,CAAQZ,KAAO,iBAHnC,4CADA","file":"static/js/8.5b8eaf50.chunk.js","sourcesContent":["import React, { useState } from 'react';\nimport axios from 'axios';\nimport {\n CCol,\n CFormGroup,\n CInput,\n CInputFile,\n CLabel,\n CButton,\n CCard,\n CCardHeader,\n CCardBody,\n CCardFooter,\n} from '@coreui/react'\nimport CIcon from '@coreui/icons-react'\n\n\nfunction Uploader() {\n\n const [file, setFile] = useState(null);\n\n function onChangeHandler(e) {\n setFile(e.target.files[0])\n }\n\n function onClickHandler(e) {\n const data = new FormData()\n data.append('file', file);\n if(file.name === 'ini_工程内検査票.xlsx' || file.name === 'ini_データ入力シート.xlsx')\n {\n axios.post(\"https://fsbsso.sumasen.net/upload\", data, { // receive two parameter endpoint url ,form data\n })\n .then(res => { // then print response status\n //console.log(res.statusText)\n if (res.statusText == 'OK') {\n alert(\"正常にアップロードされました\");\n }\n });\n }\n else {\n alert(\"ファイル名をアップロード\" + file.name + \"間違っている。名前を変更する必要があります ini_工程内検査票.xlsx また ini_データ入力シート.xlsx\");\n return\n }\n //console.log(file.name);\n //console.log('calling upload');\n\n }\n\n return ( <\n div >\n <\n CCard >\n <\n CCardHeader >\n アップロード <\n /CCardHeader> <\n CCardBody >\n <\n CFormGroup row >\n <\n CCol md = \"3\" >\n <\n CLabel htmlFor = \"date-input\" > アップロードするファイルを選んでください < /CLabel> < /\n CCol > <\n CCol xs = \"12\"\n md = \"9\" >\n <\n CInputFile type = \"file\"\n onChange = { onChangeHandler }\n id = \"file-input\"\n name = \"file-input\" / >\n <\n /CCol> < /\n CFormGroup >\n \n < CIcon name = \"cil-scrubber\" / > アップロード < /CButton> < /\n CCardFooter>\n \n \n \n )\n}\n\nexport default Uploader\n"],"sourceRoot":""} \ No newline at end of file diff --git a/build/static/js/8.5b8eaf50.chunk.js b/build/static/js/8.717aeff9.chunk.js similarity index 70% rename from build/static/js/8.5b8eaf50.chunk.js rename to build/static/js/8.717aeff9.chunk.js index b76981b..5d2d1ca 100644 --- a/build/static/js/8.5b8eaf50.chunk.js +++ b/build/static/js/8.717aeff9.chunk.js @@ -1,2 +1,2 @@ -(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[8],{773:function(e,t,i){"use strict";i.r(t);var n=i(655),s=i(1),c=i(642),r=i.n(c),a=i(637),l=i(636),j=i(18);t.default=function(){var e=Object(s.useState)(null),t=Object(n.a)(e,2),i=t[0],c=t[1];return Object(j.jsx)("div",{children:Object(j.jsxs)(a.f,{children:[Object(j.jsx)(a.j,{children:"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "})," ",Object(j.jsxs)(a.g,{children:[Object(j.jsxs)(a.t,{row:!0,children:[Object(j.jsxs)(a.k,{md:"3",children:[Object(j.jsx)(a.H,{htmlFor:"date-input",children:" \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044 "})," "]})," ",Object(j.jsx)(a.k,{xs:"12",md:"9",children:Object(j.jsx)(a.C,{type:"file",onChange:function(e){c(e.target.files[0])},id:"file-input",name:"file-input"})})," "]}),Object(j.jsxs)(a.h,{children:[Object(j.jsxs)(a.e,{type:"submit",onClick:function(e){var t=new FormData;t.append("file",i),"ini_\u5de5\u7a0b\u5185\u691c\u67fb\u7968.xlsx"===i.name||"ini_\u30c7\u30fc\u30bf\u5165\u529b\u30b7\u30fc\u30c8.xlsx"===i.name?r.a.post("https://fsbsso.sumasen.net/upload",t,{}).then((function(e){"OK"==e.statusText&&alert("\u6b63\u5e38\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3057\u305f")})):alert("\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9"+i.name+"\u9593\u9055\u3063\u3066\u3044\u308b\u3002\u540d\u524d\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059 ini_\u5de5\u7a0b\u5185\u691c\u67fb\u7968.xlsx \u307e\u305f ini_\u30c7\u30fc\u30bf\u5165\u529b\u30b7\u30fc\u30c8.xlsx")},size:"sm",color:"primary",children:[" ",Object(j.jsx)(l.a,{name:"cil-scrubber"})," \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "]})," "]})]})]})})}}}]); -//# sourceMappingURL=8.5b8eaf50.chunk.js.map \ No newline at end of file +(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[8],{773:function(e,t,i){"use strict";i.r(t);var n=i(655),s=i(1),c=i(642),r=i.n(c),a=i(637),l=i(636),j=i(18);t.default=function(){var e=Object(s.useState)(null),t=Object(n.a)(e,2),i=t[0],c=t[1];return Object(j.jsx)("div",{children:Object(j.jsxs)(a.f,{children:[Object(j.jsx)(a.j,{children:"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "})," ",Object(j.jsxs)(a.g,{children:[Object(j.jsxs)(a.t,{row:!0,children:[Object(j.jsxs)(a.k,{md:"3",children:[Object(j.jsx)(a.H,{htmlFor:"date-input",children:" \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044 "})," "]})," ",Object(j.jsx)(a.k,{xs:"12",md:"9",children:Object(j.jsx)(a.C,{type:"file",onChange:function(e){c(e.target.files[0])},id:"file-input",name:"file-input"})})," "]}),Object(j.jsxs)(a.h,{children:[Object(j.jsxs)(a.e,{type:"submit",onClick:function(e){var t=new FormData;t.append("file",i),"ini_\u5de5\u7a0b\u5185\u691c\u67fb\u7968.xlsx"===i.name||"ini_\u30c7\u30fc\u30bf\u5165\u529b\u30b7\u30fc\u30c8.xlsx"===i.name?r.a.post("https://fsbsso.sumasen.net/upload",t,{}).then((function(e){"OK"==e.statusText&&alert("\u6b63\u5e38\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3057\u305f")})):alert("\u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u540d"+i.name+"\u304c\u9593\u9055\u3063\u3066\u3044\u307e\u3059\u3002ini_\u5de5\u7a0b\u5185\u691c\u67fb\u8868.xlsx \u307e\u305f\u306f ini_\u30c7\u30fc\u30bf\u5165\u529b\u30b7\u30fc\u30c8.xlsx \u306e\u3069\u3061\u3089\u304b\u306b\u540d\u524d\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002")},size:"sm",color:"primary",children:[" ",Object(j.jsx)(l.a,{name:"cil-scrubber"})," \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "]})," "]})]})]})})}}}]); +//# sourceMappingURL=8.717aeff9.chunk.js.map \ No newline at end of file diff --git a/build/static/js/8.717aeff9.chunk.js.map b/build/static/js/8.717aeff9.chunk.js.map new file mode 100644 index 0000000..0f4b5ea --- /dev/null +++ b/build/static/js/8.717aeff9.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["views/Uploader/index.js"],"names":["Uploader","useState","file","setFile","row","md","htmlFor","xs","type","onChange","e","target","files","id","name","onClick","data","FormData","append","axios","post","then","res","statusText","alert","size","color"],"mappings":"mPAsFeA,UArEf,WAEI,MAAwBC,mBAAS,MAAjC,mBAAOC,EAAP,KAAaC,EAAb,KA6BA,OAAS,8BAEL,eACA,IADA,WAEA,cACA,IADA,oDAFA,IAKc,eACd,IADc,WAEd,eACA,IADA,CACWC,KAAG,EADd,UAEA,eACA,IADA,CACKC,GAAK,IADV,UAEA,cACA,IADA,CACOC,QAAU,aADjB,wIAFA,OAFA,IAMO,cACP,IADO,CACFC,GAAK,KACVF,GAAK,IAFE,SAGP,cACA,IADA,CACWG,KAAO,OAClBC,SA/CJ,SAAyBC,GACrBP,EAAQO,EAAEC,OAAOC,MAAM,KA+CvBC,GAAK,aACLC,KAAO,iBAbP,OAiBA,eAAC,IAAD,WACA,eAAC,IAAD,CAASN,KAAO,SAChBO,QAnDJ,SAAwBL,GACpB,IAAMM,EAAO,IAAIC,SACjBD,EAAKE,OAAO,OAAQhB,GACH,kDAAdA,EAAKY,MAA4C,8DAAdZ,EAAKY,KAEzCK,IAAMC,KAAK,oCAAqCJ,EAAM,IAEnDK,MAAK,SAAAC,GAEoB,MAAlBA,EAAIC,YACNC,MAAM,2FAKdA,MAAM,+DAAetB,EAAKY,KAAO,kSAqCnCW,KAAO,KACPC,MAAQ,UAHR,cAGoB,cAAE,IAAF,CAAQZ,KAAO,iBAHnC,4CADA","file":"static/js/8.717aeff9.chunk.js","sourcesContent":["import React, { useState } from 'react';\nimport axios from 'axios';\nimport {\n CCol,\n CFormGroup,\n CInput,\n CInputFile,\n CLabel,\n CButton,\n CCard,\n CCardHeader,\n CCardBody,\n CCardFooter,\n} from '@coreui/react'\nimport CIcon from '@coreui/icons-react'\n\n\nfunction Uploader() {\n\n const [file, setFile] = useState(null);\n\n function onChangeHandler(e) {\n setFile(e.target.files[0])\n }\n\n function onClickHandler(e) {\n const data = new FormData()\n data.append('file', file);\n if(file.name === 'ini_工程内検査票.xlsx' || file.name === 'ini_データ入力シート.xlsx')\n {\n axios.post(\"https://fsbsso.sumasen.net/upload\", data, { // receive two parameter endpoint url ,form data\n })\n .then(res => { // then print response status\n //console.log(res.statusText)\n if (res.statusText == 'OK') {\n alert(\"正常にアップロードされました\");\n }\n });\n }\n else {\n alert(\"指定されたファイル名\" + file.name + \"が間違っています。ini_工程内検査表.xlsx または ini_データ入力シート.xlsx のどちらかに名前を変更してください。\");\n return\n }\n //console.log(file.name);\n //console.log('calling upload');\n\n }\n\n return ( <\n div >\n <\n CCard >\n <\n CCardHeader >\n アップロード <\n /CCardHeader> <\n CCardBody >\n <\n CFormGroup row >\n <\n CCol md = \"3\" >\n <\n CLabel htmlFor = \"date-input\" > アップロードするファイルを選んでください < /CLabel> < /\n CCol > <\n CCol xs = \"12\"\n md = \"9\" >\n <\n CInputFile type = \"file\"\n onChange = { onChangeHandler }\n id = \"file-input\"\n name = \"file-input\" / >\n <\n /CCol> < /\n CFormGroup >\n \n < CIcon name = \"cil-scrubber\" / > アップロード < /CButton> < /\n CCardFooter>\n \n \n \n )\n}\n\nexport default Uploader\n"],"sourceRoot":""} \ No newline at end of file diff --git a/build/static/js/runtime-main.62598ad5.js b/build/static/js/runtime-main.b31c46f0.js similarity index 56% rename from build/static/js/runtime-main.62598ad5.js rename to build/static/js/runtime-main.b31c46f0.js index 573adfc..a524cc3 100644 --- a/build/static/js/runtime-main.62598ad5.js +++ b/build/static/js/runtime-main.b31c46f0.js @@ -1,2 +1,2 @@ -!function(e){function t(t){for(var n,o,u=t[0],i=t[1],f=t[2],d=0,s=[];d