Skip to content
Open

11 #162

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,7 @@ jobs:
fail-fast: false
matrix:
arch:
- aarch64_cortex-a53
- aarch64_cortex-a72
- aarch64_generic
- arm_arm1176jzf-s_vfp
- arm_arm926ej-s
- arm_cortex-a15_neon-vfpv4
- arm_cortex-a5_vfpv4
- arm_cortex-a7
- arm_cortex-a7_neon-vfpv4
- arm_cortex-a8_vfpv3
- arm_cortex-a9
- arm_cortex-a9_neon
- arm_cortex-a9_vfpv3-d16
- arm_fa526
#- arm_mpcore
- arm_xscale
- mips_24kc
#- mips_4kec
- mips_mips32
- mipsel_24kc
- mipsel_24kc_24kf
- mipsel_74kc
- mipsel_mips32
- x86_64

sdk:
- 22.03.7
- SNAPSHOT
Expand Down Expand Up @@ -140,5 +116,3 @@ jobs:

tag_name: ${{ env.TAG }}
files: release/*.zip


62 changes: 31 additions & 31 deletions luci-app-easytier/luasrc/controller/easytier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,37 @@ function index()
return
end

entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
entry({"admin", "vpn", "easytier"}, firstchild(),_("EasyTier"), 46).dependent = true
entry({"admin", "vpn", "easytier", "status"}, cbi("easytier_status"),_("Status"), 1).leaf = true
entry({"admin", "vpn", "easytier", "config"}, cbi("easytier"),_("EasyTier Core"), 2).leaf = true
entry({"admin", "vpn", "easytier", "webconsole"}, template("easytier/easytier_web"),_("EasyTier Web"), 3).leaf = true
entry({"admin", "vpn", "easytier", "log"}, template("easytier/easytier_log"),_("Logs"), 4).leaf = true
entry({"admin", "vpn", "easytier", "upload"}, template("easytier/easytier_upload"),_("Upload Program"), 5).leaf = true
entry({"admin", "vpn", "easytier", "upload_binary"}, call("upload_binary")).leaf = true
entry({"admin", "vpn", "easytier", "get_upload_config"}, call("get_upload_config")).leaf = true
entry({"admin", "vpn", "easytier", "save_upload_config"}, call("save_upload_config")).leaf = true
entry({"admin", "vpn", "easytier", "get_disk_space"}, call("get_disk_space")).leaf = true
entry({"admin", "vpn", "easytier", "get_tun_info"}, call("get_tun_info")).leaf = true
entry({"admin", "vpn", "easytier", "get_log"}, call("get_log")).leaf = true
entry({"admin", "vpn", "easytier", "get_log_size"}, call("get_log_size")).leaf = true
entry({"admin", "vpn", "easytier", "clear_log"}, call("clear_log")).leaf = true
entry({"admin", "vpn", "easytier", "get_wlog"}, call("get_wlog")).leaf = true
entry({"admin", "vpn", "easytier", "get_wlog_size"}, call("get_wlog_size")).leaf = true
entry({"admin", "vpn", "easytier", "clear_wlog"}, call("clear_wlog")).leaf = true
entry({"admin", "vpn", "easytier", "clear_version_cache"}, call("clear_version_cache")).leaf = true
entry({"admin", "vpn", "easytier", "get_web_config"}, call("get_web_config")).leaf = true
entry({"admin", "vpn", "easytier", "save_web_config"}, call("save_web_config")).leaf = true
entry({"admin", "vpn", "easytier", "reset_database"}, call("reset_database")).leaf = true
entry({"admin", "vpn", "easytier", "check_web_status"}, call("check_web_status")).leaf = true
entry({"admin", "vpn", "easytier", "api_status"}, call("act_status")).leaf = true
entry({"admin", "vpn", "easytier", "api_conninfo"}, call("act_conninfo")).leaf = true
entry({"admin", "vpn", "easytier", "restart_service"}, call("restart_service")).leaf = true
entry({"admin", "vpn", "easytier", "toggle_core"}, call("toggle_core")).leaf = true
entry({"admin", "vpn", "easytier", "toggle_web"}, call("toggle_web")).leaf = true
entry({"admin", "vpn", "easytier", "download_easytier"}, call("download_easytier")).leaf = true
entry({"admin", "vpn", "easytier", "download_progress"}, call("download_progress")).leaf = true
entry({"admin", "vpn", "easytier", "cancel_download"}, call("cancel_download")).leaf = true
entry({"admin", "services"}, firstchild(), "Services", 45).dependent = false
entry({"admin", "services", "easytier"}, firstchild(),_("EasyTier"), 46).dependent = true
entry({"admin", "services", "easytier", "status"}, cbi("easytier_status"),_("Status"), 1).leaf = true
entry({"admin", "services", "easytier", "config"}, cbi("easytier"),_("EasyTier Core"), 2).leaf = true
entry({"admin", "services", "easytier", "webconsole"}, template("easytier/easytier_web"),_("EasyTier Web"), 3).leaf = true
entry({"admin", "services", "easytier", "log"}, template("easytier/easytier_log"),_("Logs"), 4).leaf = true
entry({"admin", "services", "easytier", "upload"}, template("easytier/easytier_upload"),_("Upload Program"), 5).leaf = true
entry({"admin", "services", "easytier", "upload_binary"}, call("upload_binary")).leaf = true
entry({"admin", "services", "easytier", "get_upload_config"}, call("get_upload_config")).leaf = true
entry({"admin", "services", "easytier", "save_upload_config"}, call("save_upload_config")).leaf = true
entry({"admin", "services", "easytier", "get_disk_space"}, call("get_disk_space")).leaf = true
entry({"admin", "services", "easytier", "get_tun_info"}, call("get_tun_info")).leaf = true
entry({"admin", "services", "easytier", "get_log"}, call("get_log")).leaf = true
entry({"admin", "services", "easytier", "get_log_size"}, call("get_log_size")).leaf = true
entry({"admin", "services", "easytier", "clear_log"}, call("clear_log")).leaf = true
entry({"admin", "services", "easytier", "get_wlog"}, call("get_wlog")).leaf = true
entry({"admin", "services", "easytier", "get_wlog_size"}, call("get_wlog_size")).leaf = true
entry({"admin", "services", "easytier", "clear_wlog"}, call("clear_wlog")).leaf = true
entry({"admin", "services", "easytier", "clear_version_cache"}, call("clear_version_cache")).leaf = true
entry({"admin", "services", "easytier", "get_web_config"}, call("get_web_config")).leaf = true
entry({"admin", "services", "easytier", "save_web_config"}, call("save_web_config")).leaf = true
entry({"admin", "services", "easytier", "reset_database"}, call("reset_database")).leaf = true
entry({"admin", "services", "easytier", "check_web_status"}, call("check_web_status")).leaf = true
entry({"admin", "services", "easytier", "api_status"}, call("act_status")).leaf = true
entry({"admin", "services", "easytier", "api_conninfo"}, call("act_conninfo")).leaf = true
entry({"admin", "services", "easytier", "restart_service"}, call("restart_service")).leaf = true
entry({"admin", "services", "easytier", "toggle_core"}, call("toggle_core")).leaf = true
entry({"admin", "services", "easytier", "toggle_web"}, call("toggle_web")).leaf = true
entry({"admin", "services", "easytier", "download_easytier"}, call("download_easytier")).leaf = true
entry({"admin", "services", "easytier", "download_progress"}, call("download_progress")).leaf = true
entry({"admin", "services", "easytier", "cancel_download"}, call("cancel_download")).leaf = true
end

function act_status()
Expand Down
44 changes: 42 additions & 2 deletions luci-app-easytier/luasrc/view/easytier/easytier_cli.htm
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,46 @@
var lines = content.split(/\r?\n/).filter(function(l) { return l.trim() !== ''; });

if (lines.length === 0 || lines[0].indexOf('|') === -1) {
// 启动参数不翻译
if (tabName === 'cmdline') {
var html = '<div class="et-pre">' + escapeHtml(content) + '</div>';

// 检查是否使用配置文件启动
if (content.indexOf('--config-file') !== -1 || content.match(/-c\s+\//)) {
XHR.get('<%=url("admin/services/easytier/api_conninfo")%>', null, function(x, data) {
if (data && data.config_file) {
var configDiv = document.createElement('div');
configDiv.className = 'et-pre';
configDiv.style.marginTop = '16px';
configDiv.style.borderTop = '2px solid var(--border-color)';
configDiv.style.paddingTop = '16px';

var title = document.createElement('div');
title.style.fontWeight = '600';
title.style.marginBottom = '8px';
title.style.color = 'var(--primary-color)';
title.textContent = tr('Configuration File Content') + ':';

var contentDiv = document.createElement('pre');
contentDiv.style.margin = '0';
contentDiv.style.whiteSpace = 'pre-wrap';
contentDiv.style.wordBreak = 'break-all';
contentDiv.textContent = data.config_file;

configDiv.appendChild(title);
configDiv.appendChild(contentDiv);

var container = document.querySelector('.et-tab-content[data-tab="cmdline"]');
if (container) {
container.appendChild(configDiv);
}
}
});
}

return html;
}

// 对非表格内容进行全面翻译处理
var translatedContent = content;

Expand Down Expand Up @@ -1214,7 +1254,7 @@
btnText.textContent = '<%:Refreshing...%>';

var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "api_conninfo")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "api_conninfo")%>', true);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
isRefreshing = false;
Expand Down Expand Up @@ -1495,7 +1535,7 @@
}

// 自动刷新
XHR.poll(5, '<%=url("admin", "vpn", "easytier", "api_conninfo")%>', null, function(x, data) {
XHR.poll(5, '<%=url("admin", "services", "easytier", "api_conninfo")%>', null, function(x, data) {
if (!isRefreshing) {
updateConnInfo(data);
}
Expand Down
12 changes: 6 additions & 6 deletions luci-app-easytier/luasrc/view/easytier/easytier_log.htm
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@

function refreshLog() {
var url = currentLog === 'core'
? '<%=url("admin/vpn/easytier/get_log")%>'
: '<%=url("admin/vpn/easytier/get_wlog")%>';
? '<%=url("admin/services/easytier/get_log")%>'
: '<%=url("admin/services/easytier/get_wlog")%>';

var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
Expand Down Expand Up @@ -446,8 +446,8 @@

function updateLogSize() {
var url = currentLog === 'core'
? '<%=url("admin/vpn/easytier/get_log_size")%>'
: '<%=url("admin/vpn/easytier/get_wlog_size")%>';
? '<%=url("admin/services/easytier/get_log_size")%>'
: '<%=url("admin/services/easytier/get_wlog_size")%>';

var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
Expand All @@ -473,8 +473,8 @@

function clearCurrentLog() {
var url = currentLog === 'core'
? '<%=url("admin/vpn/easytier/clear_log")%>'
: '<%=url("admin/vpn/easytier/clear_wlog")%>';
? '<%=url("admin/services/easytier/clear_log")%>'
: '<%=url("admin/services/easytier/clear_wlog")%>';

var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
Expand Down
12 changes: 6 additions & 6 deletions luci-app-easytier/luasrc/view/easytier/easytier_status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@
showToast('<%=translate("Restarting service...")%>');

var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "restart_service")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "restart_service")%>', true);
xhr.onload = function() {
setTimeout(function() {
actionCooldown = false;
Expand Down Expand Up @@ -770,7 +770,7 @@
setControlsDisabled(true);

var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "toggle_core")%>?enabled=' + (enabled ? '1' : '0'), true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "toggle_core")%>?enabled=' + (enabled ? '1' : '0'), true);
xhr.onload = function() {
setTimeout(function() {
actionCooldown = false;
Expand All @@ -796,7 +796,7 @@
setControlsDisabled(true);

var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "toggle_web")%>?enabled=' + (enabled ? '1' : '0'), true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "toggle_web")%>?enabled=' + (enabled ? '1' : '0'), true);
xhr.onload = function() {
setTimeout(function() {
actionCooldown = false;
Expand Down Expand Up @@ -982,7 +982,7 @@
var ifname = devName || 'tun0';

var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "get_tun_info")%>?ifname=' + encodeURIComponent(ifname), true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "get_tun_info")%>?ifname=' + encodeURIComponent(ifname), true);
xhr.onload = function() {
if (xhr.status === 200) {
try {
Expand Down Expand Up @@ -1074,7 +1074,7 @@
}

var firstLoad = true;
XHR.poll(3, '<%=url("admin", "vpn", "easytier", "api_status")%>', null, function(x, data) {
XHR.poll(3, '<%=url("admin", "services", "easytier", "api_status")%>', null, function(x, data) {
updateStatus(data);

updateTunInterface(data.crunning, data.no_tun, data.dev_name);
Expand Down Expand Up @@ -1132,7 +1132,7 @@
function confirmRefreshVersion() {
closeVersionModal();
var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "clear_version_cache")%>?type=' + currentVersionType, true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "clear_version_cache")%>?type=' + currentVersionType, true);
xhr.onload = function() {
if (xhr.status === 200) {
XHR.poll(0);
Expand Down
16 changes: 8 additions & 8 deletions luci-app-easytier/luasrc/view/easytier/easytier_upload.htm
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>

function loadConfig() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "get_upload_config")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "get_upload_config")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
try {
Expand Down Expand Up @@ -795,7 +795,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>
dir = dir ? dir[1] : '/tmp';

var xhr = new XMLHttpRequest();
xhr.open('POST', '<%=url("admin", "vpn", "easytier", "get_disk_space")%>', true);
xhr.open('POST', '<%=url("admin", "services", "easytier", "get_disk_space")%>', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
if (xhr.status === 200) {
Expand Down Expand Up @@ -872,7 +872,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>
};

var xhr = new XMLHttpRequest();
xhr.open('POST', '<%=url("admin", "vpn", "easytier", "save_upload_config")%>', true);
xhr.open('POST', '<%=url("admin", "services", "easytier", "save_upload_config")%>', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
if (xhr.status === 200) {
Expand Down Expand Up @@ -1033,7 +1033,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>
formData.append('file', file);

var xhr = new XMLHttpRequest();
xhr.open('POST', '<%=url("admin", "vpn", "easytier", "upload_binary")%>', true);
xhr.open('POST', '<%=url("admin", "services", "easytier", "upload_binary")%>', true);

xhr.upload.onprogress = function(event) {
if (event.lengthComputable) {
Expand Down Expand Up @@ -1126,7 +1126,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>
showAlert('info', '<%=translate("Restarting service...")%>');

var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "restart_service")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "restart_service")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
setTimeout(function() {
Expand Down Expand Up @@ -1320,7 +1320,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>

function checkExistingDownload() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "download_progress")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "download_progress")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
try {
Expand Down Expand Up @@ -1375,7 +1375,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>
function cancelDownload() {
// 调用后端取消下载
var xhr = new XMLHttpRequest();
xhr.open('POST', '<%=url("admin", "vpn", "easytier", "cancel_download")%>', true);
xhr.open('POST', '<%=url("admin", "services", "easytier", "cancel_download")%>', true);
xhr.onload = function() {
closeDownloadModal();
showAlert('info', '<%=translate("Cancelling download, may take up to 5 minutes to stop the current task")%>');
Expand Down Expand Up @@ -1428,7 +1428,7 @@ <h3><%=translate("Online Download EasyTier")%></h3>

// 发送下载请求
var xhr = new XMLHttpRequest();
xhr.open('POST', '<%=url("admin", "vpn", "easytier", "download_easytier")%>', true);
xhr.open('POST', '<%=url("admin", "services", "easytier", "download_easytier")%>', true);
xhr.setRequestHeader('Content-Type', 'application/json');

xhr.onload = function() {
Expand Down
12 changes: 6 additions & 6 deletions luci-app-easytier/luasrc/view/easytier/easytier_web.htm
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ <h3><%:Self-hosted Web Console%></h3>

function loadConfig() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "get_web_config")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "get_web_config")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText);
Expand Down Expand Up @@ -907,7 +907,7 @@ <h3><%:Self-hosted Web Console%></h3>
}

var xhr = new XMLHttpRequest();
xhr.open('POST', '<%=url("admin", "vpn", "easytier", "save_web_config")%>', true);
xhr.open('POST', '<%=url("admin", "services", "easytier", "save_web_config")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
showAlert('success', '<%:Configuration saved successfully%>');
Expand Down Expand Up @@ -940,7 +940,7 @@ <h3><%:Self-hosted Web Console%></h3>

function checkWebStatus() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "check_web_status")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "check_web_status")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText);
Expand Down Expand Up @@ -984,7 +984,7 @@ <h3><%:Self-hosted Web Console%></h3>
var dbPath = document.getElementById('web_db_path').value || '/etc/easytier/et.db';

var xhr = new XMLHttpRequest();
xhr.open('POST', '<%=url("admin", "vpn", "easytier", "reset_database")%>', true);
xhr.open('POST', '<%=url("admin", "services", "easytier", "reset_database")%>', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
closeResetDbModal();
Expand Down Expand Up @@ -1013,7 +1013,7 @@ <h3><%:Self-hosted Web Console%></h3>

function checkWebStatusForRestart(deletedFiles) {
var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "check_web_status")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "check_web_status")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
try {
Expand Down Expand Up @@ -1061,7 +1061,7 @@ <h3><%:Self-hosted Web Console%></h3>
showAlert('info', '<%:Restarting service...%>');

var xhr = new XMLHttpRequest();
xhr.open('GET', '<%=url("admin", "vpn", "easytier", "restart_service")%>', true);
xhr.open('GET', '<%=url("admin", "services", "easytier", "restart_service")%>', true);
xhr.onload = function() {
if (xhr.status === 200) {
setTimeout(function() {
Expand Down