✨ Sync 2026-03-24 20:29:24

This commit is contained in:
github-actions[bot] committed 2026-03-24 20:29:24 +08:00
1 parent 6ab1ed486a
commit bc5ced2168
6 files changed
+82 -10

No files matched your search

@@ -4,6 +4,39 @@
'require view';
'require poll';
const DEFAULT_CONFIG_FILE = '/etc/adguardhome/adguardhome.yaml';
const DEFAULT_WORK_DIR = '/var/lib/adguardhome';
const DEFAULT_USER = 'adguardhome';
const DEFAULT_GROUP = DEFAULT_USER;
const PATH_REGEX = new RegExp('^/etc(/[^/]+)?/?$');
function validateConfigFile(_unused, value) {
if (value == null || value === '') {
return true;
}
if (!value.startsWith('/')) {
return _('Path must be absolute.');
}
if (value.endsWith('/')) {
return _('Path must not end with a slash.');
}
if (PATH_REGEX.test(value)) {
return _('Configuration file must be stored in its own directory, and not in \'/etc\'.');
}
return true;
}
function validateWorkDir(_unused, value) {
if (value == null || value === '') {
return true;
}
if (!value.startsWith('/')) {
return _('Path must be absolute.');
}
return true;
}
function renderStatus(status, agh_config) {
var spanTemp = '<span style="color:%s"><strong>%s %s</strong></span>';
var renderHTML;
@@ -65,9 +98,23 @@ return view.extend({
o.default = o.disabled;
o.rmempty = false;
o = s.option(form.Value, 'workdir', _('Work Dir'));
o = s.option(form.Value, 'config_file', _('Configuration file'));
o.datatype = 'string';
o.default = '/var/lib/adguardhome';
o.placeholder = DEFAULT_CONFIG_FILE;
o.validate = validateConfigFile;
o = s.option(form.Value, 'work_dir', _('Work Dir'));
o.datatype = 'string';
o.placeholder = DEFAULT_WORK_DIR;
o.validate = validateWorkDir;
o = s.option(form.Value, 'user', _('Service user'), _('User the service runs under.'));
o.datatype = 'string';
o.placeholder = DEFAULT_USER;
o = s.option(form.Value, 'group', _('Service group'), _('Group the service runs under.'));
o.datatype = 'string';
o.placeholder = DEFAULT_GROUP;
// 添加重定向模式选择
o = s.option(form.ListValue, 'redirect', _('Redirect'), _('AdGuardHome redirect mode'));
+11 -2
View File
@@ -163,8 +163,17 @@ msgstr "使用53端口替换dnsmasq"
msgid "AdGuardHome redirect mode"
msgstr "重定向模式"
msgid "Change Password"
msgstr "修改密码"
msgid "Work Dir"
msgstr "工作目录"
msgid "Change Password"
msgstr "修改密码"
msgid "Service user"
msgstr "以此用户权限运行"
msgid "Service group"
msgstr "以此用户组权限运行"
msgid "Configuration file"
msgstr "配置文件"
@@ -5,6 +5,10 @@ local api = require "luci.passwall.api"
<script type="text/javascript">
//<![CDATA[
function ajax_add_node(link, group) {
const dom = document.getElementById('modal-mask');
dom.style.display = 'block';
dom.innerHTML = '<div style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;"><%:Processing, please wait…%></div>';
const chunkSize = 1000; // 分片发送以突破uhttpd的限制,每块1000字符
const totalChunks = Math.ceil(link.length / chunkSize);
let currentChunk = 0;
@@ -19,11 +23,15 @@ local api = require "luci.passwall.api"
currentChunk++;
sendNextChunk();
} else {
dom.innerHTML = '';
dom.style.display = 'none';
alert("<%:Error%>");
return;
}
};
xhr.onerror = function () {
dom.innerHTML = '';
dom.style.display = 'none';
alert("<%:Network Error%>");
return;
};
@@ -93,6 +101,7 @@ local api = require "luci.passwall.api"
nodes_link = decodeIfBase64(nodes_link);
let s = nodes_link.split('://');
if (s.length > 1) {
close_add_link_div();
ajax_add_node(nodes_link, group);
} else {
alert("<%:Please enter the correct link.%>");
@@ -399,11 +399,16 @@ table td, .table .td {
}
}
if (ids.length > 0) {
if (confirm('<%:Are you sure to delete select nodes?%>') == true){
const dom = document.getElementById('modal-mask');
if (confirm('<%:Are you sure to delete select nodes?%>') == true) {
dom.style.display = 'block';
dom.innerHTML = '<div style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;"><%:Processing, please wait…%></div>';
XHR.get('<%=api.url("delete_select_nodes")%>', {
ids: ids.join()
},
function(x, data) {
dom.innerHTML = '';
dom.style.display = 'none';
if (x && x.status == 200) {
/*
for (var i = 0 ; i < ids.length; i++) {
@@ -413,8 +418,7 @@ table td, .table .td {
*/
ajaxAbortAll();
window.location.href = '<%=api.url("node_list")%>';
}
else {
} else {
alert("<%:Error%>");
}
});
+3
View File
@@ -2110,3 +2110,6 @@ msgstr "搜索节点…"
msgid "Concurrent Tunnels"
msgstr "并发隧道连接数"
msgid "Processing, please wait…"
msgstr "正在处理,请稍候…"
+3 -3
View File
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mtproxy
PKG_VERSION:=3.0.15
PKG_RELEASE:=6
PKG_VERSION:=3.0.16
PKG_RELEASE:=7
PKG_MAINTAINER:=Kosntantine Shevlakov <shevlakov@132lan.ru>
PKG_LICENSE:=GPLv2
@@ -10,7 +10,7 @@ PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/GetPageSpeed/MTProxy.git
PKG_SOURCE_VERSION:=5e6c9c3726eca633ac7bf42f524b41f420ed33e6
PKG_SOURCE_VERSION:=09ee9fb60d13adc513896eced99f80d3d45614b4
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz