rootfs_enc1v2_hi3520d_20230426

This commit is contained in:
Jan Koppe 2024-02-15 22:07:35 +01:00
parent bd71632f66
commit 07336a7379
Signed by: thunfisch
GPG Key ID: BE935B0735A2129B
136 changed files with 13300 additions and 7495 deletions

BIN
kernel

Binary file not shown.

View File

@ -3,13 +3,12 @@
/bin/mount -a /bin/mount -a
echo " echo "
_ _ _ _ _ _ _ _ _ _ _ _ _____ _ __ _______ _
\ _ _ _ _ _ ___ |_ _| (_) [ | _ |_ __ \ (_)
/ /__/ \ |_/ | | __ _ .--. | | / ] | |__) |__
/ __ / - _ ___ | | _ [ | [ \`.-. | | '' < | ___/[ |
/ / / / / / _| |__/ | | | | | | | | |\`\ \ _| |_ | |
_ _ _ _/ / / \_/ \_ ______ |________|[___][___||__][__| \_]|_____| [___]
___________\___\__________________
" "
for initscript in /etc/init.d/S[0-9][0-9]* for initscript in /etc/init.d/S[0-9][0-9]*
do do
@ -20,41 +19,4 @@ do
fi fi
done done
/sbin/sysctl -p /etc/sysctl.conf
cd /ko
./load3521d -i
telnetd
chown root:root /var/empty
/usr/local/sbin/sshd
#UART3
#himm 0x120F0100 1
#himm 0x120F0100 1
#UART1
himm 0x120F00F8 1
himm 0x120F00FC 1
#I2S
himm 0x120F00A0 1
himm 0x120F00A4 1
himm 0x120F00A8 1
himm 0x120F00AC 1
himm 0x120F00B0 1
himm 0x120F00B4 1
himm 0x120F00B8 1
himm 0x120F00BC 1
#QOS
himm 0x12120084 0x66663666
#i2c
himm 0x120F00E0 1
himm 0x120F00E4 1
/link/shell/init.sh /link/shell/init.sh

View File

@ -12,5 +12,7 @@ net.ipv4.tcp_wmem = 32768 4336600 873200
net.ipv4.tcp_rmem = 32768 4336600 873200 net.ipv4.tcp_rmem = 32768 4336600 873200
net.ipv4.tcp_mem = 786432 1048576 1572864 net.ipv4.tcp_mem = 786432 1048576 1572864
net.ipv4.ip_forward = 1 #net.ipv4.ip_forward = 1
#net.ipv4.tcp_tw_recycle = 1
#net.ipv4.tcp_tw_reuse = 1

View File

@ -1,3 +1,5 @@
#!/bin/sh #!/bin/sh
mount -t vfat -o sync /dev/sda1 /root/usb /bin/umount /root/usb
mount -t ext4 -o sync /dev/sda1 /root/usb /bin/mount -t vfat -o codepage=936,utf8 /dev/sda1 /root/usb
/bin/mount -t ext4 /dev/sda1 /root/usb
/usr/bin/ntfs-3g /dev/sda1 /root/usb

View File

@ -4,7 +4,7 @@
# -i : insmod all modules # -i : insmod all modules
# default : rmmod all moules and then insmod them # default : rmmod all moules and then insmod them
# #
. /link/shell/util/hardware.sh
####################Variables Definition########################## ####################Variables Definition##########################
AD_TYPE=6134 # ad type AD_TYPE=6134 # ad type
@ -15,7 +15,7 @@ os_mem_size=200; # 64M, os mem
mmz_start=0x8C800000; # mmz start addr mmz_start=0x8C800000; # mmz start addr
mmz_size=312M; # 128M, mmz size mmz_size=312M; # 128M, mmz size
board_mode="demo"; # demo or sck board_mode="demo"; # demo or sck
if [ "`cat /link/config/fac`" == "SH" ]; then if [ "$fac" == "SH" ]; then
mem_total=1024; # 512M, total mem mem_total=1024; # 512M, total mem
mem_start=0x80000000; # phy mem start mem_start=0x80000000; # phy mem start
@ -115,7 +115,11 @@ insert_ko()
insmod hi3521d_vpss.ko insmod hi3521d_vpss.ko
insmod hi3521d_vou.ko insmod hi3521d_vou.ko
if [ "$fac" == "SH" ]; then
insmod hifb.ko video="hifb:vram0_size:32400,vram1_size:8100" softcursor="off" insmod hifb.ko video="hifb:vram0_size:32400,vram1_size:8100" softcursor="off"
else
insmod hifb.ko video="hifb:vram0_size:8100" softcursor="off"
fi
insmod hi3521d_hdmi.ko insmod hi3521d_hdmi.ko
insmod hi3521d_rc.ko insmod hi3521d_rc.ko
@ -132,7 +136,7 @@ insert_ko()
insmod hi_ir.ko insmod hi_ir.ko
insmod extdrv/gpio_com_drv.ko insmod extdrv/gpio_com_drv.ko
if [ "`cat /link/config/fac`" == "SH" ]; then if [ "$fac" == "SH" ]; then
insmod extdrv/gs2971a.ko insmod extdrv/gs2971a.ko
insmod extdrv/8821cu_21.ko insmod extdrv/8821cu_21.ko
insmod extdrv/8852bu_21.ko insmod extdrv/8852bu_21.ko

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,356 @@
[
{
"layId": 0,
"layName": "9宫格",
"layNameEn": "grid 3x3",
"enable": false,
"layouts": [
{
"id": -1,
"name": "/",
"lock": true,
"key": 73249,
"pos": {
"a": 1,
"x": 0,
"y": 0,
"w": 0.3333,
"h": 0.3333,
"index": 1
}
},
{
"id": -2,
"name": "/",
"lock": true,
"key": 53394,
"pos": {
"a": 1,
"x": 0.3333,
"y": 0,
"w": 0.3333,
"h": 0.3333,
"index": 2
}
},
{
"id": -3,
"name": "/",
"lock": true,
"key": 28676,
"pos": {
"a": 1,
"x": 0.6667,
"y": 0,
"w": 0.3333,
"h": 0.3333,
"index": 3
}
},
{
"id": -4,
"name": "/",
"lock": true,
"key": 69702,
"pos": {
"a": 1,
"x": 0,
"y": 0.3333,
"w": 0.3333,
"h": 0.3333,
"index": 4
}
},
{
"id": -5,
"name": "/",
"lock": true,
"key": 9107,
"pos": {
"a": 1,
"x": 0.333,
"y": 0.333,
"w": 0.3333,
"h": 0.3333,
"index": 5
}
},
{
"id": -6,
"name": "/",
"lock": true,
"key": 79639,
"pos": {
"a": 1,
"x": 0.6667,
"y": 0.3333,
"w": 0.3333,
"h": 0.3333,
"index": 6
}
},
{
"id": -7,
"name": "/",
"lock": true,
"key": 45145,
"pos": {
"a": 1,
"x": 0,
"y": 0.6667,
"w": 0.3333,
"h": 0.3333,
"index": 7
}
},
{
"id": -8,
"name": "/",
"lock": true,
"key": 96008,
"pos": {
"a": 1,
"x": 0.3333,
"y": 0.6667,
"w": 0.3333,
"h": 0.3333,
"index": 8
}
},
{
"id": -9,
"name": "/",
"lock": true,
"key": 81693,
"pos": {
"a": 1,
"x": 0.6667,
"y": 0.6667,
"w": 0.3333,
"h": 0.3333,
"index": 9
}
}
]
},
{
"layId": 1,
"layName": "4分屏",
"layNameEn": "grid 2x2",
"enable": false,
"layouts": [
{
"id": -1,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0",
"y": "0",
"w": "0.5",
"h": "0.5",
"index": 1
},
"enable": false,
"key": 27788
},
{
"id": -2,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0.5",
"y": "0",
"w": "0.5",
"h": "0.5",
"index": 2
},
"enable": false,
"key": 35441
},
{
"id": -3,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0",
"y": "0.5",
"w": "0.5",
"h": "0.5",
"index": 3
},
"enable": false,
"key": 9422
},
{
"id": -4,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0.5",
"y": "0.5",
"w": "0.5",
"h": "0.5",
"index": 4
},
"enable": false,
"key": 77627
}
]
},
{
"layId": 2,
"layName": "1+2",
"layNameEn": "1+2",
"enable": false,
"layouts": [
{
"id": -1,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0",
"y": "0.1667",
"w": "0.6667",
"h": "0.6667",
"index": 1
},
"enable": false,
"key": 38752
},
{
"id": -2,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0.6667",
"y": "0.1667",
"w": "0.3333",
"h": "0.3333",
"index": 2
},
"enable": false,
"key": 23016
},
{
"id": -3,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0.6667",
"y": "0.5",
"w": "0.3333",
"h": "0.3333",
"index": 3
},
"enable": false,
"key": 62826
}
]
},
{
"layId": 3,
"layName": "画中画",
"layNameEn": "PinP",
"enable": false,
"layouts": [
{
"id": -1,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0",
"y": "0",
"w": "1",
"h": "1",
"index": 1
},
"enable": false,
"key": 25939
},
{
"id": -2,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0.6667",
"y": "0.6667",
"w": "0.25",
"h": "0.25",
"index": 2
},
"enable": false,
"key": 70744
}
]
},
{
"layId": 4,
"layName": "单画面",
"layNameEn": "Single",
"enable": false,
"layouts": [
{
"id": -1,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0",
"y": "0",
"w": "1",
"h": "1",
"index": 1
},
"enable": false,
"key": 41656
}
]
},
{
"layId": 5,
"layName": "上下",
"layNameEn": "UpDown",
"enable": false,
"layouts": [
{
"id": -1,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0",
"y": "0",
"w": "1",
"h": "0.5",
"index": 1
},
"enable": false,
"key": 33095
},
{
"id": -2,
"name": "/",
"lock": true,
"pos": {
"a": 1,
"x": "0",
"y": "0.5",
"w": "1",
"h": "0.5",
"index": 2
},
"enable": false,
"key": 81595
}
]
}
]

View File

@ -1,5 +1,5 @@
{ {
"type":"ENC1H", "type":"ENC1V2",
"groupId":0, "groupId":0,
"order":[] "order":[]
} }

View File

@ -0,0 +1,27 @@
{
"intercom": {
"buf": 8,
"did": 0,
"enable": false,
"gain": 0,
"ip": "127.0.0.1",
"name": "Director",
"hid": "/dev/headphone",
"port": 7000,
"tid": -1,
"vad": 50
},
"server": {
"enable": false
},
"tally": {
"enable": false,
"uart": "/dev/ttyTally"
},
"vmix": {
"enable": false,
"ip": "192.168.1.56",
"mode": "vmix",
"uart": "/dev/ttyAMA1"
}
}

View File

@ -0,0 +1,8 @@
{
"enable":false,
"point":[{"x":0,"y":0},{"x":0.1,"y":0.1},{"x":0.3,"y":0.3}],
"autoUpdate":false,
"tolerance":20,
"srcA":0,
"srcB":{"type":"img","path":"/link/res/x1.jpg","id":2}
}

View File

@ -0,0 +1,42 @@
[
[
-72000,
7200,
100
],
[
-72000,
68040,
100
],
[
0,
0,
100
],
[
0,
0,
100
],
[
0,
0,
100
],
[
0,
0,
100
],
[
0,
0,
100
],
[
0,
0,
100
]
]

View File

@ -0,0 +1 @@
{"timeArea":"Asia","timeCity":"Beijing"}

View File

@ -1 +1,4 @@
{"server":"cn.pool.ntp.org","enable":false} {
"enable":false,
"server":"ntp1.aliyun.com"
}

View File

@ -1,7 +1,7 @@
{ {
"autorun": false, "autorun": false,
"srcA": 6, "srcA": 0,
"srcV": 6, "srcV": 0,
"srcV_chn":"main", "srcV_chn":"main",
"url": [ "url": [
{ {

View File

@ -0,0 +1,12 @@
{
"telnet":true,
"ssh":true,
"php":true,
"nginx":true,
"crond":true,
"onvif":true,
"ndi":true,
"sls":true,
"frp":false,
"trans":false
}

View File

@ -0,0 +1,8 @@
{
"used": "default",
"themes": [
"default",
"salmon",
"skyBlue"
]
}

View File

@ -0,0 +1,6 @@
{
"baudRate": 115200,
"device": "/dev/ttyAMA1",
"ip": "192.168.1.1",
"port": "3000"
}

View File

@ -1,5 +1,5 @@
{ {
"type":"ENC1H", "type":"ENC1V2",
"groupId":0, "groupId":0,
"order":[] "order":[]
} }

View File

@ -0,0 +1,55 @@
{
"fac":"V2",
"model":"ENC1V2",
"chip":"HI3520DV400",
"interfaceV":[
{"name":"HDMI","type":"HDMI"}
],
"capability":{
"decode":{
"channels":2
},
"encode":{
"maxSize":"1080P",
"maxPixel":165888000,
"BFrame":false
},
"maxInput":"1080P60",
"maxOutput":"1080P60",
"extraVo":"VGA",
"eth1":false
},
"function":{
"record":true,
"carousel":true,
"overlay":true,
"dhcp":true,
"wifi":true,
"videoOut":true,
"line":true,
"mix":true,
"portCtrl":true,
"ndi":true,
"srt":true,
"hls":true,
"serialport":true,
"button":false,
"intercom":true,
"remote":true,
"rtspAuth":true,
"netPic":true
},
"other":{
"help":"120.78.2.184"
},
"gpio":{
"type":"himm",
"name":"gpio11_5",
"mux":"himm 0x120F0104 0x0",
"dir":"himm 0x12200400 0x0",
"addr":"0x12200080"
},
"usb":{
"lnk":"1-1"
}
}

View File

@ -0,0 +1,8 @@
{
"enable":false,
"point":[{"x":0,"y":0},{"x":0.1,"y":0.1},{"x":0.3,"y":0.3}],
"autoUpdate":false,
"tolerance":20,
"srcA":0,
"srcB":{"type":"img","path":"/link/res/x1.jpg","id":2}
}

View File

@ -0,0 +1,68 @@
[
{
"alpha": "0.9",
"color": "#000000",
"content": "/link/res/banner.png",
"enable": false,
"font": "/link/res/font.ttf",
"h": 0,
"scale": 1,
"type": "pic",
"w": 0,
"x": "0.081",
"y": "0.688"
},
{
"alpha": 1,
"color": "#000000",
"content": "This is an example of scrolling subtitles.",
"enable": false,
"font": "/link/res/font.ttf",
"h": 0,
"move": "-2",
"scale": "1.79",
"type": "text",
"w": "0.599",
"x": "0.195",
"y": "0.749"
},
{
"alpha": "1",
"color": "#909090",
"content": "hh:mm:ss",
"enable": false,
"font": "/link/res/font.ttf",
"h": 0,
"scale": "1.46",
"type": "time",
"w": 0,
"x": "0.827",
"y": "0.806"
},
{
"alpha": 1,
"color": "#ffffff",
"content": "THIS IS A TITLE",
"enable": false,
"font": "/link/res/font.ttf",
"h": 0,
"scale": "1",
"type": "text",
"w": 0,
"x": "0.431",
"y": "0.706"
},
{
"alpha": 1,
"color": "#000000",
"content": "/link/res/logo.png",
"enable": false,
"font": "/link/res/font.ttf",
"h": 0,
"scale": 1,
"type": "pic",
"w": 0,
"x": "0.049",
"y": "0.049"
}
]

View File

@ -34,10 +34,10 @@
}, },
"rudp": { "rudp": {
"send": { "send": {
"enable": true "enable": false
}, },
"recv": { "recv": {
"enable": true "enable": false
} }
}, },
"vendor": { "vendor": {

View File

@ -1 +1,4 @@
{"server":"cn.pool.ntp.org","enable":false} {
"enable":false,
"server":"ntp1.aliyun.com"
}

View File

@ -1,7 +1,7 @@
{ {
"autorun": false, "autorun": false,
"srcA": 6, "srcA": 0,
"srcV": 6, "srcV": 0,
"srcV_chn":"main", "srcV_chn":"main",
"url": [ "url": [
{ {

View File

@ -0,0 +1,12 @@
{
"telnet":true,
"ssh":true,
"php":true,
"nginx":true,
"crond":true,
"onvif":true,
"ndi":true,
"sls":true,
"frp":false,
"trans":false
}

View File

@ -1,4 +1,19 @@
[ [
{
"version": "2.1.0 build 20230426",
"logs": [
"修正了B帧解码的缓冲控制",
"减少了MP3编码的cpu占用",
"支持insta360Link最新固件",
"修正个别情况下网络流叠加特效的异常",
"修正解码插图在缩放、旋转等情况下的显示异常",
"修正某些机型的网路流旋转异常",
"解决srt对于ipv6域名解析的问题",
"更换升级包/资源上传组件",
"视频轮播支持解码、重编码(即U盘播放、推流)",
"实验室新增抠像功能,即绿幕抠图"
]
},
{ {
"version": "2.0.0 build 20230322", "version": "2.0.0 build 20230322",
"logs": [ "logs": [

View File

@ -1,5 +1,5 @@
{ {
"app": "2.0.0 build 20220512_869", "app": "2.0.0 build 20220512_869",
"sdk": "2.0.0 build 20220518_20716", "sdk": "2.0.0 build 20220518_20716",
"sys": "2.0.0 build 20230322" "sys": "2.1.0 build 20230426"
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
{
"type":"ENC1",
"groupId":0,
"order":[]
}

View File

@ -0,0 +1,5 @@
{
"type":"ENC1",
"groupId":0,
"order":[]
}

View File

@ -0,0 +1,55 @@
{
"fac":"EX2",
"model":"ENC1",
"chip":"HI3520DV400",
"interfaceV":[
{"name":"HDMI","type":"HDMI"}
],
"capability":{
"decode":{
"channels":2
},
"encode":{
"maxSize":"1080P",
"maxPixel":165888000,
"BFrame":false
},
"maxInput":"1080P60",
"maxOutput":"1080P60",
"extraVo":"VGA",
"eth1":false
},
"function":{
"record":true,
"carousel":true,
"overlay":true,
"dhcp":true,
"wifi":true,
"videoOut":true,
"line":true,
"mix":true,
"portCtrl":true,
"ndi":true,
"srt":true,
"hls":true,
"serialport":true,
"button":true,
"intercom":true,
"remote":false,
"rtspAuth":true,
"netPic":true
},
"other":{
"help":"120.78.2.184"
},
"gpio":{
"type":"himm",
"name":"gpio11_5",
"mux":"himm 0x120F0104 0x0",
"dir":"himm 0x12200400 0x0",
"addr":"0x12200080"
},
"usb":{
"lnk":"1-1"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
{
"type":"ENCSH",
"groupId":0,
"order":[]
}

View File

@ -0,0 +1,5 @@
{
"type":"ENCSH",
"groupId":0,
"order":[]
}

View File

@ -0,0 +1,56 @@
{
"fac":"SH",
"model":"ENCSH",
"chip":"HI3521DV100",
"interfaceV":[
{"name":"SDI","type":"SDI"},
{"name":"HDMI","type":"HDMI"}
],
"capability":{
"decode":{
"channels":4
},
"encode":{
"maxSize":"4K",
"maxPixel":373248000,
"BFrame":false
},
"maxInput":"4K30",
"maxOutput":"4K30",
"extraVo":"VGA",
"eth1":false
},
"function":{
"record":true,
"carousel":true,
"overlay":true,
"dhcp":true,
"wifi":true,
"videoOut":true,
"line":true,
"mix":true,
"portCtrl":true,
"ndi":true,
"srt":true,
"hls":true,
"serialport":true,
"button":false,
"intercom":true,
"remote":false,
"rtspAuth":true,
"netPic":true
},
"other":{
"help":"120.78.2.184"
},
"gpio":{
"type":"himm",
"name":"gpio0_6",
"mux":"himm",
"dir":"himm 0x12150400 0x89",
"addr":"0x12150100"
},
"usb":{
"lnk":"1-2"
}
}

View File

@ -3,21 +3,21 @@
"default":{ "default":{
"sys":[ "sys":[
{"size":12441600,"cnt":8}, {"size":12441600,"cnt":8},
{"size":3110400,"cnt":55}, {"size":3133440,"cnt":55},
{"size":345600,"cnt":30} {"size":345600,"cnt":30}
] ]
}, },
"4K_DEC":{ "4K_DEC":{
"sys":[ "sys":[
{"size":12441600,"cnt":8}, {"size":12441600,"cnt":8},
{"size":3110400,"cnt":55}, {"size":3133440,"cnt":55},
{"size":345600,"cnt":30} {"size":345600,"cnt":30}
] ]
}, },
"4K_ENC":{ "4K_ENC":{
"sys":[ "sys":[
{"size":12441600,"cnt":20}, {"size":12441600,"cnt":20},
{"size":3110400,"cnt":40}, {"size":3133440,"cnt":40},
{"size":345600,"cnt":20} {"size":345600,"cnt":20}
] ]
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
{
"type":"ENC1V2",
"groupId":0,
"order":[]
}

View File

@ -0,0 +1,5 @@
{
"type":"ENC1V2",
"groupId":0,
"order":[]
}

View File

@ -0,0 +1,55 @@
{
"fac":"V2",
"model":"ENC1V2",
"chip":"HI3520DV400",
"interfaceV":[
{"name":"HDMI","type":"HDMI"}
],
"capability":{
"decode":{
"channels":2
},
"encode":{
"maxSize":"1080P",
"maxPixel":165888000,
"BFrame":false
},
"maxInput":"1080P60",
"maxOutput":"1080P60",
"extraVo":"VGA",
"eth1":false
},
"function":{
"record":true,
"carousel":true,
"overlay":true,
"dhcp":true,
"wifi":true,
"videoOut":true,
"line":true,
"mix":true,
"portCtrl":true,
"ndi":true,
"srt":true,
"hls":true,
"serialport":true,
"button":false,
"intercom":true,
"remote":true,
"rtspAuth":true,
"netPic":true
},
"other":{
"help":"120.78.2.184"
},
"gpio":{
"type":"himm",
"name":"gpio11_5",
"mux":"himm 0x120F0104 0x0",
"dir":"himm 0x12200400 0x0",
"addr":"0x12200080"
},
"usb":{
"lnk":"1-1"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

BIN
rootfs/link/res/banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

11
rootfs/link/shell/app.sh Normal file
View File

@ -0,0 +1,11 @@
/link/shell/enc.sh &
/link/shell/gpio.sh &
if [ -f /link/bin/PortCtrl ] ;then
/link/bin/PortCtrl &
fi
if [ -f /link/shell/ptz.sh ] ;then
/link/shell/ptz.sh &
fi

View File

@ -21,4 +21,6 @@ if [ "$interface" = "eth0" ]; then
echo '{"dhcp":true,"ip":"'$ip'","mask":"'$subnet'","gateway":"'$router'","dns":"'$dns'"}' > /link/config/net.json echo '{"dhcp":true,"ip":"'$ip'","mask":"'$subnet'","gateway":"'$router'","dns":"'$dns'"}' > /link/config/net.json
echo $ip > /etc/hostname echo $ip > /etc/hostname
hostname -F /etc/hostname hostname -F /etc/hostname
else
echo '{"dhcp":true,"ip":"'$ip'","mask":"'$subnet'","gateway":"'$router'","dns":"'$dns'"}' > /link/config/net2.json
fi fi

View File

@ -14,11 +14,6 @@ umount_usb(){
done done
} }
umount_usb
echo -e "d\n1\nd\n2\nd\n3\nd\n4\n\nw" | fdisk /dev/sda
sleep 1
echo -e "n\np\n1\n1\n\nw" | fdisk /dev/sda
sleep 1
umount_usb umount_usb
if [ $1 == "ext4" ];then if [ $1 == "ext4" ];then
echo -e "\ny" | mkfs.ext4 -T largefile /dev/sda1 echo -e "\ny" | mkfs.ext4 -T largefile /dev/sda1

63
rootfs/link/shell/gpio.sh Normal file
View File

@ -0,0 +1,63 @@
. /link/shell/util/hardware.sh
count=0
type=`jget gpio.type`
himmGPIO()
{
gpioName=`jget gpio.name`
gpioAddr=`jget gpio.addr`
eval "`jget gpio.mux` > /dev/null"
eval "`jget gpio.dir` > /dev/null"
echo "Init $gpioName($gpioAddr) done."
while [ true ]
do
ret=`himd.l $gpioAddr 1 | awk 'NR==4{print $2}'`
if [ "$ret" == "00000000" ]; then
count=$(($count+1))
echo "keyDown $count"
if [ "$count" == "5" ]; then
echo "reset default config"
/link/shell/reset.sh
fi
else
count=0
fi
sleep 1
done
}
sysfsGPIO()
{
gpioName=`jget gpio.name`
gpioIndex=`jget gpio.index`
eval "`jget gpio.mux` > /dev/null"
if [ ! -d "/sys/class/gpio/gpio$gpioIndex" ];then
echo $gpioIndex > /sys/class/gpio/export
fi
echo "in" > /sys/class/gpio/gpio$gpioIndex/direction
echo "Init $gpioName($gpioIndex) done."
while [ true ]
do
ret=`cat /sys/class/gpio/gpio$gpioIndex/value`
if [ "$ret" == "0" ]; then
count=$(($count+1))
echo "keyDown $count"
if [ "$count" == "5" ]; then
echo "reset default config"
/link/shell/reset.sh
fi
else
count=0
fi
sleep 1
done
}
if [ "$type" == "himm" ]; then
himmGPIO
elif [ "$type" == "sysfs" ]; then
sysfsGPIO
fi

View File

@ -1,39 +1,23 @@
. /etc/profile . /etc/profile
/link/bin/rtc -g time . /link/shell/util/func.sh
. /link/shell/util/hardware.sh
/link/shell/update.sh /link/shell/update.sh
mkdir /tmp/snap
mkdir /tmp/hls
mkdir /tmp/log
mkdir /root/usb
ifconfig lo 127.0.0.1 ifconfig lo 127.0.0.1
/usr/php/sbin/php-fpm -R -p /usr/php -c /usr/php/etc/php.ini /sbin/sysctl -p /etc/sysctl.conf
/usr/nginx/sbin/nginx -p /usr/nginx /link/shell/init/filesystem.sh
/link/shell/init/chip.sh
ip=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` if nfsBoot ;then
if [ -z "$ip" ]; then /link/shell/init/service.sh
/link/shell/setMac.sh else
sleep 1 /link/shell/netManager.sh
/link/shell/mountUsb.sh /link/shell/init/service.sh
/link/shell/setNetwork.sh /link/shell/app.sh
/link/shell/cron.sh &
/link/shell/ndi.sh &
sls_enable=$(cat /link/config/sls_enable |awk '{printf "%s",$1}')
if [ "$sls_enable" == "true" ]; then
/link/bin/sls -c /link/config/sls.conf &
fi
sleep 2
/link/shell/enc.sh &
/link/shell/onvif.sh
/link/bin/Gpio &
/link/shell/oled.sh &
/link/shell/ptz.sh &
sleep 2
/link/bin/PortCtrl &
/link/bin/WifiCtrl &
fi fi
#mount -t nfs -o nolock 192.168.1.28:/home/zc/nfs /root/nfs

View File

@ -0,0 +1,28 @@
cd /ko
./load3521d -i
#UART3
#himm 0x120F0100 1
#himm 0x120F0100 1
#UART1
himm 0x120F00F8 1
himm 0x120F00FC 1
#I2S
himm 0x120F00A0 1
himm 0x120F00A4 1
himm 0x120F00A8 1
himm 0x120F00AC 1
himm 0x120F00B0 1
himm 0x120F00B4 1
himm 0x120F00B8 1
himm 0x120F00BC 1
#QOS
himm 0x12120084 0x66663666
#i2c
himm 0x120F00E0 1
himm 0x120F00E4 1

View File

@ -0,0 +1,16 @@
mkdir /tmp/snap
mkdir /tmp/hls
mkdir /tmp/log
if [ ! -d /root/usb ]; then
mkdir /root/usb
fi
/link/shell/mountUsb.sh
if [ -b /dev/mmcblk0p5 ]; then
/bin/mount -o remount,rw,sync,barrier=0 /dev/mmcblk0p5 /
fi
if [ -b /dev/mmcblk0p6 ]; then
/bin/mount -o rw,sync,barrier=0 /dev/mmcblk0p6 /root/usb
fi

View File

@ -0,0 +1,40 @@
. /link/shell/util/func.sh
jopen /link/config/service.json
if [ `jget telnet` == "true" ]; then
/usr/sbin/telnetd
fi
if [ `jget ssh` == "true" ] && ! procExists sshd; then
if [ ! -d /var/empty ];then
mkdir -p /var/empty
fi
chown root:root /var/empty
/usr/local/sbin/sshd
fi
if [ `jget php` == "true" ]; then
/usr/php/sbin/php-fpm -R -p /usr/php -c /usr/php/etc/php.ini
fi
if [ `jget nginx` == "true" ]; then
/usr/nginx/sbin/nginx -p /usr/nginx
fi
if [ `jget crond` == "true" ]; then
/usr/sbin/crond -d 8
fi
if [ `jget onvif` == "true" ]; then
/link/shell/onvif.sh
fi
if [ `jget ndi` == "true" ]; then
/link/shell/ndi.sh
fi
if [ `jget sls` == "true" ]; then
/link/bin/sls -c /link/config/sls.conf &
fi
/link/shell/ntp.sh &

View File

@ -1,11 +1,13 @@
#!/bin/sh #!/bin/sh
umount /root/usb
if [ -e "/dev/sda" ]; then if [ -e "/dev/sda" ]; then
umount /root/usb
if [ -e "/dev/sda1" ]; then if [ -e "/dev/sda1" ]; then
/bin/mount -t vfat /dev/sda1 /root/usb /bin/mount -t vfat -o rw,relatime,codepage=936,utf8 /dev/sda1 /root/usb
/bin/mount -t ext4 /dev/sda1 /root/usb /bin/mount -t ext4 /dev/sda1 /root/usb
/usr/bin/ntfs-3g /dev/sda1 /root/usb
else else
/bin/mount -t vfat /dev/sda /root/usb /bin/mount -t vfat -o rw,relatime,codepage=936,utf8 /dev/sda /root/usb
/bin/mount -t ext4 /dev/sda /root/usb /bin/mount -t ext4 /dev/sda /root/usb
/usr/bin/ntfs-3g /dev/sda /root/usb
fi fi
fi fi

View File

@ -6,7 +6,14 @@ sed -i "s/host-name=.*/host-name=`cat /link/config/mac`/g" /etc/avahi/avahi-daem
else else
sed -i "s/host-name=.*/host-name=test/g" /etc/avahi/avahi-daemon.conf sed -i "s/host-name=.*/host-name=test/g" /etc/avahi/avahi-daemon.conf
fi fi
if [ -f /usr/local/var/run/dbus/pid ] ;then
rm /usr/local/var/run/dbus/pid rm /usr/local/var/run/dbus/pid
fi
if [ -f /run/avahi-daemon/pid ] ;then
rm /run/avahi-daemon/pid rm /run/avahi-daemon/pid
fi
/link/bin/dbus-daemon --config-file=/etc/dbus-1/system.conf /link/bin/dbus-daemon --config-file=/etc/dbus-1/system.conf
/link/bin/avahi-daemon -f /etc/avahi/avahi-daemon.conf -D /link/bin/avahi-daemon -f /etc/avahi/avahi-daemon.conf -D

View File

@ -0,0 +1,15 @@
. /link/shell/util/hardware.sh
/link/shell/setMac.sh
sleep 1
/link/shell/setNetwork.sh
sleep 2
/link/bin/WifiCtrl &
if [ -d /sys/class/net/eth1 ]; then
/link/shell/setMac2.sh
if [ "$fac"=="ENC2" ] && [ -d /sys/class/net/eth2 ]; then
/link/shell/setNetwork2.sh eth2
else
/link/shell/setNetwork2.sh eth1
fi
fi

14
rootfs/link/shell/ntp.sh Normal file
View File

@ -0,0 +1,14 @@
. /link/shell/util/func.sh
while [ true ]
do
jopen /link/config/ntp.json
if [ `jget enable` == "true" ]; then
if ! procExists ntpd ;then
ntpd -p `jget server` -N
fi
else
pkill ntpd
fi
sleep 1
done

View File

@ -1,2 +1,3 @@
cp /link/config/default/* /link/config/ cp /link/config/default/* /link/config/
rm -rf /link/config/auto/*
reboot reboot

View File

@ -0,0 +1,8 @@
if [ ! -f "/link/config/mac2" ]; then
/link/shell/makeMac.sh > /dev/null
/link/shell/makeMac.sh > /link/config/mac2
fi
/sbin/ifconfig $1 down
/sbin/ifconfig $1 hw ether `cat /link/config/mac2`
/sbin/ifconfig $1 up

View File

@ -1,3 +1,4 @@
. /link/shell/util/func.sh
if [ -f /root/usb/local ];then if [ -f /root/usb/local ];then
cp /root/usb/local /link/config/net.json cp /root/usb/local /link/config/net.json
@ -31,6 +32,10 @@ echo $ip > /etc/hostname
hostname -F /etc/hostname hostname -F /etc/hostname
if [ ! -f /root/usb/local -a "$dhcp" == "true" ]; then if [ ! -f /root/usb/local -a "$dhcp" == "true" ]; then
ifconfig eth0 up ifconfig eth0 up
udhcpc -i eth0 -q -s /link/shell/dhcp.sh & if ! procExists udhcpc ;then
udhcpc -i eth0 -b -s /link/shell/dhcp.sh > /dev/null &
fi
else
pkill udhcpc
fi fi

View File

@ -0,0 +1,15 @@
cfg=/link/config/net2.json
ip=`cat $cfg | grep -o '"ip":[0-9|.|"| ]*' | awk -F\" '{print $4}'`
mask=`cat $cfg | grep -o '"mask":[0-9|.|"| ]*' | awk -F\" '{print $4}'`
gw=`cat $cfg | grep -o '"gateway":[0-9|.|"| ]*' | awk -F\" '{print $4}'`
dns=`cat $cfg | grep -o '"dns":[0-9|.|"| ]*' | awk -F\" '{print $4}'`
dhcp=`cat $cfg | grep -o '"dhcp":[^(,|})]*' | awk -F: '{print $2}'`
ifconfig $1 $ip netmask $mask up
if [ "$dhcp" == "true" ]; then
ifconfig $1 up
udhcpc -i $1 -b -s /link/shell/dhcp.sh > /dev/null &
fi

View File

@ -1,15 +1,46 @@
mv /link/update/* /link/update/update.tar if [ ! -z "$(ls -A /link/update)" ]; then
tar -xf /link/update/update.tar -C / mv /link/update/* /link/update/update.tar
if [ -f "/link/update/kernel" ]; then tar -xf /link/update/update.tar -C /
flash_erase /dev/mtd1 0 0
nandwrite -p /dev/mtd1 /link/update/kernel sleep 1
if [ -c "/dev/mtd1" ]; then
if [ -f "/link/update/kernel" ]; then
flash_erase /dev/mtd1 0 0
nandwrite -p /dev/mtd1 /link/update/kernel
fi
if [ -f "/link/update/logo.bin" ]; then
flash_erase /dev/mtd2 0 0
nandwrite -p /dev/mtd2 /link/update/logo.bin
fi
if [ -f "/link/update/logo.jpg" ]; then
flash_erase /dev/mtd3 0 0
nandwrite -p /dev/mtd3 /link/update/logo.jpg
fi
else
if [ -f "/link/update/kernel" ]; then
dd if=/link/update/kernel of=/dev/mmcblk0p2
fi
if [ -f "/link/update/logo.bin" ]; then
dd if=/link/update/logo.bin of=/dev/mmcblk0p3
fi
if [ -f "/link/update/logo.jpg" ]; then
dd if=/link/update/logo.jpg of=/dev/mmcblk0p4
fi
fi
rm /link/update/*
if [ -f "/link/config/reboot" ]; then
rm /link/config/reboot
reboot
fi
fi fi
if [ -f "/link/update/logo.bin" ]; then
flash_erase /dev/mtd2 0 0 if [ -f "/link/shell/runOnce.sh" ]; then
nandwrite -p /dev/mtd2 /link/update/logo.bin chmod 777 /link/shell/runOnce.sh
/link/shell/runOnce.sh
rm /link/shell/runOnce.sh
fi fi
if [ -f "/link/update/logo.jpg" ]; then
flash_erase /dev/mtd3 0 0
nandwrite -p /dev/mtd3 /link/update/logo.jpg
fi
rm /link/update/*

View File

@ -0,0 +1,29 @@
m_jsonpath=""
jopen()
{
m_jsonpath=$1
}
jget()
{
if [ "$2" ] ;then
jq -r .$1 $2
else
jq -r .$1 $m_jsonpath
fi
}
nfsBoot()
{
if [ -z "`mount -t nfs`" ]; then
return 1
else
return 0
fi
}
procExists()
{
ps -ef | grep $1 | grep -v grep > /dev/null
return $?
}

View File

@ -0,0 +1,6 @@
. /link/shell/util/func.sh
jopen /link/config/hardware.json
fac=`jget fac`
chip=`jget chip`
model=`jget model`

View File

@ -41,6 +41,18 @@ include( "head.php" );
<en>Enable</en>: <en>Enable</en>:
</label> </label>
<input type="checkbox" zcfg="enable" class="switch form-control"> <input type="checkbox" zcfg="enable" class="switch form-control">
<label class="control-label">
<cn>视频解码</cn>
<en>Video decode</en>:
</label>
<input type="checkbox" zcfg="decodeV" class="switch form-control">
<label class="control-label">
<cn>音频解码</cn>
<en>Audio decode</en>:
</label>
<input type="checkbox" zcfg="decodeA" class="switch form-control">
</form> </form>
<hr/> <hr/>
<table class="table table-striped"> <table class="table table-striped">
@ -98,6 +110,24 @@ include( "head.php" );
return "[" + m + ":" + s + "]"; return "[" + m + ":" + s + "]";
} }
function formatName(name) {
var nn = name;
var count = 7;
let reg = new RegExp("[\\u4E00-\\u9FFF]+","g")
if(!reg.test(name))
count = 12
if(name.indexOf(".") > -1) {
if(name.length > (count+3))
{
var lst = name.split(".");
nn = lst[0].substring(0,count)+"..."+lst[1];
}
}
return nn;
}
$.getJSON( "config/config.json", function ( result ) { $.getJSON( "config/config.json", function ( result ) {
config = result; config = result;
for ( var i = 0; i < config.length; i++ ) { for ( var i = 0; i < config.length; i++ ) {
@ -122,7 +152,9 @@ include( "head.php" );
list.push( playList[ k ].name ); list.push( playList[ k ].name );
} }
config[ i ].file = list; config[ i ].file = list;
config[ i ].enable = $("#cfg .switch").is( ":checked" ); config[ i ].enable = $("#cfg .switch").eq(0).is( ":checked" );
config[ i ].decodeV = $("#cfg .switch").eq(1).is( ":checked" );
config[ i ].decodeA = $("#cfg .switch").eq(2).is( ":checked" );
rpc( "enc.update", [ JSON.stringify( config, null, 2 ) ], function ( data ) { rpc( "enc.update", [ JSON.stringify( config, null, 2 ) ], function ( data ) {
getList(); getList();
} ); } );
@ -164,12 +196,12 @@ include( "head.php" );
var ticks_positions = new Array(); var ticks_positions = new Array();
var html = ""; var html = "";
for ( var i = 0; i < playList.length; i++ ) { for ( var i = 0; i < playList.length; i++ ) {
ticks_labels.push( playList[ i ].name ); ticks_labels.push( formatName(playList[ i ].name) );
ticks.push( totalLen ); ticks.push( totalLen );
totalLen += playList[ i ].duration; totalLen += playList[ i ].duration;
html += "<tr>"; html += "<tr>";
html += '<td>' + ( i + 1 ) + '</td>'; html += '<td>' + ( i + 1 ) + '</td>';
html += '<td>' + playList[ i ].name + '</td>'; html += '<td>' + formatName(playList[ i ].name) + '</td>';
html += '<td>' + timeFormat( playList[ i ].duration ) + '</td>'; html += '<td>' + timeFormat( playList[ i ].duration ) + '</td>';
html += '<td><button class="btn btn-warning" onclick="swap(' + ( i - 1 ) + ',' + i + ');"><i class="fa fa-arrow-up"></i></button> '; html += '<td><button class="btn btn-warning" onclick="swap(' + ( i - 1 ) + ',' + i + ');"><i class="fa fa-arrow-up"></i></button> ';
html += '<button class="btn btn-warning" onclick="swap(' + ( i + 1 ) + ',' + i + ');"><i class="fa fa-arrow-down"></i></button> '; html += '<button class="btn btn-warning" onclick="swap(' + ( i + 1 ) + ',' + i + ');"><i class="fa fa-arrow-down"></i></button> ';
@ -252,7 +284,7 @@ include( "head.php" );
for ( var i = 0; i < list.length; i++ ) { for ( var i = 0; i < list.length; i++ ) {
if ( list[ i ].type != "file" ) if ( list[ i ].type != "file" )
continue; continue;
$( "#fileSelect" ).append( '<option value="' + i + '">' + list[ i ].name + '</option>' ); $( "#fileSelect" ).append( '<option real="' + list[i].name + '" value="'+i+'">' + formatName(list[i].name) + '</option>' );
} }

View File

@ -0,0 +1,358 @@
<?php
include("head.php");
?>
<link href="vendor/fileinput/css/fileinput.min.css" rel="stylesheet" >
<div class="row" id="colorKey">
<div class="col-md-7">
<div class="thumbnail">
<div style="position:relative;">
<img id="snap" src="">
<div id="pointFrame">
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="panel panel-default">
<div class="title">
<h3 class="panel-title">
<cn>参数设定</cn>
<en>Setting</en>
</h3>
</div>
<div class="panel-body">
<form class="form-horizontal" role="form" id="setting">
<div class="form-group">
<label class="col-md-3 control-label">
<cn>启用</cn>
<en>Enable</en>
</label>
<div class="col-md-9">
<input type="checkbox" zcfg="enable" class="switch form-control">
</div>
</div>
<div class="form-group ">
<label class="col-md-3 control-label">
<cn>前景通道</cn>
<en>Front Channel</en>
</label>
<div class="col-md-6">
<select zcfg="colorKey.srcA" id="chnA" class="form-control">
</select>
</div>
</div>
<div class="form-group ">
<label class="col-md-3 control-label">
<cn>背景类型</cn>
<en>Background Type</en>
</label>
<div class="col-md-6">
<select zcfg="colorKey.srcB.type" id="type" class="form-control">
<option value="img" cn="图片" en="Image"></option>
<option value="chn" cn="视频通道" en="Channel"></option>
</select>
</div>
</div>
<div class="form-group " id="pic">
<label class="col-md-3 control-label">
<cn>背景图片</cn>
<en>Background Image</en>
</label>
<div class="col-md-6">
<select zcfg="colorKey.srcB.path" class="form-control">
</select>
</div>
</div>
<div class="form-group " id="chn">
<label class="col-md-3 control-label">
<cn>背景通道</cn>
<en>Background Channel</en>
</label>
<div class="col-md-6">
<select zcfg="colorKey.srcB.id" id="chnB" class="form-control">
</select>
</div>
</div>
<div class="text-center">
<button class="btn btn-warning" type="button" onClick="startPoint();">
<cn>开始取色</cn>
<en>Pick color</en>
</button>
<button class="btn btn-warning" type="button" onClick="stopPoint();">
<cn>停止取色</cn>
<en>Stop pick</en>
</button>
<button class="btn btn-warning" type="button" onClick="updatePoint();">
<cn>更新</cn>
<en>Update</en>
</button>
</div>
<div class="form-group ">
<label class="col-md-3 control-label">
<cn>容差</cn>
<en>Tolerance</en>
</label>
<div class="col-md-6">
<input zcfg="colorKey.tolerance" class="slider" type="text" data-slider-min="0" data-slider-max="50" data-slider-step="1" />
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">
<cn>自动更新</cn>
<en>Auto Update</en>
</label>
<div class="col-md-9">
<input type="checkbox" zcfg="colorKey.autoUpdate" class="switch form-control">
</div>
</div>
</form>
<hr style="margin-top:10px; margin-bottom: 10px;" />
<div class="text-center">
<button class="btn btn-warning col-xs-4 col-xs-offset-4" onClick="save();">
<cn>保存</cn>
<en>Save</en>
</button>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<cn>资源列表</cn>
<en>Resource</en>
</h3>
</div>
<div class="panel-body">
<button id="btnUpload" type="button" class="btn btn-sm btn-warning"><i class="fa fa-upload"></i>
<cn>上传</cn>
<en>Upload</en>
</button>
</div>
<table id="resList" class="table table-striped text-center">
</table>
</div>
</div>
</div>
<div class="modal" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="background: white">
<span aria-hidden="true">×</span>
</button>
<h4 id="updateTitle" class="modal-title"></h4>
</div>
<div class="modal-body" style="padding: 0px 15px 20px 15px">
<div id="alertUpload"></div>
<input type="file" id="uploadFile" name="uploadFile" />
</div>
</div>
</div>
</div>
<script src="vendor/slider/bootstrap-slider.min.js" type="text/javascript"></script>
<script src="vendor/switch/bootstrap-switch.min.js"></script>
<script src="js/zcfg.js"></script>
<script type="text/javascript" src="js/confirm/jquery-confirm.min.js"></script>
<script src="vendor/fileinput/js/fileinput.min.js"></script>
<script>
navIndex(6);
$(".slider").slider();
$.fn.bootstrapSwitch.defaults.size = 'small';
$.fn.bootstrapSwitch.defaults.onColor = 'warning';
$(".switch").bootstrapSwitch();
var config = null;
var colorKey = null;
var picking = false;
var chnId = -1;
$("#uploadModal").on('show.bs.modal', function(){
var $this = $(this);
var $modal_dialog = $this.find('.modal-dialog');
$this.css('display', 'block');
$modal_dialog.css({'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2) });
});
function getRes() {
$.getJSON("res/", function(list) {
$("#pic select").html("");
$("#resList").html("");
for (var i = 0; i < list.length; i++) {
if (list[i].name.indexOf(".jpg") > 0) {
$("#pic select").append('<option value="/link/res/' + list[i].name + '">' + list[i].name + '</option>');
$("#resList").append('<tr><td>' + list[i].name + '</td><td><button onclick="delRes(\'' + list[i].name + '\')" class="btn btn-sm btn-warning"><cn>删除</cn><en>Delete</en></button></td></tr>');
}
}
if (config == null) {
$.getJSON("config/config.json", function(result) {
config = result;
init();
});
}
});
}
function delRes( name ) {
func( "delRes", {
file: name
}, function ( data ) {
getRes();
} );
}
$("#btnUpload").click(function() {
$("#uploadModal").modal("show");
});
function init() {
for (var i = 0; i < config.length; i++) {
if (config[i].encv == undefined)
continue;
$("#chnA").append('<option value="' + i + '">' + config[i].name + '</option>');
$("#chnB").append('<option value="' + i + '">' + config[i].name + '</option>');
if (config[i].type == "colorKey") {
colorKey = config[i].colorKey;
chnId = config[i].id;
showPoint();
}
}
//初始上传控件
var tip = "";
var lang = $.cookie("lang");
if(lang == "en")
{
$("#updateTitle").html("Upload");
tip = "Please drag the image here...";
} else {
lang = "zh";
$("#updateTitle").html("上传资源")
tip = "请把图片拖动到此处仅支持jpg格式...";
}
$("#uploadFile").fileinput({
language: lang,
dropZoneTitle: tip,
showClose: false,
allowedFileExtensions: ['jpg'],
uploadUrl: "upload1.php",
maxFileCount: 3,
maxFileSize:2048
});
//上传成功
$('#uploadFile').on('fileuploaded', function(event, data) {
$("#uploadModal").modal("hide");
$('#uploadFile').fileinput('clear');
$('#uploadFile').fileinput('unlock');
getRes();
});
//上传失败
$('#uploadFile').on('fileuploaderror', function(event, data, msg) {
if(data.jqXHR.responseText) {
var errMsg = eval(data.jqXHR.responseText);
htmlAlert( "#alertUpload", "danger", errMsg, "", 30000 );
}
});
$(".btn-primary").addClass("btn-warning");
$(".file-preview").css("border","none");
$(".file-caption-main").css("padding","0px 16px");
zcfg("#setting", config[chnId]);
showHide();
setInterval(show, 300);
}
getRes();
function showHide() {
if ($("#type").val() == "img") {
$("#pic").show();
$("#chn").hide();
} else {
$("#pic").hide();
$("#chn").show();
}
}
$("#type").change(function() {
showHide();
});
function snap() {
rpc("enc.snap");
}
function show() {
setTimeout(snap, 100);
if (chnId == -1)
return;
$("#snap").attr("src", "snap/snap" + chnId + ".jpg?rnd=" + Math.random());
}
function startPoint() {
$("#pointFrame").html("");
picking = true;
}
function stopPoint() {
picking = false;
var list = [];
$(".point").each(function() {
var map = {};
map.x = $(this).attr("x");
map.y = $(this).attr("y");
list.push(map);
});
colorKey.point = list;
save();
}
function updatePoint() {
rpc("enc.updateColorKey");
}
function showPoint() {
$("#pointFrame").html("");
var list = colorKey.point;
for (var i = 0; i < list.length; i++) {
var x = list[i].x;
var y = list[i].y;
var ix = x * $("#pointFrame").outerWidth();
var iy = y * $("#pointFrame").outerHeight();
var p = $('<div class="point"></div>').css("left", ix + "px").css("top", iy + "px").attr("x", x).attr("y", y);
$("#pointFrame").append(p);
}
}
function save() {
if (picking) {
stopPoint();
return;
}
rpc("enc.update", [JSON.stringify(config, null, 2)], function(data) {
if (typeof(data.error) != "undefined") {
htmlAlert("#alert", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000);
}
});
}
$("#pointFrame").click(function(e) {
if (!picking)
return;
var ix = e.pageX - $(this).offset().left;
var iy = e.pageY - $(this).offset().top;
var x = ix / $(this).outerWidth();
var y = iy / $(this).outerHeight();
//console.log(x, y);
var p = $('<div class="point"></div>').css("left", ix + "px").css("top", iy + "px").attr("x", x).attr("y", y);
$(this).append(p);
});
</script>
<?php
include("foot.php");
?>

View File

@ -4,12 +4,25 @@ html, body {
font-size: 13px; font-size: 13px;
background: #f0f0f4; background: #f0f0f4;
font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"SimSun"; font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"SimSun";
-ms-overflow-style: none;
scrollbar-width: none;
} }
body::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; /* Safari and Chrome */ width: 8px;
height: 8px;
} }
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #bbb;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: #888;
}
en,cn{ en,cn{
display: none; display: none;
} }
@ -732,3 +745,16 @@ color: #fb0;
margin-left: 15px; margin-left: 15px;
width: 60% !important; width: 60% !important;
} }
#colorKey #pointFrame{
position:absolute; top:0; width:100%; padding-bottom:56.25%;
}
#colorKey .point{
background-color: #ff0000;
width: 8px;
height: 8px;
margin-left: -4px;
margin-top: -4px;
position: absolute;
}

View File

@ -166,6 +166,10 @@ input[type="checkbox"]:checked {
border-color: var(--checkbox_active); border-color: var(--checkbox_active);
} }
input[type="checkbox"]:focus {
outline: none;
}
input[type="checkbox"]:checked:after { input[type="checkbox"]:checked:after {
content: ''; content: '';
display: block; display: block;

View File

@ -188,19 +188,12 @@ include("head.php");
{ {
var cnt = 0; var cnt = 0;
var config; var config;
$.getJSON( "config/board.json", function ( data ) { $.getJSON( "config/hardware.json", function ( data ) {
var ifaceV=data.interfaceV; var ifaceV=data.interfaceV;
var htmlStr=""; var htmlStr="";
for(var name in ifaceV){ for(var i=0;i<ifaceV.length;i++){
var pro=ifaceV[i].type;
var pro="HDMI"; var name=ifaceV[i].name;
if(ifaceV[name].protocols!=undefined)
pro=ifaceV[name].protocols[0];
if(name.endsWith("-L"))
name=name.substr(0,name.length-2);
if(name.endsWith("-R"))
continue;
if(pro=="HDMI") if(pro=="HDMI")
htmlStr+='<div class="hdmi disable"> <span class="info">- - -</span>\n' + htmlStr+='<div class="hdmi disable"> <span class="info">- - -</span>\n' +
@ -272,7 +265,7 @@ include("head.php");
$( "#preview" ).html( "" ); $( "#preview" ).html( "" );
var str = ""; var str = "";
for ( var i = 0; i < config.length; i++ ) { for ( var i = 0; i < config.length; i++ ) {
if ( !config[ i ].enable || config[ i ].type == "file" || ( config[ i ].type == "net" && !config[ i ].net.decodeV ) ) if ( !config[ i ].enable || ( config[ i ].type == "net" && !config[ i ].net.decodeV ) )
continue; continue;
str += '<div class="col-xs-6 col-sm-4 col-md-3">' + str += '<div class="col-xs-6 col-sm-4 col-md-3">' +
'<div class="thumbnail">' + '<div class="thumbnail">' +
@ -289,7 +282,7 @@ include("head.php");
var k = 0; var k = 0;
for ( var i = 0; i < config.length; i++ ) { for ( var i = 0; i < config.length; i++ ) {
if ( !config[ i ].enable || config[ i ].type == "file" || ( config[ i ].type == "net" && !config[ i ].net.decodeV ) ) if ( !config[ i ].enable || ( config[ i ].type == "net" && !config[ i ].net.decodeV ) )
continue; continue;
if ( config[ i ].enable ) if ( config[ i ].enable )

View File

@ -38,7 +38,7 @@ include( "groupList.php" );
</style> </style>
<div id="alert"></div> <div id="alert"></div>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12" id="setAllFrame">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="title"> <div class="title">
<h3 class="panel-title"> <h3 class="panel-title">
@ -85,7 +85,7 @@ include( "groupList.php" );
<select zcfg="width*x*height" class="form-control"> <select zcfg="width*x*height" class="form-control">
<option value="-1x-1">auto</option> <option value="-1x-1">auto</option>
<?php <?php
if($support4K) if($hardware["capability"]["encode"]["maxSize"]=="4K")
{ {
?> ?>
<option value="3840x2160">4K</option> <option value="3840x2160">4K</option>
@ -105,14 +105,7 @@ include( "groupList.php" );
<option value="h264,base">H.264 Baseline Profile</option> <option value="h264,base">H.264 Baseline Profile</option>
<option value="h264,main">H.264 Main Profile</option> <option value="h264,main">H.264 Main Profile</option>
<option value="h264,high">H.264 High Profile</option> <option value="h264,high">H.264 High Profile</option>
<?php <option value="h265,main">H.265 Main Profile</option>
if($chip!="3531A")
{
?>
<option value="h265,main">H.265 Main Profile</option>
<?php
}
?>
<option value="close,base" cn="关闭" en="close"></option> <option value="close,base" cn="关闭" en="close"></option>
</select> </select>
</div> </div>
@ -139,10 +132,6 @@ include( "groupList.php" );
</div> </div>
<div class="row" id="all_sub" style="margin-top: 5px;"> <div class="row" id="all_sub" style="margin-top: 5px;">
<?php
if($enableSub)
{
?>
<div class="col-md-2 col-sm-4 text-right" style="line-height: 34px;"> <div class="col-md-2 col-sm-4 text-right" style="line-height: 34px;">
<cn>辅流参数</cn> <cn>辅流参数</cn>
<en>Sub stream</en> <en>Sub stream</en>
@ -152,7 +141,7 @@ include( "groupList.php" );
<div class="col-sm-3"> <div class="col-sm-3">
<select zcfg="width*x*height" class="form-control"> <select zcfg="width*x*height" class="form-control">
<?php <?php
if($support4K) if($hardware["capability"]["encode"]["maxSize"]=="4K")
{ {
?> ?>
<option value="3840x2160">4K</option> <option value="3840x2160">4K</option>
@ -172,14 +161,7 @@ include( "groupList.php" );
<option value="h264,base">H.264 Baseline Profile</option> <option value="h264,base">H.264 Baseline Profile</option>
<option value="h264,main">H.264 Main Profile</option> <option value="h264,main">H.264 Main Profile</option>
<option value="h264,high">H.264 High Profile</option> <option value="h264,high">H.264 High Profile</option>
<?php <option value="h265,main">H.265 Main Profile</option>
if($chip!="3531A")
{
?>
<option value="h265,main">H.265 Main Profile</option>
<?php
}
?>
<option value="close,base" cn="关闭" en="close"></option> <option value="close,base" cn="关闭" en="close"></option>
</select> </select>
</div> </div>
@ -202,9 +184,6 @@ include( "groupList.php" );
<div class="col-md-1 col-sm-2"> <div class="col-md-1 col-sm-2">
<input zcfg="gop" type="text" class="form-control"> <input zcfg="gop" type="text" class="form-control">
</div> </div>
<?php
}
?>
</div> </div>
<hr style="margin-top:10px; margin-bottom: 10px;"/> <hr style="margin-top:10px; margin-bottom: 10px;"/>
<div class="row text-center"> <div class="row text-center">
@ -250,14 +229,6 @@ include( "groupList.php" );
<option value="pcma">PCMA</option> <option value="pcma">PCMA</option>
<option value="mp2">MPEG2</option> <option value="mp2">MPEG2</option>
<option value="mp3">MP3</option> <option value="mp3">MP3</option>
<?php
if($OPUS)
{
?>
<option value="opus">OPUS</option>
<?php
}
?>
<option value="close" cn="关闭" en="close"></option> <option value="close" cn="关闭" en="close"></option>
</select> </select>
</div> </div>
@ -385,7 +356,7 @@ include( "groupList.php" );
<select zcfg="[#].encv.width*x*[#].encv.height" class="form-control"> <select zcfg="[#].encv.width*x*[#].encv.height" class="form-control">
<option value="-1x-1">auto</option> <option value="-1x-1">auto</option>
<?php <?php
if($support4K) if($hardware["capability"]["encode"]["maxSize"]=="4K")
{ {
?> ?>
<option value="3840x2160">4K</option> <option value="3840x2160">4K</option>
@ -405,14 +376,7 @@ include( "groupList.php" );
<option value="h264,base">H.264 Baseline Profile</option> <option value="h264,base">H.264 Baseline Profile</option>
<option value="h264,main">H.264 Main Profile</option> <option value="h264,main">H.264 Main Profile</option>
<option value="h264,high">H.264 High Profile</option> <option value="h264,high">H.264 High Profile</option>
<?php
if($chip!="3531A")
{
?>
<option value="h265,main">H.265 Main Profile</option> <option value="h265,main">H.265 Main Profile</option>
<?php
}
?>
<option value="close,base" cn="关闭" en="close"></option> <option value="close,base" cn="关闭" en="close"></option>
</select> </select>
</div> </div>
@ -440,10 +404,6 @@ include( "groupList.php" );
<input zcfg="[#].enable" type="checkbox" class="switch form-control"> <input zcfg="[#].enable" type="checkbox" class="switch form-control">
</div> </div>
</div> </div>
<?php
if($enableSub)
{
?>
<div class="row" style="margin-top: 5px;"> <div class="row" style="margin-top: 5px;">
<div class="col-md-2 col-sm-4"> <div class="col-md-2 col-sm-4">
</div> </div>
@ -453,7 +413,7 @@ include( "groupList.php" );
<select zcfg="[#].encv2.width*x*[#].encv2.height" class="form-control"> <select zcfg="[#].encv2.width*x*[#].encv2.height" class="form-control">
<option value="-1x-1">auto</option> <option value="-1x-1">auto</option>
<?php <?php
if($support4K) if($hardware["capability"]["encode"]["maxSize"]=="4K")
{ {
?> ?>
<option value="3840x2160">4K</option> <option value="3840x2160">4K</option>
@ -473,14 +433,7 @@ include( "groupList.php" );
<option value="h264,base">H.264 Baseline Profile</option> <option value="h264,base">H.264 Baseline Profile</option>
<option value="h264,main">H.264 Main Profile</option> <option value="h264,main">H.264 Main Profile</option>
<option value="h264,high">H.264 High Profile</option> <option value="h264,high">H.264 High Profile</option>
<?php
if($chip!="3531A")
{
?>
<option value="h265,main">H.265 Main Profile</option> <option value="h265,main">H.265 Main Profile</option>
<?php
}
?>
<option value="close,base" cn="关闭" en="close"></option> <option value="close,base" cn="关闭" en="close"></option>
</select> </select>
</div> </div>
@ -508,9 +461,6 @@ include( "groupList.php" );
<input zcfg="[#].enable2" type="checkbox" class="switch form-control"> <input zcfg="[#].enable2" type="checkbox" class="switch form-control">
</div> </div>
</div> </div>
<?php
}
?>
<hr style="margin-top:10px; margin-bottom: 10px;"/> <hr style="margin-top:10px; margin-bottom: 10px;"/>
</div> </div>
</div> </div>
@ -564,15 +514,10 @@ include( "groupList.php" );
<div class="col-md-2 col-sm-4"> <div class="col-md-2 col-sm-4">
<select zcfg="[#].encv.gopmode" class="form-control"> <select zcfg="[#].encv.gopmode" class="form-control">
<option value="0">Normal</option> <option value="0">Normal</option>
<?php
if($chip!="3531A")
{
?>
<option value="1">SmartP</option> <option value="1">SmartP</option>
<option value="2">DualP</option> <option value="2">DualP</option>
<?php <?php
} if($hardware["capability"]["encode"]["BFrame"])
if(isset($BFrame) && $BFrame)
{ {
?> ?>
<option value="3">BiPredB</option> <option value="3">BiPredB</option>
@ -610,15 +555,10 @@ include( "groupList.php" );
<div class="col-md-2 col-sm-4"> <div class="col-md-2 col-sm-4">
<select zcfg="[#].encv2.gopmode" class="form-control"> <select zcfg="[#].encv2.gopmode" class="form-control">
<option value="0">Normal</option> <option value="0">Normal</option>
<?php
if($chip!="3531A")
{
?>
<option value="1">SmartP</option> <option value="1">SmartP</option>
<option value="2">DualP</option> <option value="2">DualP</option>
<?php <?php
} if($hardware["capability"]["encode"]["BFrame"])
if(isset($BFrame) && $BFrame)
{ {
?> ?>
<option value="3">BiPredB</option> <option value="3">BiPredB</option>
@ -842,14 +782,6 @@ include( "groupList.php" );
<option value="pcma">PCMA</option> <option value="pcma">PCMA</option>
<option value="mp2">MPEG2</option> <option value="mp2">MPEG2</option>
<option value="mp3">MP3</option> <option value="mp3">MP3</option>
<?php
if($OPUS)
{
?>
<option value="opus">OPUS</option>
<?php
}
?>
<option value="close" cn="关闭" en="close"></option> <option value="close" cn="关闭" en="close"></option>
</select> </select>
</div> </div>
@ -1017,7 +949,7 @@ include( "groupList.php" );
$( ".audioSrc" ).html(""); $( ".audioSrc" ).html("");
$( "#allAudio" ).find(".audioSrc").append('<option value="source">Default</option>') $( "#allAudio" ).find(".audioSrc").append('<option value="source">Default</option>')
<?php <?php
if($type!="ENC2P" && (!isset($line) || $line==true)) if($hardware["function"]["line"])
{ {
?> ?>
$(".audioSrc").append('<option value="line">Line</option>') $(".audioSrc").append('<option value="line">Line</option>')
@ -1031,7 +963,7 @@ include( "groupList.php" );
if(config[i].enca.audioSrc == "hdmi" || config[i].enca.audioSrc == "sdi") if(config[i].enca.audioSrc == "hdmi" || config[i].enca.audioSrc == "sdi")
config[i].enca.audioSrc = config[i].id; config[i].enca.audioSrc = config[i].id;
} }
if(config[i].type != "file" && config[i].type != "ndi"){ if(config[i].enca!=undefined){
$( ".audioSrc" ).append( '<option value="' + config[ i ].id + '">' + config[ i ].name + '</option>' ); $( ".audioSrc" ).append( '<option value="' + config[ i ].id + '">' + config[ i ].name + '</option>' );
} }
} }
@ -1044,9 +976,11 @@ include( "groupList.php" );
if(config[ i ].enable){ if(config[ i ].enable){
audio.push( config[ i ] ); audio.push( config[ i ] );
} }
} else if ( config[ i ].type != "file" && config[ i ].type != "ndi" ) { } else {
audio.push( config[ i ] ); if ( config[ i ].enca != undefined )
hdmi.push( config[ i ] ); audio.push( config[ i ] );
if ( config[ i ].encv != undefined )
hdmi.push( config[ i ] );
} }
if ( config[ i ].type == "vi" ) if ( config[ i ].type == "vi" )
video.push( config[ i ] ); video.push( config[ i ] );
@ -1116,7 +1050,7 @@ include( "groupList.php" );
$( "#setAll" ).click( function ( e ) { $( "#setAll" ).click( function ( e ) {
for ( var i = 0; i < config.length; i++ ) { for ( var i = 0; i < config.length; i++ ) {
if ( config[ i ].type == "file" || config[ i ].type == "ndi" ) if ( config[ i ].encv ==undefined || config[ i ].enca ==undefined )
continue; continue;
$.extend( config[ i ].encv, all ); $.extend( config[ i ].encv, all );
$.extend( config[ i ].encv2, all_sub ); $.extend( config[ i ].encv2, all_sub );
@ -1132,13 +1066,13 @@ include( "groupList.php" );
$( "#save" ).click(); $( "#save" ).click();
} ); } );
var maxENC = <?php echo isset($maxENC)?$maxENC:"-1"; ?>; var maxENC = <?php echo $hardware["capability"]["encode"]["maxPixel"]; ?>;
$( "#save" ).click( function ( e ) { $( "#save" ).click( function ( e ) {
var sum=0; var sum=0;
for ( var i = 0; i < config.length; i++ ) { for ( var i = 0; i < config.length; i++ ) {
if(config[i].enable && config[i].type!="file" && config[i].type!="ndi"){ if(config[i].enable && config[i].encv!=undefined){
if(config[i].encv.codec!="close") if(config[i].encv.codec!="close")
sum+=config[i].encv.width*config[i].encv.height*config[i].encv.framerate; sum+=config[i].encv.width*config[i].encv.height*config[i].encv.framerate;
if(config[i].enable2 && config[i].encv2.codec!="close"){ if(config[i].enable2 && config[i].encv2.codec!="close"){
@ -1162,22 +1096,6 @@ include( "groupList.php" );
} ); } );
} }
for(var i=0;i<config.length;i++) {
if(config[i].type != "mix")
continue;
var srcV = config[i].srcV;
var layouts = config[i].layout;
for(var j=0;j<srcV.length;j++) {
for(var k=0;k<config.length;k++) {
if(srcV[j] == config[k].id && config[k].type == "net" && config[k].hasOwnProperty("cap")) {
if(layouts.length >= j)
layouts[j].rotate = config[k].cap.rotate;
}
}
}
}
rpc( "enc.update", [ JSON.stringify( config, null, 2 ) ], function ( data ) { rpc( "enc.update", [ JSON.stringify( config, null, 2 ) ], function ( data ) {
if ( typeof ( data.error ) != "undefined" ) { if ( typeof ( data.error ) != "undefined" ) {
htmlAlert( "#alert", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000 ); htmlAlert( "#alert", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000 );
@ -1206,20 +1124,7 @@ include( "groupList.php" );
grpSetStatus( index, data ? 1 : 2 ); grpSetStatus( index, data ? 1 : 2 );
k--; k--;
if ( k == 0 ) { if ( k == 0 ) {
$.getJSON( "config/config.json", function ( result ) { init();
config = result;
for ( var i = 0; i < config.length; i++ ) {
if ( config[ i ].type == "net" ) {
net[ i ] = config[ i ];
} else if ( config[ i ].type != "file" && config[ i ].type != "ndi" ) {
hdmi[ i ] = config[ i ];
}
}
zcfg( "#templetHDMI", hdmi );
zcfg( "#templetADV", hdmi );
zcfg( "#templetNET", net );
zcfg( "#templetAudio", audio );
} );
} }
}, i ); }, i );
} }

View File

@ -46,6 +46,7 @@ include( "head.php" );
<button id="btnDel" onclick="onTrashDelete()" type="button" class="btn btn-warning"><i class="fa fa-trash" style="font-size: 16px"></i></button> <button id="btnDel" onclick="onTrashDelete()" type="button" class="btn btn-warning"><i class="fa fa-trash" style="font-size: 16px"></i></button>
<button id="btnDown" onclick="onDownload()" type="button" class="btn btn-warning" style="display: none"><i class="fa fa-download"></i></button> <button id="btnDown" onclick="onDownload()" type="button" class="btn btn-warning" style="display: none"><i class="fa fa-download"></i></button>
<button id="btnEraser" onclick="onEraser();" type="button" class="btn btn-warning"><i class="fa fa-eraser"></i></button> <button id="btnEraser" onclick="onEraser();" type="button" class="btn btn-warning"><i class="fa fa-eraser"></i></button>
<button id="btnUmount" onclick="onUmount();" type="button" class="btn btn-warning"><i class="fa fa-unlink"></i></button>
</div> </div>
</div> </div>
<div id="alert" style="position: absolute;z-index: 9;width: 100%"></div> <div id="alert" style="position: absolute;z-index: 9;width: 100%"></div>
@ -521,7 +522,6 @@ include( "head.php" );
} }
htmlAlert("#alert", "success", res.result, "", 300000); htmlAlert("#alert", "success", res.result, "", 300000);
func("formatDisk",{"format":$("#diskFormat").val()},function (res) { func("formatDisk",{"format":$("#diskFormat").val()},function (res) {
console.log(res)
if(res.result == "OK"){ if(res.result == "OK"){
htmlAlert("#alert", "success", '<cn>格式化完成,请重新加载页面</cn><en>When formatting is complete, reload the page</en>', "", 30000); htmlAlert("#alert", "success", '<cn>格式化完成,请重新加载页面</cn><en>When formatting is complete, reload the page</en>', "", 30000);
} }
@ -536,6 +536,34 @@ include( "head.php" );
} ); } );
} }
function onUmount() {
$.confirm( {
title: '<h4 style="font-weight: 600"><cn>卸载磁盘</cn><en>Unmount Disk</en></h4>',
content: "<cn>是否卸载磁盘,请确保没有处于录制状态</cn><en>Whether to unmount the disk, please make sure it is not in the recording state</en>",
buttons: {
ok: {
text: "<cn>卸载</cn><en>Unmount</en>",
btnClass: 'btn-warning',
keys: [ 'enter' ],
action: function () {
func("umountDisk",[],function (res) {
if(res.error != ""){
htmlAlert("#alert", "danger", res.error, "", 3000);
return;
}
setTimeout(function () {
location.reload();
},500);
})
}
},
cancel: {
text: "<cn>取消</cn><en>Cancel</en>"
}
}
} );
}
function onJumpPath(cur,index) { function onJumpPath(cur,index) {
last = cur; last = cur;
var pathList = cur.split("/"); var pathList = cur.split("/");
@ -710,10 +738,10 @@ include( "head.php" );
$(ele).addClass("fa-spin"); $(ele).addClass("fa-spin");
func("mountDisk",[],function (res) { func("mountDisk",[],function (res) {
if(res.error != ""){ if(res.error != ""){
if(res.error.indexOf("外部存储设备挂载失败") > 0) // if(res.error.indexOf("外部存储设备挂载失败") > 0)
onEraser(); // onEraser();
else // else
htmlAlert("#alert", "danger", res.error, "", 3000); htmlAlert("#alert", "danger", res.error, "", 3000);
setTimeout(function () { setTimeout(function () {
$(ele).removeClass("fa-spin"); $(ele).removeClass("fa-spin");
},1000); },1000);
@ -975,6 +1003,10 @@ include( "head.php" );
} else { } else {
name = list[0]; name = list[0];
param.name = name+"."+list[1]; param.name = name+"."+list[1];
if(param.name.length > 17) {
param.name = name.substring(0,13);
param.name = param.name+"..."+list[1];
}
param.real = name+"*."+list[1]; param.real = name+"*."+list[1];
param.type = "vdo"; param.type = "vdo";
if(list[1] == "mp4") if(list[1] == "mp4")

View File

@ -1,46 +1,18 @@
<?php <?php
include( "head.php" ); include("hardware.php");
include("head.php");
?> ?>
<style> <style>
.touch { .wc-new-theme {
width: 50px; font-size: 14px;
height: 20px; color: var(--btn_background);
background-color: #fb0; cursor: pointer;
color: white; }
text-align: center;
font-size: 12px; .wc-new-theme:hover {
line-height: 30px; color: var(--btn_hover_background);
} cursor: pointer;
.drag { }
position: absolute;
width: 100%;
height: 100%;
background: #fb0;
top:0;
opacity: 0;
}
.resize {
display: block;
position: absolute;
width: 0px;
height: 0px;
border-right: 0px solid red;
border-bottom: 0px solid red;
right: 0px;
bottom: 0px;
overflow: hidden;
cursor: nw-resize;
z-index: 9;
}
.wc-new-theme {
font-size: 14px;
color: var(--btn_background);
cursor: pointer;
}
.wc-new-theme:hover {
color: var(--btn_hover_background);
cursor: pointer;
}
</style> </style>
<div id="alert"></div> <div id="alert"></div>
<div class="row"> <div class="row">
@ -48,7 +20,7 @@ include( "head.php" );
<div class="panel panel-default"> <div class="panel panel-default">
<div class="title"> <div class="title">
<h3 class="panel-title"> <h3 class="panel-title">
<cn>机型切换</cn> <cn>机型切换</cn>
<en>Model switch</en> <en>Model switch</en>
</h3> </h3>
</div> </div>
@ -56,57 +28,21 @@ include( "head.php" );
<form class="form-horizontal" id="type" role="form"> <form class="form-horizontal" id="type" role="form">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"> <label class="col-sm-3 control-label">
<cn>机型</cn> <cn>机型</cn>
<en>Model</en> <en>Model</en>
</label> </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select name="type" id="typeVal" class="form-control"> <select name="type" id="typeVal" class="form-control">
<?php <?php
if($chip=="3531D") $dirArr = scandir("/link/fac/");
{ foreach ($dirArr as $v) {
?> if($v=="." || $v=="..")
<option value="enc2">ENC2</option> continue;
<option value="enc5">ENC5</option> if($hardware["fac"]==$v)
<option value="enc9">ENC9</option> echo '<option value="' . $v . '" selected>' . $v . '</option>';
<option value="enc9_mate">ENC9_MATE</option> else
<option value="enc18">ENC18(ENC9+LED)</option> echo '<option value="' . $v . '">' . $v . '</option>';
<option value="sdi">C3531D</option> }
<option value="dsh">DSH</option>
<option value="lite_audio">Lite_Audio</option>
<?php
}
else if($chip=="3520D")
{
?>
<option value="DEF">DEF(3520D)</option>
<option value="EX2">EX2(ENC1)</option>
<option value="SH">SH(ENCSH)</option>
<option value="V2">V2(ENC1V2)</option>
<?php
}
else if($chip=="SS524")
{
?>
<option value="enc4s">ENC4S</option>
<option value="encsh">ENCSHV2</option>
<option value="enc1v3">ENC1V3</option>
<?php
}
else if($chip=="3519A")
{
?>
<option value="ENC1P">ENC1P</option>
<option value="C3519A">C3519A</option>
<?php
}
else if($chip=="3531DV200")
{
?>
<option value="C3531DV200">C3531DV200</option>
<option value="ENC2">ENC2</option>
<option value="ENC4">ENC4</option>
<?php
}
?> ?>
</select> </select>
</div> </div>
@ -115,7 +51,7 @@ include( "head.php" );
<div class="col-sm-6 col-sm-offset-3"> <div class="col-sm-6 col-sm-offset-3">
<button type="button" id="changeType" class=" save btn btn-warning"> <button type="button" id="changeType" class=" save btn btn-warning">
<cn>切换</cn> <cn>切换</cn>
<en>Save</en> <en>Save</en>
</button> </button>
</div> </div>
</div> </div>
@ -129,72 +65,41 @@ include( "head.php" );
<div class="panel panel-default"> <div class="panel panel-default">
<div class="title"> <div class="title">
<h3 class="panel-title"> <h3 class="panel-title">
<cn>功能开关</cn> <cn>功能开关</cn>
<en>Function Switch</en> <en>Function Switch</en>
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<form class="form-horizontal" id="funcs" role="form"> <form class="form-horizontal" id="funcs" role="form">
<div class="form-group"> <div class="form-group text-center" style="padding: 0px 20px;">
<label class="col-sm-3 control-label"> <?php
DHCP $func=$hardware["function"];
</label> foreach($func as $key => $value)
<div class="col-sm-6"> {
<select name="DHCP" class="form-control"> echo '
<option value="false" <?php if(isset($DHCP) && $DHCP==false) echo "selected"; ?> cn="隐藏" en="hide" ></option> <div class="col-md-4" style="margin-top: 15px;font-size: 14px;padding: 0;">
<option value="true" <?php if($DHCP) echo "selected"; ?> cn="显示" en="show" ></option> <div class="row">
</select> <div class="col-md-12">
</div> '.$key.'
</div> </div>
<div class="form-group"> </div>
<label class="col-sm-3 control-label"> <hr style="margin-top:5px; margin-bottom: 5px;"/>
OPUS <div class="row">
</label> <div class="col-md-12">
<div class="col-sm-6"> <input name="'.$key.'" type="checkbox" '.($value?"checked":"").' class="switch form-control">
<select name="OPUS" class="form-control"> </div>
<option value="false" <?php if(isset($OPUS) && $OPUS==false) echo "selected"; ?> cn="隐藏" en="hide" ></option> </div>
<option value="true" <?php if($OPUS) echo "selected"; ?> cn="显示" en="show" ></option> </div>
</select> ';
</div> }
</div> ?>
<div class="form-group">
<label class="col-sm-3 control-label">
NDI
</label>
<div class="col-sm-6">
<select name="NDI" class="form-control">
<option value="false" <?php if(isset($NDI) && $NDI==false) echo "selected"; ?> cn="隐藏" en="hide" ></option>
<option value="true" <?php if($NDI) echo "selected"; ?> cn="显示" en="show" ></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">
<cn>默认语言</cn><en>Default Language</en>
</label>
<div class="col-sm-6">
<select name="defLang" class="form-control">
<option value="cn" <?php if(isset($defLang) && $defLang=="cn") echo "selected"; ?> >中文</option>
<option value="en" <?php if(isset($defLang) && $defLang=="en") echo "selected"; ?> >English</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">
NO SIGNAL
</label>
<div class="col-sm-6">
<select name="netPic" class="form-control" zcfg="no_signal">
<option cn="网络流中开启 (重启生效)" en="open in net stream (need restart)" style="white-space:pre-wrap" value="true"></option>
<option cn="网络流中关闭 (重启生效)" en="close in net stream (need restart)" style="white-space:pre-wrap" value="false"></option>
</select>
</div>
</div> </div>
<hr style="margin-top:15px; margin-bottom: 10px;"/>
<div class="form-group"> <div class="form-group">
<div class="col-sm-6 col-sm-offset-3"> <div class="col-sm-12 text-center">
<button type="button" id="showFunc" class=" save btn btn-warning"> <button type="button" id="showFunc" class=" save btn btn-warning">
<cn>设定</cn> <cn>设定</cn>
<en>Save</en> <en>Save</en>
</button> </button>
</div> </div>
</div> </div>
@ -225,7 +130,7 @@ include( "head.php" );
<div class="col-sm-6 col-sm-offset-3"> <div class="col-sm-6 col-sm-offset-3">
<button type="button" id="setMAC" class=" save btn btn-warning"> <button type="button" id="setMAC" class=" save btn btn-warning">
<cn>设定</cn> <cn>设定</cn>
<en>Save</en> <en>Save</en>
</button> </button>
</div> </div>
</div> </div>
@ -261,7 +166,7 @@ include( "head.php" );
<div class="col-sm-6 col-sm-offset-3"> <div class="col-sm-6 col-sm-offset-3">
<button type="button" id="setEDID" class=" save btn btn-warning"> <button type="button" id="setEDID" class=" save btn btn-warning">
<cn>设定</cn> <cn>设定</cn>
<en>Save</en> <en>Save</en>
</button> </button>
</div> </div>
</div> </div>
@ -302,247 +207,196 @@ include( "head.php" );
</div> </div>
</div> </div>
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="title"> <div class="title">
<h3 class="panel-title"> <h3 class="panel-title">
LPH LPH
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<form class="form-horizontal" id="lphAuth" role="form"> <form class="form-horizontal" id="lphAuth" role="form">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"> <label class="col-sm-3 control-label">
<cn>认证模式</cn><en>Auth</en> <cn>认证模式</cn>
</label> <en>Auth</en>
<div class="col-sm-6"> </label>
<select name="lphAuth" id="authVal" class="form-control"> <div class="col-sm-6">
<option value="0" cn="Digest认证+登录验证" en="Digest+Login"></option> <select name="lphAuth" id="authVal" class="form-control">
<option value="1" cn="仅Digest认证" en="Digest"></option> <option value="0" cn="Digest认证+登录验证" en="Digest+Login"></option>
<option value="2" cn="仅登录验证" en="Login"></option> <option value="1" cn="仅Digest认证" en="Digest"></option>
<option value="3" cn="不验证" en="None"></option> <option value="2" cn="仅登录验证" en="Login"></option>
</select> <option value="3" cn="不验证" en="None"></option>
</div> </select>
</div> </div>
<div class="form-group"> </div>
<div class="col-sm-6 col-sm-offset-3"> <div class="form-group">
<button type="button" id="setLph" class=" save btn btn-warning"> <div class="col-sm-6 col-sm-offset-3">
<cn>设定</cn> <button type="button" id="setLph" class=" save btn btn-warning">
<en>Save</en> <cn>设定</cn>
</button> <en>Save</en>
</div> </button>
</div> </div>
</form> </div>
</div> </form>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="title">
<div class="row">
<div class="col-md-10 col-sm-10">
<h3 class="panel-title">
<cn>主题</cn>
<en>Theme</en>
</h3>
</div>
<div class="col-md-2 col-sm-2">
<div class="row">
<div class="col-md-2 col-sm-2"></div>
<div class="col-md-10 col-sm-10">
<h3 class="panel-title">
<i class="fa fa-edit wc-new-theme" data-toggle="modal" data-target=".bs-modal-lg">
<cn>编辑</cn>
<en>Edit</en>
</i>
</h3>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="panel-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-3 control-label">
<cn>主题选择</cn>
<en>Theme</en>
</label>
<div class="col-sm-6">
<select name="theme" id="theme" class="form-control"></select>
</div>
</div>
<div class="form-group">
<div class="col-sm-6 col-sm-offset-3">
<button type="button" id="setTheme" class=" save btn btn-warning">
<cn>设定</cn>
<en>Save</en>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="vendor/switch/bootstrap-switch.js"></script>
<script src="./js/handlebars-v4.7.6.js"></script>
<script src="js/zcfg.js"></script>
<div class="row"> <?php
<div class="col-md-6 col-md-offset-3"> include("themes.php");
<div class="panel panel-default"> ?>
<div class="title"> <script>
<h3 class="panel-title"> $(function() {
OLED navIndex(5);
</h3> $.fn.bootstrapSwitch.defaults.size = 'small';
</div> $.fn.bootstrapSwitch.defaults.onColor = 'warning';
<div class="panel-body"> $( ".switch" ).bootstrapSwitch();
<form class="form-horizontal" role="form"> $.ajax({
<div class="form-group"> url: "config/mac",
<div class="row" style="margin-top: 15px"> success: function(data) {
<label class="col-sm-3 control-label"> var mac = data.replace(/[\r\n]/g, "").toUpperCase();
<cn>设计</cn> var macStr = "";
<en>Design</en> for (var i = 0; i < mac.length; i += 2) {
</label> macStr += mac.substr(i, 2);
<div class="col-sm-3"> if (i + 2 < mac.length)
<div id="box" style="width: 256px;height: 128px;background-color: #eeeeee;outline: 1px solid #cccccc"></div> macStr += ":";
</div> }
<div class="col-sm-3"></div> $("#mac").val(macStr);
</div> }
<div class="row" style="margin-top: 15px"> });
<label class="col-sm-3 control-label">
<cn>模块</cn>
<en>Mods</en>
</label>
<div id="mods" class="col-sm-6" style="border: 1px solid #eee">
<div class="row" id="modBox"></div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-6 col-sm-offset-3">
<button type="button" id="setOLED" class=" save btn btn-warning">
<cn>设定</cn>
<en>Save</en>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="title">
<div class="row">
<div class="col-md-10 col-sm-10">
<h3 class="panel-title">
<cn>主题</cn>
<en>Theme</en>
</h3>
</div>
<div class="col-md-2 col-sm-2">
<div class="row">
<div class="col-md-2 col-sm-2"></div>
<div class="col-md-10 col-sm-10">
<h3 class="panel-title">
<i class="fa fa-edit wc-new-theme" data-toggle="modal" data-target=".bs-modal-lg">
<cn>编辑</cn>
<en>Edit</en>
</i>
</h3>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="panel-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-3 control-label">
<cn>主题选择</cn>
<en>Theme</en>
</label>
<div class="col-sm-6">
<select name="theme" id="theme" class="form-control"></select>
</div>
</div>
<div class="form-group">
<div class="col-sm-6 col-sm-offset-3">
<button type="button" id="setTheme" class=" save btn btn-warning">
<cn>设定</cn>
<en>Save</en>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="./js/handlebars-v4.7.6.js"></script> $.ajax({
<script src="js/zcfg.js"></script> url: "config/curEDID",
success: function(data) {
$("#edidVal").val(data.replace(/[\r\n]/g, ""));
<?php }
include( "oled.php" ); });
include("themes.php");
?>
<script>
$( function () { func("getLphAuth", [], function(res) {
navIndex( 5 ); console.log(res)
$.ajax({url:"config/fac",success:function(data){ $("#authVal").val(res.result);
$( "#typeVal" ).val(data.replace(/[\r\n]/g,"")); });
}});
$.ajax( {url: "config/mac", success: function ( data ) { $("#changeType").click(function() {
var mac=data.replace( /[\r\n]/g, "" ).toUpperCase(); func("changeType", $("#type").serialize(), function(res) {
var macStr=""; if (res.error != "")
for(var i=0;i<mac.length;i+=2){ htmlAlert("#alert", "danger", res.error, "", 2000);
macStr+=mac.substr(i,2); else
if(i+2<mac.length) htmlAlert("#alert", "success", "机型切换成功!重启生效", "", 2000);
macStr+=":"; });
}
$( "#mac" ).val(macStr);
}
} );
$.ajax({url:"config/curEDID",success:function(data){ });
$( "#edidVal" ).val(data.replace(/[\r\n]/g,""));
}}); $("#showFunc").click(function() {
func("showFunc", $("#funcs").serialize(), function(res) {
console.log(res)
if (res.error != "")
htmlAlert("#alert", "danger", res.error, "", 2000);
else
htmlAlert("#alert", "success", "修改成功", "", 2000);
});
$.ajax({url:"config/auto/netPic.json", });
success:function(data){
zcfg("#funcs",data);
},
error:function () {
zcfg("#funcs",{"no_signal":"true"});
}
});
func("getLphAuth",[], function ( res ) { $("#setEDID").click(function() {
console.log(res) func("setEDID", $("#edid").serialize(), function(res) {
$("#authVal").val(res.result); if (res.error != "")
} ); htmlAlert("#alert", "danger", res.error, "", 2000);
else
htmlAlert("#alert", "success", "修改成功", "", 2000);
});
$( "#changeType" ).click( function () { });
func("changeType",$( "#type" ).serialize(), function ( res ) {
if ( res.error != "" )
htmlAlert( "#alert", "danger", res.error, "", 2000 );
else
htmlAlert( "#alert", "success", "机型切换成功!重启生效", "", 2000 );
} );
} ); $("#setColor").click(function() {
func("setColor", $("#color").serialize(), function(res) {
if (res.error != "")
htmlAlert("#alert", "danger", res.error, "", 2000);
else
htmlAlert("#alert", "success", "修改成功", "", 2000);
});
$( "#showFunc" ).click( function () { });
func("showFunc",$( "#funcs" ).serialize(), function ( res ) {
console.log(res)
if ( res.error != "" )
htmlAlert( "#alert", "danger", res.error, "", 2000 );
else
htmlAlert( "#alert", "success", "修改成功", "", 2000 );
} );
} ); $("#setLph").click(function() {
func("setLphAuth", $("#lphAuth").serialize(), function(res) {
if (res.error != "")
htmlAlert("#alert", "danger", res.error, "", 2000);
else
htmlAlert("#alert", "success", "修改成功", "", 2000);
});
});
$( "#setEDID" ).click( function () { $("#setMAC").click(function() {
func("setEDID",$( "#edid" ).serialize(), function ( res ) { var mac = $("#mac").val().replace(/[:]/g, "");
if ( res.error != "" ) mac = mac.toLowerCase();
htmlAlert( "#alert", "danger", res.error, "", 2000 ); func("setMac", "mac=" + mac, function(res) {
else if (res.error != "")
htmlAlert( "#alert", "success", "修改成功", "", 2000 ); htmlAlert("#alert", "danger", res.error, "", 2000);
} ); else
htmlAlert("#alert", "success", "修改成功", "", 2000);
});
} ); });
});
$( "#setColor" ).click( function () { </script>
func("setColor",$( "#color" ).serialize(), function ( res ) { <?php
if ( res.error != "" ) include("foot.php");
htmlAlert( "#alert", "danger", res.error, "", 2000 ); ?>
else
htmlAlert( "#alert", "success", "修改成功", "", 2000 );
} );
} );
$( "#setLph" ).click( function () {
func("setLphAuth",$( "#lphAuth" ).serialize(), function ( res ) {
if ( res.error != "" )
htmlAlert( "#alert", "danger", res.error, "", 2000 );
else
htmlAlert( "#alert", "success", "修改成功", "", 2000 );
} );
} );
$( "#setMAC" ).click( function () {
var mac=$("#mac").val().replace( /[:]/g, "" );
mac=mac.toLowerCase();
func("setMac","mac="+mac, function ( res ) {
if ( res.error != "" )
htmlAlert( "#alert", "danger", res.error, "", 2000 );
else
htmlAlert( "#alert", "success", "修改成功", "", 2000 );
} );
} );
} );
</script>
<?php
include( "foot.php" );
?>

View File

@ -1,9 +1,11 @@
<?php <?php
include( "config.php" ); include( "hardware.php" );
include( "session.php" ); include( "session.php" );
date_default_timezone_set('PRC'); date_default_timezone_set('PRC');
ini_set( 'default_socket_timeout', 2 ); ini_set( 'default_socket_timeout', 2 );
$result = ( object )array( 'error' => '' ); $result = ( object )array( 'error' => '' );
$server = "help.linkpi.cn:5735";
$rootPath = "/root/usb";
if ( isset( $_GET[ 'func' ] ) ) if ( isset( $_GET[ 'func' ] ) )
call_user_func( $_GET[ 'func' ] ); call_user_func( $_GET[ 'func' ] );
@ -129,13 +131,13 @@ function setCron() {
function startHelp() { function startHelp() {
global $result; global $result;
global $help; global $hardware;
$result->result = "OK"; $result->result = "OK";
$authCode=$_POST[ 'authCode' ]; $authCode=$_POST[ 'authCode' ];
$sshPort=2000+intval($authCode); $sshPort=2000+intval($authCode);
$rtspPort=5000+intval($authCode); $rtspPort=5000+intval($authCode);
exec("pkill ngrokc" ); exec("pkill ngrokc" );
exec("/usr/bin/ngrokc -SER[Shost:".$help.",Sport:4443] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:".$authCode."] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:22,Rport:".$sshPort."] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:554,Rport:".$rtspPort."] > /tmp/ngrok &" ); exec("/usr/bin/ngrokc -SER[Shost:".$hardware["other"]["help"].",Sport:4443] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:".$authCode."] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:22,Rport:".$sshPort."] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:554,Rport:".$rtspPort."] > /tmp/ngrok &" );
} }
function stopHelp() { function stopHelp() {
@ -283,32 +285,18 @@ function setFrp() {
function showFunc() { function showFunc() {
global $result; global $result;
$str = file_get_contents( '/link/web/config.php' ); global $hardware;
$lines = explode("\n",$str);
$result->result = ""; foreach($hardware["function"] as $key => $val)
foreach($_POST as $key => $val)
{ {
if($key == "netPic") if($_POST[$key]=="on")
continue; $hardware["function"][$key]=true;
for($i=0;$i<count($lines);$i++){ else
if(strpos($lines[$i], $key) > 0) $hardware["function"][$key]=false;
{
if(is_string($val) && $val!="true" && $val!="false")
$lines[$i]="$".$key."=\"".$val."\";";
else
$lines[$i]="$".$key."=".$val.";";
break;
}
}
} }
file_put_contents( '/link/web/config.php', join("\n",$lines)); $json_string = json_encode( $hardware);
file_put_contents ( '/link/config/hardware.json' , $json_string );
$netPic = array( $result->result = "OK";
no_signal=>$_POST["netPic"]
);
file_put_contents( '/link/config/auto/netPic.json',json_encode($netPic));
} }
function hadFiles() { function hadFiles() {
@ -344,6 +332,18 @@ function formatReady() {
$result->result = "<cn>正在格式化,请勿关闭此页面</cn><en>Do not close this page while formatting</en>"; $result->result = "<cn>正在格式化,请勿关闭此页面</cn><en>Do not close this page while formatting</en>";
} }
function umountDisk() {
global $result;
exec("umount -l /root/usb");
exec("sync");
$output="";
exec("df -h | grep /root/usb | wc -l",$output);
if($output[0] == "0")
$result->result = "OK";
else
$result->error = "<cn>卸载失败,请确保设备没有被占用</cn><en>Unmount failed, please make sure the device is not in use</en>";
}
function formatDisk() { function formatDisk() {
global $result; global $result;
exec("/link/shell/fusb.sh ".$_POST["format"]); exec("/link/shell/fusb.sh ".$_POST["format"]);
@ -354,15 +354,15 @@ function mountDisk() {
global $result; global $result;
$output=array(); $output=array();
exec( "ls /dev/sda",$output); exec( "ls /dev/sda",$output);
//file_put_contents("/link/log.log",count($output).PHP_EOL,FILE_APPEND);
if(count($output) == 0) if(count($output) == 0)
{ {
$result->error = "<cn>没有检测到外部存储设备</cn><en>No external storage device is detected</en>"; $result->error = "<cn>没有检测到外部存储设备</cn><en>No external storage device is detected</en>";
return; return;
} }
unset($output); unset($output);
exec("mount -t vfat /dev/sda1 /root/usb"); exec("mount -t vfat -o rw,relatime,codepage=936,utf8 /dev/sda1 /root/usb");
exec("mount -t ext4 /dev/sda1 /root/usb"); exec("mount -t ext4 /dev/sda1 /root/usb");
exec("ntfs-3g /dev/sda1 /root/usb");
exec("df -h | grep /root/usb",$output); exec("df -h | grep /root/usb",$output);
if(count($output) == 1) if(count($output) == 1)
$result->result = "OK"; $result->result = "OK";
@ -399,7 +399,7 @@ function checkHelpNet() {
} }
function checkUpdate() { function checkUpdate() {
global $result; global $result,$server;
$fac = file_get_contents("/link/config/fac"); $fac = file_get_contents("/link/config/fac");
$fac = str_replace("\n","",$fac); $fac = str_replace("\n","",$fac);
@ -410,7 +410,7 @@ function checkUpdate() {
$version = json_decode(file_get_contents("/link/config/version.json"),true); $version = json_decode(file_get_contents("/link/config/version.json"),true);
$sys_ary = explode(" ",$version["sys"]); $sys_ary = explode(" ",$version["sys"]);
$args = array("type"=>$fac,"build"=>$sys_ary[0],"sys_ver"=>$sys_ary[2]); $args = array("type"=>$fac,"build"=>$sys_ary[0],"sys_ver"=>$sys_ary[2]);
$ret = send("http://help.linkpi.cn:5735/api/patch/query_master",json_encode($args)); $ret = send("http://".$server."/api/patch/query_master",json_encode($args));
if($ret["status"] == "error") if($ret["status"] == "error")
$result->error = $ret["msg"]; $result->error = $ret["msg"];
else else
@ -419,7 +419,7 @@ function checkUpdate() {
function getPatch() { function getPatch() {
global $result; global $result,$server;
$fac = file_get_contents("/link/config/fac"); $fac = file_get_contents("/link/config/fac");
$fac = str_replace("\n","",$fac); $fac = str_replace("\n","",$fac);
if(is_null($fac) || $fac == "") { if(is_null($fac) || $fac == "") {
@ -429,7 +429,7 @@ function getPatch() {
$version = json_decode(file_get_contents("/link/config/version.json"),true); $version = json_decode(file_get_contents("/link/config/version.json"),true);
$sys_ary = explode(" ",$version["sys"]); $sys_ary = explode(" ",$version["sys"]);
$args = array("type"=>$fac,"build"=>$sys_ary[0],"sys_ver"=>$sys_ary[2]); $args = array("type"=>$fac,"build"=>$sys_ary[0],"sys_ver"=>$sys_ary[2]);
$ret = send("http://help.linkpi.cn:5735/api/patch/query_patch",json_encode($args)); $ret = send("http://".$server."/api/patch/query_patch",json_encode($args));
if($ret["status"] == "error") if($ret["status"] == "error")
$result->error = $ret["msg"]; $result->error = $ret["msg"];
else else
@ -437,7 +437,7 @@ function getPatch() {
} }
function getPatchBySn() { function getPatchBySn() {
global $result; global $result,$server;
$fac = file_get_contents("/link/config/fac"); $fac = file_get_contents("/link/config/fac");
$fac = str_replace("\n","",$fac); $fac = str_replace("\n","",$fac);
if(is_null($fac) || $fac == "") { if(is_null($fac) || $fac == "") {
@ -445,7 +445,7 @@ function getPatchBySn() {
return; return;
} }
$args = array("type"=>$fac,"sn"=>$_POST["sn"]); $args = array("type"=>$fac,"sn"=>$_POST["sn"]);
$ret = send("http://help.linkpi.cn:5735/api/patch/query_sn_patch",json_encode($args)); $ret = send("http://".$server."/api/patch/query_sn_patch",json_encode($args));
if($ret["status"] == "error") if($ret["status"] == "error")
$result->error = $ret["msg"]; $result->error = $ret["msg"];
else else
@ -453,7 +453,7 @@ function getPatchBySn() {
} }
function getAliase() { function getAliase() {
global $result; global $result,$server;
$fac = file_get_contents("/link/config/fac"); $fac = file_get_contents("/link/config/fac");
$fac = str_replace("\n","",$fac); $fac = str_replace("\n","",$fac);
if(is_null($fac) || $fac == "") { if(is_null($fac) || $fac == "") {
@ -461,7 +461,7 @@ function getAliase() {
return; return;
} }
$args = array("fac"=>$fac); $args = array("fac"=>$fac);
$ret = send("http://help.linkpi.cn:5735/api/aliase/query_aliase",json_encode($args)); $ret = send("http://".$server."/api/aliase/query_aliase",json_encode($args));
if($ret["status"] == "error") if($ret["status"] == "error")
$result->error = $ret["msg"]; $result->error = $ret["msg"];
else else

View File

@ -0,0 +1,5 @@
<?php
$json_string = file_get_contents('/link/config/hardware.json');
$hardware = json_decode($json_string, true);
$chip = $hardware["chip"];
?>

View File

@ -1,110 +1,184 @@
<?php <?php
include( "config.php" ); include("hardware.php");
include( "session.php" ); include("session.php");
include( "headhead.php" ); include("headhead.php");
?> ?>
<nav class="navbar navbar-default"> <nav class="navbar navbar-default">
<div class="container" > <div class="container">
<!-- Brand and toggle get grouped for better mobile display --> <!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#defaultNavbar1"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#defaultNavbar1"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
<a class="navbar-brand" href="dashboard.php"> <img src="img/logo.png" style="width: 97px; height: 40px;" class="visible-xs-block visible-sm-block" /> <img src="img/logo.png" class="visible-md-block visible-lg-block" /> </a> </div> <a class="navbar-brand" href="dashboard.php"> <img src="img/logo.png" style="width: 97px; height: 40px;" class="visible-xs-block visible-sm-block" /> <img src="img/logo.png" class="visible-md-block visible-lg-block" /> </a>
</div>
<!-- Collect the nav links, forms, and other content for toggling --> <!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="defaultNavbar1"> <div class="collapse navbar-collapse" id="defaultNavbar1">
<ul class="nav navbar-nav navc"> <ul class="nav navbar-nav navc">
<li><a href="dashboard.php"><i class="fa fa-tachometer menuIcon"></i><cn>运行状态</cn><en>Dashboard</en></a></li> <li><a href="dashboard.php"><i class="fa fa-tachometer menuIcon"></i>
<li><a href="encode.php"><i class="fa fa-image menuIcon"></i><cn>编码设置</cn><en>Encode</en></a></li> <cn>运行状态</cn>
<li><a href="stream.php"><i class="fa fa-upload menuIcon"></i><cn>输出设置</cn><en>Stream</en></a></li> <en>Dashboard</en>
<?php </a></li>
if(!isset($overlay) || $overlay) <li><a href="encode.php"><i class="fa fa-image menuIcon"></i>
{ <cn>编码设置</cn>
?> <en>Encode</en>
<li><a href="overlay.php"><i class="fa fa-magic menuIcon"></i><cn>叠加特效</cn><en>Overlay</en></a></li> </a></li>
<?php <li><a href="stream.php"><i class="fa fa-upload menuIcon"></i>
} <cn>输出设置</cn>
?> <en>Stream</en>
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-puzzle-piece menuIcon"></i><cn>扩展功能</cn><en>Extend</en><span class="caret"></span> </a> </a></li>
<?php
if ($hardware["function"]["overlay"]) {
?>
<li><a href="overlay.php"><i class="fa fa-magic menuIcon"></i>
<cn>叠加特效</cn>
<en>Overlay</en>
</a></li>
<?php
}
?>
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-puzzle-piece menuIcon"></i>
<cn>扩展功能</cn>
<en>Extend</en><span class="caret"></span>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<?php <?php
if(!isset($MIX) || $MIX) if ($hardware["function"]["mix"]) {
{ ?>
?> <li><a href="mix.php"><i class="fa fa-th"></i>
<li><a href="mix.php"><i class="fa fa-th"></i><cn>视频混合</cn><en>Video mix</en></a></li> <cn>视频混合</cn>
<?php <en>Video mix</en>
} </a></li>
?> <?php
<?php }
if((!isset($NDI) || $NDI) && (!isset($HDMI_Out) || $HDMI_Out)) ?>
{ <?php
?> if ($hardware["function"]["ndi"] && $hardware["function"]["videoOut"]) {
<li><a href="ndi.php"><i class="fa fa-television"></i>NDI <cn>解码</cn><en>decode</en></a></li> ?>
<?php <li><a href="ndi.php"><i class="fa fa-television"></i>NDI <cn>解码</cn>
} <en>decode</en>
if($carousel) </a></li>
{ <?php
?> }
<li><a href="carousel.php"><i class="fa fa-youtube-play"></i><cn>视频轮播</cn><en>Video carousel</en></a></li> if ($hardware["function"]["carousel"]) {
<?php ?>
} <li><a href="carousel.php"><i class="fa fa-youtube-play"></i>
if($record) <cn>视频轮播</cn>
{ <en>Video carousel</en>
?> </a></li>
<li><a href="record.php"><i class="fa fa-folder-open"></i><cn>文件录制</cn><en>Record</en></a></li> <?php
<?php }
} if ($hardware["function"]["record"]) {
?> ?>
<li><a href="push.php"><i class="fa fa-arrow-circle-up"></i><cn>多平台直播</cn><en>Multiple Push</en></a></li> <li><a href="record.php"><i class="fa fa-folder-open"></i>
<li><a href="player.php"><i class="fa fa-play-circle-o"></i><cn>H5 播放器</cn><en>H5 Player</en></a></li> <cn>文件录制</cn>
<li><a href="intercom.php"><i class="fa fa-headphones"></i><cn>集成通信</cn><en>Intercom</en></a></li> <en>Record</en>
<li><a href="explorer.php"><i class="fa fa-folder-open-o"></i><cn>U盘助手</cn><en>Usb Disk</en></a></li> </a></li>
<?php <?php
if(!isset($button) || $button) }
{ ?>
?> <li><a href="push.php"><i class="fa fa-arrow-circle-up"></i>
<li><a href="uart.php"><i class="fa fa-link"></i><cn>串口、按键</cn><en>Serial, Button</en></a></li> <cn>多平台直播</cn>
<?php <en>Multiple Push</en>
} </a></li>
?> <li><a href="player.php"><i class="fa fa-play-circle-o"></i>
<?php <cn>H5 播放器</cn>
if(isset($remote) && $remote) <en>H5 Player</en>
{ </a></li>
?> <li><a href="intercom.php"><i class="fa fa-headphones"></i>
<li><a href="remote.php"><i class="fa fa-fire"></i><cn>红外遥控</cn><en>Remote</en></a></li> <cn>集成通信</cn>
<?php <en>Intercom</en>
} </a></li>
?> <li><a href="explorer.php"><i class="fa fa-folder-open-o"></i>
<cn>U盘助手</cn>
<en>Usb Disk</en>
</a></li>
<?php
if ($hardware["function"]["serialport"]) {
?>
<li><a href="uart.php"><i class="fa fa-link"></i>
<cn>串口、按键</cn>
<en>Serial, Button</en>
</a></li>
<?php
}
?>
<?php
if ($hardware["function"]["remote"]) {
?>
<li><a href="remote.php"><i class="fa fa-fire"></i>
<cn>红外遥控</cn>
<en>Remote</en>
</a></li>
<?php
}
?>
</ul> </ul>
</li> </li>
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-gears menuIcon"></i><cn>高级设置</cn><en>Options</en><span class="caret"></span> </a> <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-gears menuIcon"></i>
<cn>高级设置</cn>
<en>Options</en><span class="caret"></span>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="sys.php"><i class="fa fa-gear"></i><cn>系统设置</cn><en>System</en></a></li> <li><a href="sys.php"><i class="fa fa-gear"></i>
<li><a href="group.php"><i class="fa fa-server"></i><cn>群组设置</cn><en>Group</en></a></li> <cn>系统设置</cn>
<li><a href="rproxy.php"><i class="fa fa-wechat"></i><cn>远程访问</cn><en>Reverse Proxy</en></a></li> <en>System</en>
<li><a href="service.php"><i class="fa fa-cloud"></i><cn>服务设置</cn><en>Service</en></a></li> </a></li>
<li><a href="group.php"><i class="fa fa-server"></i>
<cn>群组设置</cn>
<en>Group</en>
</a></li>
<li><a href="rproxy.php"><i class="fa fa-wechat"></i>
<cn>远程访问</cn>
<en>Reverse Proxy</en>
</a></li>
<li><a href="service.php"><i class="fa fa-cloud"></i>
<cn>服务设置</cn>
<en>Service</en>
</a></li>
</ul> </ul>
</li> </li>
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-flask menuIcon"></i><cn>实验室</cn><en>Laboratory</en><span class="caret"></span> </a> <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-flask menuIcon"></i>
<cn>实验室</cn>
<en>Laboratory</en><span class="caret"></span>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="gb28181.php"><i class="fa fa-cloud"></i>GB28181</a></li> <li><a href="gb28181.php"><i class="fa fa-cloud"></i>GB28181</a></li>
<li><a href="roi.php"><i class="fa fa-user-circle-o"></i>ROI</a></li> <li><a href="roi.php"><i class="fa fa-user-circle-o"></i>ROI</a></li>
<li><a href="insta360.php"><i class="fa fa-camera"></i>Insta360 Link</a></li> <li><a href="insta360.php"><i class="fa fa-camera"></i>Insta360 Link</a></li>
<li> <li>
<svg style="position: absolute;margin: 5px 0px 0px 18px;" width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M43 6H23H5" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter"/><path d="M23 23V6" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter"/><path d="M8.42498 19.5798L40.3005 28.1209L38.5581 30.7598L34.5557 37.9696L32.8133 40.6085L4.80151 33.1028L8.42498 19.5798Z" fill="#fff" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter"/><path d="M38.5583 30.7598L42.422 31.7951L40.3515 39.5225L34.5559 37.9696" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter"/></svg> <svg style="position: absolute;margin: 5px 0px 0px 18px;" width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<a style="padding-left: 38px;" href="onvif.php">Onvif PTZ</a> <path d="M43 6H23H5" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
<path d="M23 23V6" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
<path d="M8.42498 19.5798L40.3005 28.1209L38.5581 30.7598L34.5557 37.9696L32.8133 40.6085L4.80151 33.1028L8.42498 19.5798Z" fill="#fff" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
<path d="M38.5583 30.7598L42.422 31.7951L40.3515 39.5225L34.5559 37.9696" stroke="#fff" stroke-width="4" stroke-linecap="square" stroke-linejoin="miter" />
</svg>
<a style="padding-left: 38px;" href="onvif.php">Onvif PTZ</a>
</li> </li>
<li><a href="sync.php"><i class="fa fa-tasks"></i><cn>同步调节</cn><en>Synchronization</en></a></li> <li><a href="sync.php"><i class="fa fa-tasks"></i>
<cn>同步调节</cn>
<en>Synchronization</en>
</a></li>
<li><a href="colorKey.php"><i class="fa fa-cut"></i>
<cn>抠像</cn>
<en>ColorKey</en>
</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
<ul class="nav navbar-nav navr"> <ul class="nav navbar-nav navr">
<li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-globe"></i><en>语言</en><cn>Language</cn><span class="caret"></span> </a> <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-globe"></i>
<en>语言</en>
<cn>Language</cn><span class="caret"></span>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#" onClick="changeLang('en');">English</a></li> <li><a href="#" onClick="changeLang('en');">English</a></li>
<li><a href="#" onClick="changeLang('cn');">中文</a></li> <li><a href="#" onClick="changeLang('cn');">中文</a></li>
</ul> </ul>
</li> </li>
<li> <a id="logout" class="btn btn-default" href="login.php?logout=true"> <i class="fa fa-sign-out"></i><en>Sign out</en><cn>退出</cn></a> </li> <li> <a id="logout" class="btn btn-default" href="login.php?logout=true"> <i class="fa fa-sign-out"></i>
<en>Sign out</en>
<cn>退出</cn>
</a> </li>
</ul> </ul>
</div> </div>

View File

@ -14,7 +14,6 @@
<link href="js/confirm/jquery-confirm.min.css" rel="stylesheet"/> <link href="js/confirm/jquery-confirm.min.css" rel="stylesheet"/>
<link href="vendor/slider/css/bootstrap-slider.min.css" rel="stylesheet" /> <link href="vendor/slider/css/bootstrap-slider.min.css" rel="stylesheet" />
<link href="vendor/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet" /> <link href="vendor/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="webuploader/webuploader.css">
<link href="css/my.css" rel="stylesheet"> <link href="css/my.css" rel="stylesheet">
<link rel="stylesheet" id="langcss"> <link rel="stylesheet" id="langcss">
@ -26,6 +25,6 @@
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.cookie.js"></script> <script src="js/jquery.cookie.js"></script>
<script src="js/bootstrap.js"></script> <script src="js/bootstrap.js"></script>
<script src="js/global.js" id="globaljs" defLang="<?php echo isset($defLang)?$defLang:"cn"; ?>"></script> <script src="js/global.js" id="globaljs" defLang="cn"></script>
</head> </head>
<body> <body>

View File

@ -136,7 +136,7 @@ function getUsedLang() {
$.ajaxSettings.async = true; $.ajaxSettings.async = true;
} }
function linkHref(path) { function linkHref(path) {
var link = document.createElement('link'); var link = document.createElement('link');
link.href = path; link.href = path;
link.rel = 'stylesheet'; link.rel = 'stylesheet';
@ -147,7 +147,6 @@ function linkHref(path) {
var usedTheme=getUsedTheme(); var usedTheme=getUsedTheme();
if(usedTheme!="") if(usedTheme!="")
{ {
linkHref("css/theme/clear.css");
linkHref("css/theme/"+getUsedTheme()+".css"); linkHref("css/theme/"+getUsedTheme()+".css");
linkHref("css/theme/theme.css"); linkHref("css/theme/theme.css");
} }

View File

@ -1,5 +1,4 @@
<?php <?php
include( "config.php" );
session_start(); session_start();
if ( isset( $_GET[ 'logout' ] ) ) if ( isset( $_GET[ 'logout' ] ) )
$_SESSION[ 'login' ] = ""; $_SESSION[ 'login' ] = "";

View File

@ -1,34 +1,34 @@
<?php <?php
include( "head.php" ); include("head.php");
?> ?>
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-5">
<div class="thumbnail"> <div class="thumbnail">
<div class="caption "> <div class="caption ">
<form class="form-inline "> <form class="form-inline ">
<div class="form-group "> <div class="form-group ">
<label class="control-label"> <label class="control-label">
<cn>频道</cn> <cn>频道</cn>
<en>Channel</en>: <en>Channel</en>:
</label> </label>
<select id="channels" class="form-control"></select> <select id="channels" class="form-control"></select>
<label class="control-label" style="margin-left: 15px;"> <label class="control-label" style="margin-left: 15px;">
<cn>布局</cn> <cn>布局</cn>
<en>Layout</en>: <en>Layout</en>:
</label> </label>
<select id="SysLayout" class="form-control"> <select id="SysLayout" class="form-control">
<!-- <option cn="9宫格" en="grid 3x3" value="0"></option>--> <!-- <option cn="9宫格" en="grid 3x3" value="0"></option>-->
<!-- <option cn="4分屏" en="grid 2x2"value="1"></option>--> <!-- <option cn="4分屏" en="grid 2x2"value="1"></option>-->
<!-- <option value="2">1+2</option>--> <!-- <option value="2">1+2</option>-->
<!-- <option cn="画中画" en="PinP" value="3"></option>--> <!-- <option cn="画中画" en="PinP" value="3"></option>-->
<!-- <option cn="单画面" en="Single" value="4"></option>--> <!-- <option cn="单画面" en="Single" value="4"></option>-->
<!-- <option cn="上下" en="UpDown" value="5"></option>--> <!-- <option cn="上下" en="UpDown" value="5"></option>-->
<!-- <option cn="自定义" en="user" value="6"></option>--> <!-- <option cn="自定义" en="user" value="6"></option>-->
</select> </select>
<label id="defLay" style="position: absolute;right: 30px;top:20px;cursor: pointer"> <label id="defLay" style="position: absolute;right: 30px;top:20px;cursor: pointer">
<i class="fa fa-cog fa-lg"></i> <i class="fa fa-cog fa-lg"></i>
</label> </label>
</div> </div>
</form> </form>
</div> </div>
<img id="snap" src=""> <img id="snap" src="">
@ -43,31 +43,31 @@ include( "head.php" );
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div id="templeLay" style="position: absolute; padding: 10px; width: 33%;height: 33%; border: 1px solid #ddd; z-index: 0; background-color: #777; display: none; "> <div id="templeLay" style="position: absolute; padding: 10px; width: 33%;height: 33%; border: 1px solid #ddd; z-index: 0; background-color: #777; display: none; ">
<table style="width: 100%;"> <table style="width: 100%;">
<tr> <tr>
<td width="100%"> <td width="100%">
<select onChange="update();" id="laySrc" class="form-control input-sm"> <select onChange="update();" id="laySrc" class="form-control input-sm">
<option cn="" en="NULL" value="-1"></option> <option cn="" en="NULL" value="-1"></option>
</select> </select>
</td> </td>
<td> <td>
<button style="width: 36px;" onClick="mute(this);" class="btn btn-sm btn-disable" ><i class="fa fa-volume-off"></i></button> <button style="width: 36px;" onClick="mute(this);" class="btn btn-sm btn-disable"><i class="fa fa-volume-off"></i></button>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="layout" style="position: relative; width: 100%; padding-bottom: 56.25%; background-color: #000;"> <div id="layout" style="position: relative; width: 100%; padding-bottom: 56.25%; background-color: #000;">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row" <?php if(isset($HDMI_Out) && !$HDMI_Out) echo 'style="display: none;"'; ?> > <div class="row" <?php if (!$hardware["function"]["videoOut"]) echo 'style="display: none;"'; ?>>
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="title"> <div class="title">
@ -81,7 +81,8 @@ include( "head.php" );
<form class="form-horizontal" id="output" role="form"> <form class="form-horizontal" id="output" role="form">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label"> <label class="col-sm-2 control-label">
<cn>混合开关</cn><en>Mix enable</en> <cn>混合开关</cn>
<en>Mix enable</en>
</label> </label>
<div class="col-sm-5"> <div class="col-sm-5">
<input type="checkbox" zcfg="enable" class="switch form-control"> <input type="checkbox" zcfg="enable" class="switch form-control">
@ -90,43 +91,78 @@ include( "head.php" );
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label"> <label class="col-sm-4 control-label">
HDMI <cn>开关</cn><en>enable</en> HDMI <cn>开关</cn>
</label> <en>enable</en>
<div class="col-sm-6"> </label>
<input type="checkbox" zcfg="output.enable" class="switch form-control"> <div class="col-sm-6">
</div> <input type="checkbox" zcfg="output.enable" class="switch form-control">
</div> </div>
<div class="form-group"> </div>
<label class="col-sm-4 control-label">
<cn>分辨率</cn><en>resolution</en>
</label>
<div class="col-sm-6">
<select zcfg="output.output" class="form-control">
<?php
if($type!="ENC1H")
{
?>
<option value="3840x2160_60">4K60</option>
<option value="3840x2160_50">4K50</option>
<option value="3840x2160_30">4K30</option>
<?php
}
?>
<option value="1080P60">1080P60</option>
<option value="1080I60">1080I60</option>
<option value="1080P50">1080P50</option>
<option value="1080I50">1080I50</option>
<option value="1080P30">1080P30</option>
<option value="720P60">720P60</option>
<option value="720P50">720P50</option>
</select>
</div>
</div>
<!--
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label"> <label class="col-sm-4 control-label">
<cn>旋转</cn><en>rotate</en> <cn>接口模式</cn>
<en>Interface</en>
</label>
<div class="col-sm-6">
<select zcfg="output.type" class="form-control">
<option value="hdmi">HDMI</option>
<option value="dvi">DVI</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>分辨率</cn>
<en>resolution</en>
</label>
<div class="col-sm-6">
<select zcfg="output.output" class="form-control">
<?php
if ($hardware["capability"]["maxOutput"]=="4K60") {
?>
<option value="3840x2160_60">4K60</option>
<option value="3840x2160_50">4K50</option>
<?php
}
if ($hardware["capability"]["maxOutput"]=="4K60" || $hardware["capability"]["maxOutput"]=="4K30")
{
?>
<option value="3840x2160_30">4K30</option>
<?php
}
?>
<option value="1080P60">1080P60</option>
<option value="1080I60">1080I60</option>
<option value="1080P50">1080P50</option>
<option value="1080I50">1080I50</option>
<option value="1080P30">1080P30</option>
<option value="1080P25">1080P25</option>
<option value="1080P24">1080P24</option>
<option value="720P60">720P60</option>
<option value="720P50">720P50</option>
<option value="1920x2160_30">1920x2160_30</option>
<option value="2560x1600_60">2560x1600_60</option>
<option value="2560x1440_60">2560x1440_60</option>
<option value="2560x1440_30">2560x1440_30</option>
<option value="1920x1200_60">1920x1200_60</option>
<option value="1680x1050_60">1680x1050_60</option>
<option value="1600x1200_60">1600x1200_60</option>
<option value="1440x900_60">1440x900_60</option>
<option value="1366x768_60">1366x768_60</option>
<option value="1280x1024_60">1280x1024_60</option>
<option value="1280x800_60">1280x800_60</option>
<option value="800x600_60">800x600_60</option>
<option value="576P50">576P50</option>
<option value="480P60">480P60</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>旋转</cn>
<en>rotate</en>
</label> </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select zcfg="output.rotate" class="form-control"> <select zcfg="output.rotate" class="form-control">
@ -137,57 +173,111 @@ include( "head.php" );
</select> </select>
</div> </div>
</div> </div>
-->
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>视频源</cn><en>video source</en>
</label>
<div class="col-sm-6">
<select zcfg="output.src" id="hdmisrc" class="form-control">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>低延时</cn><en>low latency</en>
</label>
<div class="col-sm-6">
<input type="checkbox" zcfg="output.lowLatency" class="switch form-control">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-4 control-label">
<?php
echo isset($extraVo)?$extraVo:"VGA";
?>
<cn>开关</cn><en>enable</en>
</label>
<div class="col-sm-6">
<input type="checkbox" zcfg="output2.enable" class="switch form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>分辨率</cn><en>resolution</en>
</label>
<div class="col-sm-6">
<select zcfg="output2.output" class="form-control">
<option value="1080P60">1080P60</option>
<option value="1080I60">1080I60</option>
<option value="1080P50">1080P50</option>
<option value="1080I50">1080I50</option>
<option value="1080P30">1080P30</option>
<option value="720P60">720P60</option>
<option value="720P50">720P50</option>
</select>
</div>
</div>
<!--
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label"> <label class="col-sm-4 control-label">
<cn>旋转</cn><en>rotate</en> <cn>视频源</cn>
<en>video source</en>
</label>
<div class="col-sm-6">
<select zcfg="output.src" id="hdmisrc" class="form-control">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>低延时</cn>
<en>low latency</en>
</label>
<div class="col-sm-6">
<input type="checkbox" zcfg="output.lowLatency" class="switch form-control">
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>色域转换</cn>
<en>CSC</en>
</label>
<div class="col-sm-6">
<select zcfg="output.csc.matrix" class="form-control">
<option value="identity" cn="不转换" en="Identity"></option>
<option value="601_709">601 to 709</option>
<option value="709_601">709 to 601</option>
</select>
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>亮度</cn>
<en>luma</en>
</label>
<div class="col-sm-6">
<input zcfg="output.csc.luma" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>对比度</cn>
<en>contrast</en>
</label>
<div class="col-sm-6">
<input zcfg="output.csc.contrast" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>饱和度</cn>
<en>saturation</en>
</label>
<div class="col-sm-6">
<input zcfg="output.csc.saturation" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>色调</cn>
<en>hue</en>
</label>
<div class="col-sm-6">
<input zcfg="output.csc.hue" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" style="height:34px">
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<?php
echo $hardware["capability"]["extraVo"];
?>
<cn>开关</cn>
<en>enable</en>
</label>
<div class="col-sm-6">
<input type="checkbox" zcfg="output2.enable" class="switch form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>分辨率</cn>
<en>resolution</en>
</label>
<div class="col-sm-6">
<select zcfg="output2.output" class="form-control">
<option value="1080P60">1080P60</option>
<option value="1080I60">1080I60</option>
<option value="1080P50">1080P50</option>
<option value="1080I50">1080I50</option>
<option value="1080P30">1080P30</option>
<option value="720P60">720P60</option>
<option value="720P50">720P50</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">
<cn>旋转</cn>
<en>rotate</en>
</label> </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select zcfg="output2.rotate" class="form-control"> <select zcfg="output2.rotate" class="form-control">
@ -198,24 +288,74 @@ echo isset($extraVo)?$extraVo:"VGA";
</select> </select>
</div> </div>
</div> </div>
--> <div class="form-group">
<div class="form-group"> <label class="col-sm-4 control-label">
<label class="col-sm-4 control-label"> <cn>视频源</cn>
<cn>视频源</cn><en>video source</en> <en>video source</en>
</label> </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select zcfg="output2.src" id="vgasrc" class="form-control"> <select zcfg="output2.src" id="vgasrc" class="form-control">
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label"> <label class="col-sm-4 control-label">
<cn>低延时</cn><en>low latency</en> <cn>低延时</cn>
</label> <en>low latency</en>
<div class="col-sm-6"> </label>
<input type="checkbox" zcfg="output2.lowLatency" class="switch form-control"> <div class="col-sm-6">
</div> <input type="checkbox" zcfg="output2.lowLatency" class="switch form-control">
</div> </div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>色域转换</cn>
<en>CSC</en>
</label>
<div class="col-sm-6">
<select zcfg="output2.csc.matrix" class="form-control">
<option value="identity" cn="不转换" en="Identity"></option>
<option value="601_709">601 to 709</option>
<option value="709_601">709 to 601</option>
</select>
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>亮度</cn>
<en>luma</en>
</label>
<div class="col-sm-6">
<input zcfg="output2.csc.luma" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>对比度</cn>
<en>contrast</en>
</label>
<div class="col-sm-6">
<input zcfg="output2.csc.contrast" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>饱和度</cn>
<en>saturation</en>
</label>
<div class="col-sm-6">
<input zcfg="output2.csc.saturation" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label">
<cn>色调</cn>
<en>hue</en>
</label>
<div class="col-sm-6">
<input zcfg="output2.csc.hue" class="slider" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" />
</div>
</div>
</div> </div>
</div> </div>
@ -234,13 +374,15 @@ echo isset($extraVo)?$extraVo:"VGA";
</div> </div>
</div> </div>
<script src="vendor/slider/bootstrap-slider.min.js" type="text/javascript"></script>
<script src="vendor/switch/bootstrap-switch.min.js"></script> <script src="vendor/switch/bootstrap-switch.min.js"></script>
<script type="text/javascript" language="javascript" src="js/confirm/jquery-confirm.min.js"></script> <script type="text/javascript" language="javascript" src="js/confirm/jquery-confirm.min.js"></script>
<script src="js/zcfg.js"></script> <script src="js/zcfg.js"></script>
<script> <script>
$(".slider").slider();
$.fn.bootstrapSwitch.defaults.size = 'small'; $.fn.bootstrapSwitch.defaults.size = 'small';
$.fn.bootstrapSwitch.defaults.onColor = 'warning'; $.fn.bootstrapSwitch.defaults.onColor = 'warning';
navIndex( 4 ); navIndex(4);
var config = null; var config = null;
var mixCfg = null; var mixCfg = null;
var curChn = -1; var curChn = -1;
@ -249,28 +391,27 @@ echo isset($extraVo)?$extraVo:"VGA";
var SysLayout = []; var SysLayout = [];
var mixV = []; var mixV = [];
$("#myModal").on('show.bs.modal', function(){ $("#myModal").on('show.bs.modal', function() {
var $this = $(this); var $this = $(this);
var $modal_dialog = $this.find('.modal-dialog'); var $modal_dialog = $this.find('.modal-dialog');
$this.css('display', 'block'); $this.css('display', 'block');
$modal_dialog.css({'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2) }); $modal_dialog.css({
}); 'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2)
});
});
function isMute(obj) function isMute(obj) {
{
return $(obj).hasClass("btn-disable"); return $(obj).hasClass("btn-disable");
} }
function setMute(obj,bMute) function setMute(obj, bMute) {
{ var btn = $(obj).find("i");
var btn=$(obj).find("i"); if (bMute) {
if(bMute){
btn.removeClass("fa-volume-up"); btn.removeClass("fa-volume-up");
btn.addClass("fa-volume-off"); btn.addClass("fa-volume-off");
$(obj).removeClass("btn-warning"); $(obj).removeClass("btn-warning");
$(obj).addClass("btn-disable"); $(obj).addClass("btn-disable");
} } else {
else{
btn.removeClass("fa-volume-off"); btn.removeClass("fa-volume-off");
btn.addClass("fa-volume-up"); btn.addClass("fa-volume-up");
$(obj).removeClass("btn-disable"); $(obj).removeClass("btn-disable");
@ -278,281 +419,269 @@ echo isset($extraVo)?$extraVo:"VGA";
} }
} }
function mute(obj){ function mute(obj) {
setMute(obj,!isMute(obj)); setMute(obj, !isMute(obj));
update(); update();
} }
function init() { function init() {
for ( var i = 0; i < config.length; i++ ) { for (var i = 0; i < config.length; i++) {
if(config[i].type != "file"){ $("#laySrc").append('<option value="' + config[i].id + '">' + config[i].name + '</option>');
$( "#laySrc" ).append( '<option value="' + config[ i ].id + '">' + config[ i ].name + '</option>' ); $("#vgasrc").append('<option value="' + config[i].id + '">' + config[i].name + '</option>');
$( "#vgasrc" ).append( '<option value="' + config[ i ].id + '">' + config[ i ].name + '</option>' ); $("#hdmisrc").append('<option value="' + config[i].id + '">' + config[i].name + '</option>');
$( "#hdmisrc" ).append( '<option value="' + config[ i ].id + '">' + config[ i ].name + '</option>' );
} if (config[i].type != "mix")
if ( config[ i ].type != "mix" )
continue; continue;
mixV = config[i].srcV; mixV = config[i].srcV;
$( "#channels" ).append( '<option value="' + config[ i ].id + '">' + config[ i ].name + '</option>' ); $("#channels").append('<option value="' + config[i].id + '">' + config[i].name + '</option>');
zcfg("#output",config[ i ]); zcfg("#output", config[i]);
} }
setInterval( show, 300 ); setInterval(show, 300);
$( "#channels" ).change( function () { $("#channels").change(function() {
setChannel( $( "#channels" ).val() ); setChannel($("#channels").val());
} ); });
$( "#SysLayout" ).change( function () { $("#SysLayout").change(function() {
curLayIndex=$( "#SysLayout" ).val(); curLayIndex = $("#SysLayout").val();
var defLay = defLays[curLayIndex]; var defLay = defLays[curLayIndex];
var temp = []; var temp = [];
var type = false; var type = false;
for(var i=0;i<defLay.layouts.length;i++){ for (var i = 0; i < defLay.layouts.length; i++) {
var lay = defLay.layouts[i]; var lay = defLay.layouts[i];
if(lay.id < 0){ if (lay.id < 0) {
temp.push("-1"); temp.push("-1");
} else { } else {
type = true; type = true;
temp.push(lay.id+""); temp.push(lay.id + "");
} }
} }
var mixSrcV = mixCfg["srcV"]; var mixSrcV = mixCfg["srcV"];
//如果自定义布局中存在指定输入源 //如果自定义布局中存在指定输入源
if(type) if (type)
mixCfg["srcV"] = temp; mixCfg["srcV"] = temp;
// for(var i=0;i<mixSrcV.length;i++){ // for(var i=0;i<mixSrcV.length;i++){
// if( i >= temp.length) // if( i >= temp.length)
// break; // break;
// if(mixSrcV[i] == "-1") // if(mixSrcV[i] == "-1")
// continue; // continue;
// var mark = false; // var mark = false;
// for(var j=0;j<temp.length;j++){ // for(var j=0;j<temp.length;j++){
// if(temp[j] == mixSrcV[i]) // if(temp[j] == mixSrcV[i])
// mark = true; // mark = true;
// } // }
// if(!mark) // if(!mark)
// temp[i] = mixSrcV[i]; // temp[i] = mixSrcV[i];
// } // }
// mixCfg["srcV"] = temp; // mixCfg["srcV"] = temp;
setLayout(); setLayout();
update(); update();
} ); });
setChannel($('#channels option:first').val() ); setChannel($('#channels option:first').val());
} }
function setLayout() function setLayout() {
{ var layout = SysLayout[curLayIndex];
var layout=SysLayout[curLayIndex]; $("#userLay").val(JSON.stringify(layout).replace(/},{/g, "},\n{"));
$("#userLay").val(JSON.stringify(layout).replace(/},{/g,"},\n{"));
$("#layout").html(''); $("#layout").html('');
for(var i=0;i<layout.length;i++){ for (var i = 0; i < layout.length; i++) {
var lay=$("#templeLay").clone(); var lay = $("#templeLay").clone();
var optlist = lay.find("#laySrc").find("option").toArray(); var optlist = lay.find("#laySrc").find("option").toArray();
for(var k=optlist.length-1;k>=0;k--){ for (var k = optlist.length - 1; k >= 0; k--) {
var opt = optlist[k]; var opt = optlist[k];
var id = $(opt).val()+""; var id = $(opt).val() + "";
for(var n=0;n<mixV.length;n++) { for (var n = 0; n < mixV.length; n++) {
if(id == mixV[n] && id != mixV[i] && id != "-1"){ if (id == mixV[n] && id != mixV[i] && id != "-1") {
lay.find("#laySrc")[0].options.remove(k); lay.find("#laySrc")[0].options.remove(k);
} }
} }
}
lay.css("display","block");
lay.css("left",(layout[i].x*100)+"%");
lay.css("top",(layout[i].y*100)+"%");
lay.css("width",(layout[i].w*100)+"%");
lay.css("height",(layout[i].h*100)+"%");
lay.css("z-index",i);
var color=128;
if(i%2==0){
color+=25*(i/2);
} }
else{
color-=25*(i/2+1); lay.css("display", "block");
lay.css("left", (layout[i].x * 100) + "%");
lay.css("top", (layout[i].y * 100) + "%");
lay.css("width", (layout[i].w * 100) + "%");
lay.css("height", (layout[i].h * 100) + "%");
lay.css("z-index", i);
var color = 128;
if (i % 2 == 0) {
color += 25 * (i / 2);
} else {
color -= 25 * (i / 2 + 1);
} }
lay.css("background-color", "rgb("+color+","+color+","+color+")"); lay.css("background-color", "rgb(" + color + "," + color + "," + color + ")");
lay.appendTo("#layout"); lay.appendTo("#layout");
} }
var srcA=mixCfg["srcA"]; var srcA = mixCfg["srcA"];
var srcV=mixCfg["srcV"]; var srcV = mixCfg["srcV"];
for(var i=0;i<srcV.length && i<$("#layout #templeLay").length;i++){ for (var i = 0; i < srcV.length && i < $("#layout #templeLay").length; i++) {
$("#layout #templeLay").eq(i).find("#laySrc").val(srcV[i]); $("#layout #templeLay").eq(i).find("#laySrc").val(srcV[i]);
setMute($("#layout #templeLay").eq(i).find("button"),($.inArray(srcV[i], srcA)==-1) || srcV[i]==-1 ); setMute($("#layout #templeLay").eq(i).find("button"), ($.inArray(srcV[i], srcA) == -1) || srcV[i] == -1);
} }
} }
function setChannel( id ) { function setChannel(id) {
curChn = id; curChn = id;
mixCfg = config[id]; mixCfg = config[id];
// key值重新排序为对比做准备 // key值重新排序为对比做准备
var layList = []; var layList = [];
for(var i=0;i<mixCfg["layout"].length;i++) for (var i = 0; i < mixCfg["layout"].length; i++) {
{ var layout = mixCfg["layout"][i];
var layout = mixCfg["layout"][i]; var layObj = {
var layObj = { "a": layout["a"],
"a": layout["a"], "x": layout["x"],
"x": layout["x"], "y": layout["y"],
"y": layout["y"], "w": layout["w"],
"w": layout["w"], "h": layout["h"],
"h": layout["h"], "index": layout["index"]
"index": layout["index"] }
} layList.push(layObj);
layList.push(layObj); }
} var str = JSON.stringify(layList);
var str=JSON.stringify(layList); curLayIndex = 6;
curLayIndex=6; for (var i = 0; i < SysLayout.length; i++) {
for(var i=0;i<SysLayout.length;i++){ if (JSON.stringify(SysLayout[i]) == str) {
if(JSON.stringify(SysLayout[i])==str) $("#SysLayout").val(i);
{ curLayIndex = i;
$( "#SysLayout" ).val(i);
curLayIndex=i;
} }
} }
if(curLayIndex==6){ if (curLayIndex == 6) {
$( "#SysLayout" ).val(6); $("#SysLayout").val(6);
SysLayout[6]=mixCfg["layout"]; SysLayout[6] = mixCfg["layout"];
} }
setLayout(); setLayout();
} }
function update() function update() {
{ var srcV = new Array();
var srcV=new Array(); var srcA = new Array();
var srcA=new Array(); for (var i = 0; i < $("#layout #templeLay").length; i++) {
for(var i=0;i<$("#layout #templeLay").length;i++){ var id = $("#layout #templeLay").eq(i).find("#laySrc").val();
var id=$("#layout #templeLay").eq(i).find("#laySrc").val(); if ($.inArray(id, srcV) >= 0 && id != -1) {
if($.inArray(id, srcV)>=0 && id!=-1){
$("#layout #templeLay").eq(i).find("#laySrc").val(-1); $("#layout #templeLay").eq(i).find("#laySrc").val(-1);
setMute($("#layout #templeLay").eq(i).find("button"),true); setMute($("#layout #templeLay").eq(i).find("button"), true);
continue; continue;
} } else
else
srcV.push(id); srcV.push(id);
if(!isMute($("#layout #templeLay").eq(i).find("button"))){ if (!isMute($("#layout #templeLay").eq(i).find("button"))) {
// if(config[id].type!="vi") // if(config[id].type!="vi")
// setMute($("#layout #templeLay").eq(i).find("button"),true); // setMute($("#layout #templeLay").eq(i).find("button"),true);
// else // else
srcA.push(id); srcA.push(id);
} }
} }
mixV = srcV; mixV = srcV;
for(var i=0;i<$("#layout #templeLay").length;i++){ for (var i = 0; i < $("#layout #templeLay").length; i++) {
var lay=$("#layout #templeLay").eq(i); var lay = $("#layout #templeLay").eq(i);
lay.find("#laySrc")[0].options.length = 1; lay.find("#laySrc")[0].options.length = 1;
for ( var k = 0; k < config.length; k++ ) { for (var k = 0; k < config.length; k++) {
if(config[k].type != "file"){ if ($.inArray(config[k].id + "", mixV) < 0 || config[k].id + "" == mixV[i]) {
if($.inArray(config[k].id+"",mixV) < 0 || config[k].id+"" == mixV[i]){ lay.find("#laySrc").append('<option value="' + config[k].id + '">' + config[k].name + '</option>');
lay.find("#laySrc").append( '<option value="' + config[ k ].id + '">' + config[ k ].name + '</option>' ); }
} }
} lay.find("#laySrc").val(mixV[i]);
} }
lay.find("#laySrc").val(mixV[i]);
}
mixCfg["srcA"]=srcA; mixCfg["srcA"] = srcA;
mixCfg["srcV"]=srcV; mixCfg["srcV"] = srcV;
mixCfg["layout"]=SysLayout[curLayIndex]; mixCfg["layout"] = SysLayout[curLayIndex];
save(); save();
} }
function snap() { function snap() {
rpc( "enc.snap" ); rpc("enc.snap");
} }
function show() { function show() {
setTimeout( snap, 100 ); setTimeout(snap, 100);
$( "#snap" ).attr( "src", "snap/snap" + curChn + ".jpg?rnd=" + Math.random() ); $("#snap").attr("src", "snap/snap" + curChn + ".jpg?rnd=" + Math.random());
} }
$("#defLay").click(function () { $("#defLay").click(function() {
$.confirm( { $.confirm({
title: '<cn>布局</cn><en>Layout</en>', title: '<cn>布局</cn><en>Layout</en>',
content: '<cn>是否打开布局管理器?</cn><en>Jump to Layout Manager?</en>', content: '<cn>是否打开布局管理器?</cn><en>Jump to Layout Manager?</en>',
buttons: { buttons: {
ok: { ok: {
text: "<cn>打开</cn><en>Confirm</en>", text: "<cn>打开</cn><en>Confirm</en>",
btnClass: 'btn-warning', btnClass: 'btn-warning',
keys: [ 'enter' ], keys: ['enter'],
action: function () { action: function() {
window.location.href = "defLayout.php"; window.location.href = "defLayout.php";
} }
}, },
cancel: { cancel: {
text: "<cn>取消</cn><en>Cancel</en>" text: "<cn>取消</cn><en>Cancel</en>"
} }
} }
} ); });
}); });
function save() { function save() {
rpc( "enc.update", [ JSON.stringify( config, null, 2 ) ], function ( data ) { rpc("enc.update", [JSON.stringify(config, null, 2)], function(data) {
if ( typeof ( data.error ) != "undefined" ) { if (typeof(data.error) != "undefined") {
htmlAlert( "#alert", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000 ); htmlAlert("#alert", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000);
} }
} ); });
} }
$( "#save" ).click( function ( e ) { $("#save").click(function(e) {
rpc( "enc.update", [ JSON.stringify( config, null, 2 ) ], function ( data ) { rpc("enc.update", [JSON.stringify(config, null, 2)], function(data) {
if ( typeof ( data.error ) != "undefined" ) { if (typeof(data.error) != "undefined") {
htmlAlert( "#alertOut", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000 ); htmlAlert("#alertOut", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000);
} else
htmlAlert("#alertOut", "success", "<cn>保存设置成功!</cn><en>Save config success!</en>", "", 2000);
});
});
$.ajaxSettings.async = false;
$.getJSON("config/defLays.json?rnd=" + Math.random(), function(result) {
defLays = result;
for (var i = 0; i < defLays.length; i++) {
var defLay = defLays[i];
var las = defLay.layouts;
var layout = [];
for (var j = 0; j < las.length; j++) {
layout.push(las[j].pos);
} }
else SysLayout.push(layout);
htmlAlert( "#alertOut", "success", "<cn>保存设置成功!</cn><en>Save config success!</en>", "", 2000 ); $("#SysLayout").append("<option cn='" + defLay.layName + "' en='" + defLay.layNameEn + "' value='" + defLay.layId + "'></option>");
} ); }
} ); });
$.ajaxSettings.async = false; $.getJSON("config/config.json?rnd=" + Math.random(), function(result) {
$.getJSON( "config/defLays.json?rnd=" + Math.random(), function ( result ) {
defLays = result;
for(var i=0;i<defLays.length;i++){
var defLay = defLays[i];
var las = defLay.layouts;
var layout = [];
for(var j=0;j<las.length;j++) {
layout.push(las[j].pos);
}
SysLayout.push(layout);
$("#SysLayout").append("<option cn='"+defLay.layName+"' en='"+defLay.layNameEn+"' value='"+defLay.layId+"'></option>");
}
} );
$.getJSON( "config/config.json?rnd=" + Math.random(), function ( result ) {
config = result; config = result;
init(); init();
} ); });
$.ajaxSettings.async = true; $.ajaxSettings.async = true;
setInterval(function () {
$.getJSON( "config/defLays.json?rnd=" + Math.random(), function ( result ) {
defLays = result;
SysLayout = [];
for(var i=0;i<defLays.length;i++){
var defLay = defLays[i];
var las = defLay.layouts;
var layout = [];
for(var j=0;j<las.length;j++) {
layout.push(las[j].pos);
}
SysLayout.push(layout);
}
} );
},1000)
setInterval(function() {
$.getJSON("config/defLays.json?rnd=" + Math.random(), function(result) {
defLays = result;
SysLayout = [];
for (var i = 0; i < defLays.length; i++) {
var defLay = defLays[i];
var las = defLay.layouts;
var layout = [];
for (var j = 0; j < las.length; j++) {
layout.push(las[j].pos);
}
SysLayout.push(layout);
}
});
}, 1000)
</script> </script>
<?php <?php
include( "foot.php" ); include("foot.php");
?> ?>

View File

@ -1,6 +1,7 @@
<?php <?php
include( "head.php" ); include( "head.php" );
?> ?>
<link href="vendor/fileinput/css/fileinput.min.css" rel="stylesheet" >
<div class="row" id="effect"> <div class="row" id="effect">
<div class="col-md-7"> <div class="col-md-7">
<div class="thumbnail"> <div class="thumbnail">
@ -250,37 +251,28 @@ include( "head.php" );
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="modalUpload" tabindex="-1" role="dialog"> <div class="modal" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="background: white">
</div> <span aria-hidden="true">×</span>
<div class="modal-body text-center"> </button>
<div id="uploader" class="wu-example"> <h4 id="updateTitle" class="modal-title"></h4>
<div id="thelist" class="uploader-list"></div> </div>
<div class="btns"> <div class="modal-body" style="padding: 0px 15px 20px 15px">
<div id="picker"> <div id="alertUpload"></div>
<cn>选择文件</cn> <input type="file" id="uploadFile" name="uploadFile" />
<en>Select file</en> </div>
</div> </div>
<button id="ctlBtn" role="button" type="button" class="btn btn-default"> </div>
<cn>开始上传</cn>
<en>Upload</en>
</button>
</div>
</div>
</div>
</div>
</div>
</div> </div>
<script src="vendor/slider/bootstrap-slider.min.js" type="text/javascript"></script> <script src="vendor/slider/bootstrap-slider.min.js" type="text/javascript"></script>
<script src="vendor/switch/bootstrap-switch.min.js"></script> <script src="vendor/switch/bootstrap-switch.min.js"></script>
<script src="vendor/colorpicker/js/bootstrap-colorpicker.min.js"></script> <script src="vendor/colorpicker/js/bootstrap-colorpicker.min.js"></script>
<script src="js/zcfg.js"></script> <script src="js/zcfg.js"></script>
<script src="js/ajaxfileupload.js"></script> <script type="text/javascript" src="js/confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="webuploader/webuploader.js"></script> <script src="vendor/fileinput/js/fileinput.min.js"></script>
<script type="text/javascript" language="javascript" src="js/confirm/jquery-confirm.min.js"></script>
<script> <script>
navIndex( 3 ); navIndex( 3 );
$( '.colorPicker' ).colorpicker( { $( '.colorPicker' ).colorpicker( {
@ -291,11 +283,19 @@ include( "head.php" );
$.fn.bootstrapSwitch.defaults.onColor = 'warning'; $.fn.bootstrapSwitch.defaults.onColor = 'warning';
$( ".switch" ).bootstrapSwitch(); $( ".switch" ).bootstrapSwitch();
var config = null; var config = null;
var overlayList = null;
var lays; var lays;
var curChn = -1; var curChn = -1;
var curOvr = -1; var curOvr = -1;
getRes(); getRes();
$("#uploadModal").on('show.bs.modal', function(){
var $this = $(this);
var $modal_dialog = $this.find('.modal-dialog');
$this.css('display', 'block');
$modal_dialog.css({'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2) });
});
function init() { function init() {
for ( var i = 0; i < config.length; i++ ) { for ( var i = 0; i < config.length; i++ ) {
if ( config[ i ].type == "file" ) if ( config[ i ].type == "file" )
@ -315,7 +315,8 @@ include( "head.php" );
function setChannel( id ) { function setChannel( id ) {
curChn = id; curChn = id;
lays = config[ id ].overlay; lays = overlayList[ id ];
var list = lays; var list = lays;
$( "#list" ).html( "" ); $( "#list" ).html( "" );
var str = ""; var str = "";
@ -334,21 +335,27 @@ include( "head.php" );
str += "<cn>矩形</cn><en>Rect</en>"; str += "<cn>矩形</cn><en>Rect</en>";
if ( data.type == "border" ) if ( data.type == "border" )
str += "<cn>边框</cn><en>border</en>"; str += "<cn>边框</cn><en>border</en>";
str += '</td><td>' + data.content + '</td>';
var ctx = data.content;
if(data.type == "text" && data.content.length > 15) {
ctx = ctx.slice(0,15);
ctx += "...";
}
str += '</td><td>' + ctx + '</td>';
str += '<td>x:' + data.x + ', y:' + data.y + '</td>'; str += '<td>x:' + data.x + ', y:' + data.y + '</td>';
str += '<td><button onClick="edit(' + i + ');" class="btn btn-sm btn-warning"><i class="fa fa-edit"></i> <cn>编辑</cn><en>Edit</en></button> '; str += '<td><button onClick="edit(' + i + ');" class="btn btn-sm btn-warning"><i class="fa fa-edit"></i> <cn>编辑</cn><en>Edit</en></button> ';
str += '<button onClick="del(' + i + ');" class="btn btn-sm btn-warning"><i class="fa fa-minus"></i> <cn>删除</cn><en>Delete</en></button></td></tr>'; str += '<button onClick="del(' + i + ');" class="btn btn-sm btn-warning"><i class="fa fa-minus"></i> <cn>删除</cn><en>Delete</en></button></td></tr>';
} }
$( "#list" ).html( str ); $( "#list" ).html( str );
if ( list.length > 0 ) var ed = 0;
edit( 0 ); if(list.length == 0)
else ed = -1;
edit( -1 ); else if(curOvr != -1 && curOvr < list.length)
ed = curOvr
edit(ed);
} }
function getRes() { function getRes() {
$.getJSON( "res/", function ( list ) { $.getJSON( "res/", function ( list ) {
$( "#pic select" ).html( "" ); $( "#pic select" ).html( "" );
@ -367,7 +374,10 @@ include( "head.php" );
if ( config == null ) { if ( config == null ) {
$.getJSON( "config/config.json", function ( result ) { $.getJSON( "config/config.json", function ( result ) {
config = result; config = result;
init(); $.getJSON( "config/auto/overlay.json", function ( result ) {
overlayList = result;
init();
} );
} ); } );
} }
else else
@ -383,8 +393,8 @@ include( "head.php" );
return; return;
} }
curOvr = id; curOvr = id;
zcfg( "#edit", config[ curChn ].overlay[ id ] ); zcfg( "#edit", overlayList[ curChn ][ id ] );
showHide( config[ curChn ].overlay[ id ].type ); showHide( overlayList[ curChn ][ id ].type );
$( "#editIndex" ).text( "#" + id ); $( "#editIndex" ).text( "#" + id );
$( "#list tr" ).removeClass( "info" ); $( "#list tr" ).removeClass( "info" );
$( "#list tr" ).eq( id ).addClass( "info" ); $( "#list tr" ).eq( id ).addClass( "info" );
@ -400,8 +410,7 @@ include( "head.php" );
btnClass: 'btn-warning', btnClass: 'btn-warning',
keys: [ 'enter' ], keys: [ 'enter' ],
action: function () { action: function () {
config[ curChn ].overlay.splice( id, 1 ); overlayList[ curChn ].splice( id, 1 );
setChannel( curChn );
save(); save();
} }
@ -456,10 +465,12 @@ include( "head.php" );
} }
if ( type == "text" || type == "time" ) { if ( type == "text" || type == "time" ) {
$( "#edit #text input" ).attr("placeholder","yyyy-MM-dd hh:mm:ss");
$( "#edit #text" ).show(); if ( type == "text") {
if ( type == "text") $( "#edit #w" ).show();
$( "#edit #w" ).show(); $( "#edit #text input" ).removeAttr("placeholder");
}
$( "#edit #text" ).show();
$( "#edit #color" ).show(); $( "#edit #color" ).show();
$( "#edit #bgColor" ).show(); $( "#edit #bgColor" ).show();
$( "#edit #font" ).show(); $( "#edit #font" ).show();
@ -492,79 +503,56 @@ include( "head.php" );
function save() { function save() {
rpc( "enc.update", [ JSON.stringify( config, null, 2 ) ], function ( data ) { rpc( "enc.updateOverlay", [ JSON.stringify( overlayList, null, 2 ) ], function ( data ) {
if ( typeof ( data.error ) != "undefined" ) { if ( typeof ( data.error ) != "undefined" ) {
htmlAlert( "#alert", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000 ); htmlAlert( "#alert", "danger", "<cn>保存设置失败!</cn><en>Save config failed!</en>", "", 2000 );
} }
setChannel(curChn);
} ); } );
} }
$( "#btnUpload" ).click( function () {
$( '#modalUpload' ).modal( 'show' );
} );
var initUpload = false;
$( '#modalUpload' ).on( 'shown.bs.modal', function ( e ) {
if ( initUpload )
return;
initUpload = true;
var $list = $( "#thelist" ); //这几个初始化全局的百度文档上没说明,好蛋疼。
var $btn = $( "#ctlBtn" ); //开始上传
var uploader = WebUploader.create( {
// swf文件路径 $("#btnUpload").click(function() {
swf: 'webuploader/Uploader.swf', $("#uploadModal").modal("show");
});
// 文件接收服务端。 var tip = "";
server: 'upload2.php?path=res', var lang = $.cookie("lang");
if(lang == "en")
{
$("#updateTitle").html("Upload");
tip = "Please drag the resourse here...";
} else {
lang = "zh";
$("#updateTitle").html("上传资源")
tip = "请把资源拖到此处仅支持png图片ttf格式字体...";
}
// 选择文件的按钮。可选。 $("#uploadFile").fileinput({
// 内部根据当前运行是创建可能是input元素也可能是flash. language: lang,
pick: '#picker', dropZoneTitle: tip,
showClose: false,
allowedFileExtensions: ['png','ttf'],
uploadUrl: "upload1.php",
allowedPreviewTypes: ['image'],
maxFileCount: 3
});
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传 $('#uploadFile').on('fileuploaded', function(event, data) {
resize: false $("#uploadModal").modal("hide");
} ); $('#uploadFile').fileinput('clear');
uploader.on( 'fileQueued', function ( file ) { $('#uploadFile').fileinput('unlock');
$list.append( '<div id="' + file.id + '" class="item">' + getRes();
'<h4 class="info">' + file.name + '</h4>' + });
'<p class="state"><cn>等待上传</cn><en>Waiting for upload</en>...</p>' +
'</div>' );
} );
uploader.on( 'uploadProgress', function ( file, percentage ) {
var $li = $( '#' + file.id ),
$percent = $li.find( '.progress .progress-bar' );
// 避免重复创建 $('#uploadFile').on('fileuploaderror', function(event, data, msg) {
if ( !$percent.length ) { if(data.jqXHR.responseText) {
$percent = $( '<div class="progress progress-striped active">' + var errMsg = eval(data.jqXHR.responseText);
'<div class="progress-bar" role="progressbar" style="width: 0%">' + htmlAlert( "#alertUpload", "danger", errMsg, "", 30000 );
'</div>' + }
'</div>' ).appendTo( $li ).find( '.progress-bar' ); });
} $(".btn-primary").addClass("btn-warning");
$(".file-preview").css("border","none");
$li.find( 'p.state' ).html( '<cn>上传中</cn><en>Uploading</en>' ); $(".file-caption-main").css("padding","0px 16px");
$percent.css( 'width', percentage * 100 + '%' );
} );
uploader.on( 'uploadSuccess', function ( file ) {
$( '#' + file.id ).find( 'p.state' ).html( '<cn>已上传</cn><en>Upload done</en>' );
getRes();
setTimeout( "$( '#modalUpload' ).modal( 'hide' );", 300 );
} );
uploader.on( 'uploadError', function ( file ) {
$( '#' + file.id ).find( 'p.state' ).html( '<cn>上传出错</cn><en>Upload faild</en>' );
} );
uploader.on( 'uploadComplete', function ( file ) {
$( '#' + file.id ).find( '.progress' ).fadeOut();
} );
$btn.on( 'click', function () {
console.log( "上传..." );
uploader.upload();
console.log( "上传成功" );
} );
} );
$( "#btnAddShow" ).click( function () { $( "#btnAddShow" ).click( function () {
$( '#modalAdd' ).modal( 'show' ); $( '#modalAdd' ).modal( 'show' );
@ -586,15 +574,11 @@ include( "head.php" );
alpha: 1, alpha: 1,
font: "/link/res/font.ttf" font: "/link/res/font.ttf"
}; };
if(newlay.type=="time") if(newlay.type=="time")
{
newlay.content="yyyy-MM-dd hh:mm:ss"; newlay.content="yyyy-MM-dd hh:mm:ss";
} overlayList[ curChn ].push( newlay);
config[ curChn ].overlay.push( newlay);
setChannel( curChn ); setChannel( curChn );
edit( config[ curChn ].overlay.length - 1 ); edit( overlayList[ curChn ].length - 1 );
} ); } );
</script> </script>
<?php <?php

View File

@ -121,7 +121,7 @@ include( "head.php" );
$("#warning").popover({content:ctx, html:true, placement:"left"}); $("#warning").popover({content:ctx, html:true, placement:"left"});
var player=null; var player=null;
function setChannel(codec,suffix){ function setChannel(codec,suffix,hasAudio){
$(".video-cloud").show(); $(".video-cloud").show();
if(player!=null) if(player!=null)
{ {
@ -141,11 +141,11 @@ include( "head.php" );
videoBuffer: bufferTime/1000, videoBuffer: bufferTime/1000,
decoder: "js/jessibuca/decoder.js", decoder: "js/jessibuca/decoder.js",
isResize: true, isResize: true,
hasAudio: true, hasAudio: hasAudio,
operateBtns: { operateBtns: {
fullscreen: true, fullscreen: true,
play: true, play: true,
audio: true, audio: hasAudio,
}, },
forceNoOffscreen: true, forceNoOffscreen: true,
isNotMute: false, isNotMute: false,
@ -158,9 +158,10 @@ include( "head.php" );
$("#player").show(); $("#player").show();
$("#jess").hide(); $("#jess").hide();
$("#bufferBox").hide(); $("#bufferBox").hide();
player = flvjs.createPlayer({ player = flvjs.createPlayer({
type: 'flv', type: 'flv',
hasAudio: true, hasAudio: hasAudio,
url: 'http://'+window.location.host+'/flv?app=live&stream='+suffix url: 'http://'+window.location.host+'/flv?app=live&stream='+suffix
}); });
player.attachMediaElement(document.getElementById("player")); player.attachMediaElement(document.getElementById("player"));
@ -175,7 +176,8 @@ include( "head.php" );
$( "#channels" ).change( function () { $( "#channels" ).change( function () {
var codec = $("#channels option:selected").attr("codec"); var codec = $("#channels option:selected").attr("codec");
var suffix = $("#channels option:selected").attr("suffix"); var suffix = $("#channels option:selected").attr("suffix");
setChannel(codec, suffix); var hasAudio = $("#channels option:selected").attr("hasAudio");
setChannel(codec, suffix, hasAudio);
} ); } );
function checkDelay() { function checkDelay() {
@ -193,6 +195,7 @@ include( "head.php" );
var first=-1; var first=-1;
var codec=-1; var codec=-1;
var sufx = -1; var sufx = -1;
var hasAudio=false;
for ( var i = 0; i < config.length; i++ ) { for ( var i = 0; i < config.length; i++ ) {
if ( !config[ i ].enable || !config[i].stream.rtmp ) if ( !config[ i ].enable || !config[i].stream.rtmp )
continue; continue;
@ -205,10 +208,12 @@ include( "head.php" );
first=config[ i ].id; first=config[ i ].id;
codec=config[ i ].encv.codec; codec=config[ i ].encv.codec;
sufx = suffix; sufx = suffix;
if(config[ i ].enca.codec != "close")
hasAudio = true
} }
$( "#channels" ).append( '<option value="' + config[ i ].id + '" codec="'+config[i].encv.codec+'" suffix="'+suffix+'" >' + config[ i ].name + '</option>' ); $( "#channels" ).append( '<option value="' + config[ i ].id + '" codec="'+config[i].encv.codec+'"hasAudio="'+hasAudio+'" suffix="'+suffix+'" >' + config[ i ].name + '</option>' );
} }
setChannel(codec, sufx); setChannel(codec, sufx, hasAudio);
} ); } );
$("#warning").hover(function () { $("#warning").hover(function () {
@ -225,7 +230,8 @@ include( "head.php" );
var id = $( "#channels" ).val(); var id = $( "#channels" ).val();
var codec = $("#channels option:selected").attr("codec"); var codec = $("#channels option:selected").attr("codec");
var suffix = $("#channels option:selected").attr("suffix"); var suffix = $("#channels option:selected").attr("suffix");
setChannel(codec,suffix); var hasAudio = $("#channels option:selected").attr("hasAudio");
setChannel(codec,suffix,hasAudio);
}); });
} ); } );
</script> </script>

View File

@ -13,6 +13,9 @@ include( "head.php" );
<div style="position: absolute;right: 35px;top: 6px;font-size: 20px;cursor:pointer;"> <div style="position: absolute;right: 35px;top: 6px;font-size: 20px;cursor:pointer;">
<i class="fa fa-cog" aria-hidden="true" onclick="onSetting()"></i> <i class="fa fa-cog" aria-hidden="true" onclick="onSetting()"></i>
</div> </div>
<div style="position: absolute;right: 70px;top: 8px;font-size: 18px;cursor:pointer;">
<i class="fa fa-unlink" aria-hidden="true" onclick="onUmount()"></i>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-2 text-center" style="margin-top: 30px;margin-left: 10px"> <div class="col-sm-2 text-center" style="margin-top: 30px;margin-left: 10px">
@ -445,6 +448,34 @@ include( "head.php" );
zcfg( "#segment", fragmentData ); zcfg( "#segment", fragmentData );
} }
function onUmount() {
$.confirm( {
title: '<h4 style="font-weight: 600"><cn>卸载磁盘</cn><en>Unmount Disk</en></h4>',
content: "<cn>是否卸载磁盘,请确保没有处于录制状态</cn><en>Whether to unmount the disk, please make sure it is not in the recording state</en>",
buttons: {
ok: {
text: "<cn>卸载</cn><en>Unmount</en>",
btnClass: 'btn-warning',
keys: [ 'enter' ],
action: function () {
func("umountDisk",[],function (res) {
if(res.error != ""){
htmlAlert("#alert", "danger", res.error, "", 3000);
return;
}
setTimeout(function () {
location.reload();
},500);
})
}
},
cancel: {
text: "<cn>取消</cn><en>Cancel</en>"
}
}
} );
}
function setSegment() { function setSegment() {
rpc("rec.isRecordState", [], function (data) { rpc("rec.isRecordState", [], function (data) {
if(data) { if(data) {
@ -737,7 +768,7 @@ include( "head.php" );
isRecordMark = true; isRecordMark = true;
} }
enabledChn.push(chns[j]); enabledChn.push(chns[j]);
html += '<div class="col-sm-3"><div class="checkbox"><label><input type="checkbox" name="' + i + '" value="'+result[i].id+'">' + result[ i ].name + '</label></div></div>'; html += '<div class="col-sm-3"><div class="checkbox"><label><input type="checkbox" style="margin-top: 2px" name="' + i + '" value="'+result[i].id+'">' + result[ i ].name + '</label></div></div>';
} }
} }
} }

View File

@ -91,9 +91,7 @@ include( "head.php" );
<script src="vendor/switch/bootstrap-switch.min.js"></script> <script src="vendor/switch/bootstrap-switch.min.js"></script>
<script src="vendor/colorpicker/js/bootstrap-colorpicker.min.js"></script> <script src="vendor/colorpicker/js/bootstrap-colorpicker.min.js"></script>
<script src="js/zcfg.js"></script> <script src="js/zcfg.js"></script>
<script src="js/ajaxfileupload.js"></script> <script type="text/javascript" src="js/confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="webuploader/webuploader.js"></script>
<script type="text/javascript" language="javascript" src="js/confirm/jquery-confirm.min.js"></script>
<script> <script>
navIndex( 6 ); navIndex( 6 );
$( '.colorPicker' ).colorpicker( { $( '.colorPicker' ).colorpicker( {
@ -104,6 +102,7 @@ include( "head.php" );
$.fn.bootstrapSwitch.defaults.onColor = 'warning'; $.fn.bootstrapSwitch.defaults.onColor = 'warning';
$( ".switch" ).bootstrapSwitch(); $( ".switch" ).bootstrapSwitch();
var config = null; var config = null;
var roiList = null;
var curChn = -1; var curChn = -1;
var curIndex = -1; var curIndex = -1;
var curRoi = null; var curRoi = null;
@ -129,7 +128,7 @@ include( "head.php" );
function setIndex( id ) { function setIndex( id ) {
curIndex = id; curIndex = id;
curRoi = config[ curChn ].encv.roi[ curIndex ]; curRoi = roiList[ curChn ][ curIndex ];
zcfg( "#edit", curRoi ); zcfg( "#edit", curRoi );
$("#rect").css("left",(100*curRoi.x)+"%"); $("#rect").css("left",(100*curRoi.x)+"%");
$("#rect").css("top",(100*curRoi.y)+"%"); $("#rect").css("top",(100*curRoi.y)+"%");
@ -140,7 +139,10 @@ include( "head.php" );
$.getJSON( "config/config.json", function ( result ) { $.getJSON( "config/config.json", function ( result ) {
config = result; config = result;
init(); $.getJSON( "config/auto/roi.json", function ( result ) {
roiList = result;
init();
} );
} ); } );
function setChannel( id ) { function setChannel( id ) {

View File

@ -129,10 +129,12 @@ include( "head.php" );
} ); } );
} ); } );
var serviceCfg;
$.ajax( { $.ajax( {
url: "config/sls_enable", url: "config/service.json",
success: function ( data ) { success: function ( data ) {
$("#sls_enable").bootstrapSwitch('state', (data.replace( /[\r\n]/g, "" )=="true"), true); serviceCfg = data;
$("#sls_enable").bootstrapSwitch('state', data["sls"], true);
} }
} ).responseText; } ).responseText;
@ -144,7 +146,8 @@ include( "head.php" );
} ).responseText; } ).responseText;
$( "#save_sls" ).click( function ( e ) { $( "#save_sls" ).click( function ( e ) {
func( "saveConfigFile", {path:"config/sls_enable",data:($("#sls_enable").is(":checked"))}, function ( res ) { serviceCfg["sls"] = $("#sls_enable").is(":checked");
func( "saveConfigFile", {path:"config/service.json",data:JSON.stringify(serviceCfg,null,2)}, function ( res ) {
console.log( res ); console.log( res );
} ); } );
func( "saveConfigFile", {path:"config/sls.conf",data:$("#sls_cfg").val()}, function ( res ) { func( "saveConfigFile", {path:"config/sls.conf",data:$("#sls_cfg").val()}, function ( res ) {

View File

@ -17,7 +17,7 @@ include( "groupList.php" );
<div class="col-md-2 col-xs-4"></div> <div class="col-md-2 col-xs-4"></div>
<div class="col-md-1 col-xs-2">HTTP</div> <div class="col-md-1 col-xs-2">HTTP</div>
<?php <?php
if(!isset($HLS) || $HLS) if($hardware["function"]["hls"])
{ {
?> ?>
<div class="col-md-1 col-xs-2">HLS</div> <div class="col-md-1 col-xs-2">HLS</div>
@ -50,7 +50,7 @@ if(!isset($HLS) || $HLS)
<input type="checkbox" zcfg="http" class="switch form-control"> <input type="checkbox" zcfg="http" class="switch form-control">
</div> </div>
<?php <?php
if(!isset($HLS) || $HLS) if($hardware["function"]["hls"])
{ {
?> ?>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
@ -64,7 +64,7 @@ if(!isset($HLS) || $HLS)
</div> </div>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
<?php <?php
if(isset($rtspAuth) && $rtspAuth) if($hardware["function"]["rtspAuth"])
{ {
?> ?>
<input type="checkbox" zcfg="rtsp.enable" class="switch form-control"> <input type="checkbox" zcfg="rtsp.enable" class="switch form-control">
@ -90,10 +90,6 @@ else
<div class="col-md-2 col-xs-4 text-center"></div> <div class="col-md-2 col-xs-4 text-center"></div>
</div> </div>
<div class="row" id="all_sub" style="margin-top: 5px;"> <div class="row" id="all_sub" style="margin-top: 5px;">
<?php
if($enableSub)
{
?>
<div class="col-md-2 col-xs-4 text-center"> <div class="col-md-2 col-xs-4 text-center">
<cn>辅流协议</cn> <cn>辅流协议</cn>
<en>Sub protocol</en> <en>Sub protocol</en>
@ -102,7 +98,7 @@ else
<input type="checkbox" zcfg="http" class="switch form-control"> <input type="checkbox" zcfg="http" class="switch form-control">
</div> </div>
<?php <?php
if(!isset($HLS) || $HLS) if($hardware["function"]["hls"])
{ {
?> ?>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
@ -116,7 +112,7 @@ if(!isset($HLS) || $HLS)
</div> </div>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
<?php <?php
if(isset($rtspAuth) && $rtspAuth) if($hardware["function"]["rtspAuth"])
{ {
?> ?>
<input type="checkbox" zcfg="rtsp.enable" class="switch form-control"> <input type="checkbox" zcfg="rtsp.enable" class="switch form-control">
@ -140,9 +136,6 @@ else
<input type="checkbox" zcfg="push.enable" class="switch form-control"> <input type="checkbox" zcfg="push.enable" class="switch form-control">
</div> </div>
<div class="col-md-2 col-xs-4 text-center"></div> <div class="col-md-2 col-xs-4 text-center"></div>
<?php
}
?>
</div> </div>
<hr/> <hr/>
<div class="row text-center"> <div class="row text-center">
@ -165,21 +158,21 @@ else
<li role="presentation"><a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>TS设置</cn><en>TS Config</en></a> <li role="presentation"><a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>TS设置</cn><en>TS Config</en></a>
</li> </li>
<?php <?php
if(!isset($HLS) || $HLS) if($hardware["function"]["hls"])
{ {
?> ?>
<li role="presentation"><a href="#tab3" aria-controls="tab3" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>HLS设置</cn><en>HLS Config</en></a> <li role="presentation"><a href="#tab3" aria-controls="tab3" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>HLS设置</cn><en>HLS Config</en></a>
</li> </li>
<?php <?php
} }
if(isset($rtspAuth) && $rtspAuth) if($hardware["function"]["rtspAuth"])
{ {
?> ?>
<li role="presentation"><a href="#tab8" aria-controls="tab8" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>RTSP设置</cn><en>RTSP Config</en></a> <li role="presentation"><a href="#tab8" aria-controls="tab8" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>RTSP设置</cn><en>RTSP Config</en></a>
</li> </li>
<?php <?php
} }
if(!isset($SRT) || $SRT) if($hardware["function"]["srt"])
{ {
?> ?>
<li role="presentation"><a href="#tab7" aria-controls="tab7" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>SRT设置</cn><en>SRT Config</en></a> <li role="presentation"><a href="#tab7" aria-controls="tab7" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>SRT设置</cn><en>SRT Config</en></a>
@ -187,7 +180,7 @@ else
<?php <?php
} }
if(!isset($NDI) || $NDI) if($hardware["function"]["ndi"])
{ {
?> ?>
<li role="presentation"><a href="#tab6" aria-controls="tab6" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>NDI设置</cn><en>NDI Config</en></a> <li role="presentation"><a href="#tab6" aria-controls="tab6" role="tab" data-toggle="tab"><i class="fa fa-gear"></i> <cn>NDI设置</cn><en>NDI Config</en></a>
@ -209,7 +202,7 @@ else
</div> </div>
<div class="col-md-1 col-xs-2">HTTP</div> <div class="col-md-1 col-xs-2">HTTP</div>
<?php <?php
if(!isset($HLS) || $HLS) if($hardware["function"]["hls"])
{ {
?> ?>
<div class="col-md-1 col-xs-2">HLS</div> <div class="col-md-1 col-xs-2">HLS</div>
@ -245,7 +238,7 @@ if(!isset($HLS) || $HLS)
<input type="checkbox" zcfg="[#].stream.http" class="switch form-control"> <input type="checkbox" zcfg="[#].stream.http" class="switch form-control">
</div> </div>
<?php <?php
if(!isset($HLS) || $HLS) if($hardware["function"]["hls"])
{ {
?> ?>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
@ -259,7 +252,7 @@ if(!isset($HLS) || $HLS)
</div> </div>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
<?php <?php
if(isset($rtspAuth) && $rtspAuth) if($hardware["function"]["rtspAuth"])
{ {
?> ?>
<input type="checkbox" zcfg="[#].stream.rtsp.enable" class="switch form-control"> <input type="checkbox" zcfg="[#].stream.rtsp.enable" class="switch form-control">
@ -285,10 +278,6 @@ else
<input zcfg="[#].stream.push.path" type="text" class="form-control"> <input zcfg="[#].stream.push.path" type="text" class="form-control">
</div> </div>
</div> </div>
<?php
if($enableSub)
{
?>
<div class="row" style="margin-top: 5px;"> <div class="row" style="margin-top: 5px;">
<div class="col-md-2 col-xs-4"> <div class="col-md-2 col-xs-4">
</div> </div>
@ -296,7 +285,7 @@ else
<input type="checkbox" zcfg="[#].stream2.http" class="switch form-control"> <input type="checkbox" zcfg="[#].stream2.http" class="switch form-control">
</div> </div>
<?php <?php
if(!isset($HLS) || $HLS) if($hardware["function"]["hls"])
{ {
?> ?>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
@ -310,7 +299,7 @@ if(!isset($HLS) || $HLS)
</div> </div>
<div class="col-md-1 col-xs-2"> <div class="col-md-1 col-xs-2">
<?php <?php
if(isset($rtspAuth) && $rtspAuth) if($hardware["function"]["rtspAuth"])
{ {
?> ?>
<input type="checkbox" zcfg="[#].stream2.rtsp.enable" class="switch form-control"> <input type="checkbox" zcfg="[#].stream2.rtsp.enable" class="switch form-control">
@ -336,9 +325,6 @@ else
<input zcfg="[#].stream2.push.path" type="text" class="form-control"> <input zcfg="[#].stream2.push.path" type="text" class="form-control">
</div> </div>
</div> </div>
<?php
}
?>
<hr style="margin-top:10px; margin-bottom: 10px;"/> <hr style="margin-top:10px; margin-bottom: 10px;"/>
</div> </div>
@ -813,7 +799,7 @@ else
var epg; var epg;
var all = new Object(); var all = new Object();
var all_sub = new Object(); var all_sub = new Object();
var rtspAuth = <?php echo isset($rtspAuth)?$rtspAuth:-1; ?>; var rtspAuth = <?php echo $hardware["function"]["rtspAuth"]?1:-1; ?>;
$.fn.bootstrapSwitch.defaults.size = 'small'; $.fn.bootstrapSwitch.defaults.size = 'small';
$.fn.bootstrapSwitch.defaults.onColor = 'warning'; $.fn.bootstrapSwitch.defaults.onColor = 'warning';

View File

@ -91,6 +91,7 @@ include( "head.php" );
</style> </style>
<link href="vendor/table/bootstrap-table.min.css" rel="stylesheet"> <link href="vendor/table/bootstrap-table.min.css" rel="stylesheet">
<link href="vendor/fileinput/css/fileinput.min.css" rel="stylesheet" >
<div id="alert"></div> <div id="alert"></div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@ -99,14 +100,14 @@ include( "head.php" );
<li role="presentation" class="active"><a href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab"> <cn>网口1</cn><en>LAN1</en></a> <li role="presentation" class="active"><a href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab"> <cn>网口1</cn><en>LAN1</en></a>
</li> </li>
<?php <?php
if ( isset( $ETH1 ) && $ETH1 ) { if ( $hardware["capability"]["eth1"] ) {
?> ?>
<li role="presentation"><a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab"> <cn>网口2</cn><en>LAN2</en></a> <li role="presentation"><a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab"> <cn>网口2</cn><en>LAN2</en></a>
</li> </li>
<?php <?php
} }
if ( !isset( $wifi ) || $wifi ) { if ( $hardware["function"]["wifi"] ) {
?> ?>
<li role="presentation"><a href="#tab3" aria-controls="tab3" role="tab" data-toggle="tab"> <cn>无线网</cn><en>WIFI</en></a> <li role="presentation"><a href="#tab3" aria-controls="tab3" role="tab" data-toggle="tab"> <cn>无线网</cn><en>WIFI</en></a>
</li> </li>
@ -118,7 +119,7 @@ include( "head.php" );
<div role="tabpanel" class="tab-pane fade in active" id="tab1"> <div role="tabpanel" class="tab-pane fade in active" id="tab1">
<form class="form-horizontal" id="net" role="form" style="margin-top: 20px;"> <form class="form-horizontal" id="net" role="form" style="margin-top: 20px;">
<?php <?php
if ( !isset( $DHCP ) || $DHCP ) { if ( $hardware["function"]["dhcp"] ) {
?> ?>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">DHCP</label> <label class="col-sm-3 control-label">DHCP</label>
@ -183,7 +184,7 @@ include( "head.php" );
<div role="tabpanel" class="tab-pane fade in" id="tab2"> <div role="tabpanel" class="tab-pane fade in" id="tab2">
<form class="form-horizontal" id="net2" role="form" style="margin-top: 20px;"> <form class="form-horizontal" id="net2" role="form" style="margin-top: 20px;">
<?php <?php
if ( !isset( $DHCP ) || $DHCP ) { if ( $hardware["function"]["dhcp"] ) {
?> ?>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">DHCP</label> <label class="col-sm-3 control-label">DHCP</label>
@ -567,9 +568,9 @@ include( "head.php" );
<div class="col-md-10 col-md-offset-1"> <div class="col-md-10 col-md-offset-1">
<div class="row"> <div class="row">
<div class="col-md-3 text-center" style="padding: 0"><cn>编解码配置</cn><en>Default Config</en></div> <div class="col-md-3 text-center" style="padding: 0"><cn>编解码配置</cn><en>Default Config</en></div>
<div class="col-md-3 text-center" style="padding: 0"><cn>OLED配置</cn><en>OLED Config</en></div>
<div class="col-md-3 text-center" style="padding: 0"><cn>布局配置</cn><en>Layout Config</en></div> <div class="col-md-3 text-center" style="padding: 0"><cn>布局配置</cn><en>Layout Config</en></div>
<div class="col-md-3 text-center" style="padding: 0"><cn>推流配置</cn><en>Push Config</en></div> <div class="col-md-3 text-center" style="padding: 0"><cn>推流配置</cn><en>Push Config</en></div>
<div class="col-md-3 text-center" style="padding: 0"><cn>录制配置</cn><en>Record Config</en></div>
</div> </div>
</div> </div>
</div> </div>
@ -580,22 +581,29 @@ include( "head.php" );
<div class="col-md-3"> <div class="col-md-3">
<input type="checkbox" checked conf="config.json" class="switch form-control"> <input type="checkbox" checked conf="config.json" class="switch form-control">
</div> </div>
<div class="col-md-3">
<input type="checkbox" checked conf="oled" class="switch form-control">
</div>
<div class="col-md-3"> <div class="col-md-3">
<input type="checkbox" conf="defLays.json" class="switch form-control"> <input type="checkbox" conf="defLays.json" class="switch form-control">
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<input type="checkbox" conf="push.json" class="switch form-control"> <input type="checkbox" conf="push.json" class="switch form-control">
</div> </div>
<div class="col-md-3">
<input type="checkbox" conf="record.json" class="switch form-control">
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-10 col-md-offset-1"> <div class="col-md-10 col-md-offset-1">
<div class="row"> <div class="row">
<?php
if($hardware["function"]["portCtrl"])
{
?>
<div class="col-md-3 text-center" style="padding: 0"><cn>端口配置</cn><en>Port Config</en></div> <div class="col-md-3 text-center" style="padding: 0"><cn>端口配置</cn><en>Port Config</en></div>
<?php
}
?>
<div class="col-md-3 text-center" style="padding: 0"><cn>密码配置</cn><en>Password Config</en></div> <div class="col-md-3 text-center" style="padding: 0"><cn>密码配置</cn><en>Password Config</en></div>
<div class="col-md-3 text-center" style="padding: 0"><cn>维护配置</cn><en>NTP Config</en></div> <div class="col-md-3 text-center" style="padding: 0"><cn>维护配置</cn><en>NTP Config</en></div>
<div class="col-md-3 text-center" style="padding: 0"><cn>场景配置</cn><en>Scene Config</en></div> <div class="col-md-3 text-center" style="padding: 0"><cn>场景配置</cn><en>Scene Config</en></div>
@ -606,9 +614,16 @@ include( "head.php" );
<div class="row" style="margin-bottom: 40px;"> <div class="row" style="margin-bottom: 40px;">
<div class="col-md-10 col-md-offset-1"> <div class="col-md-10 col-md-offset-1">
<div class="row"> <div class="row">
<?php
if($hardware["function"]["portCtrl"])
{
?>
<div class="col-md-3"> <div class="col-md-3">
<input type="checkbox" conf="port.json" class="switch form-control"> <input type="checkbox" conf="port.json" class="switch form-control">
</div> </div>
<?php
}
?>
<div class="col-md-3"> <div class="col-md-3">
<input type="checkbox" conf="passwd.json" class="switch form-control"> <input type="checkbox" conf="passwd.json" class="switch form-control">
</div> </div>
@ -636,7 +651,7 @@ include( "head.php" );
</div> </div>
</div> </div>
<?php <?php
if(isset($PortCtrl) && $PortCtrl==true) if($hardware["function"]["portCtrl"])
{ {
?> ?>
@ -746,67 +761,72 @@ if(isset($PortCtrl) && $PortCtrl==true)
</div> </div>
<?php <?php
} }
if(isset($help) && $help!="") ?>
<div class="row">
<?php
if($hardware["other"]["help"]!="")
{ {
?> ?>
<div class="row"> <div class="col-md-6">
<div class="col-md-6"> <div class="row">
<div class="row"> <div class="col-md-12">
<div class="col-md-12"> <div class="panel panel-default">
<div class="panel panel-default"> <div class="panel-heading">
<div class="panel-heading"> <h3 class="panel-title">
<h3 class="panel-title"> <cn>远程协助</cn>
<cn>远程协助</cn> <en>Remote Assistance</en>
<en>Remote Assistance</en> </h3>
</h3> </div>
</div> <div class="panel-body" style="padding: 28px 15px;">
<div class="panel-body" style="padding: 28px 15px;"> <div id="alertHelp"></div>
<div id="alertHelp"></div> <form class="form-horizontal" role="form" >
<form class="form-horizontal" role="form" > <div class="form-group">
<div class="form-group"> <label class="col-sm-3 control-label"><cn>授权码</cn><en>Auth code</en></label>
<label class="col-sm-3 control-label"><cn>授权码</cn><en>Auth code</en></label> <div class="col-sm-3">
<div class="col-sm-3"> <input type="text" id="authCode" readonly class="form-control"/>
<input type="text" id="authCode" readonly class="form-control"/>
</div>
<div class="col-sm-6">
<button id="startHelp" type="button" class="btn btn-warning ">
<cn>开始协助</cn>
<en>Start</en>
</button>
<button id="stopHelp" type="button" class="btn btn-warning ">
<cn>停止协助</cn>
<en>Stop</en>
</button>
</div>
</div> </div>
</form> <div class="col-sm-6">
</div> <button id="startHelp" type="button" class="btn btn-warning ">
<cn>开始协助</cn>
<en>Start</en>
</button>
<button id="stopHelp" type="button" class="btn btn-warning ">
<cn>停止协助</cn>
<en>Stop</en>
</button>
</div>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> </div>
<div class="col-md-12"> <div class="row">
<div class="panel panel-default""> <div class="col-md-12">
<div class="panel-heading"> <div class="panel panel-default"">
<h3 class="panel-title"> <div class="panel-heading">
<cn>网络测试</cn> <h3 class="panel-title">
<en>Network Test</en> <cn>网络测试</cn>
</h3> <en>Network Test</en>
</div> </h3>
<div class="panel-body" style="padding: 27px 15px"> </div>
<div id="alertNetTest"></div> <div class="panel-body" style="padding: 27px 15px">
<div class="text-center"> <div id="alertNetTest"></div>
<button id="netTest" type="button" class="btn btn-warning "> <div class="text-center">
<cn>开始测试</cn> <button id="netTest" type="button" class="btn btn-warning ">
<en>Start Test</en> <cn>开始测试</cn>
</button> <en>Start Test</en>
</div> </button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<?php
}
?>
<div class="col-md-6"> <div class="col-md-6">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
@ -815,7 +835,7 @@ if(isset($help) && $help!="")
<en>Upgrade</en> <en>Upgrade</en>
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body" style="padding-bottom: 30px;">
<div id="alertup"></div> <div id="alertup"></div>
<div class="col-md-12" style="padding-top: 10px;"> <div class="col-md-12" style="padding-top: 10px;">
<div class="row" style="margin-bottom: 15px;"> <div class="row" style="margin-bottom: 15px;">
@ -844,76 +864,64 @@ if(isset($help) && $help!="")
</div> </div>
<hr> <hr>
<div class="row"> <div class="row">
<div id="update"> <form class="form-horizontal" role="form" id="ff" enctype="multipart/form-data">
<form class="form-horizontal" role="form" id="ff" enctype="multipart/form-data"> <label class="col-sm-3 control-label">
<label class="col-sm-3 control-label"> <cn>上传升级包</cn>
<cn>上传升级包</cn> <en>upload packet</en>
<en>upload packet</en> </label>
</label> <div class="col-sm-6">
<div class="col-sm-6"> <div class="row">
<div id="uploader" class="wu-example"> <div class="col-sm-5" style="padding-right: 0">
<!--用来存放文件信息--> <button id="picker" role="button" type="button" class="btn btn-warning">
<div id="thelist" class="uploader-list"></div> <cn>选择文件</cn>
<div class="row"> <en>Select file</en>
<div class="col-sm-5" style="padding-right: 0"> </button>
<div id="picker"> </div>
<cn>选择文件</cn> <div class="col-sm-5" style="padding-left: 0;">
<en>Select file</en> <button type="button" id="verLog" class="btn btn-warning">
</div> <cn>版本日志</cn>
</div> <en style="font-size: 12px;">Version Log</en>
<div class="col-sm-6" style="padding-left: 0"> </button>
<button id="ctlBtn" role="button" type="button" class="btn btn-default">
<cn>开始上传</cn>
<en>Upload</en>
</button>
</div>
</div>
</div> </div>
</div> </div>
</form> </div>
</div> </form>
</div> </div>
<div class="row"> <div class="row" style="margin-top: 3px;">
<label class="col-sm-3 text-center" style="font-size: 14px;line-height: 34px;padding: 0;margin-bottom: 15px;"> <form class="form-horizontal" role="form" id="ff" enctype="multipart/form-data">
<cn>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在线升级</cn> <label class="col-sm-3 control-label">
<en style="font-size: 12px">online update</en> <cn>在线升级</cn>
</label> <en style="font-size: 12px">online update</en>
<div class="col-sm-6"> </label>
<div class="row"> <div class="col-sm-6">
<div class="col-sm-5" style="padding-right: 0px"> <div class="row">
<button id="checkUpdate" type="button" class="btn btn-warning"> <div class="col-sm-5" style="padding-right: 0">
<div class="fa"> <button id="checkUpdate" type="button" class="btn btn-warning">
<cn>检测更新</cn> <div class="fa">
<en>Search</en> <cn>检测更新</cn>
</div> <en>Search</en>
<div class="sp spinBox hide"> </div>
<div class="spin"></div> <div class="sp spinBox hide">
</div> <div class="spin"></div>
</button> </div>
</div> </button>
<div class="col-sm-4" style="padding-left: 0px;"> </div>
<button type="button" id="verLog" class="btn btn-warning"> <div class="col-sm-4" style="padding:0 4px 0 0;">
<cn>版本日志</cn> <button id="patchSearch" type="button" class="btn btn-warning" style="width: 100%">
<en style="font-size: 12px;">Version Log</en> <i class="fa fa-search" aria-hidden="true"></i>
</button> </button>
</div> </div>
<div class="col-sm-2" style="padding: 0 7px;">
<button id="patchSearch" type="button" class="btn btn-warning">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</div> </div>
</div> </div>
</div> </form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php
}
?>
<div class="modal fade" id="modalAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal fade" id="modalAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
@ -1007,6 +1015,7 @@ if(isset($help) && $help!="")
<div class="modal fade" id="modalLog" tabindex="-1" role="dialog" aria-labelledby="modalPatchLabel"> <div class="modal fade" id="modalLog" tabindex="-1" role="dialog" aria-labelledby="modalPatchLabel">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<button type="button" class="close" style="margin-right: 15px;margin-top: 10px;" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="modal-body" style="overflow: auto;max-height: 700px"></div> <div class="modal-body" style="overflow: auto;max-height: 700px"></div>
</div> </div>
</div> </div>
@ -1042,15 +1051,33 @@ if(isset($help) && $help!="")
</div> </div>
</div> </div>
</div> </div>
<div class="modal" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="background: white">
<span aria-hidden="true">×</span>
</button>
<h4 id="updateTitle" class="modal-title"></h4>
</div>
<div class="modal-body" style="padding: 0px 15px 20px 15px">
<div id="alertUpload"></div>
<input type="file" id="uploadFile" name="uploadFile" />
</div>
</div>
</div>
</div>
<script src="js/zcfg.js"></script> <script src="js/zcfg.js"></script>
<script src="vendor/switch/bootstrap-switch.min.js"></script> <script src="vendor/switch/bootstrap-switch.min.js"></script>
<script type="text/javascript" language="javascript" src="js/confirm/jquery-confirm.min.js"></script> <script type="text/javascript" src="js/confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="webuploader/webuploader.js"></script>
<script src="js/fontawesome-iconpicker.min.js"></script> <script src="js/fontawesome-iconpicker.min.js"></script>
<script src="vendor/table/bootstrap-table.min.js"></script> <script src="vendor/table/bootstrap-table.min.js"></script>
<script src="js/handlebars-v4.7.6.js"></script> <script src="js/handlebars-v4.7.6.js"></script>
<script src="js/jszip.js"></script> <script src="js/jszip.js"></script>
<script src="js/filesaver.min.js"></script> <script src="js/filesaver.min.js"></script>
<script src="vendor/fileinput/js/fileinput.min.js"></script>
<script id="tpl" type="text/x-handlebars-template"> <script id="tpl" type="text/x-handlebars-template">
{{#each this}} {{#each this}}
<div class="row"> <div class="row">
@ -1074,16 +1101,11 @@ if(isset($help) && $help!="")
var updatePatchs = ""; var updatePatchs = "";
var facAliase = ""; var facAliase = "";
var hadUpdate = false; var hadUpdate = false;
$("#modalPatch,#modalLog,#modalSN").on('show.bs.modal', function(){ $("#modalPatch,#modalLog,#modalSN,#uploadModal").on('show.bs.modal', function(){
var $this = $(this); var $this = $(this);
var $modal_dialog = $this.find('.modal-dialog'); var $modal_dialog = $this.find('.modal-dialog');
$this.css('display', 'block'); $this.css('display', 'block');
$modal_dialog.css({'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2) }); $modal_dialog.css({'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2) });
$("body").css("overflow","hidden");
});
$("#modalPatch,#modalLog,#modalSN").on('hide.bs.modal', function(){
$("body").css("overflow","auto");
}); });
function setWifi( func, id ) { function setWifi( func, id ) {
@ -1228,27 +1250,7 @@ if(isset($help) && $help!="")
$("#modalPatch").modal("hide"); $("#modalPatch").modal("hide");
checkLoading(false); checkLoading(false);
hadUpdate = false; hadUpdate = false;
$.confirm( { onConfirmReboot("下载完成,是否立即重启系统完成更新?");
title: '<cn>重启</cn><en>Reboot</en>',
content: '<cn>下载完成,是否立即重启系统完成更新?</cn><en>Reboot immediately?</en>',
buttons: {
ok: {
text: "<cn>确认重启</cn><en>Confirm</en>",
btnClass: 'btn-warning',
keys: [ 'enter' ],
action: function () {
func( "reboot" );
}
},
cancel: {
text: "<cn>取消</cn><en>Cancel</en>",
action: function () {
console.log( 'the user clicked cancel' );
}
}
}
} );
} }
},1000) },1000)
}); });
@ -1276,6 +1278,30 @@ if(isset($help) && $help!="")
a.dispatchEvent(e); a.dispatchEvent(e);
} }
function onConfirmReboot(msg) {
$.confirm( {
title: '<cn>重启</cn><en>Reboot</en>',
content: '<cn>'+msg+'</cn><en>Reboot immediately?</en>',
buttons: {
ok: {
text: "<cn>确认重启</cn><en>Confirm</en>",
btnClass: 'btn-warning',
keys: [ 'enter' ],
action: function () {
func( "reboot" );
}
},
cancel: {
text: "<cn>取消</cn><en>Cancel</en>",
action: function () {
console.log( 'the user clicked cancel' );
}
}
}
} );
}
$( function () { $( function () {
navIndex( 5 ); navIndex( 5 );
$.fn.bootstrapSwitch.defaults.size = 'small'; $.fn.bootstrapSwitch.defaults.size = 'small';
@ -1317,7 +1343,7 @@ if(isset($help) && $help!="")
zcfg( "#ntp", ntpCfg ); zcfg( "#ntp", ntpCfg );
} ); } );
<?php <?php
if(isset($PortCtrl) && $PortCtrl==true) if($hardware["function"]["portCtrl"])
{ {
?> ?>
var portCfg; var portCfg;
@ -1408,13 +1434,7 @@ if(isset($PortCtrl) && $PortCtrl==true)
$("#upConfig").find("input").each(function (index,ele) { $("#upConfig").find("input").each(function (index,ele) {
if($(ele)[0].checked) { if($(ele)[0].checked) {
var cfg_path = $(ele).attr("conf"); var cfg_path = $(ele).attr("conf");
if(cfg_path == "oled") { if(cfg_path == "cron") {
confs.push("oled/oled.json");
confs.push("oled/oledMods.json");
confs.push("oled/remfea.json");
confs.push("oled/remods.json");
confs.push("oled/remote.json");
} else if(cfg_path == "cron") {
confs.push("ntp.json"); confs.push("ntp.json");
confs.push("auto/root.cron"); confs.push("auto/root.cron");
confs.push("misc/timezone/tzselect.json"); confs.push("misc/timezone/tzselect.json");
@ -1671,28 +1691,7 @@ if(isset($PortCtrl) && $PortCtrl==true)
} ); } );
$( "#reboot" ).click( function ( e ) { $( "#reboot" ).click( function ( e ) {
$.confirm( { onConfirmReboot("是否立即重启系统?");
title: '<cn>重启</cn><en>Reboot</en>',
content: '<cn>是否立即重启系统?</cn><en>Reboot immediately?</en>',
buttons: {
ok: {
text: "<cn>确认重启</cn><en>Confirm</en>",
btnClass: 'btn-warning',
keys: [ 'enter' ],
action: function () {
func( "reboot" );
}
},
cancel: {
text: "<cn>取消</cn><en>Cancel</en>",
action: function () {
console.log( 'the user clicked cancel' );
}
}
}
} );
} ); } );
$( "#reset" ).click( function ( e ) { $( "#reset" ).click( function ( e ) {
@ -1729,84 +1728,70 @@ if(isset($PortCtrl) && $PortCtrl==true)
setTimeout(function (){ setTimeout(function (){
func("checkHelpNet",[],function (res){ func("checkHelpNet",[],function (res){
if ( res.error != "" ) { if ( res.error != "" ) {
$( "#update" ).myAlert("danger", res.error, "", 3000 ); $( "#alertup" ).myAlert("danger", res.error, "", 3000 );
return; return;
} }
func("getAliase",[],function (res) { func("getAliase",[],function (res) {
if (res.error != "") { if (res.error != "") {
$("#update").myAlert("danger", res.error, "", 3000); $("#alertup").myAlert("danger", res.error, "", 3000);
return; return;
} }
if(res.result.length == 0) { if(res.result.length == 0) {
$("#update").myAlert("success", "<cn>已经是最新版本</cn><en>It is the latest version</en>", "", 3000); $("#alertup").myAlert("success", "<cn>已经是最新版本</cn><en>It is the latest version</en>", "", 3000);
checkLoading(false); checkLoading(false);
return; return;
} }
facAliase = res.result[0].aliase; facAliase = res.result[0].aliase;
func("checkUpdate", [], function (res) {
if (res.error != "") { func("getPatch", [], function (patchs) {
$("#update").myAlert("danger", res.error, "", 3000); if (patchs.error != "") {
$("#alertup").myAlert("danger", patchs.error, "", 3000);
checkLoading(false); checkLoading(false);
return; return;
} }
if (parseInt(res.result) <= 0) { if (patchs.result.length == 0) {
$("#alertup").myAlert("success", "<cn>已经是最新版本</cn><en>It is the latest version</en>", "", 3000);
checkLoading(false); checkLoading(false);
$.confirm({ return;
title: '<cn>注意</cn><en>Tip</en>',
content: '<cn>设备可能升级过其他固件,如果继续升级,功能可能会被覆盖,是否继续?</cn><en>The device may have been upgraded with custom firmware, and the upgrade function may be overwritten. Do you want to continue?</en>',
buttons: {
ok: {
text: "<cn>继续</cn><en>Continue</en>",
btnClass: 'btn-warning',
keys: ['enter'],
action: function () {
checkLoading(true);
setTimeout(function () {
func("getPatch", [], function (res) {
if (res.error != "") {
$("#update").myAlert("danger", res.error, "", 3000);
checkLoading(false);
return;
}
if (res.result.length == 0) {
$("#update").myAlert("success", "<cn>已经是最新版本</cn><en>It is the latest version</en>", "", 3000);
checkLoading(false);
return;
}
console.log(res.result);
setModalPatch(res.result);
$('#modalPatch').modal({backdrop: 'static', keyboard: false});
});
}, 1000);
}
},
cancel: {
text: "<cn>取消</cn><en>Cancel</en>",
action: function () {
//$("body").css("overflow","auto");
}
}
}
});
} else {
func("getPatch", [], function (res) {
if (res.error != "") {
$("#update").myAlert("danger", res.error, "", 3000);
checkLoading(false);
return;
}
if (res.result.length == 0) {
$("#update").myAlert("success", "<cn>已经是最新版本</cn><en>It is the latest version</en>", "", 3000);
checkLoading(false);
return;
}
setModalPatch(res.result);
$('#modalPatch').modal({backdrop: 'static', keyboard: false});
});
} }
func("checkUpdate", [], function (res) {
if (res.error != "") {
$("#alertup").myAlert("danger", res.error, "", 3000);
checkLoading(false);
return;
}
if (parseInt(res.result) <= 0) {
checkLoading(false);
$.confirm({
title: '<cn>注意</cn><en>Tip</en>',
content: '<cn>设备可能升级过其他固件,如果继续升级,功能可能会被覆盖,是否继续?</cn><en>The device may have been upgraded with custom firmware, and the upgrade function may be overwritten. Do you want to continue?</en>',
buttons: {
ok: {
text: "<cn>继续</cn><en>Continue</en>",
btnClass: 'btn-warning',
keys: ['enter'],
action: function () {
checkLoading(true);
setModalPatch(patchs.result);
$('#modalPatch').modal({backdrop: 'static', keyboard: false});
}
},
cancel: {
text: "<cn>取消</cn><en>Cancel</en>",
action: function () {
//$("body").css("overflow","auto");
}
}
}
});
} else {
setModalPatch(patchs.result);
$('#modalPatch').modal({backdrop: 'static', keyboard: false});
}
});
}); });
}); });
}); });
@ -1829,7 +1814,7 @@ if(isset($PortCtrl) && $PortCtrl==true)
$("#patchSearch").click(function () { $("#patchSearch").click(function () {
func("checkHelpNet",[],function (res) { func("checkHelpNet",[],function (res) {
if (res.error != "") { if (res.error != "") {
$("#update").myAlert("danger", res.error, "", 3000); $("#alertup").myAlert("danger", res.error, "", 3000);
return; return;
} }
$("#modalSN").modal("show"); $("#modalSN").modal("show");
@ -1983,69 +1968,56 @@ if(isset($PortCtrl) && $PortCtrl==true)
}); });
} ); } );
var $list = $( "#thelist" ); //这几个初始化全局的百度文档上没说明,好蛋疼。 $("#picker").click(function (){
var $btn = $( "#ctlBtn" ); //开始上传 $("#uploadModal").modal("show");
var uploader = WebUploader.create( { });
//初始上传控件
var tip = "";
var lang = $.cookie("lang");
if(lang == "en")
{
$("#updateTitle").html("Upload");
tip = "Please drag the upgrade package here...";
} else {
lang = "zh";
$("#updateTitle").html("上传升级包")
tip = "请把升级包拖动到此处...";
}
// swf文件路径 $("#uploadFile").fileinput({
swf: 'webuploader/Uploader.swf', language: lang,
dropZoneTitle: tip,
// 文件接收服务端。 showClose: false,
server: 'upload.php', allowedFileExtensions: ['bin'],
uploadUrl: "upload.php",
// 选择文件的按钮。可选。 maxFileCount: 1
// 内部根据当前运行是创建可能是input元素也可能是flash. });
pick: '#picker', //上传成功
$('#uploadFile').on('fileuploaded', function(event, data) {
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传 var ret = data["response"];
resize: false, if(ret["upload"] == "0")
accept: { {
title: 'Update', $("#uploadModal").modal("hide");
extensions: 'bin', $('#uploadFile').fileinput('clear');
mimeTypes: 'Data/*' $('#uploadFile').fileinput('unlock');
} onConfirmReboot("上传成功,是否立即重启系统完成更新?");
} ); }
uploader.on( 'fileQueued', function ( file ) { if(ret["upload"] == "-1")
$list.append( '<div id="' + file.id + '" class="item">' + htmlAlert( "#alertUpload", "danger", "<cn>上传失败,升级包机型不匹配!</cn><en>Upload failed, upgrade package model does not match!</en>", "", 30000 );
'<h4 class="info">' + file.name + '</h4>' + if(ret["upload"] == "-2")
'<p class="state"><cn>等待上传</cn><en>Waiting for upload</en>...</p>' + htmlAlert( "#alertUpload", "danger", "<cn>上传失败,升级包与系统版本不匹配!</cn><en>Upload failed, the upgrade package does not match the system versio!</en>", "", 30000 );
'</div>' ); });
} ); //上传失败
uploader.on( 'uploadProgress', function ( file, percentage ) { $('#uploadFile').on('fileuploaderror', function(event, data, msg) {
var $li = $( '#' + file.id ), if(data.jqXHR.responseText) {
$percent = $li.find( '.progress .progress-bar' ); var errMsg = eval(data.jqXHR.responseText);
htmlAlert( "#alertUpload", "danger", errMsg, "", 30000 );
// 避免重复创建 }
if ( !$percent.length ) { });
$percent = $( '<div class="progress progress-striped active">' + $(".btn-primary").addClass("btn-warning");
'<div class="progress-bar" role="progressbar" style="width: 0%">' + $(".file-preview").css("border","none");
'</div>' + $(".fileinput-remove").hide();
'</div>' ).appendTo( $li ).find( '.progress-bar' ); $(".file-caption-main").css("padding","0px 16px");
}
$li.find( 'p.state' ).html( '<cn>上传中</cn><en>Uploading</en>' );
$percent.css( 'width', percentage * 100 + '%' );
} );
uploader.on( 'uploadSuccess', function ( file ) {
$( '#' + file.id ).find( 'p.state' ).html( '<cn>已上传</cn><en>Upload done</en>' );
$( "#update" ).myAlert( "success", "<cn>上传成功</cn><en>Upload success</en>", "<cn>重启后生效</cn><en>effect after reboot</en>" );
} );
uploader.on( 'uploadError', function ( file ) {
$( '#' + file.id ).find( 'p.state' ).html( '<cn>上传出错</cn><en>Upload faild</en>' );
} );
uploader.on( 'uploadComplete', function ( file ) {
$( '#' + file.id ).find( '.progress' ).fadeOut();
} );
$btn.on( 'click', function () {
console.log( "<cn>上传</cn><en>Uploading</en>..." );
uploader.upload();
console.log( "<cn>上传成功</cn><en>Upload success</en>" );
} );
$(".webuploader-pick").css("height","34px");
$(".webuploader-pick").css("padding-top","8px");
} ); } );
</script> </script>
<?php <?php

View File

@ -59,7 +59,7 @@ include( "head.php" );
</div> </div>
</div> </div>
<?php <?php
if(isset($button) && $button) if($hardware["function"]["button"])
{ {
?> ?>
<div class="row"> <div class="row">

View File

@ -1,165 +1,53 @@
<?php <?php
include( "session.php" ); upload();
/** function upload()
* upload.php {
* try
* Copyright 2013, Moxiecode Systems AB {
* Released under GPL License. if(is_uploaded_file($_FILES["uploadFile"]["tmp_name"]))
* {
* License: http://www.plupload.com/license $Filedata = $_FILES["uploadFile"];
* Contributing: http://www.plupload.com/contributing if($Filedata["error"] == UPLOAD_ERR_OK)
*/ {
#!! 注意 $tmp_name = $Filedata["tmp_name"];
#!! 此文件只是个示例,不要用于真正的产品之中。 move_uploaded_file($tmp_name, "/link/update/update.tar");
#!! 不保证代码安全性。 exec("tar xvf /link/update/update.tar link/config/hardware.json tmp/allow.json -C /tmp/");
#!! IMPORTANT:
#!! this file is just an example, it doesn't incorporate any security checks and
#!! is not recommended to be used in production environment as it is. Be sure to
#!! revise it and customize to your needs.
// Make sure file is not cached (as it happens for example on iOS devices)
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// Support CORS
// header("Access-Control-Allow-Origin: *");
// other CORS headers if any...
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
exit; // finish preflight CORS requests here
}
if ( !empty($_REQUEST[ 'debug' ]) ) {
$random = rand(0, intval($_REQUEST[ 'debug' ]) );
if ( $random === 0 ) {
header("HTTP/1.0 500 Internal Server Error");
exit;
}
}
// header("HTTP/1.0 500 Internal Server Error");
// exit;
// 5 minutes execution time
@set_time_limit(5 * 60);
// Uncomment this one to fake upload time
// usleep(5000);
// Settings
// $targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
$targetDir = '/tmp';
$uploadDir = '/link/update';
$cleanupTargetDir = true; // Remove old files $up = "0";
$maxFileAge = 5 * 3600; // Temp file age in seconds if(file_exists("/tmp/link/config/hardware.json"))
// Create target dir {
if (!file_exists($targetDir)) { $hardware1 = json_decode(file_get_contents("/tmp/link/config/hardware.json"),true);
@mkdir($targetDir); $fac1 = $hardware1["fac"];
} $hardware2 = json_decode(file_get_contents("/link/config/hardware.json"),true);
// Create target dir $fac2 = $hardware2["fac"];
if (!file_exists($uploadDir)) { if($fac1 != $fac2)
@mkdir($uploadDir); $up = "-1";
}
// Get a file name
if (isset($_REQUEST["name"])) {
$fileName = $_REQUEST["name"];
} elseif (!empty($_FILES)) {
$fileName = $_FILES["file"]["name"];
} else {
$fileName = uniqid("file_");
}
$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
$uploadPath = $uploadDir . DIRECTORY_SEPARATOR . $fileName; if($up == "0")
//if ( isset( $_GET[ 'update' ] ) ) {
//{ if(file_exists("/tmp/tmp/allow.json"))
// $uploadPath = "/mmc/update.bin"; {
//} $allow = json_decode(file_get_contents("/tmp//tmp/allow.json"),true);
if ( !isset( $_GET[ 'path' ] ) ) { $allow_version = $allow["allow"];
$uploadPath="/link/update/update.tar" ; $sys = json_decode(file_get_contents("/link/config/version.json"),true);
} $sys_ary = explode(" ",$sys["sys"]);
// Chunking might be enabled $cur_version = $sys_ary[2];
$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0; if(intval($allow_version) >= intval($cur_version))
$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 1; $up = "-2";
// Remove old temp files }
if ($cleanupTargetDir) { }
if (!is_dir($targetDir) || !$dir = opendir($targetDir)) { }
die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}');
} if($up != "0")
while (($file = readdir($dir)) !== false) { exec("rm /link/update/update.tar");
$tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;
// If temp file is current file proceed to the next echo '{"upload":"'.$up.'"}';
if ($tmpfilePath == "{$filePath}_{$chunk}.part" || $tmpfilePath == "{$filePath}_{$chunk}.parttmp") {
continue;
}
// Remove temp file if it is older than the max age and is not the current file
if (preg_match('/\.(part|parttmp)$/', $file) && (@filemtime($tmpfilePath) < time() - $maxFileAge)) {
@unlink($tmpfilePath);
}
}
closedir($dir);
}
// Open temp file
if (!$out = @fopen("{$filePath}_{$chunk}.parttmp", "wb")) {
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
}
if (!empty($_FILES)) {
if ($_FILES["file"]["error"] || !is_uploaded_file($_FILES["file"]["tmp_name"])) {
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');
}
// Read binary input stream and append it to temp file
if (!$in = @fopen($_FILES["file"]["tmp_name"], "rb")) {
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
}
} else {
if (!$in = @fopen("php://input", "rb")) {
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
}
}
while ($buff = fread($in, 4096)) {
fwrite($out, $buff);
}
@fclose($out);
@fclose($in);
rename("{$filePath}_{$chunk}.parttmp", "{$filePath}_{$chunk}.part");
$index = 0;
$done = true;
for( $index = 0; $index < $chunks; $index++ ) {
if ( !file_exists("{$filePath}_{$index}.part") ) {
$done = false;
break;
}
}
if ( $done ) {
if (!$out = @fopen($uploadPath, "wb")) {
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
}
if ( flock($out, LOCK_EX) ) {
for( $index = 0; $index < $chunks; $index++ ) {
if (!$in = @fopen("{$filePath}_{$index}.part", "rb")) {
break;
} }
while ($buff = fread($in, 4096)) {
fwrite($out, $buff);
}
@fclose($in);
@unlink("{$filePath}_{$index}.part");
} }
flock($out, LOCK_UN);
} }
@fclose($out); catch (Exception $e)
{
echo "{error:'上传失败," . $e->getMessage() . "'}";
}
} }
// Return Success JSON-RPC response
die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}');
//if ( $_FILES[ "file" ][ "error" ] > 0 ) {
// echo $_FILES[ "file" ][ "error" ];
//} else {
//
// if ( isset( $_GET[ 'path' ] ) ) {
// move_uploaded_file( $_FILES[ "file" ][ "tmp_name" ], "/itv/vod/" . $_FILES[ "file" ][ "name" ] );
// } else {
// move_uploaded_file( $_FILES[ "file" ][ "tmp_name" ], "/var/www/temp/update.zip" );
// }
//
// echo "OK";
//}
?>

View File

@ -0,0 +1,24 @@
<?php
upload();
function upload()
{
try
{
if(is_uploaded_file($_FILES["uploadFile"]["tmp_name"]))
{
$Filedata = $_FILES["uploadFile"];
if($Filedata["error"] == UPLOAD_ERR_OK)
{
$name = $Filedata["name"];
$tmp_name = $Filedata["tmp_name"];
move_uploaded_file($tmp_name, "/link/res/".$name);
echo "{}";
}
}
}
catch (Exception $e)
{
echo "{error:'上传失败," . $e->getMessage() . "'}";
}
}

View File

@ -0,0 +1,401 @@
/*!
* bootstrap-fileinput v4.3.6
* http://plugins.krajee.com/file-input
*
* Author: Kartik Visweswaran
* Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD 3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
*/
.file-loading {
top: 0;
right: 0;
width: 25px;
height: 25px;
font-size: 999px;
text-align: right;
color: #fff;
background: transparent url('../img/loading.gif') top left no-repeat;
border: none;
}
.file-object {
margin: 0 0 -5px 0;
padding: 0;
}
.btn-file {
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
min-height: 100%;
text-align: right;
opacity: 0;
background: none repeat scroll 0 0 transparent;
cursor: inherit;
display: block;
}
.file-caption-name {
display: inline-block;
overflow: hidden;
height: 20px;
word-break: break-all;
}
.input-group-lg .file-caption-name {
height: 25px;
}
.file-zoom-dialog {
text-align: left;
}
.file-error-message {
color: #a94442;
background-color: #f2dede;
margin: 5px;
border: 1px solid #ebccd1;
border-radius: 4px;
padding: 15px;
}
.file-error-message pre, .file-error-message ul {
margin: 0;
text-align: left;
}
.file-error-message pre {
margin: 5px 0;
}
.file-caption-disabled {
background-color: #EEEEEE;
cursor: not-allowed;
opacity: 1;
}
.file-preview {
border-radius: 5px;
border: 1px solid #ddd;
padding: 5px;
width: 100%;
margin-bottom: 5px;
}
.file-preview-frame {
position: relative;
display: table;
margin: 8px;
height: 160px;
border: 1px solid #ddd;
box-shadow: 1px 1px 5px 0 #a2958a;
padding: 6px;
float: left;
text-align: center;
vertical-align: middle;
}
.file-preview-frame:not(.file-preview-error):hover {
box-shadow: 3px 3px 5px 0 #333;
}
.file-preview-image {
vertical-align: middle;
image-orientation: from-image;
}
.file-preview-text {
display: block;
color: #428bca;
border: 1px solid #ddd;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
outline: none;
padding: 8px;
resize: none;
}
.file-preview-html {
border: 1px solid #ddd;
padding: 8px;
overflow: auto;
}
.file-zoom-dialog .file-preview-text {
font-size: 1.2em;
}
.file-preview-other {
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
text-align: center;
vertical-align: middle;
padding: 10px;
}
.file-preview-other:hover {
opacity: 0.8;
}
.file-actions, .file-other-error {
text-align: left;
}
.file-other-icon {
font-size: 4.8em;
}
/* noinspection CssOverwrittenProperties */
.file-zoom-dialog .file-other-icon {
font-size: 8em;
font-size: 55vmin;
}
.file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file,
.file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button,
.file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button {
display: none;
}
.file-caption-main {
width: 100%;
}
.file-input-ajax-new .no-browse .input-group-btn,
.file-input-new .no-browse .input-group-btn {
display: none;
}
.file-input-ajax-new .no-browse .form-control,
.file-input-new .no-browse .form-control {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.file-thumb-loading {
background: transparent url('../img/loading.gif') no-repeat scroll center center content-box !important;
}
.file-actions {
margin-top: 15px;
}
.file-footer-buttons {
float: right;
}
.file-upload-indicator {
display: inline;
cursor: default;
opacity: 0.8;
width: 60%;
}
.file-upload-indicator:hover {
font-weight: bold;
opacity: 1;
}
.file-footer-caption {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 160px;
text-align: center;
padding-top: 4px;
font-size: 11px;
color: #777;
margin: 5px auto;
}
.file-preview-error {
opacity: 0.65;
box-shadow: none;
}
.file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
color: #000;
}
.file-drop-zone {
border: 1px dashed #aaa;
border-radius: 4px;
height: 100%;
text-align: center;
vertical-align: middle;
margin: 12px 15px 12px 12px;
padding: 5px;
}
.file-drop-zone-title {
color: #aaa;
font-size: 1.6em;
padding: 85px 10px;
cursor: default;
}
.file-preview .clickable,
.clickable .file-drop-zone-title {
cursor: pointer;
}
.file-drop-zone.clickable:hover {
border: 2px dashed #999;
}
.file-drop-zone.clickable:focus {
border: 2px solid #5acde2;
}
.file-drop-zone .file-preview-thumbnails {
cursor: default;
}
.file-highlighted {
border: 2px dashed #999 !important;
background-color: #f0f0f0;
}
.file-uploading {
background: url('../img/loading-sm.gif') no-repeat center bottom 10px;
opacity: 0.65;
}
.file-thumb-progress {
height: 10px;
}
.file-thumb-progress .progress, .file-thumb-progress .progress-bar {
height: 10px;
font-size: 9px;
line-height: 10px;
}
.file-thumbnail-footer {
position: relative;
}
.file-thumb-progress {
position: absolute;
top: 35px;
left: 0;
right: 0;
}
.file-zoom-fullscreen.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.file-zoom-fullscreen .modal-dialog {
position: fixed;
margin: 0;
width: 100%;
height: 100%;
padding: 0;
}
.file-zoom-fullscreen .modal-content {
border-radius: 0;
box-shadow: none;
}
.file-zoom-fullscreen .modal-body {
overflow-y: auto;
}
.file-zoom-dialog .modal-body {
position: relative !important;
}
.file-zoom-dialog .btn-navigate {
position: absolute;
padding: 0;
margin: 0;
background: transparent;
text-decoration: none;
outline: none;
opacity: 0.7;
top: 45%;
font-size: 4em;
color: #1c94c4;
}
.file-zoom-dialog .floating-buttons {
position: absolute;
top: 5px;
right: 10px;
}
.floating-buttons, .floating-buttons .btn {
z-index: 3000;
}
.file-zoom-dialog .kv-zoom-actions .btn,
.floating-buttons .btn {
margin-left: 3px;
}
.file-zoom-dialog .btn-navigate:not([disabled]):hover,
.file-zoom-dialog .btn-navigate:not([disabled]):focus {
outline: none;
box-shadow: none;
opacity: 0.5;
}
.file-zoom-dialog .btn-navigate[disabled] {
opacity: 0.3;
}
.file-zoom-dialog .btn-prev {
left: 1px;
}
.file-zoom-dialog .btn-next {
right: 1px;
}
.file-drag-handle {
display: inline;
margin-right: 2px;
font-size: 16px;
cursor: move;
cursor: -webkit-grabbing;
}
.file-drag-handle:hover {
opacity: 0.7;
}
.file-zoom-content {
height: 480px;
text-align: center;
}
.file-preview-initial.sortable-chosen {
background-color: #d9edf7;
}
.file-preview-frame.sortable-ghost {
background-color: #eee;
}
/* IE 10 fix */
.btn-file ::-ms-browse {
width: 100%;
height: 100%;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,74 @@
/*!
* FileInput <_LANG_> Translations
*
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
*
* @see http://github.com/kartik-v/bootstrap-fileinput
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
(function ($) {
"use strict";
$.fn.fileinputLocales['_LANG_'] = {
fileSingle: 'file',
filePlural: 'files',
browseLabel: 'Browse &hellip;',
removeLabel: 'Remove',
removeTitle: 'Clear selected files',
cancelLabel: 'Cancel',
cancelTitle: 'Abort ongoing upload',
uploadLabel: 'Upload',
uploadTitle: 'Upload selected files',
msgNo: 'No',
msgNoFilesSelected: 'No files selected',
msgCancelled: 'Cancelled',
msgZoomModalHeading: 'Detailed Preview',
msgSizeTooSmall: 'File "{name}" (<b>{size} KB</b>) is too small and must be larger than <b>{minSize} KB</b>.',
msgSizeTooLarge: 'File "{name}" (<b>{size} KB</b>) exceeds maximum allowed upload size of <b>{maxSize} KB</b>.',
msgFilesTooLess: 'You must select at least <b>{n}</b> {files} to upload.',
msgFilesTooMany: 'Number of files selected for upload <b>({n})</b> exceeds maximum allowed limit of <b>{m}</b>.',
msgFileNotFound: 'File "{name}" not found!',
msgFileSecured: 'Security restrictions prevent reading the file "{name}".',
msgFileNotReadable: 'File "{name}" is not readable.',
msgFilePreviewAborted: 'File preview aborted for "{name}".',
msgFilePreviewError: 'An error occurred while reading the file "{name}".',
msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".',
msgInvalidFileType: 'Invalid type for file "{name}". Only "{types}" files are supported.',
msgInvalidFileExtension: 'Invalid extension for file "{name}". Only "{extensions}" files are supported.',
msgUploadAborted: 'The file upload was aborted',
msgUploadThreshold: 'Processing...',
msgValidationError: 'Validation Error',
msgLoading: 'Loading file {index} of {files} &hellip;',
msgProgress: 'Loading file {index} of {files} - {name} - {percent}% completed.',
msgSelected: '{n} {files} selected',
msgFoldersNotAllowed: 'Drag & drop files only! Skipped {n} dropped folder(s).',
msgImageWidthSmall: 'Width of image file "{name}" must be at least {size} px.',
msgImageHeightSmall: 'Height of image file "{name}" must be at least {size} px.',
msgImageWidthLarge: 'Width of image file "{name}" cannot exceed {size} px.',
msgImageHeightLarge: 'Height of image file "{name}" cannot exceed {size} px.',
msgImageResizeError: 'Could not get the image dimensions to resize.',
msgImageResizeException: 'Error while resizing the image.<pre>{errors}</pre>',
dropZoneTitle: 'Drag & drop files here &hellip;',
dropZoneClickTitle: '<br>(or click to select {files})',
fileActionSettings: {
removeTitle: 'Remove file',
uploadTitle: 'Upload file',
zoomTitle: 'View details',
dragTitle: 'Move / Rearrange',
indicatorNewTitle: 'Not uploaded yet',
indicatorSuccessTitle: 'Uploaded',
indicatorErrorTitle: 'Upload Error',
indicatorLoadingTitle: 'Uploading ...'
},
previewZoomButtonTitles: {
prev: 'View previous file',
next: 'View next file',
toggleheader: 'Toggle header',
fullscreen: 'Toggle full screen',
borderless: 'Toggle borderless mode',
close: 'Close detailed preview'
}
};
})(window.jQuery);

View File

@ -0,0 +1,76 @@
/*!
* FileInput Chinese Traditional Translations
*
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
*
* @see http://github.com/kartik-v/bootstrap-fileinput
* @author kangqf <kangqingfei@gmail.com>
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
(function ($) {
"use strict";
$.fn.fileinputLocales['zh-TW'] = {
fileSingle: '單一檔案',
filePlural: '複選檔案',
browseLabel: '瀏覽 &hellip;',
removeLabel: '移除',
removeTitle: '清除選取檔案',
cancelLabel: '取消',
cancelTitle: '取消上傳中檔案',
uploadLabel: '上傳',
uploadTitle: '上傳選取檔案',
msgNo: '沒有',
msgNoFilesSelected: '',
msgCancelled: '取消',
zoomTitle: '詳細資料',
msgZoomModalHeading: '內容預覽',
msgSizeTooSmall: 'File "{name}" (<b>{size} KB</b>) is too small and must be larger than <b>{minSize} KB</b>.',
msgSizeTooLarge: '檔案 "{name}" (<b>{size} KB</b>) 大小超過上限 <b>{maxSize} KB</b>.',
msgFilesTooLess: '最少必須選擇 <b>{n}</b> {files} 來上傳. ',
msgFilesTooMany: '上傳的檔案數量 <b>({n})</b> 超過最大檔案上傳限制 <b>{m}</b>.',
msgFileNotFound: '檔案 "{name}" 未發現!',
msgFileSecured: '安全限制,禁止讀取檔案 "{name}".',
msgFileNotReadable: '文件 "{name}" 不可讀取.',
msgFilePreviewAborted: '檔案 "{name}" 預覽中止.',
msgFilePreviewError: '讀取 "{name}" 發生錯誤.',
msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".',
msgInvalidFileType: '檔案類型錯誤 "{name}". 只能使用 "{types}" 類型的檔案.',
msgInvalidFileExtension: '附檔名錯誤 "{name}". 只能使用 "{extensions}" 的檔案.',
msgUploadAborted: '該文件上傳被中止',
msgUploadThreshold: 'Processing...',
msgValidationError: '驗證錯誤',
msgLoading: '載入第 {index} 個檔案,共 {files} &hellip;',
msgProgress: '載入第 {index} 個檔案,共 {files} - {name} - {percent}% 成功.',
msgSelected: '{n} {files} 選取',
msgFoldersNotAllowed: '只支援單檔拖曳! 無法使用 {n} 拖拽的資料夹.',
msgImageWidthSmall: '圖檔寬度"{name}"必須至少為{size}像素(px).',
msgImageHeightSmall: '圖檔高度"{name}"必須至少為{size}像素(px).',
msgImageWidthLarge: '圖檔寬度"{name}"不能超過{size}像素(px).',
msgImageHeightLarge: '圖檔高度"{name}"不能超過{size}像素(px).',
msgImageResizeError: '無法獲取的圖像尺寸調整。',
msgImageResizeException: '錯誤而調整圖像大小。<pre>{errors}</pre>',
dropZoneTitle: '拖曳檔案至此 &hellip;',
dropZoneClickTitle: '<br>(or click to select {files})',
fileActionSettings: {
removeTitle: '刪除檔案',
uploadTitle: '上傳檔案',
zoomTitle: '詳細資料',
dragTitle: 'Move / Rearrange',
indicatorNewTitle: '尚未上傳',
indicatorSuccessTitle: '上傳成功',
indicatorErrorTitle: '上傳失敗',
indicatorLoadingTitle: '上傳中 ...'
},
previewZoomButtonTitles: {
prev: 'View previous file',
next: 'View next file',
toggleheader: 'Toggle header',
fullscreen: 'Toggle full screen',
borderless: 'Toggle borderless mode',
close: 'Close detailed preview'
}
};
})(window.jQuery);

View File

@ -0,0 +1,75 @@
/*!
* FileInput Chinese Translations
*
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
*
* @see http://github.com/kartik-v/bootstrap-fileinput
* @author kangqf <kangqingfei@gmail.com>
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
(function ($) {
"use strict";
$.fn.fileinputLocales['zh'] = {
fileSingle: '文件',
filePlural: '个文件',
browseLabel: '选择 &hellip;',
removeLabel: '移除',
removeTitle: '清除选中文件',
cancelLabel: '取消',
cancelTitle: '取消进行中的上传',
uploadLabel: '上传',
uploadTitle: '上传选中文件',
msgNo: '没有',
msgNoFilesSelected: '',
msgCancelled: '取消',
msgZoomModalHeading: '详细预览',
msgSizeTooSmall: 'File "{name}" (<b>{size} KB</b>) 超过了大小下限 <b>{minSize} KB</b>.',
msgSizeTooLarge: '文件 "{name}" (<b>{size} KB</b>) 超过了大小上限 <b>{maxSize} KB</b>.',
msgFilesTooLess: '你必须选择最少 <b>{n}</b> {files} 来上传. ',
msgFilesTooMany: '选择的上传文件个数 <b>({n})</b> 超出最大文件的限制个数 <b>{m}</b>.',
msgFileNotFound: '文件 "{name}" 未找到!',
msgFileSecured: '安全限制,为了防止读取文件 "{name}".',
msgFileNotReadable: '文件 "{name}" 不可读.',
msgFilePreviewAborted: '取消 "{name}" 的预览.',
msgFilePreviewError: '读取 "{name}" 时出错.',
msgInvalidFileName: '"{name}" 的字符编码格式错误或系统不支持.',
msgInvalidFileType: '"{name}" 类型错误. 只支持 "{types}" 类型的文件.',
msgInvalidFileExtension: '"{name}" 文件扩展名错误. 只支持扩展名为"{extensions}" 的文件.',
msgUploadAborted: '该文件上传被中止',
msgUploadThreshold: '处理中...',
msgValidationError: '验证错误',
msgLoading: '加载第 {index} 文件 共 {files} &hellip;',
msgProgress: '加载第 {index} 文件 共 {files} - {name} - {percent}% 完成.',
msgSelected: '{n} {files} 选中',
msgFoldersNotAllowed: '只支持拖拽文件! 跳过 {n} 拖拽的文件夹.',
msgImageWidthSmall: '图像文件"{name}"的宽度必须是至少{size}像素.',
msgImageHeightSmall: '图像文件"{name}"的高度必须至少为{size}像素.',
msgImageWidthLarge: '图像文件"{name}"的宽度不能超过{size}像素.',
msgImageHeightLarge: '图像文件"{name}"的高度不能超过{size}像素.',
msgImageResizeError: '无法获取的图像尺寸调整。',
msgImageResizeException: '错误而调整图像大小。<pre>{errors}</pre>',
dropZoneTitle: '拖拽文件到这里 &hellip;<br>支持多文件同时上传',
dropZoneClickTitle: '<br>(或点击{files}按钮选择文件)',
fileActionSettings: {
removeTitle: '删除文件',
uploadTitle: '上传文件',
zoomTitle: '查看详情',
dragTitle: '移动 / 重置',
indicatorNewTitle: '没有上传',
indicatorSuccessTitle: '上传',
indicatorErrorTitle: '上传错误',
indicatorLoadingTitle: '上传 ...'
},
previewZoomButtonTitles: {
prev: '预览上一个文件',
next: '预览下一个文件',
toggleheader: '缩放',
fullscreen: '全屏',
borderless: '无边界模式',
close: '关闭当前预览'
}
};
})(window.jQuery);

Some files were not shown because too many files have changed in this diff Show More