mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-04 08:43:56 +08:00
🔥 Sync 2026-07-19 20:20:12
This commit is contained in:
1 parent
8570b2d838
commit
0e974e420a
29 files changed
+1161
-1032
No files matched your search
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-daede
|
||||
PKG_VERSION:=1.14.7
|
||||
PKG_RELEASE:=33
|
||||
PKG_RELEASE:=34
|
||||
PKG_MAINTAINER:=kenzok8
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ function renderDaedSettings() {
|
||||
const err = (res.stderr || res.stdout || ('exit ' + res.code)).trim().split('\n')[0];
|
||||
flash(_('Subscription update failed: %s').format(err), 'err', 9000);
|
||||
} else {
|
||||
flash(_('Subscriptions updated (daed restarted)'), 'ok');
|
||||
flash(_('Subscriptions updated and applied'), 'ok');
|
||||
}
|
||||
}).catch(function(e) {
|
||||
flash(_('Subscription update failed: %s').format(e.message || e), 'err', 9000);
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
|
||||
const MAX_LINES = 5000;
|
||||
|
||||
function execChecked(command, args) {
|
||||
return fs.exec(command, args || []).then(function(res) {
|
||||
if (res && res.code !== 0)
|
||||
throw new Error((res.stderr || res.stdout || ('exit ' + res.code)).trim());
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
const CSS = [
|
||||
'.dd-log-wrap{padding:4px 0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif}',
|
||||
'.dd-log-card{border:1px solid rgba(0,0,0,.06);border-radius:10px;padding:10px 14px;margin-bottom:10px;box-shadow:0 2px 8px rgba(0,0,0,.03);background:rgba(255,255,255,.02)}',
|
||||
@@ -20,6 +28,7 @@ const CSS = [
|
||||
'.dd-log-toolbar input[type="text"]{font-size:11.5px;padding:4px 8px;border-radius:5px;border:1px solid rgba(128,128,128,.28);background:transparent;color:inherit;min-width:160px}',
|
||||
'.dd-log-toolbar .dd-log-btn{font-size:11.5px;line-height:1.4;min-height:0;height:auto;padding:4px 12px;border-radius:5px;border:1px solid rgba(128,128,128,.28);background:transparent;color:inherit;cursor:pointer}',
|
||||
'.dd-log-toolbar .dd-log-btn:hover{background:rgba(128,128,128,.1)}',
|
||||
'.dd-log-toolbar .dd-log-stop{color:#d9534f;border-color:rgba(217,83,79,.45)}',
|
||||
'.dd-log-toolbar .dd-log-meta{margin-left:auto;font-size:10.5px;opacity:.55;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}',
|
||||
'.dd-log-pane{height:60vh;min-height:360px;overflow:auto;padding:8px 10px;border:1px solid rgba(0,0,0,.08);border-radius:7px;background:#1a1d21;color:#d8dde6;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;font-size:11.5px;line-height:1.55;white-space:pre-wrap;word-break:break-all}',
|
||||
'.dd-log-pane .dd-line{padding:1px 4px;border-radius:3px;display:block}',
|
||||
@@ -192,6 +201,25 @@ return view.extend({
|
||||
}).catch(function() {});
|
||||
});
|
||||
|
||||
let btnStop = null;
|
||||
if (ctx.name === 'daed') {
|
||||
btnStop = E('button', { 'class': 'dd-log-btn dd-log-stop' }, _('Stop daed'));
|
||||
btnStop.addEventListener('click', function() {
|
||||
if (!confirm(_('Stop daed now?')))
|
||||
return;
|
||||
btnStop.disabled = true;
|
||||
execChecked('/sbin/uci', ['set', 'daed.config.enabled=0'])
|
||||
.then(function() { return execChecked('/sbin/uci', ['commit', 'daed']); })
|
||||
.then(function() { return execChecked('/etc/init.d/daed', ['disable']); })
|
||||
.then(function() { return execChecked('/etc/init.d/daed', ['stop']); })
|
||||
.then(function() { btnStop.textContent = _('daed stopped'); })
|
||||
.catch(function(e) {
|
||||
btnStop.disabled = false;
|
||||
ui.addNotification(null, E('p', {}, _('Failed to stop daed: %s').format(e.message || e)), 'error');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function applyFilter() {
|
||||
const f = state.filter;
|
||||
pane.querySelectorAll('.dd-line').forEach(function(el) {
|
||||
@@ -281,15 +309,17 @@ return view.extend({
|
||||
poll.add(tick);
|
||||
tick();
|
||||
|
||||
const toolbar = E('div', { 'class': 'dd-log-toolbar' }, [
|
||||
const toolbarItems = [
|
||||
E('label', {}, [ cbAuto, _('Auto-scroll') ]),
|
||||
E('label', {}, [ cbPause, _('Pause') ]),
|
||||
selFilter,
|
||||
btnClear,
|
||||
btnDownload,
|
||||
btnTruncate,
|
||||
meta
|
||||
]);
|
||||
btnTruncate
|
||||
];
|
||||
if (btnStop) toolbarItems.push(btnStop);
|
||||
toolbarItems.push(meta);
|
||||
const toolbar = E('div', { 'class': 'dd-log-toolbar' }, toolbarItems);
|
||||
|
||||
return E('div', { 'class': 'dd-log-wrap' }, [
|
||||
E('style', {}, CSS),
|
||||
|
||||
@@ -388,6 +388,18 @@ msgstr ""
|
||||
msgid "Download"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop daed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop daed now?"
|
||||
msgstr ""
|
||||
|
||||
msgid "daed stopped"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to stop daed: %s"
|
||||
msgstr ""
|
||||
|
||||
#: dae.js
|
||||
msgid "One node share link per line — ss, vmess, vless, trojan, tuic, hysteria2, socks5."
|
||||
msgstr ""
|
||||
@@ -464,6 +476,9 @@ msgstr ""
|
||||
msgid "Subscriptions updated (dae reloaded)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Subscriptions updated and applied"
|
||||
msgstr ""
|
||||
|
||||
#: dae.js
|
||||
msgid "Save manual config"
|
||||
msgstr ""
|
||||
|
||||
@@ -400,6 +400,18 @@ msgstr "清空文件"
|
||||
msgid "Download"
|
||||
msgstr "下载"
|
||||
|
||||
msgid "Stop daed"
|
||||
msgstr "停止 daed"
|
||||
|
||||
msgid "Stop daed now?"
|
||||
msgstr "立即停止 daed?"
|
||||
|
||||
msgid "daed stopped"
|
||||
msgstr "daed 已停止"
|
||||
|
||||
msgid "Failed to stop daed: %s"
|
||||
msgstr "停止 daed 失败:%s"
|
||||
|
||||
# ---- config.js: Subscription Card ----
|
||||
msgid "Subscription Management"
|
||||
msgstr "订阅管理"
|
||||
@@ -628,8 +640,8 @@ msgstr "更新失败:%s"
|
||||
msgid "Subscriptions updated (dae reloaded)"
|
||||
msgstr "订阅已更新(dae 已重载)"
|
||||
|
||||
msgid "Subscriptions updated (daed restarted)"
|
||||
msgstr "订阅已更新,daed 已重启"
|
||||
msgid "Subscriptions updated and applied"
|
||||
msgstr "订阅已更新并应用"
|
||||
|
||||
msgid "Section"
|
||||
msgstr "区块"
|
||||
|
||||
@@ -400,6 +400,18 @@ msgstr "清空文件"
|
||||
msgid "Download"
|
||||
msgstr "下载"
|
||||
|
||||
msgid "Stop daed"
|
||||
msgstr "停止 daed"
|
||||
|
||||
msgid "Stop daed now?"
|
||||
msgstr "立即停止 daed?"
|
||||
|
||||
msgid "daed stopped"
|
||||
msgstr "daed 已停止"
|
||||
|
||||
msgid "Failed to stop daed: %s"
|
||||
msgstr "停止 daed 失败:%s"
|
||||
|
||||
# ---- config.js: Subscription Card ----
|
||||
msgid "Subscription Management"
|
||||
msgstr "订阅管理"
|
||||
@@ -628,8 +640,8 @@ msgstr "更新失败:%s"
|
||||
msgid "Subscriptions updated (dae reloaded)"
|
||||
msgstr "订阅已更新(dae 已重载)"
|
||||
|
||||
msgid "Subscriptions updated (daed restarted)"
|
||||
msgstr "订阅已更新,daed 已重启"
|
||||
msgid "Subscriptions updated and applied"
|
||||
msgstr "订阅已更新并应用"
|
||||
|
||||
msgid "Section"
|
||||
msgstr "区块"
|
||||
|
||||
@@ -121,9 +121,12 @@ if [ "$fail" -ne 0 ]; then
|
||||
fi
|
||||
|
||||
if [ "$count" -gt 0 ] && [ "$ok" -gt 0 ] && /bin/pidof daed >/dev/null 2>&1; then
|
||||
log "restarting daed to apply updated subscriptions"
|
||||
if ! /etc/init.d/daed restart >>"$LOG" 2>&1; then
|
||||
fail 8 "daed restart failed after subscription update"
|
||||
run_body="$TMPDIR/run.json"
|
||||
run_resp="$TMPDIR/run.out"
|
||||
printf '{"query":"mutation Run($dry:Boolean!){run(dry:$dry)}","variables":{"dry":false}}' > "$run_body"
|
||||
log "applying updated subscriptions"
|
||||
if ! post_graphql "$run_body" "$run_resp" "$token" || grep -q '"errors"' "$run_resp"; then
|
||||
fail 8 "failed to apply updated subscriptions: $(cat "$run_resp" 2>/dev/null)"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -61,10 +61,15 @@ fi
|
||||
rc=1
|
||||
else
|
||||
size=$(wc -c < "$TMP" 2>/dev/null || echo 0)
|
||||
if [ "$size" -lt 102400 ]; then
|
||||
magic=$(hexdump -n 1 -e '1/1 "%02x"' "$TMP" 2>/dev/null)
|
||||
if [ "$size" -lt 1024 ]; then
|
||||
echo "$(date '+%F %T') file too small ($size bytes)"
|
||||
rm -f "$TMP"
|
||||
rc=2
|
||||
elif [ "$magic" != "0a" ]; then
|
||||
echo "$(date '+%F %T') invalid geodata format"
|
||||
rm -f "$TMP"
|
||||
rc=3
|
||||
else
|
||||
mv "$TMP" "$DEST"
|
||||
echo "$(date '+%F %T') updated $DEST ($size bytes)"
|
||||
|
||||
Reference in new issue
Block a user