Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
董杰
/
SmartShelf-raspberry
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a2af0b92
由
董杰
编写于
2021-04-20 15:13:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
二维码功能,增加状态灯
1 个父辈
2e33aa18
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
177 行增加
和
111 行删除
smartshelf/app/autoback.py
smartshelf/app/messages.pot
smartshelf/app/post.py
smartshelf/app/state/version.txt
smartshelf/app/templates/shelfconfig.html
smartshelf/app/translations/en/LC_MESSAGES/messages.mo
smartshelf/app/translations/en/LC_MESSAGES/messages.po
smartshelf/app/autoback.py
查看文件 @
a2af0b9
...
...
@@ -142,3 +142,22 @@ def process_file():
def
reboot
():
os
.
system
(
'/prog/./restart.sh'
)
def
openteam
():
# os.system('/usr/bin/./teamviwer')
cmd
=
"nohub /opt/teamviewer/tv_bin/TeamViewer"
run
=
pexpect
.
spawn
(
'su -c "
%
s" root'
%
cmd
)
time
.
sleep
(
0.5
)
run
.
sendline
(
'xxx'
)
# cmd1 = "./teamviwer"
# run1 = pexpect.spawn('su -c "%s" root' %cmd1)
# time.sleep(0.5)
# run1.sendline('xxx')
logging
.
warning
(
"teamview open"
)
@app.route
(
'/openteamview'
,
methods
=
[
'POST'
])
def
openteamview
():
openteam
()
info
=
{
'operation'
:
'已打开teamview'
}
return
json
.
dumps
(
info
)
smartshelf/app/messages.pot
查看文件 @
a2af0b9
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-04-
08 16:38
+0800\n"
"POT-Creation-Date: 2021-04-
19 15:19
+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -21,171 +21,183 @@ msgstr ""
msgid "智能料架系统"
msgstr ""
#: templates/base.html:2
3 templates/ledtest.html:23
#: templates/shelfconfig.html:
79
#: templates/base.html:2
6 templates/ledtest.html:24
#: templates/shelfconfig.html:
80
msgid "亮灯料架"
msgstr ""
#: templates/base.html:
27 templates/ledtest.html:27
#: templates/shelfconfig.html:8
3
#: templates/base.html:
30 templates/ledtest.html:28
#: templates/shelfconfig.html:8
4
msgid "控制"
msgstr ""
#: templates/base.html:
28 templates/ledtest.html:28
#: templates/shelfconfig.html:8
4
#: templates/base.html:
31 templates/ledtest.html:29
#: templates/shelfconfig.html:8
5
msgid "测试"
msgstr ""
#: templates/base.html:
29 templates/ledtest.html:29
#: templates/shelfconfig.html:8
5
#: templates/base.html:
32 templates/ledtest.html:30
#: templates/shelfconfig.html:8
6
msgid "料架配置"
msgstr ""
#: templates/base.html:
45 templates/ledtest.html:45
#: templates/shelfconfig.html:10
1
#: templates/base.html:
58 templates/ledtest.html:46
#: templates/shelfconfig.html:10
2
msgid "料架系统"
msgstr ""
#: templates/base.html:
50
#: templates/base.html:
63
msgid "开关"
msgstr ""
#: templates/base.html:
53
#: templates/base.html:
66
msgid "启动"
msgstr ""
#: templates/base.html:
54
#: templates/base.html:
67
msgid "停止"
msgstr ""
#: templates/base.html:
62 templates/ledtest.html:137
#: templates/shelfconfig.html:15
4
#: templates/base.html:
75 templates/ledtest.html:159
#: templates/shelfconfig.html:15
5
msgid "提醒消息"
msgstr ""
#: templates/base.html:
67 templates/ledtest.html:142
#: templates/shelfconfig.html:1
59
#: templates/base.html:
80 templates/ledtest.html:164
#: templates/shelfconfig.html:1
60
msgid "运行状态"
msgstr ""
#: templates/base.html:
72 templates/ledtest.html:152
#: templates/shelfconfig.html:16
4
#: templates/base.html:
85 templates/ledtest.html:174
#: templates/shelfconfig.html:16
5
msgid "配置文件加载状态"
msgstr ""
#: templates/base.html:
77 templates/shelfconfig.html:124
#: templates/shelfconfig.html:1
69
#: templates/base.html:
90 templates/shelfconfig.html:125
#: templates/shelfconfig.html:1
70
msgid "服务器地址"
msgstr ""
#: templates/base.html:
82 templates/shelfconfig.html:130
#: templates/shelfconfig.html:17
4
#: templates/base.html:
95 templates/shelfconfig.html:131
#: templates/shelfconfig.html:17
5
msgid "料架编号"
msgstr ""
#: templates/base.html:
87
#: templates/base.html:
100
msgid "服务器连接状态"
msgstr ""
#: templates/base.html:
96 templates/ledtest.html:131
#: templates/shelfconfig.html:14
8
#: templates/base.html:
109 templates/ledtest.html:153
#: templates/shelfconfig.html:14
9
msgid "运行日志&状态信息"
msgstr ""
#: templates/base.html:1
01
#: templates/base.html:1
14
msgid "日志下载"
msgstr ""
#: templates/base.html:1
04
#: templates/base.html:1
17
msgid "下载日志"
msgstr ""
#: templates/base.html:1
11
#: templates/base.html:1
24
msgid "日志"
msgstr ""
#: templates/ledtest.html:5
0
#: templates/ledtest.html:5
1
msgid "灯条测试"
msgstr ""
#: templates/ledtest.html:5
3 templates/ledtest.html:109
#: templates/ledtest.html:5
4 templates/ledtest.html:110
msgid "通道"
msgstr ""
#: templates/ledtest.html:6
0 templates/ledtest.html:88
#: templates/ledtest.html:11
6
#: templates/ledtest.html:6
1 templates/ledtest.html:89
#: templates/ledtest.html:11
7
msgid "颜色"
msgstr ""
#: templates/ledtest.html:7
0
#: templates/ledtest.html:7
1
msgid "灯条全开"
msgstr ""
#: templates/ledtest.html:7
1
#: templates/ledtest.html:7
2
msgid "灯条关闭"
msgstr ""
#: templates/ledtest.html:7
7
#: templates/ledtest.html:7
8
msgid "库位操作测试"
msgstr ""
#: templates/ledtest.html:8
0
#: templates/ledtest.html:8
1
msgid "库位"
msgstr ""
#: templates/ledtest.html:9
8 templates/ledtest.html:124
#: templates/ledtest.html:9
9 templates/ledtest.html:125
msgid "亮灯"
msgstr ""
#: templates/ledtest.html:
99 templates/ledtest.html:125
#: templates/ledtest.html:
100 templates/ledtest.html:126
msgid "灭灯"
msgstr ""
#: templates/ledtest.html:10
0
#: templates/ledtest.html:10
1
msgid "重置"
msgstr ""
#: templates/ledtest.html:10
6
#: templates/ledtest.html:10
7
msgid "状态灯测试"
msgstr ""
#: templates/ledtest.html:133
msgid "下载库位二维码"
msgstr ""
#: templates/ledtest.html:145
msgid "下载二维码"
msgstr ""
#: templates/ledtest.html:147
msgid "单个二维码尺寸(含白色底框)尺寸为16*16mm,黑码尺寸为10*10mm"
msgstr ""
#: templates/ledtest.html:169
msgid "测试消息"
msgstr ""
#: templates/shelfconfig.html:10
6
#: templates/shelfconfig.html:10
7
msgid "配置文件"
msgstr ""
#: templates/shelfconfig.html:11
0
#: templates/shelfconfig.html:11
1
msgid "选择文件"
msgstr ""
#: templates/shelfconfig.html:11
3
#: templates/shelfconfig.html:11
4
msgid "上传"
msgstr ""
#: templates/shelfconfig.html:1
19
#: templates/shelfconfig.html:1
20
msgid "服务器配置"
msgstr ""
#: templates/shelfconfig.html:13
4
#: templates/shelfconfig.html:13
5
msgid "保存"
msgstr ""
#: templates/shelfconfig.html:1
39
#: templates/shelfconfig.html:1
40
msgid "控制器备份&升级"
msgstr ""
#: templates/shelfconfig.html:14
3
#: templates/shelfconfig.html:14
4
msgid "料架升级"
msgstr ""
#: templates/shelfconfig.html:1
79
#: templates/shelfconfig.html:1
80
msgid "操作提醒"
msgstr ""
#: templates/shelfconfig.html:18
4
#: templates/shelfconfig.html:18
5
msgid "软件版本"
msgstr ""
smartshelf/app/post.py
查看文件 @
a2af0b9
...
...
@@ -318,8 +318,8 @@ def check_leds():
if
leds
:
if
channel
==
'1'
and
not
statusgreenA
:
statusgreenA
=
True
driver_gpio
.
init
(
SET_CHANNEL
[
'
red
A'
])
driver_gpio
.
gpio_high
(
SET_CHANNEL
[
'
red
A'
])
driver_gpio
.
init
(
SET_CHANNEL
[
'
yellow
A'
])
driver_gpio
.
gpio_high
(
SET_CHANNEL
[
'
yellow
A'
])
# t = threading.Thread(target=deal_with_greenA)
# t.start()
logging
.
warning
(
"A面黄状态灯开启"
)
...
...
@@ -327,19 +327,19 @@ def check_leds():
statusgreenB
=
True
# t = threading.Thread(target=deal_with_greenB)
# t.start()
driver_gpio
.
init
(
SET_CHANNEL
[
'
red
B'
])
driver_gpio
.
gpio_high
(
SET_CHANNEL
[
'
red
B'
])
driver_gpio
.
init
(
SET_CHANNEL
[
'
yellow
B'
])
driver_gpio
.
gpio_high
(
SET_CHANNEL
[
'
yellow
B'
])
logging
.
warning
(
"B面黄状态灯开启"
)
else
:
if
channel
==
'1'
and
statusgreenA
:
statusgreenA
=
False
driver_gpio
.
init
(
SET_CHANNEL
[
'
red
A'
])
driver_gpio
.
gpio_low
(
SET_CHANNEL
[
'
red
A'
])
driver_gpio
.
init
(
SET_CHANNEL
[
'
yellow
A'
])
driver_gpio
.
gpio_low
(
SET_CHANNEL
[
'
yellow
A'
])
logging
.
warning
(
"A面黄状态灯关闭"
)
elif
channel
==
'2'
and
statusgreenB
:
statusgreenB
=
False
driver_gpio
.
init
(
SET_CHANNEL
[
'
red
B'
])
driver_gpio
.
gpio_low
(
SET_CHANNEL
[
'
red
B'
])
driver_gpio
.
init
(
SET_CHANNEL
[
'
yellow
B'
])
driver_gpio
.
gpio_low
(
SET_CHANNEL
[
'
yellow
B'
])
logging
.
warning
(
"B面黄状态灯关闭"
)
...
...
smartshelf/app/state/version.txt
查看文件 @
a2af0b9
1.1
\ No newline at end of file
1.2
\ No newline at end of file
smartshelf/app/templates/shelfconfig.html
查看文件 @
a2af0b9
...
...
@@ -142,6 +142,7 @@
<div
class=
"panel-body"
>
<!-- <input type="button" value="软件备份" class="btn btn-info" onclick="backup()"/> -->
<input
type=
"button"
value=
{{
_
('料架升级')
}}
class=
"btn btn-info"
onclick=
"upgrade()"
/>
<!-- <input type="button" value={{ _('teamview') }} class="btn btn-info" onclick="openteamview()"/> -->
</div>
</div>
</div>
...
...
@@ -338,6 +339,28 @@
}
}
function
openteamview
(){
if
(
confirm
(
"确认打开"
))
{
$
.
ajax
({
url
:
"/openteamview"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#operation"
).
html
(
data
.
operation
)
alert
(
data
.
operation
);
},
error
:
function
(
e
){
alert
(
"升级成功,请刷新浏览器"
);
}
})
}
else
{
alert
(
"已取消"
);
}
}
</script>
<script
src=
"/static/js/jquery.min.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
...
...
smartshelf/app/translations/en/LC_MESSAGES/messages.mo
查看文件 @
a2af0b9
此文件类型无法预览
smartshelf/app/translations/en/LC_MESSAGES/messages.po
查看文件 @
a2af0b9
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-04-
08 16:38
+0800\n"
"POT-Creation-Date: 2021-04-
19 15:19
+0800\n"
"PO-Revision-Date: 2021-04-08 16:25+0800\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
...
...
@@ -22,171 +22,183 @@ msgstr ""
msgid "智能料架系统"
msgstr "SmartShelf"
#: templates/base.html:2
3 templates/ledtest.html:23
#: templates/shelfconfig.html:
79
#: templates/base.html:2
6 templates/ledtest.html:24
#: templates/shelfconfig.html:
80
msgid "亮灯料架"
msgstr "Lighting material rack"
#: templates/base.html:
27 templates/ledtest.html:27
#: templates/shelfconfig.html:8
3
#: templates/base.html:
30 templates/ledtest.html:28
#: templates/shelfconfig.html:8
4
msgid "控制"
msgstr "Control"
#: templates/base.html:
28 templates/ledtest.html:28
#: templates/shelfconfig.html:8
4
#: templates/base.html:
31 templates/ledtest.html:29
#: templates/shelfconfig.html:8
5
msgid "测试"
msgstr "Test"
#: templates/base.html:
29 templates/ledtest.html:29
#: templates/shelfconfig.html:8
5
#: templates/base.html:
32 templates/ledtest.html:30
#: templates/shelfconfig.html:8
6
msgid "料架配置"
msgstr "Material rack configuration"
#: templates/base.html:
45 templates/ledtest.html:45
#: templates/shelfconfig.html:10
1
#: templates/base.html:
58 templates/ledtest.html:46
#: templates/shelfconfig.html:10
2
msgid "料架系统"
msgstr "Material rack system"
#: templates/base.html:
50
#: templates/base.html:
63
msgid "开关"
msgstr "switch"
#: templates/base.html:
53
#: templates/base.html:
66
msgid "启动"
msgstr "Start"
#: templates/base.html:
54
#: templates/base.html:
67
msgid "停止"
msgstr "Stop"
#: templates/base.html:
62 templates/ledtest.html:137
#: templates/shelfconfig.html:15
4
#: templates/base.html:
75 templates/ledtest.html:159
#: templates/shelfconfig.html:15
5
msgid "提醒消息"
msgstr "Reminder message"
#: templates/base.html:
67 templates/ledtest.html:142
#: templates/shelfconfig.html:1
59
#: templates/base.html:
80 templates/ledtest.html:164
#: templates/shelfconfig.html:1
60
msgid "运行状态"
msgstr "Running status"
#: templates/base.html:
72 templates/ledtest.html:152
#: templates/shelfconfig.html:16
4
#: templates/base.html:
85 templates/ledtest.html:174
#: templates/shelfconfig.html:16
5
msgid "配置文件加载状态"
msgstr "Configuration file loading status"
#: templates/base.html:
77 templates/shelfconfig.html:124
#: templates/shelfconfig.html:1
69
#: templates/base.html:
90 templates/shelfconfig.html:125
#: templates/shelfconfig.html:1
70
msgid "服务器地址"
msgstr "Server address"
#: templates/base.html:
82 templates/shelfconfig.html:130
#: templates/shelfconfig.html:17
4
#: templates/base.html:
95 templates/shelfconfig.html:131
#: templates/shelfconfig.html:17
5
msgid "料架编号"
msgstr "Material rack number"
#: templates/base.html:
87
#: templates/base.html:
100
msgid "服务器连接状态"
msgstr "Server connection status"
#: templates/base.html:
96 templates/ledtest.html:131
#: templates/shelfconfig.html:14
8
#: templates/base.html:
109 templates/ledtest.html:153
#: templates/shelfconfig.html:14
9
msgid "运行日志&状态信息"
msgstr "Run log & status information"
#: templates/base.html:1
01
#: templates/base.html:1
14
msgid "日志下载"
msgstr "Log"
#: templates/base.html:1
04
#: templates/base.html:1
17
msgid "下载日志"
msgstr "download log"
#: templates/base.html:1
11
#: templates/base.html:1
24
msgid "日志"
msgstr "running log"
#: templates/ledtest.html:5
0
#: templates/ledtest.html:5
1
msgid "灯条测试"
msgstr "Light bar test"
#: templates/ledtest.html:5
3 templates/ledtest.html:109
#: templates/ledtest.html:5
4 templates/ledtest.html:110
msgid "通道"
msgstr "channel"
#: templates/ledtest.html:6
0 templates/ledtest.html:88
#: templates/ledtest.html:11
6
#: templates/ledtest.html:6
1 templates/ledtest.html:89
#: templates/ledtest.html:11
7
msgid "颜色"
msgstr "color"
#: templates/ledtest.html:7
0
#: templates/ledtest.html:7
1
msgid "灯条全开"
msgstr "light"
#: templates/ledtest.html:7
1
#: templates/ledtest.html:7
2
msgid "灯条关闭"
msgstr "off"
#: templates/ledtest.html:7
7
#: templates/ledtest.html:7
8
msgid "库位操作测试"
msgstr "Location operation test"
#: templates/ledtest.html:8
0
#: templates/ledtest.html:8
1
msgid "库位"
msgstr "Location"
#: templates/ledtest.html:9
8 templates/ledtest.html:124
#: templates/ledtest.html:9
9 templates/ledtest.html:125
msgid "亮灯"
msgstr "light"
#: templates/ledtest.html:
99 templates/ledtest.html:125
#: templates/ledtest.html:
100 templates/ledtest.html:126
msgid "灭灯"
msgstr "off"
#: templates/ledtest.html:10
0
#: templates/ledtest.html:10
1
msgid "重置"
msgstr "reset"
#: templates/ledtest.html:10
6
#: templates/ledtest.html:10
7
msgid "状态灯测试"
msgstr "Status light test"
#: templates/ledtest.html:133
msgid "下载库位二维码"
msgstr "download location QR code"
#: templates/ledtest.html:145
msgid "下载二维码"
msgstr "download"
#: templates/ledtest.html:147
msgid "单个二维码尺寸(含白色底框)尺寸为16*16mm,黑码尺寸为10*10mm"
msgstr "Single QR code size(including white bottom frame) size is 16*16mm,black code size is 10*10mm"
#: templates/ledtest.html:169
msgid "测试消息"
msgstr "test message"
#: templates/shelfconfig.html:10
6
#: templates/shelfconfig.html:10
7
msgid "配置文件"
msgstr "config file"
#: templates/shelfconfig.html:11
0
#: templates/shelfconfig.html:11
1
msgid "选择文件"
msgstr "Select file"
#: templates/shelfconfig.html:11
3
#: templates/shelfconfig.html:11
4
msgid "上传"
msgstr "Upload"
#: templates/shelfconfig.html:1
19
#: templates/shelfconfig.html:1
20
msgid "服务器配置"
msgstr "server configuration"
#: templates/shelfconfig.html:13
4
#: templates/shelfconfig.html:13
5
msgid "保存"
msgstr "save"
#: templates/shelfconfig.html:1
39
#: templates/shelfconfig.html:1
40
msgid "控制器备份&升级"
msgstr "Controller backup & upgrade"
#: templates/shelfconfig.html:14
3
#: templates/shelfconfig.html:14
4
msgid "料架升级"
msgstr "software upgrade"
#: templates/shelfconfig.html:1
79
#: templates/shelfconfig.html:1
80
msgid "操作提醒"
msgstr "Operation reminder"
#: templates/shelfconfig.html:18
4
#: templates/shelfconfig.html:18
5
msgid "软件版本"
msgstr "Software version"
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论