diff --git a/web/src/app/home/plugins/components/plugin-installed/plugin-card/PluginCardComponent.tsx b/web/src/app/home/plugins/components/plugin-installed/plugin-card/PluginCardComponent.tsx index ccf8b6fe..b5d9c4b1 100644 --- a/web/src/app/home/plugins/components/plugin-installed/plugin-card/PluginCardComponent.tsx +++ b/web/src/app/home/plugins/components/plugin-installed/plugin-card/PluginCardComponent.tsx @@ -91,16 +91,8 @@ export default function PluginCardComponent({ { - e.stopPropagation(); - window.open( - cardVO.install_info.github_url, - '_blank', - ); - }} > {t('plugins.fromGithub')} - )} {cardVO.install_source === 'local' && ( @@ -115,19 +107,8 @@ export default function PluginCardComponent({ { - e.stopPropagation(); - window.open( - getCloudServiceClientSync().getPluginMarketplaceURL( - cardVO.author, - cardVO.name, - ), - '_blank', - ); - }} > {t('plugins.fromMarketplace')} - )} @@ -200,6 +181,31 @@ export default function PluginCardComponent({ {t('plugins.update')} )} + {/**view source */} + {(cardVO.install_source === 'github' || + cardVO.install_source === 'marketplace') && ( + { + e.stopPropagation(); + if (cardVO.install_source === 'github') { + window.open(cardVO.install_info.github_url, '_blank'); + } else if (cardVO.install_source === 'marketplace') { + window.open( + getCloudServiceClientSync().getPluginMarketplaceURL( + cardVO.author, + cardVO.name, + ), + '_blank', + ); + } + setDropdownOpen(false); + }} + > + + {t('plugins.viewSource')} + + )} { diff --git a/web/src/i18n/locales/en-US.ts b/web/src/i18n/locales/en-US.ts index eff9def1..b08a887a 100644 --- a/web/src/i18n/locales/en-US.ts +++ b/web/src/i18n/locales/en-US.ts @@ -282,6 +282,7 @@ const enUS = { saveConfigError: 'Configuration save failed: ', config: 'Configuration', readme: 'Documentation', + viewSource: 'View Source', loadingReadme: 'Loading documentation...', noReadme: 'This plugin does not provide README documentation', fileUpload: { diff --git a/web/src/i18n/locales/ja-JP.ts b/web/src/i18n/locales/ja-JP.ts index 027e62ab..c7cf6a3b 100644 --- a/web/src/i18n/locales/ja-JP.ts +++ b/web/src/i18n/locales/ja-JP.ts @@ -283,6 +283,7 @@ const jaJP = { saveConfigError: '設定の保存に失敗しました:', config: '設定', readme: 'ドキュメント', + viewSource: 'ソースを表示', loadingReadme: 'ドキュメントを読み込み中...', noReadme: 'このプラグインはREADMEドキュメントを提供していません', fileUpload: { diff --git a/web/src/i18n/locales/zh-Hans.ts b/web/src/i18n/locales/zh-Hans.ts index 4f73b516..5d11ef87 100644 --- a/web/src/i18n/locales/zh-Hans.ts +++ b/web/src/i18n/locales/zh-Hans.ts @@ -268,6 +268,7 @@ const zhHans = { saveConfigError: '保存配置失败:', config: '配置', readme: '文档', + viewSource: '查看来源', loadingReadme: '正在加载文档...', noReadme: '该插件没有提供 README 文档', fileUpload: { diff --git a/web/src/i18n/locales/zh-Hant.ts b/web/src/i18n/locales/zh-Hant.ts index d4869508..ecfb9059 100644 --- a/web/src/i18n/locales/zh-Hant.ts +++ b/web/src/i18n/locales/zh-Hant.ts @@ -267,6 +267,7 @@ const zhHant = { saveConfigError: '儲存配置失敗:', config: '配置', readme: '文件', + viewSource: '查看來源', loadingReadme: '正在載入文件...', noReadme: '該插件沒有提供 README 文件', fileUpload: {