Skip to content
This repository was archived by the owner on Jul 31, 2019. It is now read-only.

Commit 7bd132d

Browse files
committed
Changed to use Lua script provided by FlashAir IoT Hub.
1 parent 88ec183 commit 7bd132d

18 files changed

Lines changed: 933 additions & 840 deletions

README.ja.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ FlashAir™の無線LAN機能を使い、FlashAir IoT Hubを経由する事で
3535
## Usage
3636

3737
1. 事前にFlashAir IoT Hubでアカウント登録し、FlashAirを登録する。詳細は[FlashAir IoT Hubのご利用の流れ](https://www.flashair-developers.com/ja/documents/tutorials/iot-hub/1/)を参照。
38-
2. [Luaスクリプト](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/download/v0.1.1/FlashAirFileManagerScript-0.1.1.zip)をダウンロード・解凍してFlashAirのルート上に置く。
39-
3. FlashAirのCONFIGに`LUA_RUN_SCRIPT=/fafm_boot.lua`を追記する。
38+
2. FlashAir IoT Hubにログインし、[Luaスクリプト](https://iot-hub.flashair-developers.com/ja/static/flashair-scripts.zip)をダウンロード・解凍してFlashAirのルート上に置く。
39+
3. FlashAirのCONFIGに`LUA_RUN_SCRIPT=/bootscript.lua`を追記する。
4040
4. FlashAirを抜き挿しするなどして、再起動する。
4141
5. FlashAirFileMangerを起動する。
42-
6. (初回起動の場合)FlashAir IoT Hub にログインし、アクセスの承認を行う
42+
6. FlashAir IoT Hubへのアクセス承認を行う
4343
7. 登録したFlashAirを選択すると、FlashAirのファイル一覧が画面左側に表示されます。
4444
8. FlashAirのファイルを選択して、画面中央のダウンロードボタンをクリックすると、ファイルが画面右側に表示されているフォルダーにダウンロードされます。
4545

46+
注意:Version 0.2.0より[FlashAir IoT Hub](https://iot-hub.flashair-developers.com)のLuaスクリプトを使う様に変更されました。0.2.0より前のバージョンをお使いの方は次の手順を実行してください。
47+
48+
- FlashAir IoT Hubにログインし、[Luaスクリプト](https://iot-hub.flashair-developers.com/ja/static/flashair-scripts.zip)をダウンロード・解凍してFlashAirのルート上に置く。
49+
- FlashAirのCONFIGを`LUA_RUN_SCRIPT=/fafm_boot.lua`から`LUA_RUN_SCRIPT=/bootscript.lua`に変更する。
50+
4651
## Build
4752

4853
### Windows

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ It is in [FlashAir Developers - FlashairFileManager](https://www.flashair-develo
3535
## Usage
3636

3737
1. Register your account in advance with FlashAir IoT Hub and register FlashAir. For details, please refer to [Flow of using FlashAir IoT Hub](https://www.flashair-developers.com/en/documents/tutorials/iot-hub/1/).
38-
2. Download [Lua script](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/download/v0.1.1/FlashAirFileManagerScript-0.1.1.zip), unzip it and place it on the root of FlashAir.
39-
3. Add `LUA_RUN_SCRIPT=/fafm_boot.lua` to FlashAir CONFIG.
38+
2. Login to FlashAir IoT Hub and download [Lua script](https://iot-hub.flashair-developers.com/en/static/flashair-scripts.zip), unzip it and place it on the root of FlashAir.
39+
3. Add `LUA_RUN_SCRIPT=/bootscript.lua` to FlashAir CONFIG.
4040
4. Disconnect and reconnect the FlashAir and restart.
4141
5. Start FlashAirFileManger.
42-
6. (First time startup) Login to FlashAir IoT Hub and approve access.
42+
6. Approve access to FlashAir IoT Hub.
4343
7. If you select the registered FlashAir, the file list of FlashAir is displayed on the left side of the screen.
4444
8. When you select a FlashAir file and click the download button in the center of the screen, the file will be downloaded to the folder displayed on the right side of the screen.
4545

46+
Note: Since version 0.2.0, Lua scripts are using [FlashAir IoT Hub] (https://iot-hub.flashair-developers.com) instead. If you are using a version earlier than 0.2.0, please follow the steps below.
47+
48+
- Login to FlashAir IoT Hub and download [Lua script](https://iot-hub.flashair-developers.com/en/static/flashair-scripts.zip), unzip it and place it on the root of FlashAir.
49+
- Change FlashAir CONFIG from `LUA_RUN_SCRIPT=/fafm_boot.lua` to` LUA_RUN_SCRIPT=/bootscript.lua`.
50+
4651
## Build
4752

4853
### Windows

electron-builder.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"appId": "com.flashair-developers",
33
"productName": "FlashAirFileManger",
44
"asar": true,
5+
"electronVersion": "1.7.9",
56
"files": [
67
"static/**/*",
78
"node_modules/**/*",

lua/fafm.lua

Lines changed: 0 additions & 84 deletions
This file was deleted.

lua/fafm_boot.lua

Lines changed: 0 additions & 9 deletions
This file was deleted.

lua/fafm_list.lua

Lines changed: 0 additions & 28 deletions
This file was deleted.

lua/fafm_upload.lua

Lines changed: 0 additions & 44 deletions
This file was deleted.

package.json

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "flashair-file-manager",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "The application to browse and download files on FlashAir™ via the network.",
55
"homepage": "https://github.com/FlashAirDevelopers/FlashAirFileManager",
66
"main": "./src/main/main.js",
77
"scripts": {
88
"dist:win": "npm config set msvs_version 2015 && npm config set scripts-prepend-node-path true && cross-env NODE_ENV=production npm run compile && electron-builder --win --x64",
99
"pack:win": "npm config set msvs_version 2015 && npm config set scripts-prepend-node-path true && cross-env NODE_ENV=production npm run compile && electron-builder --win --x64 --dir",
10+
"pack:win-dev": "npm config set msvs_version 2015 && npm config set scripts-prepend-node-path true && cross-env NODE_ENV=development npm run compile && electron-builder --win --x64 --dir",
1011
"compile": "webpack --config webpack.app.config.js",
1112
"lint": "eslint src/**/*.js",
1213
"fix": "eslint --fix",
@@ -21,52 +22,53 @@
2122
"javascript"
2223
],
2324
"author": "FlashAir Developers",
24-
"license": "Apache 2.0",
25+
"license": "Apache-2.0",
2526
"dependencies": {
26-
"@openid/appauth": "^0.2.2",
27+
"@openid/appauth": "^0.2.3",
2728
"about-window": "^1.8.0",
2829
"bootstrap": "^3.3.7",
2930
"bootstrap-notify": "^3.1.3",
3031
"bootstrap-select": "^1.12.4",
31-
"electron-log": "^2.2.9",
32+
"electron-log": "^2.2.11",
3233
"es6-promise": "^4.1.1",
33-
"handlebars": "^4.0.10",
34+
"handlebars": "^4.0.11",
3435
"isomorphic-fetch": "^2.2.1",
3536
"jquery": "^3.2.1",
3637
"js-base64": "^2.3.2",
3738
"jssha": "^2.3.1",
38-
"keytar": "^4.0.4",
39-
"source-map-support": "^0.4.18",
39+
"keytar": "^4.0.5",
40+
"source-map-support": "^0.5.0",
4041
"spin.js": "^2.3.2"
4142
},
4243
"devDependencies": {
4344
"babel-core": "^6.26.0",
44-
"babel-eslint": "^7.2.3",
45+
"babel-eslint": "^8.0.1",
4546
"babel-loader": "^7.1.2",
47+
"babel-minify-webpack-plugin": "^0.2.0",
4648
"babel-preset-es2015": "^6.24.1",
4749
"babel-runtime": "^6.26.0",
48-
"clean-webpack-plugin": "^0.1.16",
49-
"cross-env": "^5.0.5",
50-
"css-hot-loader": "^1.3.1",
50+
"clean-webpack-plugin": "^0.1.17",
51+
"cross-env": "^5.1.1",
52+
"css-hot-loader": "^1.3.2",
5153
"css-loader": "^0.28.7",
52-
"electron": "^1.7.8",
53-
"electron-builder": "^19.34.1",
54-
"electron-webpack": "^1.6.1",
55-
"eslint": "^4.6.1",
54+
"electron": "^1.7.9",
55+
"electron-builder": "^19.45.0",
56+
"electron-webpack": "^1.11.0",
57+
"eslint": "^4.10.0",
5658
"eslint-config-standard": "^10.2.1",
57-
"eslint-plugin-import": "^2.7.0",
58-
"eslint-plugin-node": "^5.1.1",
59-
"eslint-plugin-promise": "^3.5.0",
59+
"eslint-plugin-import": "^2.8.0",
60+
"eslint-plugin-node": "^5.2.1",
61+
"eslint-plugin-promise": "^3.6.0",
6062
"eslint-plugin-standard": "^3.0.1",
61-
"extract-text-webpack-plugin": "^3.0.0",
62-
"file-loader": "^0.11.2",
63+
"extract-text-webpack-plugin": "^3.0.2",
64+
"file-loader": "^1.1.5",
6365
"handlebars-loader": "^1.6.0",
6466
"node-gyp": "^3.6.2",
6567
"node-loader": "^0.6.0",
6668
"rcedit": "^0.9.0",
6769
"shebang-loader": "^0.0.1",
68-
"style-loader": "^0.18.2",
69-
"url-loader": "^0.5.9",
70-
"webpack": "^3.6.0"
70+
"style-loader": "^0.19.0",
71+
"url-loader": "^0.6.2",
72+
"webpack": "^3.8.1"
7173
}
7274
}

src/common/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ export const IoTHubApi = {
4343
files: '/v1/flashairs/{flashair_id}/files',
4444
};
4545
export const FlashAIrScript = {
46-
LIST: '/fafm_list.lua',
47-
UPLOAD: '/fafm_upload.lua'
46+
LIST: '/list_file.lua',
47+
UPLOAD: '/upload_file.lua'
4848
};

src/common/util.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ export const dateFormat = {
4949
return result;
5050
},
5151
};
52+
export const basename = path => {
53+
const base = path.substr(path.lastIndexOf('/') + 1);
54+
return base.replace(new RegExp('$', 'g'), '');
55+
};

0 commit comments

Comments
 (0)