update 2025-01-22 16:25:57

This commit is contained in:
kenzok8 2025-01-22 16:25:57 +08:00
parent 290f9c9f4f
commit 9a1e226c84
9 changed files with 78 additions and 8 deletions

View File

@ -130,10 +130,10 @@ const proxy_group_type = [
const routing_port_type = [
['all', _('All ports')],
['common_tcpport', _('Common ports only (bypass P2P traffic)')],
['common_udpport', _('Common ports only (bypass P2P traffic)')],
['stun_port', _('STUN ports')],
['turn_port', _('TURN ports')],
['common_tcpport', _('Common ports only (bypass P2P traffic)'), uci.get('fchomo', 'routing', 'common_tcpport') || '20-21,22,53,80,110,143,443,465,853,873,993,995,5222,8080,8443,9418'],
['common_udpport', _('Common ports only (bypass P2P traffic)'), uci.get('fchomo', 'routing', 'common_udpport') || '20-21,22,53,80,110,143,443,853,993,995,8080,8443,9418'],
['stun_port', _('STUN ports'), uci.get('fchomo', 'routing', 'stun_port') || '3478,19302'],
['turn_port', _('TURN ports'), uci.get('fchomo', 'routing', 'turn_port') || '5349'],
];
const rules_type = [
@ -292,6 +292,12 @@ const CBIListValue = form.ListValue.extend({
}
});
const CBIRichMultiValue = form.MultiValue.extend({
__name__: 'CBI.RichMultiValue',
value: (form.RichListValue || form.MultiValue).prototype.value
});
const CBIStaticList = form.DynamicList.extend({
__name__: 'CBI.StaticList',
@ -1153,6 +1159,7 @@ return baseclass.extend({
DynamicList: CBIDynamicList,
GenValue: CBIGenValue,
ListValue: CBIListValue,
RichMultiValue: CBIRichMultiValue,
StaticList: CBIStaticList,
TextValue: CBITextValue,

View File

@ -726,7 +726,7 @@ return view.extend({
/* Routing control */
ss.tab('routing_control', _('Routing Control'));
so = ss.taboption('routing_control', form.MultiValue, 'routing_tcpport', _('Routing ports') + ' (TCP)',
so = ss.taboption('routing_control', hm.RichMultiValue, 'routing_tcpport', _('Routing ports') + ' (TCP)',
_('Specify target ports to be proxied. Multiple ports must be separated by commas.'));
so.create = true;
hm.routing_port_type.forEach((res) => {
@ -735,7 +735,7 @@ return view.extend({
})
so.validate = L.bind(hm.validateCommonPort, so);
so = ss.taboption('routing_control', form.MultiValue, 'routing_udpport', _('Routing ports') + ' (UDP)',
so = ss.taboption('routing_control', hm.RichMultiValue, 'routing_udpport', _('Routing ports') + ' (UDP)',
_('Specify target ports to be proxied. Multiple ports must be separated by commas.'));
so.create = true;
hm.routing_port_type.forEach((res) => {

View File

@ -11,7 +11,7 @@ LUCI_DEPENDS:=+curl +opkg +luci-base +tar +libuci-lua +mount-utils +luci-lib-tas
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.19)
LUCI_PKGARCH:=all
PKG_VERSION:=0.1.27-3
PKG_VERSION:=0.1.27-4
# PKG_RELEASE MUST be empty for luci.mk
PKG_RELEASE:=

View File

@ -36,6 +36,7 @@
<script>
(function() {
let beforeunloadRegistered = false;
taskd.show_mask_on_stopped = true;
window.istore_log = function(flush_menu_onclose, onExit) {
if (flush_menu_onclose && !beforeunloadRegistered) {
beforeunloadRegistered = true;

View File

@ -11,7 +11,7 @@ LUCI_DEPENDS:=+luci-lib-xterm +taskd
LUCI_EXTRA_DEPENDS:=taskd (>=1.0.3-1)
LUCI_PKGARCH:=all
PKG_VERSION:=1.0.20
PKG_VERSION:=1.0.22
PKG_RELEASE:=
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>

View File

@ -45,6 +45,7 @@
overflow: hidden;
}
.dialog-content {
position: relative;
max-height: 500px;
overflow-y: scroll;
margin-right: -10px;
@ -109,4 +110,42 @@
border-color: darkorange;
}
#tasks_result_mask {
display: none;
background-color: #000d;
position: absolute;
left: 0;
top: 0;
z-index: 100;
width: 100%;
height: 100%;
cursor: default;
user-select: none;
font-size: small;
}
.tasks_stopped #tasks_result_mask {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.tasks_result_success, .tasks_stopped.tasks_failed .tasks_result_success, .tasks_result_failed {
display: none;
font-size: xx-large;
}
.tasks_stopped .tasks_result_success {
display: initial;
color: #27c840;
}
.tasks_failed .tasks_result_failed {
display: initial;
color: darkorange;
}
@keyframes border-blink { 50% { border-color:#fff ; } }

View File

@ -66,6 +66,14 @@
return false;
};
}
const tasks_result_mask = container.querySelector("#tasks_result_mask");
if (taskd.show_mask_on_stopped) {
tasks_result_mask.onclick = function(){
tasks_result_mask.hidden=true;
};
} else {
tasks_result_mask.hidden=true;
}
term.open(document.getElementById("tasks_xterm_log"));
return {term,container};

View File

@ -28,6 +28,12 @@
</div>
<div class="dialog-content">
<div id="tasks_xterm_log"></div>
<div id="tasks_result_mask">
<span class="tasks_result_success"><%:Task execution successful !%></span>
<span class="tasks_result_failed"><%:Task execution failed !%></span>
<br/>
<span><%:Click the button in the upper right corner of the dialog box to close it, or click here to view the log%></span>
</div>
</div>
</div>
`;

View File

@ -39,3 +39,12 @@ msgstr "点此查看运行中的任务"
msgid "Task Running"
msgstr "任务执行中"
msgid "Task execution successful !"
msgstr "任务执行成功!"
msgid "Task execution failed !"
msgstr "任务执行失败!"
msgid "Click the button in the upper right corner of the dialog box to close it, or click here to view the log"
msgstr "点击对话框右上角按钮关闭,或者点此查看日志"