refactor: centralize status visuals and improve connection indicator logic

- Introduced a new `status-visuals.ts` file to centralize status icons and labels for consistency across the plugin.
- Updated connection indicator logic in the settings tab to utilize the new centralized visuals.
- Removed deprecated connection visual methods to streamline the codebase.
- Enhanced error handling in the status bar to reflect the new status visuals structure.
This commit is contained in:
Anish Sarkar 2026-04-25 01:47:37 +05:30
parent 1c18735d38
commit 68156d2e74
5 changed files with 32 additions and 60 deletions

View file

@ -203,7 +203,7 @@ export class SurfSenseApiClient {
const baseUrl = this.opts.getServerUrl().replace(/\/+$/, "");
const token = this.opts.getToken();
if (!token) {
throw new AuthError("Missing API token. Open SurfSense settings to paste one.");
throw new AuthError("Missing API token. Open plugin settings to paste one.");
}
if (Date.now() < this.authBlockedUntil) {
throw new AuthError("Token rejected. Paste a fresh one in settings.");