🌴 Sync 2026-03-05 23:51:42

This commit is contained in:
github-actions[bot] committed 2026-03-05 23:51:42 +08:00
1 parent 97c049ed0a
commit 0acff03804
14253 files changed
+3893239

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2025 ImmortalWrt.org
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for RustDesk Server
LUCI_DEPENDS:=+rustdesk-server
PKG_LICENSE:=Apache-2.0
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
@@ -0,0 +1,112 @@
// SPDX-License-Identifier: Apache-2.0
'use strict';
'require form';
'require poll';
'require rpc';
'require view';
const callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: ['name'],
expect: { '': {} }
});
function getServiceStatus() {
return L.resolveDefault(callServiceList('rustdesk-server'), {}).then(function(res) {
const status = {
hbbs: res?.['rustdesk-server']?.['instances']?.['hbbs']?.['running'],
hbbr: res?.['rustdesk-server']?.['instances']?.['hbbr']?.['running']
};
return status;
});
}
function renderStatus(status) {
const spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
let renderHTML = [];
for (let i in status) {
const color = (status[i] === true) ? 'green' : 'red';
const service = (i === 'hbbs') ? _('RustDesk Server') : _('RustDesk Relay');
const running = (status[i] === true) ? _('RUNNING') : _('NOT RUNNING');
renderHTML.push(spanTemp.format(color, service, running));
}
return renderHTML;
}
return view.extend({
render() {
let m, s, o;
m = new form.Map('rustdesk-server', _('RustDesk Server'));
s = m.section(form.TypedSection);
s.anonymous = true;
s.render = function() {
poll.add(function() {
return L.resolveDefault(getServiceStatus()).then(function(res) {
const stats = renderStatus(res);
const srvs = [ 'hbbr_status', 'hbbs_status' ];
for (let i in srvs) {
let view = document.getElementById(srvs[i]);
view.innerHTML = stats[i];
}
});
});
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
E('p', { id: 'hbbr_status' }, _('Collecting data…')),
E('p', { id: 'hbbs_status' }, _('Collecting data…'))
]);
}
s = m.section(form.NamedSection, 'global', 'rustdesk-server', _('Global settings'));
o = s.option(form.Value, 'port', _('Listen port'));
o.datatype = 'port';
o.placeholder = '21116';
o = s.option(form.Value, 'key', _('Key'),
_('Force the use of a specific key if set. Force the use of any key if set to "_".'));
o = s.option(form.Flag, 'auto_fw', _('Allow connection from Internet'));
s = m.section(form.NamedSection, 'hbbs', 'rustdesk-server', _('Server settings'));
o = s.option(form.Flag, 'enabled', _('Enable RustDesk Server'));
o = s.option(form.Flag, 'always_use_relay', _('Always use relay'),
_('Disallows direct peer connection if enabled.'));
o.enabled = 'Y';
o.disabled = 'N';
s = m.section(form.NamedSection, 'hbbr', 'rustdesk-server', _('Relay settings'));
o = s.option(form.Flag, 'enabled', _('Enable RustDesk Relay'));
o = s.option(form.Value, 'downgrade_start_check', _('Downgrade check delay'),
_('Delay before downgrade check (in seconds).'));
o.datatype = 'uinteger';
o = s.option(form.Value, 'downgrade_threshold', _('Downgrade check threshold'),
_('Threshold of downgrade check (bit/ms).'));
o.datatype = 'ufloat';
o = s.option(form.Value, 'limit_speed', _('Speed limit'),
_('Speed limit (in Mb/s).'));
o.datatype = 'uinteger';
o = s.option(form.Value, 'total_bandwidth', _('Total bandwidth'),
_('Max total bandwidth (in Mb/s).'));
o.datatype = 'uinteger';
o = s.option(form.Value, 'single_bandwidth', _('Single bandwidth'),
_('Max bandwidth for a single connection (in Mb/s).'));
o.datatype = 'uinteger';
return m.render();
}
});
@@ -0,0 +1,115 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:75
msgid "Allow connection from Internet"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:81
msgid "Always use relay"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:61
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:62
msgid "Collecting data…"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:91
msgid "Delay before downgrade check (in seconds)."
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:82
msgid "Disallows direct peer connection if enabled."
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:90
msgid "Downgrade check delay"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:94
msgid "Downgrade check threshold"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:88
msgid "Enable RustDesk Relay"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:79
msgid "Enable RustDesk Server"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:73
msgid ""
"Force the use of a specific key if set. Force the use of any key if set to "
"\"_\"."
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:66
msgid "Global settings"
msgstr ""
#: applications/luci-app-rustdesk-server/root/usr/share/rpcd/acl.d/luci-app-rustdesk-server.json:3
msgid "Grant UCI access for luci-app-rustdesk-server"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:72
msgid "Key"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:68
msgid "Listen port"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:107
msgid "Max bandwidth for a single connection (in Mb/s)."
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:103
msgid "Max total bandwidth (in Mb/s)."
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:33
msgid "NOT RUNNING"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:33
msgid "RUNNING"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:86
msgid "Relay settings"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:32
msgid "RustDesk Relay"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:32
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:44
#: applications/luci-app-rustdesk-server/root/usr/share/luci/menu.d/luci-app-rustdesk-server.json:3
msgid "RustDesk Server"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:77
msgid "Server settings"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:106
msgid "Single bandwidth"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:98
msgid "Speed limit"
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:99
msgid "Speed limit (in Mb/s)."
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:95
msgid "Threshold of downgrade check (bit/ms)."
msgstr ""
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:102
msgid "Total bandwidth"
msgstr ""
+1
View File
@@ -0,0 +1 @@
zh_Hans
@@ -0,0 +1,124 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:75
msgid "Allow connection from Internet"
msgstr "允许从互联网连接"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:81
msgid "Always use relay"
msgstr "始终使用中继器"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:61
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:62
msgid "Collecting data…"
msgstr "正在收集数据中…"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:91
msgid "Delay before downgrade check (in seconds)."
msgstr "降级检查延迟(单位:秒)"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:82
msgid "Disallows direct peer connection if enabled."
msgstr "如果启用,则不允许直接连接对端。"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:90
msgid "Downgrade check delay"
msgstr "降级检查延迟"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:94
msgid "Downgrade check threshold"
msgstr "降级检查阈值"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:88
msgid "Enable RustDesk Relay"
msgstr "启用 RustDesk 中继器"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:79
msgid "Enable RustDesk Server"
msgstr "启用 RustDesk 服务器"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:73
msgid ""
"Force the use of a specific key if set. Force the use of any key if set to "
"\"_\"."
msgstr ""
"如果设置了特定的密钥,则强制使用该密钥。如果设置为“_”,则允许使用任何密钥连"
"接。"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:66
msgid "Global settings"
msgstr "全局设置"
#: applications/luci-app-rustdesk-server/root/usr/share/rpcd/acl.d/luci-app-rustdesk-server.json:3
msgid "Grant UCI access for luci-app-rustdesk-server"
msgstr "授予 luci-app-rustdesk-server 访问 UCI 配置的权限"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:72
msgid "Key"
msgstr "密钥"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:68
msgid "Listen port"
msgstr "监听端口"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:107
msgid "Max bandwidth for a single connection (in Mb/s)."
msgstr "单个连接的最大带宽(单位:Mb/s)"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:103
msgid "Max total bandwidth (in Mb/s)."
msgstr "最大总带宽(单位:Mb/s)"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:33
msgid "NOT RUNNING"
msgstr "未运行"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:33
msgid "RUNNING"
msgstr "运行中"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:86
msgid "Relay settings"
msgstr "中继器设置"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:32
msgid "RustDesk Relay"
msgstr "RustDesk 中继器"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:32
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:44
#: applications/luci-app-rustdesk-server/root/usr/share/luci/menu.d/luci-app-rustdesk-server.json:3
msgid "RustDesk Server"
msgstr "RustDesk 服务器"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:77
msgid "Server settings"
msgstr "服务器设置"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:106
msgid "Single bandwidth"
msgstr "单个带宽"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:98
msgid "Speed limit"
msgstr "速度限制"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:99
msgid "Speed limit (in Mb/s)."
msgstr "速度限制(单位:Mb/s)"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:95
msgid "Threshold of downgrade check (bit/ms)."
msgstr "降级检查阈值(单位:bit/ms)"
#: applications/luci-app-rustdesk-server/htdocs/luci-static/resources/view/rustdesk-server.js:102
msgid "Total bandwidth"
msgstr "总带宽"
@@ -0,0 +1,13 @@
{
"admin/services/rustdesk-server": {
"title": "RustDesk Server",
"action": {
"type": "view",
"path": "rustdesk-server"
},
"depends": {
"acl": [ "luci-app-rustdesk-server" ],
"uci": { "rustdesk-server": true }
}
}
}
@@ -0,0 +1,14 @@
{
"luci-app-rustdesk-server": {
"description": "Grant UCI access for luci-app-rustdesk-server",
"read": {
"ubus": {
"service": [ "list" ]
},
"uci": [ "rustdesk-server" ]
},
"write": {
"uci": [ "rustdesk-server" ]
}
}
}