perf: display installed plugin icon

This commit is contained in:
Junyan Qin
2025-08-28 23:50:26 +08:00
parent 91959527a4
commit 40f1af4434
5 changed files with 50 additions and 2 deletions
+11
View File
@@ -438,6 +438,17 @@ export class BackendClient extends BaseHttpClient {
return this.put(`/api/v1/plugins/${author}/${name}/config`, config);
}
public getPluginIconURL(author: string, name: string): string {
if (this.instance.defaults.baseURL === '/') {
const url = window.location.href;
const baseURL = url.split('/').slice(0, 3).join('/');
return `${baseURL}/api/v1/plugins/${author}/${name}/icon`;
}
return (
this.instance.defaults.baseURL + `/api/v1/plugins/${author}/${name}/icon`
);
}
public installPluginFromGithub(
source: string,
): Promise<AsyncTaskCreatedResp> {