wolfboys commented on code in PR #3461: URL: https://github.com/apache/incubator-streampark/pull/3461#discussion_r1444013882
########## streampark-console/streampark-console-webapp/src/views/flink/home/components/Modal.vue: ########## @@ -100,18 +100,20 @@ flinkHome: formValue.flinkHome, }); const checkResp = parseInt(resp.data); - if (checkResp != 0) { - // Environment detection is successful - if (checkResp == -1) { - Swal.fire('Failed', 'FLINK_HOME invalid path.', 'error'); - } else if (checkResp == 1) { - Swal.fire('Failed', t('setting.flinkHome.operateMessage.flinkNameIsUnique'), 'error'); - } else if (checkResp == 2) { - Swal.fire( - 'Failed', - 'can no found flink-dist or found multiple flink-dist, FLINK_HOME error.', - 'error', - ); + if (checkResp !== FlinkEvnEnum.FEASIBLE) { + switch (checkResp) { + case FlinkEvnEnum.INVALID: + Swal.fire('Failed', 'FLINK_HOME invalid path.', 'error'); Review Comment: error msg should use i18n ########## streampark-console/streampark-console-webapp/src/views/flink/home/components/Modal.vue: ########## @@ -100,18 +100,20 @@ flinkHome: formValue.flinkHome, }); const checkResp = parseInt(resp.data); - if (checkResp != 0) { - // Environment detection is successful - if (checkResp == -1) { - Swal.fire('Failed', 'FLINK_HOME invalid path.', 'error'); - } else if (checkResp == 1) { - Swal.fire('Failed', t('setting.flinkHome.operateMessage.flinkNameIsUnique'), 'error'); - } else if (checkResp == 2) { - Swal.fire( - 'Failed', - 'can no found flink-dist or found multiple flink-dist, FLINK_HOME error.', - 'error', - ); + if (checkResp !== FlinkEvnEnum.FEASIBLE) { + switch (checkResp) { + case FlinkEvnEnum.INVALID: + Swal.fire('Failed', 'FLINK_HOME invalid path.', 'error'); + break; + case FlinkEvnEnum.NAME_REPEATED: + Swal.fire('Failed', t('setting.flinkHome.operateMessage.flinkNameIsUnique'), 'error'); + break; + case FlinkEvnEnum.FLINK_DIST_REPEATED: + Swal.fire( + 'Failed', + 'can no found flink-dist or found multiple flink-dist, FLINK_HOME error.', Review Comment: error msg should use i18n, e.g: t('setting.flinkHome.operateMessage.FLINK_DIST_REPEATED') ... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@streampark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org