mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 11:26:00 +00:00
fix
This commit is contained in:
@@ -6,15 +6,16 @@ export function extractPluginIcon(packageManifest) {
|
||||
const homepage = (links && links.homepage) || packageManifest.homepage;
|
||||
const tested = repository || homepage || packageManifest.homepage;
|
||||
|
||||
if (tested == 'https://dbgate.org' || tested == 'https://github.com/dbgate/dbgate') {
|
||||
// monorepo plugin
|
||||
return `https://github.com/dbgate/dbgate/raw/master/plugins/${packageManifest.name}/icon.svg`;
|
||||
}
|
||||
|
||||
if (tested) {
|
||||
const match = tested.match(/https:\/\/github.com\/([^/]*)\/([^/]*)/);
|
||||
if (match) {
|
||||
return `https://raw.githubusercontent.com/${match[1]}/${match[2]}/master/icon.svg`;
|
||||
}
|
||||
|
||||
if (tested == 'https://dbgate.org') {
|
||||
return `https://github.com/dbgate/dbgate/raw/master/plugins/${packageManifest.name}/icon.svg`;
|
||||
}
|
||||
}
|
||||
return 'unknown.svg';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user