mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-07 21:54:10 +00:00
- Replace plain textarea with CodeMirror editor (YAML syntax highlighting, line numbers, auto-indent) for Clash subscription template - Fix confAlerts crash when subClashURI/subURI/subJsonURI is null/undefined (prevented save button from enabling) - Add yaml.js CodeMirror mode asset - Include docs and .gitignore cleanup
879 B
879 B
fix: MariaDB JSON_EACH compatibility for subscription and traffic queries
Date: 2026-04-24
Problem
Subscription endpoint (/sub/:subid, /json/:subid) returns Error! on MariaDB.
Root cause: JSON_EACH is SQLite-only; MariaDB requires JSON_TABLE.
Changes
sub/subService.go
getInboundsBySubId: branch SQL by DB type —JSON_TABLEfor MariaDB,JSON_EACHfor SQLitegetFallbackMaster: same branching for fallback query- Added
configimport forGetDBTypeFromJSON()
web/service/inbound.go
GetClientTrafficByID: branch SQL by DB typeMigrationRemoveOrphanedTraffics: branch SQL by DB type- Added
configimport
config/version
- Bump to v1.5.1
Not in scope
getAllEmails()(TG Bot) — same issue, deferred
Verification
go build ./...passesgo test ./...all passgo vet ./sub/ ./web/service/clean