qioo777 opened a new pull request, #229: URL: https://github.com/apache/casbin-gateway/pull/229
The saved-accounts table said nothing about which account is worth switching to, so choosing one meant opening the agent and finding out. Each stored subscription account now shows a "Usage left" column: every rate limit window with what is left of it, when it fills back up, and the rate limit resets the account still holds. The numbers belong to the account rather than to this machine, so they are read from the vendor with the account's own token, through `/api/get-agent-accounts-usage` rather than the listing call — the table renders first and the limits arrive after it. They are re-read when an account is saved, added or switched, and on the table's own refresh button. An API key is billed by usage and has no plan limits, so it is left out rather than reported as a failure, and an account the vendor no longer answers for says so instead of showing a figure nobody can stand behind. Validation: `go build ./...`, `go vet ./...` and `go test ./agentusage/... ./object/... ./controllers/... ./agentauth/... ./util/...` pass; `tsc -b`, `eslint` and `vite build` pass. Checked live against a signed-in ChatGPT account on Windows: the column loads after the listing, both windows and the reset counts match what the endpoint returned, reset times render in local time, and save and refresh each re-read the limits. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
