推送窗口现在会判断是否有配置Git远程仓库,显示正确的提示信息

This commit is contained in:
xintaofei
2026-03-31 18:52:18 +08:00
parent 8937543f80
commit c5fe85d309
11 changed files with 21 additions and 3 deletions

View File

@@ -414,8 +414,10 @@ export function PushWorkspace({
<span className="truncate text-sm font-medium">
{pushInfoData.branch}
</span>
<ArrowRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
{uniqueRemotes.length <= 1 ? (
{uniqueRemotes.length > 0 && (
<ArrowRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
)}
{uniqueRemotes.length === 0 ? null : uniqueRemotes.length <= 1 ? (
<span className="truncate text-sm text-muted-foreground">
{selectedRemote ?? "origin"}/{pushInfoData.branch}
</span>
@@ -453,6 +455,10 @@ export function PushWorkspace({
<div className="flex items-center justify-center py-12">
<Loader2 className="h-5 w-5 animate-spin text-muted-foreground" />
</div>
) : uniqueRemotes.length === 0 ? (
<div className="flex items-center justify-center px-4 py-12 text-center text-sm text-muted-foreground whitespace-pre-line">
{t("noRemoteConfigured")}
</div>
) : unpushedCommits.length === 0 ? (
<div className="flex items-center justify-center py-12 text-sm text-muted-foreground">
{!hasUpstream
@@ -533,7 +539,9 @@ export function PushWorkspace({
<Button
className="w-full"
disabled={
pushing || (hasUpstream && unpushedCommits.length === 0)
pushing ||
uniqueRemotes.length === 0 ||
(hasUpstream && unpushedCommits.length === 0)
}
onClick={handlePush}
>

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "دفع الكود",
"noUnpushedCommits": "لا توجد التزامات غير مدفوعة",
"noRemoteConfigured": "لم يتم تكوين مستودع Git بعيد\nأضف واحدًا في «إدارة المستودعات البعيدة»",
"newBranchNoPushedCommits": "فرع جديد — ادفع لإنشاء فرع تتبع عن بُعد",
"unpushed": "غير مدفوع",
"selectFileToViewDiff": "اختر ملفًا لعرض الفرق",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "Code pushen",
"noUnpushedCommits": "Keine ungepushten Commits",
"noRemoteConfigured": "Kein Git-Remote konfiguriert\nFüge einen unter „Remotes verwalten" hinzu",
"newBranchNoPushedCommits": "Neuer Branch pushen, um Remote-Tracking-Branch zu erstellen",
"unpushed": "Nicht gepusht",
"selectFileToViewDiff": "Datei auswählen, um Unterschiede anzuzeigen",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "Push Code",
"noUnpushedCommits": "No unpushed commits",
"noRemoteConfigured": "No Git remote configured\nAdd a remote in Manage Remotes",
"newBranchNoPushedCommits": "New branch — push to create remote tracking branch",
"unpushed": "Unpushed",
"selectFileToViewDiff": "Select a file to view diff",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "Enviar código",
"noUnpushedCommits": "No hay commits sin enviar",
"noRemoteConfigured": "No hay remoto Git configurado\nAñade uno en «Gestionar remotos»",
"newBranchNoPushedCommits": "Nueva rama — enviar para crear rama de seguimiento remota",
"unpushed": "Sin enviar",
"selectFileToViewDiff": "Selecciona un archivo para ver las diferencias",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "Pousser le code",
"noUnpushedCommits": "Aucun commit non poussé",
"noRemoteConfigured": "Aucun dépôt distant Git configuré\nAjoutez-en un dans « Gérer les dépôts distants »",
"newBranchNoPushedCommits": "Nouvelle branche — pousser pour créer la branche de suivi distante",
"unpushed": "Non poussé",
"selectFileToViewDiff": "Sélectionnez un fichier pour voir les différences",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "コードをプッシュ",
"noUnpushedCommits": "未プッシュのコミットはありません",
"noRemoteConfigured": "Git リモートが設定されていません\n「リモート管理」からリモートを追加してください",
"newBranchNoPushedCommits": "新しいブランチ — プッシュしてリモート追跡ブランチを作成",
"unpushed": "未プッシュ",
"selectFileToViewDiff": "ファイルを選択して差分を表示",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "코드 푸시",
"noUnpushedCommits": "푸시되지 않은 커밋이 없습니다",
"noRemoteConfigured": "Git 원격이 구성되지 않았습니다\n「원격 관리」에서 원격을 추가하세요",
"newBranchNoPushedCommits": "새 브랜치 — 푸시하여 원격 추적 브랜치 생성",
"unpushed": "미푸시",
"selectFileToViewDiff": "파일을 선택하여 차이 보기",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "Enviar código",
"noUnpushedCommits": "Nenhum commit não enviado",
"noRemoteConfigured": "Nenhum remoto Git configurado\nAdicione um em «Gerenciar remotos»",
"newBranchNoPushedCommits": "Nova branch — enviar para criar branch de rastreamento remota",
"unpushed": "Não enviado",
"selectFileToViewDiff": "Selecione um arquivo para ver as diferenças",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "推送代码",
"noUnpushedCommits": "没有未推送的提交",
"noRemoteConfigured": "未配置 Git 远程仓库\n请在「管理远程」中添加远程地址",
"newBranchNoPushedCommits": "新分支 — 推送以创建远程跟踪分支",
"unpushed": "未推送",
"selectFileToViewDiff": "选择文件查看差异",

View File

@@ -1055,6 +1055,7 @@
"pushWindow": {
"title": "推送程式碼",
"noUnpushedCommits": "沒有未推送的提交",
"noRemoteConfigured": "未設定 Git 遠端儲存庫\n請在「管理遠端」中新增遠端地址",
"newBranchNoPushedCommits": "新分支 — 推送以建立遠端追蹤分支",
"unpushed": "未推送",
"selectFileToViewDiff": "選擇檔案查看差異",