Add subscription info refresh endpoint and UI stats

This commit is contained in:
2026-07-11 09:49:55 +03:00
parent 6bc7840fb1
commit 99f7f58fcb
8 changed files with 521 additions and 40 deletions

View File

@@ -133,6 +133,12 @@ function App() {
});
}
async function refreshSubscriptionInfo() {
const data = await api.subscription.refreshInfo();
setState((prev) => prev ? { ...prev, userInfo: data.userInfo, fetchedAt: data.fetchedAt } : prev);
return data;
}
async function forgetSubscription() {
if (!confirm('Удалить подписку и остановить sing-box?')) return;
return withBusy('Подписка удалена', async () => {
@@ -426,6 +432,7 @@ function App() {
pendingTag={pendingTag}
setPendingTag={setPendingTag}
onFetchSubscription={fetchSubscription}
onRefreshSubscriptionInfo={refreshSubscriptionInfo}
onApply={applyServer}
onRestart={restartSingbox}
onStop={() => stopSingbox(false)}