feat(web,ui): per-provider git forge API base URL and detection URLs

Configure a default API base URL per git provider (github/gitlab/gitea)
in settings.json gitProviders, with GitHub Enterprise support (Octokit
baseUrl + device-flow web origin derived from the API base), and replace
the client-side custom-domains list with server-persisted detection URL
chips (SSH/HTTPS forms normalized to hosts). The configured API base host
auto-counts as a detection host. Settings round-trip through the existing
/api/config/settings sanitizer; the UI store hydrates from server settings
with a one-time localStorage migration.
This commit is contained in:
2026-08-17 09:55:11 +00:00
parent a87b3fd228
commit 0fc857959e
55 changed files with 1685 additions and 272 deletions
@@ -1711,9 +1711,12 @@ export const settingsDict = {
'settings.github.page.toast.ghCliEnabled': 'gh CLI フォールバックを有効化しました',
'settings.github.page.toast.ghCliDisabled': 'gh CLI フォールバックを無効化しました',
'settings.github.page.toast.ghCliUpdateFailed': 'gh CLI 設定の更新に失敗しました',
'settings.github.page.customDomains.label': 'カスタムドメイン',
'settings.github.page.customDomains.description': 'これらのドメインでホストされているリポジトリは GitHub として扱われます。',
'settings.github.page.customDomains.placeholder': 'github.example.com, git.mycompany.com',
'settings.github.page.apiBaseUrl.label': 'API ベース URL',
'settings.github.page.apiBaseUrl.placeholder': 'https://github.example.com/api/v3',
'settings.github.page.apiBaseUrl.description': 'API 呼び出しに使用する既定のベース URL です。GitHub Enterprise の場合はサーバーアドレスを指定します。例: https://github.example.com/api/v3。',
'settings.github.page.detectUrls.label': '検出 URL',
'settings.github.page.detectUrls.placeholder': 'ssh://git@git.example.com:2222, https://git.example.com',
'settings.github.page.detectUrls.description': 'これらのホストから SSH または HTTPS でクローンしたリポジトリは GitHub として認識されます。',
'settings.gitlab.page.title': 'GitLab パーソナルアクセストークン',
'settings.gitlab.page.description': 'GitLab パーソナルアクセストークンを貼り付けて接続します。セルフホストの GitLab インスタンスを使用する場合はベース URL を設定してください。',
'settings.gitlab.page.tooltip.connectAccount': 'アプリ内の Issue とマージリクエストのワークフロー用に GitLab アカウントを接続します。',
@@ -1721,9 +1724,12 @@ export const settingsDict = {
'settings.gitlab.page.accessToken.placeholder': 'GitLab パーソナルアクセストークンを貼り付け',
'settings.gitlab.page.baseUrl.label': 'ベース URL(任意)',
'settings.gitlab.page.baseUrl.placeholder': 'https://gitlab.com',
'settings.gitlab.page.customDomains.label': 'カスタムドメイン',
'settings.gitlab.page.customDomains.description': 'これらのドメインでホストされているリポジトリは GitLab として扱われます。',
'settings.gitlab.page.customDomains.placeholder': 'gitlab.example.com, git.company.com',
'settings.gitlab.page.apiBaseUrl.label': 'API ベース URL',
'settings.gitlab.page.apiBaseUrl.placeholder': 'https://gitlab.example.com',
'settings.gitlab.page.apiBaseUrl.description': 'API 呼び出しに使用する既定のベース URL です。セルフホストインスタンスの場合はサーバーアドレスを指定します。例: https://gitlab.example.com。',
'settings.gitlab.page.detectUrls.label': '検出 URL',
'settings.gitlab.page.detectUrls.placeholder': 'ssh://git@git.example.com:2222, https://git.example.com',
'settings.gitlab.page.detectUrls.description': 'これらのホストから SSH または HTTPS でクローンしたリポジトリは GitLab として認識されます。',
'settings.gitlab.page.actions.connect': 'GitLab に接続',
'settings.gitlab.page.actions.disconnect': '切断',
'settings.gitlab.page.actions.switch': '切り替え',
@@ -1763,9 +1769,15 @@ export const settingsDict = {
'settings.gitea.page.toast.disconnectFailed': 'Gitea の切断に失敗しました',
'settings.gitea.page.toast.accountSwitched': 'Gitea アカウントを切り替えました',
'settings.gitea.page.toast.accountSwitchFailed': 'Gitea アカウントの切り替えに失敗しました',
'settings.gitea.page.customDomains.label': 'カスタムドメイン',
'settings.gitea.page.customDomains.description': 'これらのドメインでホストされているリポジトリは Gitea または Forgejo として扱われます。',
'settings.gitea.page.customDomains.placeholder': 'gitea.example.com, git.company.com',
'settings.gitea.page.apiBaseUrl.label': 'API ベース URL',
'settings.gitea.page.apiBaseUrl.placeholder': 'https://gitea.example.com',
'settings.gitea.page.apiBaseUrl.description': 'API 呼び出しに使用する既定のベース URL です。セルフホストインスタンスの場合はサーバーアドレスを指定します。例: https://gitea.example.com。',
'settings.gitea.page.detectUrls.label': '検出 URL',
'settings.gitea.page.detectUrls.placeholder': 'ssh://git@git.example.com:2222, https://git.example.com',
'settings.gitea.page.detectUrls.description': 'これらのホストから SSH または HTTPS でクローンしたリポジトリは Gitea または Forgejo として認識されます。',
'settings.gitProviders.detectUrls.add': '検出 URL を追加',
'settings.gitProviders.detectUrls.remove': '{host} を削除',
'settings.gitProviders.detectUrls.invalid': '有効な SSH または HTTPS の URL またはホスト名を入力してください。',
'settings.notifications.page.delivery.title': '通知配信',
'settings.notifications.page.delivery.enableAria': '通知を有効化',
'settings.notifications.page.delivery.enableLabel': '通知を有効化',