Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ make menuconfig
<a href="https://ko-fi.com/vernesong"><img width="300" src="https://www.ko-fi.com/img/githubbutton_sm.svg"> </a>
</p>

* USDT-TRC20
* USDT-BSC
<p align="left">
<img width="300" src="https://github.com/vernesong/OpenClash/raw/master/img/USDT-Wallet.png">
</p>
Binary file modified img/USDT-Wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion luci-app-openclash/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.47.088
PKG_VERSION:=0.47.091
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
Expand Down
10 changes: 7 additions & 3 deletions luci-app-openclash/luasrc/controller/openclash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,12 @@ function get_sub_url(filename)
string.gsub(s.url, '[^\n]+', function(w) table.insert(info_tb, w) end)
end
if #info_tb == 1 then
local url, _ = parse_url_with_name(info_tb[1], filename)
sub_url = url
local url, name = parse_url_with_name(info_tb[1], filename)
if url ~= info_tb[1] then
table.insert(providers, {name = name, url = url})
else
sub_url = url
end
elseif #info_tb > 1 then
for _, raw in ipairs(info_tb) do
local url, name = parse_url_with_name(raw, filename)
Expand Down Expand Up @@ -3317,7 +3321,7 @@ end
function action_add_subscription()
local name = luci.http.formvalue("name")
local address = luci.http.formvalue("address")
local sub_ua = luci.http.formvalue("sub_ua") or "clash.meta"
local sub_ua = luci.http.formvalue("sub_ua") or "clash-verge/v2.4.5"
local sub_convert = luci.http.formvalue("sub_convert") or "0"
local convert_address = luci.http.formvalue("convert_address") or ""
local template = luci.http.formvalue("template") or ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,13 @@ o = s:taboption("meta", Flag, "enable_unified_delay", font_red..bold_on..transla
o.description = font_red..bold_on..translate("Change The Delay Calculation Method To Remove Extra Delays Such as Handshaking")..bold_off..font_off
o.default = "0"

o = s:taboption("meta", Value, "global_ua", translate("Global User-Agent"))
o:value("0", translate("Disable"))
o:value("clash-verge/v2.4.5")
o:value("clash.meta/1.19.20")
o:value("Clash")
o.default = "0"

o = s:taboption("meta", ListValue, "find_process_mode", translate("Enable Process Rule"))
o.description = translate("Whether to Enable Process Rules, Only Works on Routerself, If You Are Not Sure, Please Choose off Which Useful in Router Environment, Depend on kmod-inet-diag")
o:value("0", translate("Disable"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ end
---- UA
o = s:option(Value, "sub_ua", "User-Agent")
o.description = font_red..bold_on..translate("Used for Downloading Subscriptions, Defaults to Clash")..bold_off..font_off
o:value("clash.meta")
o:value("clash-verge/v1.5.1")
o:value("clash-verge/v2.4.5")
o:value("clash.meta/1.19.20")
o:value("Clash")
o.default = "clash.meta"
o.default = "clash-verge/v2.4.5"
o.rmempty = true

---- subconverter
Expand Down
6 changes: 1 addition & 5 deletions luci-app-openclash/luasrc/view/openclash/config_edit.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2738,11 +2738,7 @@
model.querySelector('#overwrite-add-close').onclick = function() {
document.body.removeChild(ocDiv);
};
overlay.onclick = function(e) {
if (e.target === overlay) {
document.body.removeChild(ocDiv);
}
};

model.querySelector('#overwrite-upload-cancel').onclick = function() {
document.body.removeChild(ocDiv);
};
Expand Down
26 changes: 14 additions & 12 deletions luci-app-openclash/luasrc/view/openclash/config_upload.htm
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
padding: 10px 12px;
border: 1px solid var(--border-light);
border-radius: var(--radius-sm);
background: var(--bg-white);
background: var(--bg-white) !important;
color: var(--text-primary);
font-size: 14px;
transition: all var(--transition-fast);
Expand Down Expand Up @@ -258,6 +258,10 @@
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.oc .form-textarea::placeholder {
color: var(--text-secondary);
}

.oc .form-row {
display: flex;
gap: 16px;
Expand Down Expand Up @@ -553,6 +557,10 @@
box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
}

.oc[data-darkmode="true"] .form-textarea::placeholder {
color: var(--text-secondary);
}

.oc[data-darkmode="true"] .checkmark {
border-color: var(--border-light);
background: var(--bg-gray);
Expand Down Expand Up @@ -752,8 +760,8 @@
<label for="subscribe-ua-input"><%:User-Agent%> (<%:Optional%>):</label>
<div class="form-select-wrapper">
<select id="subscribe-ua-input" class="form-select">
<option value="clash.meta">clash.meta</option>
<option value="clash-verge/v1.5.1">clash-verge/v1.5.1</option>
<option value="clash-verge/v2.4.5">clash-verge/v2.4.5</option>
<option value="clash.meta/1.19.20">clash.meta/1.19.20</option>
<option value="Clash">clash</option>
<option value="custom"><%:Custom%></option>
</select>
Expand Down Expand Up @@ -1120,12 +1128,6 @@
}
});

this.overlay.addEventListener('click', function(e) {
if (e.target === self.overlay && !self.isProcessing) {
self.hide();
}
});

document.addEventListener('keydown', function(e) {
if (e.key === 'Escape' && !self.isProcessing && self.overlay.classList.contains('show')) {
self.hide();
Expand Down Expand Up @@ -1197,7 +1199,7 @@
this.switchMode('file');
document.getElementById('config-filename-input').value = '';
document.getElementById('subscribe-url-input').value = '';
document.getElementById('subscribe-ua-input').value = 'clash.meta';
document.getElementById('subscribe-ua-input').value = 'clash-verge/v2.4.5';
document.getElementById('subscribe-ua-custom').style.display = 'none';

document.getElementById('advanced-options-enable').checked = false;
Expand Down Expand Up @@ -1226,7 +1228,7 @@
document.getElementById('subscribe-url-input').value = data.address;
}
if (data.sub_ua) {
if (data.sub_ua === 'clash.meta' || data.sub_ua === 'clash-verge/v1.5.1' || data.sub_ua === 'Clash' || data.sub_ua === 'custom') {
if (data.sub_ua === 'clash.meta/1.19.20' || data.sub_ua === 'clash-verge/v2.4.5' || data.sub_ua === 'Clash' || data.sub_ua === 'custom') {
document.getElementById('subscribe-ua-input').value = data.sub_ua;
if (data.sub_ua === 'custom') {
document.getElementById('subscribe-ua-custom').style.display = 'block';
Expand Down Expand Up @@ -1562,7 +1564,7 @@
}

if (userAgent === 'custom') {
userAgent = subscribeUaCustom.value.trim() || 'clash.meta';
userAgent = subscribeUaCustom.value.trim();
}

if (!url || !filename) {
Expand Down
2 changes: 2 additions & 0 deletions luci-app-openclash/luasrc/view/openclash/log.htm
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@
var currentContent = "";
var bufferToProcess = [];

clearTimeout(r);

for(var i=0; i<titles.length; i++){
if(titles[i].className === 'cbi-tab') {
activeTabId = i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

--control-height: 36px;
--card-padding: 6px 8px;
--version-right: 8px;
--gap-size: 16px;
}

Expand Down
78 changes: 56 additions & 22 deletions luci-app-openclash/luasrc/view/openclash/status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@
--radius-lg: 8px;
--transition-fast: 0.15s ease;
--transition-normal: 0.3s ease;
--stripe-color: rgba(255,255,255,0.24);
--stripe-opacity: 0.5;
--stripe-size: 40px;

--control-height: 32px;
--card-padding: 6px 8px;
--version-right: 8px;
--gap-size: 10px;

--row-1-height: 160px;
Expand Down Expand Up @@ -57,6 +61,8 @@
--warning-color: #fa41c8;
--watchdog-color: #c147f5;
--info-color: #3b82f6;
--stripe-color: rgba(0, 0, 0, 0.255);
--stripe-opacity: 0.8;
}

.oc[data-darkmode="true"] .plugin-toggle-slider {
Expand Down Expand Up @@ -341,7 +347,7 @@

.oc .version-display-container {
position: absolute;
right: 10px;
right: var(--version-right);
display: flex;
gap: 8px;
z-index: 2;
Expand Down Expand Up @@ -915,6 +921,7 @@
min-height: 24px;
min-width: 0;
gap: 8px;
padding: 0 20px;
}

.oc .subscription-info-details {
Expand Down Expand Up @@ -946,6 +953,30 @@
height: 100%;
border-radius: 4px;
transition: width 0.3s ease;
position: relative;
overflow: hidden;
}

.oc .subscription-progress-fill::before {
content: "";
position: absolute;
inset: 0;
background-image: linear-gradient(45deg, var(--stripe-color) 25%, transparent 25%, transparent 50%, var(--stripe-color) 50%, var(--stripe-color) 75%, transparent 75%, transparent);
background-size: var(--stripe-size) var(--stripe-size);
animation: oc-stripes 2s linear infinite;
opacity: var(--stripe-opacity);
pointer-events: none;
mix-blend-mode: overlay;
border-radius: 4px;
}

@keyframes oc-stripes {
to { background-position: 40px 0; }
}

.oc[data-darkmode="true"] .subscription-progress-fill::before {
background-image: linear-gradient(45deg, var(--stripe-color) 25%, transparent 25%, transparent 50%, var(--stripe-color) 50%, var(--stripe-color) 75%, transparent 75%, transparent);
opacity: var(--stripe-opacity);
}

.oc .subscription-progress-fill.high {
Expand Down Expand Up @@ -1210,10 +1241,22 @@
text-overflow: ellipsis;
min-width: 0;
max-width: 100%;
padding-left: 20px;
overflow: hidden;
}

.oc .config-file-name .selected-file-dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
vertical-align: middle;
margin-right: 0.2em;
margin-bottom: 0.2em;
background: var(--primary-color);
flex-shrink: 0;
animation: gentlePulse 4s cubic-bezier(.17,.67,.83,.67) infinite;
}

.oc .config-file-bottom {
display: flex;
align-items: center;
Expand Down Expand Up @@ -1282,13 +1325,20 @@
min-width: 0;
max-width: 30vw;
overflow: hidden;
border: 1px solid var(--border-light);
border-radius: var(--radius-sm);
}

.oc .file-info:hover {
background: var(--hover-bg);
color: var(--text-primary);
}

.oc .file-info-item {
display: block;
align-items: center;
white-space: nowrap;
padding-right: 20px;
padding: 2px 6px;
font-size: 13px;
overflow: hidden;
text-overflow: ellipsis;
Expand Down Expand Up @@ -2831,9 +2881,7 @@
var displayName = this.formatDisplayName(configFile);
if (configFile === this.rawCurrentConfig) {
configNameElement.innerHTML =
'<svg width="0.6em" height="0.6em" viewBox="0 0 24 24" fill="var(--primary-color)" style="vertical-align:middle;margin-right:0.2em;margin-bottom:0.2em;">' +
'<circle cx="12" cy="12" r="8" fill="var(--primary-color)"/>' +
'</svg>' + displayName;
'<span class="selected-file-dot"></span>' + displayName;
} else {
configNameElement.textContent = displayName;
}
Expand Down Expand Up @@ -3227,8 +3275,8 @@
}

var needsErrorHandling = false;
if (x && x.status == 200 && status.providers) {
var newProvidersLength = (status.providers) ? status.providers.length : 0;
if (x && x.status == 200 && status.providers.length > 0) {
var newProvidersLength = status.providers.length;
var cachedProvidersLength = (parsedData && parsedData.providers) ? parsedData.providers.length : 0;

if (newProvidersLength !== cachedProvidersLength && cachedProvidersLength > newProvidersLength) {
Expand Down Expand Up @@ -3597,26 +3645,18 @@

bindEvents: function() {
var textarea = document.getElementById('subscription-url-textarea');
var overlay = document.getElementById('subscription-url-overlay');

if (textarea) {
textarea.addEventListener('keydown', this.handleKeyDown.bind(this));
}
if (overlay) {
overlay.addEventListener('click', this.handleOverlayClick.bind(this));
}
},

unbindEvents: function() {
var textarea = document.getElementById('subscription-url-textarea');
var overlay = document.getElementById('subscription-url-overlay');

if (textarea) {
textarea.removeEventListener('keydown', this.handleKeyDown.bind(this));
}
if (overlay) {
overlay.removeEventListener('click', this.handleOverlayClick.bind(this));
}
},

handleKeyDown: function(event) {
Expand All @@ -3627,12 +3667,6 @@
}
},

handleOverlayClick: function(event) {
if (event.target.id === 'subscription-url-overlay') {
this.hide();
}
},

submit: function() {
var textarea = document.getElementById('subscription-url-textarea');
if (!textarea) return;
Expand Down
4 changes: 2 additions & 2 deletions luci-app-openclash/luasrc/view/openclash/sub_info_show.htm
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,9 @@

XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "sub_info_get")%>', {filename: "<%=filename%>"}, function(x, status) {
var needsErrorHandling = false;
if (x && x.status == 200 && status.providers) {
if (x && x.status == 200 && status.providers.length > 0) {
var save_info_length = (save_info && save_info.providers) ? save_info.providers.length : 0;
var newProvidersLength = (status && status.providers) ? status.providers.length : 0;
var newProvidersLength = status.providers.length;
if (save_info_length !== newProvidersLength && save_info_length > newProvidersLength) {
needsErrorHandling = true;
}
Expand Down
Loading