mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-11-20 07:52:52 +08:00
c17de413e2
The usage page could only show converted amounts with a hand-entered exchange rate. Add an opt-in "fetch automatically" rate source. - Usage settings > Display gains a rate source selector: manual (default) or automatic. Nothing is fetched until the user picks automatic. - Automatic rates are stored separately from manual ones, so switching back to manual keeps the user's own values. - New fetch_exchange_rates command tries open.er-api.com, then floatrates.com (8 s timeout each, app-wide proxy honored). - In automatic mode the usage page refreshes rates older than 12 hours; failures keep the last cached or manual rate. Costs are still stored in USD. - The hint links to the actual data source (ExchangeRate-API or FloatRates), as open.er-api.com's free terms require. - Async saves merge into the latest settings and are dropped after the page unmounts, so concurrent setting changes are not overwritten.