Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c8d00d18c | ||
|
|
e28fd0631a | ||
|
|
029903be2e |
@@ -7,13 +7,13 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=alist
|
PKG_NAME:=alist
|
||||||
PKG_VERSION:=3.63.0
|
PKG_VERSION:=3.64.0
|
||||||
PKG_WEB_VERSION:=3.64.0
|
PKG_WEB_VERSION:=3.64.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/AlistGo/alist/tar.gz/v$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/AlistGo/alist/tar.gz/v$(PKG_VERSION)?
|
||||||
PKG_HASH:=a850506424e695bbbf411a928711588bcb8274d64b88029ecf0856cc4c21763b
|
PKG_HASH:=599065ec4b26375e4012cf212415f4195c9b92864bdcde4105356261920563f4
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-3.0
|
PKG_LICENSE:=GPL-3.0
|
||||||
PKG_LICENSE_FILE:=LICENSE
|
PKG_LICENSE_FILE:=LICENSE
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 389 KiB |
|
After Width: | Height: | Size: 640 KiB |
|
After Width: | Height: | Size: 550 KiB |
|
After Width: | Height: | Size: 547 KiB |
|
After Width: | Height: | Size: 659 KiB |
|
After Width: | Height: | Size: 650 KiB |
@@ -16,25 +16,34 @@ return view.extend({
|
|||||||
|
|
||||||
load: function () {
|
load: function () {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
this.callHostHints(),
|
this.callHostHints()
|
||||||
fs.read('/proc/net/arp')
|
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
parseArp: function (data) {
|
parseHostHints: function (data) {
|
||||||
var lines = data.split('\n'),
|
var hosts = [];
|
||||||
hosts = [];
|
|
||||||
|
|
||||||
for (var i = 1; i < lines.length; i++) {
|
Object.keys(data || {}).forEach(function (mac) {
|
||||||
var columns = lines[i].replace(/ +/g, ' ').split(' ');
|
var hint = data[mac] || {},
|
||||||
|
ipaddrs = hint.ipaddrs || hint.ipv4 || [];
|
||||||
|
|
||||||
if (columns.length >= 6) {
|
if (!Array.isArray(ipaddrs))
|
||||||
hosts.push({
|
ipaddrs = [ ipaddrs ];
|
||||||
ip: columns[0],
|
|
||||||
mac: columns[3]
|
ipaddrs.forEach(function (ip) {
|
||||||
});
|
var octets = (typeof(ip) === 'string' && /^\d{1,3}(\.\d{1,3}){3}$/.test(ip))
|
||||||
}
|
? ip.split('.').map(Number) : [];
|
||||||
}
|
|
||||||
|
if (octets.length === 4 && octets.every(function (octet) {
|
||||||
|
return octet >= 0 && octet <= 255;
|
||||||
|
})) {
|
||||||
|
hosts.push({
|
||||||
|
ip: ip,
|
||||||
|
mac: mac
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Sort hosts array by IP address
|
// Sort hosts array by IP address
|
||||||
hosts.sort(function (a, b) {
|
hosts.sort(function (a, b) {
|
||||||
@@ -62,8 +71,7 @@ return view.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render: function (data) {
|
render: function (data) {
|
||||||
var arpData = data[1],
|
var hosts = this.parseHostHints(data[0]),
|
||||||
hosts = this.parseArp(arpData),
|
|
||||||
m, s, o,
|
m, s, o,
|
||||||
programPath = '/usr/share/wechatpush/wechatpush';
|
programPath = '/usr/share/wechatpush/wechatpush';
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
"read": {
|
"read": {
|
||||||
"file": {
|
"file": {
|
||||||
"/etc/init.d/wechatpush": [ "exec" ],
|
"/etc/init.d/wechatpush": [ "exec" ],
|
||||||
"/proc/net/arp": [ "read" ],
|
|
||||||
"/usr/share/wechatpush/wechatpush": [ "exec" ],
|
"/usr/share/wechatpush/wechatpush": [ "exec" ],
|
||||||
"/tmp/wechatpush/*": [ "read" ],
|
"/tmp/wechatpush/*": [ "read" ],
|
||||||
"/usr/share/wechatpush/api/*": [ "read" ],
|
"/usr/share/wechatpush/api/*": [ "read" ],
|
||||||
"/usr/libexec/wechatpush-call": [ "exec" ]
|
"/usr/libexec/wechatpush-call": [ "exec" ]
|
||||||
},
|
},
|
||||||
"ubus": {
|
"ubus": {
|
||||||
|
"luci-rpc": [ "getHostHints" ],
|
||||||
"service": [ "list" ]
|
"service": [ "list" ]
|
||||||
},
|
},
|
||||||
"uci": [ "wechatpush" ]
|
"uci": [ "wechatpush" ]
|
||||||
|
|||||||