aaden-cli 1.1.101 → 1.1.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitattributes CHANGED
@@ -1,2 +1,2 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
File without changes
File without changes
@@ -1,179 +1,179 @@
1
-
2
-
3
- ## Aaden配置说明
4
- ---
5
-
6
- 下载地址[https://2.gp/a72RO]
7
-
8
- 请将本文件夹整个拷贝到目标电脑上
9
-
10
- 右键目标电脑上到文件夹
11
-
12
- 选择在此打开终端
13
-
14
- 打开终端后 输入
15
-
16
- ./aadensetup.sh
17
-
18
- 如果提示权限不够,需要右键sh文件,给予她执行权限
19
-
20
- 按照流程配置要求配置,请注意查看所有提示文字
21
-
22
- ----
23
-
24
- 执行结束后,建立一个最高权限的匿名用户,在终端中执行下面的语句
25
-
26
- mysql < aaden.sql
27
-
28
- ---
29
-
30
- 更改服务器权限
31
-
32
- 将var/www/html 目录改为777权限,注意选择需要recurisive。
33
-
34
-
35
- ---
36
-
37
- ## 配置CronJob
38
-
39
-
40
- 进入webmin
41
-
42
- 在搜索栏中搜索cronjob 选择 Scheduled Cron Jobs
43
-
44
- 在右上角选择create a new Schedule cron job后进入创建CronJob窗口
45
-
46
- 选择Execute cron job as root 或 aaden
47
-
48
- command 一栏中填写
49
- ```
50
- /var/www/html/crontab.sh > /dev/null 2>&1
51
- ```
52
-
53
- When to execute 一项选择 每分钟执行一次
54
-
55
- Times and dates selected below ..
56
-
57
- 后面全部选择All
58
-
59
- 然后点Create
60
-
61
- 然后会退出
62
-
63
- 然后点击Save and run now
64
-
65
- 看到这样的显示说明正常
66
-
67
- 下面同理,命令换成
68
-
69
- 每小时执行一次
70
-
71
- command:
72
- ```
73
- wget -O /dev/null "http://localhost/PHP/AccessLog.php?op=reportStatus"
74
- ```
75
-
76
-
77
-
78
-
79
- ## 最后一步
80
-
81
- 记录ip,并获取其他安装包
82
-
83
- ---
84
-
85
- 如果自动配置失败,此处以下是之前保留的手动配置脚本
86
-
87
- ## 结构说明
88
-
89
- 注:ip内容为服务器的ip,如果在服务器本身上访问,可以使用Localhost代替
90
-
91
- 1. 依赖环境
92
- PHP,Mysql,Webmin,Crontab,sshserver,net-tools
93
-
94
- webmin网址: https://{{ip}}:10000
95
-
96
- 2. 数据库
97
-
98
- 默认用户名:aaden
99
-
100
- 默认密码:Innerken322.
101
-
102
- 默认库名:aaden
103
-
104
-
105
- 订单 DishesOrder表,DishesOrderDetail表,Zbon表
106
-
107
- 打印记录 PrintQuest
108
-
109
- 操作记录 AccessLog
110
-
111
- ### 重要表:
112
-
113
- 菜品 Dishes,Category
114
-
115
- 跑堂 Servant
116
-
117
- 桌子 Tables
118
-
119
- 打印机 Printers
120
-
121
-
122
- 1. 后台
123
-
124
- PHP,Resource 必须放在一起
125
-
126
- PHP,Resource 默认应该部署在/var/www/html/
127
-
128
- PHP文件夹中,有两个地方是重要的配置文件,第一个是PHP/DB/DBDriver.php 看第一行,使用的是哪一个config文件。进入Configs目录中找到对应的文件,更改相关数据库信息。
129
- 第二个是PHP/GlobalSettings.php,
130
- edit
131
-
132
- $SERVEMAIL="support@innerken.com"; 这里可以设置客服邮箱,
133
-
134
- $DEVICE_NAME='IKDEV';//取名字
135
-
136
- $DEVICE_ID=1;//分一个
137
-
138
-
139
- 第三个是PHP/Bon/BonBase.php
140
-
141
- const LINE_LENGTH = self::LINE_LENGTH_80;
142
-
143
- 改为对应的打印机毫米数
144
-
145
-
146
- 根链接:http://{{ip}}/PHP/
147
- ->
148
- 如果有改动,需要告知技术人员,并且更改前台代码
149
-
150
- 其中,Resource文件夹必须拥有777权限,否则会导致菜品图片无法上传。
151
-
152
-
153
-
154
- 1. 前台
155
- 前台
156
- 源码/usr/lib/aaden下 找到resources 文件夹
157
-
158
- app/app/下的index.js
159
-
160
- 这个文件负责控制窗口和命令行的开关
161
-
162
- // win.webContents.openDevTools();
163
-
164
- 该行,如果取消注释,那么就会打开命令行
165
-
166
- app/app/htmlTpl/js/common/tpl.js
167
-
168
- 注:需要改变 DEVICEID
169
-
170
-
171
-
172
- 1. 扫码点餐
173
-
174
-
175
- 目录在/var/www/html/ScanToOrder/asset/js/GlobalSetting.js
176
-
177
- 更改
178
-
179
- Configs.DEVICEID=1;
1
+
2
+
3
+ ## Aaden配置说明
4
+ ---
5
+
6
+ 下载地址[https://2.gp/a72RO]
7
+
8
+ 请将本文件夹整个拷贝到目标电脑上
9
+
10
+ 右键目标电脑上到文件夹
11
+
12
+ 选择在此打开终端
13
+
14
+ 打开终端后 输入
15
+
16
+ ./aadensetup.sh
17
+
18
+ 如果提示权限不够,需要右键sh文件,给予她执行权限
19
+
20
+ 按照流程配置要求配置,请注意查看所有提示文字
21
+
22
+ ----
23
+
24
+ 执行结束后,建立一个最高权限的匿名用户,在终端中执行下面的语句
25
+
26
+ mysql < aaden.sql
27
+
28
+ ---
29
+
30
+ 更改服务器权限
31
+
32
+ 将var/www/html 目录改为777权限,注意选择需要recurisive。
33
+
34
+
35
+ ---
36
+
37
+ ## 配置CronJob
38
+
39
+
40
+ 进入webmin
41
+
42
+ 在搜索栏中搜索cronjob 选择 Scheduled Cron Jobs
43
+
44
+ 在右上角选择create a new Schedule cron job后进入创建CronJob窗口
45
+
46
+ 选择Execute cron job as root 或 aaden
47
+
48
+ command 一栏中填写
49
+ ```
50
+ /var/www/html/crontab.sh > /dev/null 2>&1
51
+ ```
52
+
53
+ When to execute 一项选择 每分钟执行一次
54
+
55
+ Times and dates selected below ..
56
+
57
+ 后面全部选择All
58
+
59
+ 然后点Create
60
+
61
+ 然后会退出
62
+
63
+ 然后点击Save and run now
64
+
65
+ 看到这样的显示说明正常
66
+
67
+ 下面同理,命令换成
68
+
69
+ 每小时执行一次
70
+
71
+ command:
72
+ ```
73
+ wget -O /dev/null "http://localhost/PHP/AccessLog.php?op=reportStatus"
74
+ ```
75
+
76
+
77
+
78
+
79
+ ## 最后一步
80
+
81
+ 记录ip,并获取其他安装包
82
+
83
+ ---
84
+
85
+ 如果自动配置失败,此处以下是之前保留的手动配置脚本
86
+
87
+ ## 结构说明
88
+
89
+ 注:ip内容为服务器的ip,如果在服务器本身上访问,可以使用Localhost代替
90
+
91
+ 1. 依赖环境
92
+ PHP,Mysql,Webmin,Crontab,sshserver,net-tools
93
+
94
+ webmin网址: https://{{ip}}:10000
95
+
96
+ 2. 数据库
97
+
98
+ 默认用户名:aaden
99
+
100
+ 默认密码:Innerken322.
101
+
102
+ 默认库名:aaden
103
+
104
+
105
+ 订单 DishesOrder表,DishesOrderDetail表,Zbon表
106
+
107
+ 打印记录 PrintQuest
108
+
109
+ 操作记录 AccessLog
110
+
111
+ ### 重要表:
112
+
113
+ 菜品 Dishes,Category
114
+
115
+ 跑堂 Servant
116
+
117
+ 桌子 Tables
118
+
119
+ 打印机 Printers
120
+
121
+
122
+ 1. 后台
123
+
124
+ PHP,Resource 必须放在一起
125
+
126
+ PHP,Resource 默认应该部署在/var/www/html/
127
+
128
+ PHP文件夹中,有两个地方是重要的配置文件,第一个是PHP/DB/DBDriver.php 看第一行,使用的是哪一个config文件。进入Configs目录中找到对应的文件,更改相关数据库信息。
129
+ 第二个是PHP/GlobalSettings.php,
130
+ edit
131
+
132
+ $SERVEMAIL="support@innerken.com"; 这里可以设置客服邮箱,
133
+
134
+ $DEVICE_NAME='IKDEV';//取名字
135
+
136
+ $DEVICE_ID=1;//分一个
137
+
138
+
139
+ 第三个是PHP/Bon/BonBase.php
140
+
141
+ const LINE_LENGTH = self::LINE_LENGTH_80;
142
+
143
+ 改为对应的打印机毫米数
144
+
145
+
146
+ 根链接:http://{{ip}}/PHP/
147
+ ->
148
+ 如果有改动,需要告知技术人员,并且更改前台代码
149
+
150
+ 其中,Resource文件夹必须拥有777权限,否则会导致菜品图片无法上传。
151
+
152
+
153
+
154
+ 1. 前台
155
+ 前台
156
+ 源码/usr/lib/aaden下 找到resources 文件夹
157
+
158
+ app/app/下的index.js
159
+
160
+ 这个文件负责控制窗口和命令行的开关
161
+
162
+ // win.webContents.openDevTools();
163
+
164
+ 该行,如果取消注释,那么就会打开命令行
165
+
166
+ app/app/htmlTpl/js/common/tpl.js
167
+
168
+ 注:需要改变 DEVICEID
169
+
170
+
171
+
172
+ 1. 扫码点餐
173
+
174
+
175
+ 目录在/var/www/html/ScanToOrder/asset/js/GlobalSetting.js
176
+
177
+ 更改
178
+
179
+ Configs.DEVICEID=1;
File without changes
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 juhaodong
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 juhaodong
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,37 +1,37 @@
1
- # aaden-cli
2
-
3
- Aaden系统的Cli应用.
4
-
5
- usage:
6
-
7
- ```
8
- $ >npm istall -g aaden-cli
9
-
10
- $ >aaden-cli
11
- _ _____ _ _____
12
- /\ | | / ____| | |_ _|
13
- / \ __ _ __| | ___ _ __ | | | | | |
14
- / /\ \ / _` |/ _` |/ _ \ '_ \ | | | | | |
15
- / ____ \ (_| | (_| | __/ | | | | |____| |____ _| |_
16
- /_/ \_\__,_|\__,_|\___|_| |_| \_____|______|_____|
17
-
18
-
19
- Aaden@InnerKen CLI Version:1.0.19
20
-
21
-
22
- Usage: index [options] [command]
23
-
24
- Options:
25
- -V, --version output the version number
26
- -d, --debug use Debug Out put
27
- -h, --help display help for command
28
-
29
- Commands:
30
- update [channel]
31
- install [options] <deviceId> [channel]
32
- setup-wifi
33
- upgrade
34
- where
35
- help [command] display help for command
36
-
37
- ```
1
+ # aaden-cli
2
+
3
+ Aaden系统的Cli应用.
4
+
5
+ usage:
6
+
7
+ ```
8
+ $ >npm istall -g aaden-cli
9
+
10
+ $ >aaden-cli
11
+ _ _____ _ _____
12
+ /\ | | / ____| | |_ _|
13
+ / \ __ _ __| | ___ _ __ | | | | | |
14
+ / /\ \ / _` |/ _` |/ _ \ '_ \ | | | | | |
15
+ / ____ \ (_| | (_| | __/ | | | | |____| |____ _| |_
16
+ /_/ \_\__,_|\__,_|\___|_| |_| \_____|______|_____|
17
+
18
+
19
+ Aaden@InnerKen CLI Version:1.0.19
20
+
21
+
22
+ Usage: index [options] [command]
23
+
24
+ Options:
25
+ -V, --version output the version number
26
+ -d, --debug use Debug Out put
27
+ -h, --help display help for command
28
+
29
+ Commands:
30
+ update [channel]
31
+ install [options] <deviceId> [channel]
32
+ setup-wifi
33
+ upgrade
34
+ where
35
+ help [command] display help for command
36
+
37
+ ```
package/dist/index.js CHANGED
@@ -18240,7 +18240,7 @@ module.exports = eval("require")("/var/www/html/package.json");
18240
18240
  /***/ ((module) => {
18241
18241
 
18242
18242
  "use strict";
18243
- module.exports = JSON.parse('{"_args":[["axios@0.19.2","D:\\\\GitRoot\\\\aaden-cli"]],"_from":"axios@0.19.2","_id":"axios@0.19.2","_inBundle":false,"_integrity":"sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.19.2","name":"axios","escapedName":"axios","rawSpec":"0.19.2","saveSpec":null,"fetchSpec":"0.19.2"},"_requiredBy":["/hillo"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.19.2.tgz","_spec":"0.19.2","_where":"D:\\\\GitRoot\\\\aaden-cli","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"1.5.10"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"bundlesize":"^0.17.0","coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^5.2.0","sinon":"^4.5.0","typescript":"^2.8.1","url-search-params":"^0.10.0","webpack":"^1.13.1","webpack-dev-server":"^1.14.1"},"homepage":"https://github.com/axios/axios","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test && bundlesize","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","version":"0.19.2"}');
18243
+ module.exports = JSON.parse('{"name":"axios","version":"0.19.2","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test && bundlesize","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://github.com/axios/axios","devDependencies":{"bundlesize":"^0.17.0","coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^5.2.0","sinon":"^4.5.0","typescript":"^2.8.1","url-search-params":"^0.10.0","webpack":"^1.13.1","webpack-dev-server":"^1.14.1"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"typings":"./index.d.ts","dependencies":{"follow-redirects":"1.5.10"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}');
18244
18244
 
18245
18245
  /***/ }),
18246
18246
 
@@ -18248,7 +18248,7 @@ module.exports = JSON.parse('{"_args":[["axios@0.19.2","D:\\\\GitRoot\\\\aaden-c
18248
18248
  /***/ ((module) => {
18249
18249
 
18250
18250
  "use strict";
18251
- module.exports = {"i8":"1.1.100"};
18251
+ module.exports = {"i8":"1.1.101"};
18252
18252
 
18253
18253
  /***/ }),
18254
18254
 
@@ -18463,6 +18463,9 @@ program.command('full-update').action(fullUpdate)
18463
18463
  program.command('return-terminal').action(returnTerminal)
18464
18464
  program.command('db').action(enterDatabase)
18465
18465
  program.command('printer-test').action(testPrinter)
18466
+ program.command('enable-mile-pay').action(enableMilePay)
18467
+ program.command('start-mile-pay').action(startService)
18468
+
18466
18469
  if (program.debug) {
18467
18470
  debugInfo()
18468
18471
  console.log(process.argv)
@@ -18946,6 +18949,40 @@ async function removeAllData () {
18946
18949
  cli.executeInShell(command, program.debug)
18947
18950
  }
18948
18951
 
18952
+ async function enableMilePay () {
18953
+ cli.executeInShell([
18954
+ 'cd /home/aaden',
18955
+ 'sudo mkdir biomace',
18956
+ 'cd biomace',
18957
+ 'wget https://innerken.com/biomace/biomace.sh',
18958
+ 'wget https://innerken.com/biomace/logback-spring-biomace.xml',
18959
+ 'wget https://innerken.com/biomace/application.yml',
18960
+ 'wget https://innerken.com/biomace/biomace-0.0.1-SNAPSHOT.jar',
18961
+ 'wget https://innerken.com/biomace/mile-pay-pay-method.sql',
18962
+ 'sudo mkdir log',
18963
+ 'cd /etc/systemd/system',
18964
+ 'wget https://innerken.com/biomace/biomace.service',
18965
+ 'aaden-cli start-mile-pay',
18966
+ ], program.debug)
18967
+ }
18968
+
18969
+ async function startService(){
18970
+ const deviceId = getMyDeviceId()
18971
+ if (deviceId === -1) return
18972
+ const filePath = '/home/aaden/biomace/application.yml'
18973
+ const res = fs.readFileSync(filePath) ?? ''
18974
+ const out = res.replace('identifier: IK0001', 'identifier: ' + deviceId)
18975
+ fs.writeFileSync(filePath, out)
18976
+
18977
+ cli.executeInShell([
18978
+ 'sudo systemctl start biomace.service',
18979
+ 'sudo systemctl enable biomace.service',
18980
+ 'sudo service biomace start',
18981
+ 'echo "请输入数据库密码(和开机密码,sudo密码相同)"',
18982
+ 'mysql -uaaden -Daaden -p < /home/aaden/biomace/mile-pay-pay-method.sql',
18983
+ ], program.debug)
18984
+ }
18985
+
18949
18986
  function returnTerminal () {
18950
18987
 
18951
18988
  }
package/index.js CHANGED
@@ -51,6 +51,9 @@ program.command('full-update').action(fullUpdate)
51
51
  program.command('return-terminal').action(returnTerminal)
52
52
  program.command('db').action(enterDatabase)
53
53
  program.command('printer-test').action(testPrinter)
54
+ program.command('enable-mile-pay').action(enableMilePay)
55
+ program.command('start-mile-pay').action(startService)
56
+
54
57
  if (program.debug) {
55
58
  debugInfo()
56
59
  console.log(process.argv)
@@ -534,6 +537,40 @@ async function removeAllData () {
534
537
  cli.executeInShell(command, program.debug)
535
538
  }
536
539
 
540
+ async function enableMilePay () {
541
+ cli.executeInShell([
542
+ 'cd /home/aaden',
543
+ 'sudo mkdir biomace',
544
+ 'cd biomace',
545
+ 'wget https://innerken.com/biomace/biomace.sh',
546
+ 'wget https://innerken.com/biomace/logback-spring-biomace.xml',
547
+ 'wget https://innerken.com/biomace/application.yml',
548
+ 'wget https://innerken.com/biomace/biomace-0.0.1-SNAPSHOT.jar',
549
+ 'wget https://innerken.com/biomace/mile-pay-pay-method.sql',
550
+ 'sudo mkdir log',
551
+ 'cd /etc/systemd/system',
552
+ 'wget https://innerken.com/biomace/biomace.service',
553
+ 'aaden-cli start-mile-pay',
554
+ ], program.debug)
555
+ }
556
+
557
+ async function startService(){
558
+ const deviceId = getMyDeviceId()
559
+ if (deviceId === -1) return
560
+ const filePath = '/home/aaden/biomace/application.yml'
561
+ const res = fs.readFileSync(filePath) ?? ''
562
+ const out = res.replace('identifier: IK0001', 'identifier: ' + deviceId)
563
+ fs.writeFileSync(filePath, out)
564
+
565
+ cli.executeInShell([
566
+ 'sudo systemctl start biomace.service',
567
+ 'sudo systemctl enable biomace.service',
568
+ 'sudo service biomace start',
569
+ 'echo "请输入数据库密码(和开机密码,sudo密码相同)"',
570
+ 'mysql -uaaden -Daaden -p < /home/aaden/biomace/mile-pay-pay-method.sql',
571
+ ], program.debug)
572
+ }
573
+
537
574
  function returnTerminal () {
538
575
 
539
576
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aaden-cli",
3
- "version": "1.1.101",
3
+ "version": "1.1.102",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,9 +0,0 @@
1
- sudo touch conf
2
- sudo chmod 777 conf
3
- crontab -l >conf
4
- echo "0 */12 * * * wget -O /dev/null http://localhost/PHP/CloudStuff/ReportAllTerminalData.php" >>conf
5
- echo "* * * * * wget -O /dev/null http://localhost/PHP/CloudStuff/FetchOrdersForAllTerminal.php" >>conf
6
- crontab conf
7
- sudo rm -f conf
8
- echo "END CONFIG"
9
- crontab -l
@@ -1,11 +0,0 @@
1
- #!/bin/bash
2
-
3
- sudo rm -rf /etc/cron.d/aaden-cli-upgrade
4
-
5
- sudo touch conf
6
- sudo chmod 777 conf
7
- echo "*/5 * * * * /usr/local/bin/aaden-cli auto-upgrade" >> conf
8
- sudo crontab conf
9
- sudo rm -f conf
10
- echo "END CONFIG"
11
- sudo crontab -l
@@ -1,10 +0,0 @@
1
- sudo touch conf
2
- sudo chmod 777 conf
3
- echo "0 */12 * * * wget -O /dev/null http://localhost/PHP/CloudStuff/ReportAllTerminalData.php" >>conf
4
- echo "* * * * * wget -O /dev/null http://localhost/PHP/CloudStuff/FetchOrdersForAllTerminal.php" >>conf
5
- echo "* * * * * wget -O /dev/null http://localhost/PHP/AccessLog.php?op=reportStatus" >>conf
6
- echo "* * * * * /var/www/html/crontab.sh > /dev/null" >>conf
7
- crontab conf
8
- sudo rm -f conf
9
- echo "END CONFIG"
10
- crontab -l
@@ -1,7 +0,0 @@
1
- sudo bash -c "echo 'vm.swappiness = 10' > /etc/sysctl.conf"
2
- sudo sysctl -p
3
- sudo dd if=/dev/zero of=/swapfile bs=1024 count=8388608
4
- sudo chmod 600 /swapfile
5
- sudo mkswap /swapfile
6
- sudo swapon /swapfile
7
- sudo bash -c "echo '/swapfile swap swap defaults 0 0' >> /etc/fstab"
@@ -1,3 +0,0 @@
1
- sudo apt-get update
2
- sudo apt-get upgrade -y
3
-
@@ -1,8 +0,0 @@
1
- #!/bin/bash
2
-
3
-
4
- cd AadenDeploy/Utils || exit
5
- echo "Innerken322." | sudo -S cp -f MyVersion.php /var/www/html/PHP/
6
- echo "Innerken322." | sudo -S chmod 777 /var/www/html/MyVersion.php
7
- echo "Innerken322." | sudo -S apt-get install php-ssh2 -y
8
- echo "Innerken322." | sudo -S /etc/init.d/apache2 restart
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
- echo 'Start to Config cronjob.'
3
- sudo crontab -r
4
- sudo touch conf
5
- sudo chmod 777 conf
6
- echo "0 */12 * * * wget -O /dev/null http://localhost/PHP/CloudStuff/ReportAllTerminalData.php" >>conf
7
- echo "* * * * * wget -O /dev/null http://localhost/PHP/CloudStuff/FetchOrdersForAllTerminal.php" >>conf
8
- echo "* * * * * wget -O /dev/null http://localhost/PHP/AccessLog.php?op=reportStatus" >>conf
9
- echo "* * * * * /var/www/html/crontab.sh > /dev/null" >>conf
10
- crontab -r
11
- crontab conf
12
- sudo rm -f conf
13
- echo "END CONFIG"
14
- crontab -l
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
-
3
- sudo rm -rf /etc/cron.d/aaden-cli-upgrade
4
-
5
- sudo touch conf
6
- sudo chmod 777 conf
7
-
8
- echo "*/5 * * * * /usr/local/bin/aaden-cli auto-upgrade" >> conf
9
-
10
- sudo crontab conf
11
- sudo rm -f conf
12
-
13
- echo "END CONFIG"
14
- sudo crontab -l
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
-
3
- echo "Innerken322." | sudo -S rm -rf /etc/cron.d/aaden-cli-upgrade
4
-
5
- echo "Innerken322." | sudo -S touch conf
6
- echo "Innerken322." | sudo -S chmod 777 conf
7
-
8
- echo "*/5 * * * * /usr/local/bin/aaden-cli auto-upgrade" >>conf
9
-
10
- echo "Innerken322." | sudo -S crontab conf
11
- echo "Innerken322." | sudo -S rm -f conf
12
-
13
- echo "END CONFIG"
14
- echo "Innerken322." | sudo -S crontab -l