A web-based NAS client system(developing)
- Ant-design
- React.js
- React-router
- Axios
- JWT
- CryptoJS
-
Install dependencies
$ npm install
-
Edit package.json For example:
"proxy": "http://192.168.2.6:8888/",
location is refered by server
-
Edit vinas_react/src/Pages/User/Files.js(Will fix this issue in feature)
const playMedia = (name) => { // Todo: CORS authHelper.renewToken().then((res) => { if(res) { const objectID = name; // Edit this line const url = `//PROXY_LOCATION/api/user/media/?objectID=${ objectID }&accessToken=${ localStorage.getItem('accessToken') }&refreshToken=${ localStorage.getItem('refreshToken') }`; setMediaURL(url); setIsVideoModalVisible(true); } else { authHelper.logout(); } }); } const downloadHandler = (objectID) => { // Todo: CORS authHelper.renewToken() .then((result) => { if(result) { const iframe = document.createElement('iframe'); // Edit this line iframe.src = `//PROXY_LOCATION/api/user/getFile?objectID=${ objectID }&accessToken=${ localStorage.getItem('accessToken') }&refreshToken=${ localStorage.getItem('refreshToken') }`; iframe.style.display = 'none'; // Todo: remove iframe by interval check document.body.appendChild(iframe); } else { // Todo: Error warning } }) }
-
Run client
$ npm start
Server implmentation: https://github.com/40443219/vinas_server