Provide more useful error info when editing a problematic replication rule (#16736)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Shijun Sun 2022-04-26 09:21:46 +08:00 committed by GitHub
parent fbff7ab5cb
commit bef9f5f5f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 10 deletions

View File

@ -36,6 +36,7 @@ import { Registry } from "../../../../../../../ng-swagger-gen/models/registry";
import { Label } from "../../../../../../../ng-swagger-gen/models/label";
import { LabelService } from "../../../../../../../ng-swagger-gen/services/label.service";
import { BandwidthUnit, Decoration, Flatten_I18n_MAP, Flatten_Level } from "../../replication";
import { errorHandler as errorHandlerFn} from '../../../../../shared/units/shared.utils';
const PREFIX: string = '0 ';
const PAGE_SIZE: number = 100;
@ -496,7 +497,11 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy {
this.setFilterAndTrigger(adapter);
this.updateRuleFormAndCopyUpdateForm(ruleInfo);
}, (error: any) => {
this.inlineAlert.showInlineError(error);
this.translateService.get('REPLICATION.UNREACHABLE_SOURCE_REGISTRY', {
error: errorHandlerFn(error)
}).subscribe(translatedResponse => {
this.inlineAlert.showInlineError(translatedResponse);
});
});
}, (error: any) => {
this.onGoing = false;

View File

@ -654,7 +654,8 @@
"BANDWIDTH": "Bandbreite",
"BANDWIDTH_ERROR_TIP": "Bitte -1 oder einen Integer-Wert größer als 0 eingeben",
"BANDWIDTH_TOOLTIP": "Legt die maximale Netzwerkbandbreite für jede Ausführung fest. Bitte auf die Anzahl der parallelen Ausführungen achten. Für umbegrenzte Bandbreite, bitte -1 eingeben",
"UNLIMITED": "Unbegrenzt"
"UNLIMITED": "Unbegrenzt",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}"
},
"DESTINATION": {
"NEW_ENDPOINT": "Neuer Endpunkt",

View File

@ -654,7 +654,8 @@
"BANDWIDTH": "Bandwidth",
"BANDWIDTH_ERROR_TIP": "Please enter -1 or an integer greater than 0",
"BANDWIDTH_TOOLTIP": "Set the maximum network bandwidth for each execution. Please pay attention to the number of concurrent executions. For unlimited bandwidth, please enter -1",
"UNLIMITED": "Unlimited"
"UNLIMITED": "Unlimited",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}"
},
"DESTINATION": {
"NEW_ENDPOINT": "New Endpoint",

View File

@ -656,7 +656,8 @@
"BANDWIDTH": "Bandwidth",
"BANDWIDTH_ERROR_TIP": "Please enter -1 or an integer greater than 0",
"BANDWIDTH_TOOLTIP": "Set the maximum network bandwidth for each execution. Please pay attention to the number of concurrent executions. For unlimited bandwidth, please enter -1",
"UNLIMITED": "Unlimited"
"UNLIMITED": "Unlimited",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}"
},
"DESTINATION": {
"NEW_ENDPOINT": "Nuevo Endpoint",

View File

@ -644,7 +644,8 @@
"BANDWIDTH": "Bande passante",
"BANDWIDTH_ERROR_TIP": "Veuillez saisir -1 ou un nombre entier supérieur à 0",
"BANDWIDTH_TOOLTIP": "Définissez la bande passante réseau maximale pour chaque exécution. Veuillez faire attention au nombre d'exécutions simultanées. Pour une bande passante illimitée, veuillez entrer -1",
"UNLIMITED": "Illimitée"
"UNLIMITED": "Illimitée",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}"
},
"DESTINATION": {
"NEW_ENDPOINT": "Nouveau Endpoint",
@ -1693,4 +1694,4 @@
"NOTARY": "Notary",
"PLACEHOLDER": "Nous n'avons trouvé aucun accessoire !"
}
}
}

View File

@ -654,7 +654,8 @@
"BANDWIDTH": "Banda",
"BANDWIDTH_ERROR_TIP": "Informe um número inteiro maior que 0 (zero) ou -1",
"BANDWIDTH_TOOLTIP": "Informe o limite de banda para cada execução. Tome cuidado e observe a relação com o número de execuções simultâneas. Para remover qualquer limite, informe -1",
"UNLIMITED": "Ilimitado"
"UNLIMITED": "Ilimitado",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}"
},
"DESTINATION": {
"NEW_ENDPOINT": "Novo Endereço",

View File

@ -654,7 +654,8 @@
"BANDWIDTH": "Bandwidth",
"BANDWIDTH_ERROR_TIP": "Please enter -1 or an integer greater than 0",
"BANDWIDTH_TOOLTIP": "Set the maximum network bandwidth for each execution. Please pay attention to the number of concurrent executions. For unlimited bandwidth, please enter -1",
"UNLIMITED": "Unlimited"
"UNLIMITED": "Unlimited",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}"
},
"DESTINATION": {
"NEW_ENDPOINT": "Yeni Uç Nokta",

View File

@ -656,7 +656,8 @@
"BANDWIDTH": "带宽",
"BANDWIDTH_ERROR_TIP": "请输入-1或者大于0的整数",
"BANDWIDTH_TOOLTIP": "设置执行该条同步规则时的最大网络带宽。实际总带宽需要考虑并发执行的情况。如无需限制,请输入-1",
"UNLIMITED": "无限制"
"UNLIMITED": "无限制",
"UNREACHABLE_SOURCE_REGISTRY": "连接源仓库失败,在编辑此规则前请先确保源仓库可用: {{error}}"
},
"DESTINATION": {
"NEW_ENDPOINT": "新建目标",

View File

@ -651,7 +651,8 @@
"BANDWIDTH": "Bandwidth",
"BANDWIDTH_ERROR_TIP": "Please enter -1 or an integer greater than 0",
"BANDWIDTH_TOOLTIP": "Set the maximum network bandwidth for each execution. Please pay attention to the number of concurrent executions. For unlimited bandwidth, please enter -1",
"UNLIMITED": "Unlimited"
"UNLIMITED": "Unlimited",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}"
},
"DESTINATION":{
"NEW_ENDPOINT": "新建目標",