From d34775296c69f943f37f54c583964c9161414df5 Mon Sep 17 00:00:00 2001 From: Shijun Sun <30999793+AllForNothing@users.noreply.github.com> Date: Thu, 3 Aug 2023 18:18:54 +0800 Subject: [PATCH] Update cron ui for add replicatipn rule page (#19083) 1.Fixes #19072 Signed-off-by: AllForNothing --- .../create-edit-rule.component.html | 36 ++++++++++--------- .../create-edit-rule.component.scss | 8 +++++ .../create-edit-rule.component.ts | 10 ++++++ src/portal/src/i18n/lang/de-de-lang.json | 5 +-- src/portal/src/i18n/lang/en-us-lang.json | 5 +-- src/portal/src/i18n/lang/es-es-lang.json | 5 +-- src/portal/src/i18n/lang/fr-fr-lang.json | 5 +-- src/portal/src/i18n/lang/pt-br-lang.json | 5 +-- src/portal/src/i18n/lang/tr-tr-lang.json | 5 +-- src/portal/src/i18n/lang/zh-cn-lang.json | 5 +-- src/portal/src/i18n/lang/zh-tw-lang.json | 5 +-- 11 files changed, 62 insertions(+), 32 deletions(-) diff --git a/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.html b/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.html index 572e70369..692be5dce 100644 --- a/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.html +++ b/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.html @@ -596,11 +596,15 @@ formGroupName="trigger_settings" class="clr-form-control">
- {{ + 'REPLICATION.CRON_STR' | translate + }}
@@ -615,6 +619,19 @@ pattern="^0\s(?!(\*\s)).+$" class="form-control cron-input clr-input" formControlName="cron" /> + + + + + +
@@ -624,19 +641,6 @@ }}
- - -
- -
-
diff --git a/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.scss b/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.scss index 098e2f337..8e8d72b22 100644 --- a/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.scss +++ b/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.scss @@ -343,3 +343,11 @@ clr-modal { .label-input { padding-right: 1.2rem; } + +.no-extend { + flex: 1; +} + +.cron-input { + width: 12rem; +} diff --git a/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.ts b/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.ts index 26611fb28..f72e4b659 100644 --- a/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.ts +++ b/src/portal/src/app/base/left-side-nav/replication/replication/create-edit-rule/create-edit-rule.component.ts @@ -730,6 +730,16 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy { this.ruleForm?.get('trigger')?.get('trigger_settings')?.get('cron') ?.dirty ) { + if ( + !this.ruleForm + ?.get('trigger') + ?.get('trigger_settings') + ?.get('cron') + ?.value?.startsWith(PREFIX) + ) { + return true; + } + return ( this.ruleForm ?.get('trigger') diff --git a/src/portal/src/i18n/lang/de-de-lang.json b/src/portal/src/i18n/lang/de-de-lang.json index 3c5d3aac9..5c69765ec 100644 --- a/src/portal/src/i18n/lang/de-de-lang.json +++ b/src/portal/src/i18n/lang/de-de-lang.json @@ -660,10 +660,11 @@ "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", "UNREACHABLE_SOURCE_REGISTRY": "Verbindung zur Quell-Registry fehlgeschlagen, bitte sicherstellen, dass die Quell-Registry verfügbar ist, bevor diese Regel angepasst wird: {{error}}", - "CRON_ERROR_TIP": "Das Feld ist erforderlich und \"*\" ist im \"Minuten\" Feld nicht erlaubt", + "CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"", "COPY_BY_CHUNK": "Copy by chunk", "COPY_BY_CHUNK_TIP": "Specify whether to copy the blob by chunk. Transfer by chunk may increase the number of API requests.", - "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully" + "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully", + "CRON_STR": "Cron String" }, "DESTINATION": { "NEW_ENDPOINT": "Neuer Endpunkt", diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index aef38cdf4..3bfba8d8e 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -661,10 +661,11 @@ "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", "UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}", - "CRON_ERROR_TIP": "Field is required and \"*\" is not allowed for the \"Minutes\" field", + "CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"", "COPY_BY_CHUNK": "Copy by chunk", "COPY_BY_CHUNK_TIP": "Specify whether to copy the blob by chunk. Transfer by chunk may increase the number of API requests.", - "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully" + "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully", + "CRON_STR": "Cron String" }, "DESTINATION": { "NEW_ENDPOINT": "New Endpoint", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index db5f79f6c..6e0c109b1 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -661,10 +661,11 @@ "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", "UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}", - "CRON_ERROR_TIP": "Field is required and \"*\" is not allowed for the \"Minutes\" field", + "CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"", "COPY_BY_CHUNK": "Copy by chunk", "COPY_BY_CHUNK_TIP": "Specify whether to copy the blob by chunk. Transfer by chunk may increase the number of API requests.", - "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully" + "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully", + "CRON_STR": "Cron String" }, "DESTINATION": { "NEW_ENDPOINT": "Nuevo Endpoint", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index 05f94d485..393314e02 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -647,10 +647,11 @@ "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", "UNREACHABLE_SOURCE_REGISTRY": "Échec de connexion au registre source. Veuillez vérifier que le registre source est disponible avant d'éditer cette règle: {{error}}", - "CRON_ERROR_TIP": "Ce champ est requis et \"*\" n'est pas autorisé pour le champ \"Minutes\"", + "CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"", "COPY_BY_CHUNK": "Copier par morceaux", "COPY_BY_CHUNK_TIP": "Specifie si le blob doit être copié par morceaux. Transférer par morceaux peut augmenter le nombre de requêtes faites à l'API.", - "TRIGGER_STOP_SUCCESS": "Déclenchement avec succès de l'arrêt d'exécution" + "TRIGGER_STOP_SUCCESS": "Déclenchement avec succès de l'arrêt d'exécution", + "CRON_STR": "Cron String" }, "DESTINATION": { "NEW_ENDPOINT": "Nouveau Endpoint", diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index 87c3d5854..c1a267f9c 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -659,10 +659,11 @@ "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", "UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}", - "CRON_ERROR_TIP": "Field is required and \"*\"is not allowed for the \"Minutes\" field", + "CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"", "COPY_BY_CHUNK": "Copy by chunk", "COPY_BY_CHUNK_TIP": "Specify whether to copy the blob by chunk. Transfer by chunk may increase the number of API requests.", - "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully" + "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully", + "CRON_STR": "Cron String" }, "DESTINATION": { "NEW_ENDPOINT": "Novo Endereço", diff --git a/src/portal/src/i18n/lang/tr-tr-lang.json b/src/portal/src/i18n/lang/tr-tr-lang.json index 01bbd792b..c9d23efa2 100644 --- a/src/portal/src/i18n/lang/tr-tr-lang.json +++ b/src/portal/src/i18n/lang/tr-tr-lang.json @@ -660,10 +660,11 @@ "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", "UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}", - "CRON_ERROR_TIP": "Field is required and \"*\" is not allowed for the \"Minutes\" field", + "CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"", "COPY_BY_CHUNK": "Copy by chunk", "COPY_BY_CHUNK_TIP": "Specify whether to copy the blob by chunk. Transfer by chunk may increase the number of API requests.", - "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully" + "TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully", + "CRON_STR": "Cron String" }, "DESTINATION": { "NEW_ENDPOINT": "Yeni Uç Nokta", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index 6041b49f3..7234d4234 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -660,10 +660,11 @@ "BANDWIDTH_TOOLTIP": "设置执行该条同步规则时的最大网络带宽。实际总带宽需要考虑并发执行的情况。如无需限制,请输入-1", "UNLIMITED": "无限制", "UNREACHABLE_SOURCE_REGISTRY": "连接源仓库失败,在编辑此规则前请先确保源仓库可用: {{error}}", - "CRON_ERROR_TIP": "此项必填且\"分钟\"项不能为\"*\"", + "CRON_ERROR_TIP": "Cron 字符串的第一项必须为0且第二项不能为\"*\"", "COPY_BY_CHUNK": "分块复制", "COPY_BY_CHUNK_TIP": "请指定是否开启分块复制。开启此项可能导致相应的 API 请求数量增加。", - "TRIGGER_STOP_SUCCESS": "成功触发停止执行" + "TRIGGER_STOP_SUCCESS": "成功触发停止执行", + "CRON_STR": "Cron" }, "DESTINATION": { "NEW_ENDPOINT": "新建目标", diff --git a/src/portal/src/i18n/lang/zh-tw-lang.json b/src/portal/src/i18n/lang/zh-tw-lang.json index e8fee0f52..cbed5774b 100644 --- a/src/portal/src/i18n/lang/zh-tw-lang.json +++ b/src/portal/src/i18n/lang/zh-tw-lang.json @@ -656,10 +656,11 @@ "BANDWIDTH_TOOLTIP": "設定每個執行的最大網路頻寬。請注意並發執行的數量。若要無限制頻寬,請輸入 -1", "UNLIMITED": "無限制", "UNREACHABLE_SOURCE_REGISTRY": "無法連接到來源登錄,請在編輯此規則之前確保來源登錄可用:{{error}}", - "CRON_ERROR_TIP": "欄位為必填,「分鐘」欄位不允許使用「*」", + "CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"", "COPY_BY_CHUNK": "分段複製", "COPY_BY_CHUNK_TIP": "指定是否按分段複製 blob。分段傳輸可能會增加 API 請求的數量。", - "TRIGGER_STOP_SUCCESS": "成功觸發停止執行" + "TRIGGER_STOP_SUCCESS": "成功觸發停止執行", + "CRON_STR": "Cron String" }, "DESTINATION": { "NEW_ENDPOINT": "新增目標",