From ebca4e0da9fc3d1c3289b5085fef17a5648ab913 Mon Sep 17 00:00:00 2001 From: booboosui Date: Tue, 29 Aug 2023 18:25:08 +0800 Subject: [PATCH] chore(pro) --- backend/app/controllers/user.py | 43 +++++++++++++-- backend/app/pkgs/tools/i18b.py | 5 ++ backend/run.py | 2 +- frontend/static/js/coder.js | 29 ++++------ frontend/static/js/user.js | 41 +++++++++++++++ frontend/user_login.html | 74 ++++++++++++++++++++++++++ frontend/user_register.html | 82 +++++++++++++++++++++++++++++ i18n/controllers.pot | 64 +++++++++++++--------- i18n/en_controllers.po | 64 +++++++++++++--------- i18n/en_controllers.po~ | 28 ++++++---- i18n/en_frontend.po | 22 +++++++- i18n/en_frontend.po~ | 12 ++++- i18n/frontend.pot | 22 +++++++- i18n/zh/LC_MESSAGES/controllers.mo | Bin 2026 -> 2436 bytes i18n/zh/LC_MESSAGES/frontend.mo | Bin 6133 -> 6293 bytes i18n/zh_controllers.po | 71 ++++++++++++++----------- i18n/zh_controllers.po~ | 30 +++++++---- i18n/zh_frontend.po | 22 +++++++- i18n/zh_frontend.po~ | 12 ++++- 19 files changed, 494 insertions(+), 129 deletions(-) create mode 100644 frontend/static/js/user.js create mode 100644 frontend/user_login.html create mode 100644 frontend/user_register.html diff --git a/backend/app/controllers/user.py b/backend/app/controllers/user.py index eff9288b..a4289bc1 100644 --- a/backend/app/controllers/user.py +++ b/backend/app/controllers/user.py @@ -9,6 +9,28 @@ bp = Blueprint('user', __name__, url_prefix='/user') +@bp.route('/register', methods=['POST']) +@json_response +def register(): + _ = getI18n("controllers") + data = request.json + username = data['username'] + password = data['password'] + email = data['email'] + phone_number = data['phone'] + zone_language = LANGUAGE + if "language" in session: + zone_language = session['language'] + + if GRADE == "base": + raise Exception("The current version does not support this feature") + else: + # todo 0 + current_tenant = 0 + user = UserPro.create_user(username, password, phone_number, email, zone_language, current_tenant) + + return user.username + @bp.route('/login', methods=['POST']) @json_response def login(): @@ -19,24 +41,32 @@ def login(): if GRADE == "base": ok = User.checkPassword(username, password) + session['tenant_id'] = 0 else: ok = UserPro.checkPassword(username, password) + if ok: + userinfo = UserPro.get_user_by_name(username) + session['language'] = userinfo["zone_language"] + session['tenant_id'] = userinfo["current_tenant"] if ok: session['logged_in'] = True - session['username'] = username - # todo 1 - session['tenant_id'] = 0 + session['username'] = username return {'message': _('Login successful.')} else: - raise Exception("Invalid username or password") + raise Exception(_("Invalid username or password")) @bp.route('/logout', methods=['POST']) @json_response def logout(): _ = getI18n("controllers") + language = LANGUAGE + if "language" in session: + language = session['language'] session.clear() + session['language'] = language + session.update() return {'message': _('Logout successful.')} @bp.route('/change_language', methods=['GET']) @@ -53,6 +83,11 @@ def change_language(): session['language'] = "zh" session.update() + if GRADE != "base" and "username" in session: + username = session['username'] + userinfo = UserPro.get_user_by_name(username) + UserPro.update_user(userinfo["user_id"], zone_language=session['language']) + return {'message': _('success.')} diff --git a/backend/app/pkgs/tools/i18b.py b/backend/app/pkgs/tools/i18b.py index f8d7cbe8..900f0db8 100644 --- a/backend/app/pkgs/tools/i18b.py +++ b/backend/app/pkgs/tools/i18b.py @@ -118,4 +118,9 @@ def getFrontendText(): "requirement_satisfaction": _("Requirement satisfaction_rating"), "opensource_version_1": _("Historical requirement recovery is not supported at this time, please visit workspace to obtain the code results"), "notice": _("Notice"), + "username": _("Username"), + "password": _("Password"), + "register": _("Register"), + "email": _("Email"), + "phone": _("Phone"), } \ No newline at end of file diff --git a/backend/run.py b/backend/run.py index 4daa566a..88f6a034 100644 --- a/backend/run.py +++ b/backend/run.py @@ -21,7 +21,7 @@ def require_login(): session['tenant_id'] = 0 session[session["username"]] = getEmptyTaskInfo() - if request.path == '/user/language' or request.path == '/user/login': + if request.path == '/user/language' or request.path == '/user/login' or request.path == '/user/logout' or request.path == '/user/change_language' or request.path == '/user/register': no = 1 elif 'logged_in' not in session: return {'success': False, 'error': 'Access denied', 'code': 401} diff --git a/frontend/static/js/coder.js b/frontend/static/js/coder.js index 87c8251f..9002231f 100644 --- a/frontend/static/js/coder.js +++ b/frontend/static/js/coder.js @@ -41,7 +41,7 @@ function sendAjaxRequest(url, method, requestData, successCallback, errorCallbac } else { console.log(data.error) try { - errorCallback(data.error + "
" + globalFrontendText["backend_return_error"]); + errorCallback(data.error); } catch (error) { myAlert("ERROR", error); console.error(error); @@ -457,15 +457,19 @@ function logincheck() { successCallback = function(data) { var username = data.data.username - //const url = window.location; - //const newUrl = url.origin+url.pathname; - //history.pushState('', '', newUrl); $("#current-username").html(username) $("#watermark-username").html(username) } errorCallback = function(data) { - $("#my-login").modal('show') + username = "Guest" + $("#current-username").html(username) + $("#watermark-username").html(username) + const url = window.location; + const path = url.pathname; + if (path != "/user_login.html" && path != "/user_register.html") { + window.location.href = "user_login.html"; + } } sendAjaxRequest('/requirement/clear_up', 'GET', info, successCallback, errorCallback, true, false) @@ -473,7 +477,7 @@ function logincheck() { function logout() { successCallback = function() { - location.reload(); + window.location.href = "user_login.html"; } sendAjaxRequest('/user/logout', "POST", "", successCallback, alertErrorCallback, true, true) @@ -487,20 +491,7 @@ function changeLanguage() { sendAjaxRequest('/user/change_language', "GET", "", successCallback, alertErrorCallback, true, false) } -function login() { - var requestData = JSON.stringify({ 'username': $("#login-username").val(), 'password': $("#login-password").val() }) - - successCallback = function(data) { - location.reload(); - } - - errorCallback = function(error) { - $("#login-message").html(error) - $("#login-message").fadeOut().fadeIn() - } - sendAjaxRequest('/user/login', "POST", requestData, successCallback, errorCallback, true, false) -} function myAlert(alert_title, alert_content) { $("#my-alert-title").html(alert_title) diff --git a/frontend/static/js/user.js b/frontend/static/js/user.js new file mode 100644 index 00000000..bd1c1236 --- /dev/null +++ b/frontend/static/js/user.js @@ -0,0 +1,41 @@ +$(document).ready(function () { + // show dropdown on hover + $('.main.menu .ui.dropdown').dropdown({ + on: 'hover' + }); +}); + +function login() { + var requestData = JSON.stringify({ 'username': $("#login-username").val(), 'password': $("#login-password").val() }) + + successCallback = function(data) { + window.location.href = "index.html"; + } + + errorCallback = function(error) { + $("#login-message").html(error) + $("#login-message").fadeOut().fadeIn() + } + + sendAjaxRequest('/user/login', "POST", requestData, successCallback, errorCallback, true, false) +} + +function register() { + var requestData = JSON.stringify({ + 'username': $("#login-username").val(), + 'password': $("#login-password").val(), + 'email': $("#login-email").val(), + 'phone': $("#login-phone").val(), + }) + + successCallback = function(data) { + window.location.href = "user_login.html"; + } + + errorCallback = function(error) { + $("#login-message").html(error) + $("#login-message").fadeOut().fadeIn() + } + + sendAjaxRequest('/user/register', "POST", requestData, successCallback, errorCallback, true, false) +} \ No newline at end of file diff --git a/frontend/user_login.html b/frontend/user_login.html new file mode 100644 index 00000000..8d769e25 --- /dev/null +++ b/frontend/user_login.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+ + + + +
+ @
+ + + diff --git a/frontend/user_register.html b/frontend/user_register.html new file mode 100644 index 00000000..f3ce4d7a --- /dev/null +++ b/frontend/user_register.html @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+ + + + +
+ @
+ + + diff --git a/i18n/controllers.pot b/i18n/controllers.pot index 1ef7eefb..cd6d990c 100644 --- a/i18n/controllers.pot +++ b/i18n/controllers.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-08 16:16+0800\n" +"POT-Creation-Date: 2023-08-29 17:32+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,59 +17,72 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: backend/app/controllers/app.py:32 +#: backend/app/controllers/app.py:36 msgid "Failed to add an application." msgstr "" -#: backend/app/controllers/app.py:49 +#: backend/app/controllers/app.py:51 msgid "Failed to get applications." msgstr "" -#: backend/app/controllers/step_api.py:29 +#: backend/app/controllers/app.py:61 +msgid "Failed to analysis applications." +msgstr "" + +#: backend/app/controllers/requirement.py:51 +msgid "Failed to set up app." +msgstr "" + +#: backend/app/controllers/setting.py:17 backend/app/controllers/setting.py:29 +#: backend/app/controllers/setting.py:41 backend/app/controllers/setting.py:53 +msgid "Failed to get git config list." +msgstr "" + +#: backend/app/controllers/step_api.py:31 msgid "Failed to clarify API." msgstr "" -#: backend/app/controllers/step_code.py:21 +#: backend/app/controllers/step_code.py:22 msgid "Failed to edit file with new task." msgstr "" -#: backend/app/controllers/step_code.py:34 +#: backend/app/controllers/step_code.py:37 msgid "Failed to check file." msgstr "" -#: backend/app/controllers/step_code.py:50 +#: backend/app/controllers/step_code.py:55 msgid "Failed to merge old and new code." msgstr "" -#: backend/app/controllers/step_code.py:68 +#: backend/app/controllers/step_code.py:75 msgid "Failed to reference repair no reference file found." msgstr "" -#: backend/app/controllers/step_code.py:72 +#: backend/app/controllers/step_code.py:79 msgid "Reference repair failed for unknown reasons." msgstr "" -#: backend/app/controllers/step_devops.py:50 +#: backend/app/controllers/step_devops.py:69 msgid "Compile check pass." msgstr "" -#: backend/app/controllers/step_devops.py:57 +#: backend/app/controllers/step_devops.py:76 msgid "Compile check failed for unknown reasons." msgstr "" -#: backend/app/controllers/step_devops.py:72 +#: backend/app/controllers/step_devops.py:93 msgid "Static code scan passed." msgstr "" -#: backend/app/controllers/step_devops.py:79 +#: backend/app/controllers/step_devops.py:100 msgid "Static code scan failed for unknown reasons." msgstr "" -#: backend/app/controllers/step_requirement.py:20 +#: backend/app/controllers/step_requirement.py:24 msgid "Please select the application you want to develop." msgstr "" -#: backend/app/controllers/step_requirement.py:28 +#: backend/app/controllers/step_requirement.py:35 msgid "Failed to clarify requirement." msgstr "" @@ -77,19 +90,19 @@ msgstr "" msgid "Failed to split task." msgstr "" -#: backend/app/controllers/task.py:39 -msgid "Failed to set up app." +#: backend/app/controllers/user.py:47 +msgid "Login successful." msgstr "" -#: backend/app/controllers/user.py:28 -msgid "Login successful." +#: backend/app/controllers/user.py:49 +msgid "Invalid username or password" msgstr "" -#: backend/app/controllers/user.py:38 +#: backend/app/controllers/user.py:57 msgid "Logout successful." msgstr "" -#: backend/app/controllers/user.py:54 +#: backend/app/controllers/user.py:73 msgid "success." msgstr "" @@ -105,10 +118,11 @@ msgstr "" msgid "Failed to create workspace." msgstr "" -#: backend/app/controllers/workspace.py:72 -msgid "Push code successfully." +#: backend/app/controllers/workspace.py:73 +#: backend/app/controllers/workspace.py:80 +msgid "Failed to push code." msgstr "" -#: backend/app/controllers/workspace.py:74 -msgid "Failed to push code." +#: backend/app/controllers/workspace.py:78 +msgid "Push code successfully." msgstr "" diff --git a/i18n/en_controllers.po b/i18n/en_controllers.po index 2ba53cc8..730a6f9e 100644 --- a/i18n/en_controllers.po +++ b/i18n/en_controllers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-08 16:16+0800\n" +"POT-Creation-Date: 2023-08-29 17:32+0800\n" "PO-Revision-Date: 2023-07-17 15:03+0800\n" "Last-Translator: booboo \n" "Language-Team: Language i18n/en\n" @@ -16,59 +16,72 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: backend/app/controllers/app.py:32 +#: backend/app/controllers/app.py:36 msgid "Failed to add an application." msgstr "" -#: backend/app/controllers/app.py:49 +#: backend/app/controllers/app.py:51 msgid "Failed to get applications." msgstr "" -#: backend/app/controllers/step_api.py:29 +#: backend/app/controllers/app.py:61 +msgid "Failed to analysis applications." +msgstr "" + +#: backend/app/controllers/requirement.py:51 +msgid "Failed to set up app." +msgstr "" + +#: backend/app/controllers/setting.py:17 backend/app/controllers/setting.py:29 +#: backend/app/controllers/setting.py:41 backend/app/controllers/setting.py:53 +msgid "Failed to get git config list." +msgstr "" + +#: backend/app/controllers/step_api.py:31 msgid "Failed to clarify API." msgstr "" -#: backend/app/controllers/step_code.py:21 +#: backend/app/controllers/step_code.py:22 msgid "Failed to edit file with new task." msgstr "" -#: backend/app/controllers/step_code.py:34 +#: backend/app/controllers/step_code.py:37 msgid "Failed to check file." msgstr "" -#: backend/app/controllers/step_code.py:50 +#: backend/app/controllers/step_code.py:55 msgid "Failed to merge old and new code." msgstr "" -#: backend/app/controllers/step_code.py:68 +#: backend/app/controllers/step_code.py:75 msgid "Failed to reference repair no reference file found." msgstr "" -#: backend/app/controllers/step_code.py:72 +#: backend/app/controllers/step_code.py:79 msgid "Reference repair failed for unknown reasons." msgstr "" -#: backend/app/controllers/step_devops.py:50 +#: backend/app/controllers/step_devops.py:69 msgid "Compile check pass." msgstr "" -#: backend/app/controllers/step_devops.py:57 +#: backend/app/controllers/step_devops.py:76 msgid "Compile check failed for unknown reasons." msgstr "" -#: backend/app/controllers/step_devops.py:72 +#: backend/app/controllers/step_devops.py:93 msgid "Static code scan passed." msgstr "" -#: backend/app/controllers/step_devops.py:79 +#: backend/app/controllers/step_devops.py:100 msgid "Static code scan failed for unknown reasons." msgstr "" -#: backend/app/controllers/step_requirement.py:20 +#: backend/app/controllers/step_requirement.py:24 msgid "Please select the application you want to develop." msgstr "" -#: backend/app/controllers/step_requirement.py:28 +#: backend/app/controllers/step_requirement.py:35 msgid "Failed to clarify requirement." msgstr "" @@ -76,19 +89,19 @@ msgstr "" msgid "Failed to split task." msgstr "" -#: backend/app/controllers/task.py:39 -msgid "Failed to set up app." +#: backend/app/controllers/user.py:47 +msgid "Login successful." msgstr "" -#: backend/app/controllers/user.py:28 -msgid "Login successful." +#: backend/app/controllers/user.py:49 +msgid "Invalid username or password" msgstr "" -#: backend/app/controllers/user.py:38 +#: backend/app/controllers/user.py:57 msgid "Logout successful." msgstr "" -#: backend/app/controllers/user.py:54 +#: backend/app/controllers/user.py:73 msgid "success." msgstr "" @@ -104,10 +117,11 @@ msgstr "" msgid "Failed to create workspace." msgstr "" -#: backend/app/controllers/workspace.py:72 -msgid "Push code successfully." +#: backend/app/controllers/workspace.py:73 +#: backend/app/controllers/workspace.py:80 +msgid "Failed to push code." msgstr "" -#: backend/app/controllers/workspace.py:74 -msgid "Failed to push code." +#: backend/app/controllers/workspace.py:78 +msgid "Push code successfully." msgstr "" diff --git a/i18n/en_controllers.po~ b/i18n/en_controllers.po~ index aba3affc..2ba53cc8 100644 --- a/i18n/en_controllers.po~ +++ b/i18n/en_controllers.po~ @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-02 18:55+0800\n" +"POT-Creation-Date: 2023-08-08 16:16+0800\n" "PO-Revision-Date: 2023-07-17 15:03+0800\n" "Last-Translator: booboo \n" "Language-Team: Language i18n/en\n" @@ -28,23 +28,23 @@ msgstr "" msgid "Failed to clarify API." msgstr "" -#: backend/app/controllers/step_code.py:22 +#: backend/app/controllers/step_code.py:21 msgid "Failed to edit file with new task." msgstr "" -#: backend/app/controllers/step_code.py:35 +#: backend/app/controllers/step_code.py:34 msgid "Failed to check file." msgstr "" -#: backend/app/controllers/step_code.py:51 +#: backend/app/controllers/step_code.py:50 msgid "Failed to merge old and new code." msgstr "" -#: backend/app/controllers/step_code.py:69 +#: backend/app/controllers/step_code.py:68 msgid "Failed to reference repair no reference file found." msgstr "" -#: backend/app/controllers/step_code.py:73 +#: backend/app/controllers/step_code.py:72 msgid "Reference repair failed for unknown reasons." msgstr "" @@ -72,7 +72,7 @@ msgstr "" msgid "Failed to clarify requirement." msgstr "" -#: backend/app/controllers/step_subtask.py:65 +#: backend/app/controllers/step_subtask.py:64 msgid "Failed to split task." msgstr "" @@ -92,14 +92,22 @@ msgstr "" msgid "success." msgstr "" -#: backend/app/controllers/workspace.py:23 +#: backend/app/controllers/workspace.py:27 msgid "Saved code successfully." msgstr "" -#: backend/app/controllers/workspace.py:43 +#: backend/app/controllers/workspace.py:50 msgid "Create workspace successfully." msgstr "" -#: backend/app/controllers/workspace.py:45 +#: backend/app/controllers/workspace.py:52 msgid "Failed to create workspace." msgstr "" + +#: backend/app/controllers/workspace.py:72 +msgid "Push code successfully." +msgstr "" + +#: backend/app/controllers/workspace.py:74 +msgid "Failed to push code." +msgstr "" diff --git a/i18n/en_frontend.po b/i18n/en_frontend.po index 32912d4c..a0e7f4b3 100644 --- a/i18n/en_frontend.po +++ b/i18n/en_frontend.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 22:27+0800\n" +"POT-Creation-Date: 2023-08-29 17:28+0800\n" "PO-Revision-Date: 2023-07-17 18:37+0800\n" "Last-Translator: booboo \n" "Language-Team: Language i18n/en\n" @@ -382,3 +382,23 @@ msgstr "" #: backend/app/pkgs/tools/i18b.py:120 msgid "Notice" msgstr "" + +#: backend/app/pkgs/tools/i18b.py:121 +msgid "Username" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:122 +msgid "Password" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:123 +msgid "Register" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:124 +msgid "Email" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:125 +msgid "Phone" +msgstr "" diff --git a/i18n/en_frontend.po~ b/i18n/en_frontend.po~ index f05a81fa..32912d4c 100644 --- a/i18n/en_frontend.po~ +++ b/i18n/en_frontend.po~ @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 22:13+0800\n" +"POT-Creation-Date: 2023-08-26 22:27+0800\n" "PO-Revision-Date: 2023-07-17 18:37+0800\n" "Last-Translator: booboo \n" "Language-Team: Language i18n/en\n" @@ -372,3 +372,13 @@ msgstr "" #: backend/app/pkgs/tools/i18b.py:118 msgid "Requirement satisfaction_rating" msgstr "" + +#: backend/app/pkgs/tools/i18b.py:119 +msgid "" +"Historical requirement recovery is not supported at this time, please visit " +"workspace to obtain the code results" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:120 +msgid "Notice" +msgstr "" diff --git a/i18n/frontend.pot b/i18n/frontend.pot index 421aeca6..8fcf86b3 100644 --- a/i18n/frontend.pot +++ b/i18n/frontend.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 22:27+0800\n" +"POT-Creation-Date: 2023-08-29 17:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -383,3 +383,23 @@ msgstr "" #: backend/app/pkgs/tools/i18b.py:120 msgid "Notice" msgstr "" + +#: backend/app/pkgs/tools/i18b.py:121 +msgid "Username" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:122 +msgid "Password" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:123 +msgid "Register" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:124 +msgid "Email" +msgstr "" + +#: backend/app/pkgs/tools/i18b.py:125 +msgid "Phone" +msgstr "" diff --git a/i18n/zh/LC_MESSAGES/controllers.mo b/i18n/zh/LC_MESSAGES/controllers.mo index 5bc7ecf1772307a5ec3cc124916256c19ca0cd23..df876beb5673ecbaabe70cbd61e869c0b5808939 100644 GIT binary patch delta 908 zcmYk)&1(}u7zf}a3JU5$L5mj;UV164$u`}vP1ek=v3N+T zwgzouaFSvWRIox0Vvq!SDD_Y9BKQHK2i<&V@gm~E9{kPj92|J_%sV@?Gy6`y2X2Qm zpF^G!K^qjY1rH%Ux$uLgcMx(IUWH-!2=0efxDUR865NEnu-i>Y9~_2!-buI@PQruG z6!}Bvd4|-{Ie-Um;V$?a9)(>V=Y^+*mmxo790uVX7=mSZ1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|}B5 zB6D+BFsjNeDj|G`8t^Uh=YE*le+`t58Yl}j(blN*JEF!ZKwTh=TIm$C*xKi!`Yl0? zSDw!PXHi*CgLYsaZpNdioe8o0a*W|}407Xifz`MOH=%auCAP!Q$e&APR(T1|wL;}1 z*&aY$s4YB%dNa;hdp&k1PvxKnC_wcaj=E5hwU?R;?f6pE zLf2aRZq$MgMyaS{rFp?lxNg>el*)EIjDg;oB7rr#v!y9TD}#>knghmzWKy_jvD6;>Rx}bybiU{Agj^wkZ;uG zQqflQLY*)OwUR&)$_aSm91+^j;4ciFsd?KPg<|3}vF(yT>ws59%W zJ+Zkzfef=9vMATX@-VI>pNf<58fxc~cvr_`7`1?%*au^nq^JBAm2A9+JYVh|^6+{O z+Dud@efe}T4tay-qDp6CI5B`|NvP;+Sm4$C4^S8CMZ{P_-;cpWF`=UC|5y5vMTil^ zNITLObuab3SLsHKBc>4g^ax_qR9MbfOcXr&rsf zqIX(lwvU@(>H!=^Xq#20`uzQ!WVL+MTQkjaJ_p|GtTaG$)H~6iiXI%@0)5^7loBf3 zLhqjsZ;e-a@vARad!i>1j%`hDQBX*&6)}*=A!ZRgG;TEUZ|On81-;TW{vi2rLi}vX z_CRc4T3);?ZD%n4t;w`tyfD->5UM>|U3>bNdw;X~\n" "Language-Team: Language i18n/zh\n" @@ -16,59 +16,72 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: backend/app/controllers/app.py:32 +#: backend/app/controllers/app.py:36 msgid "Failed to add an application." msgstr "添加应用失败。" -#: backend/app/controllers/app.py:49 +#: backend/app/controllers/app.py:51 msgid "Failed to get applications." msgstr "获取应用失败。" -#: backend/app/controllers/step_api.py:29 +#: backend/app/controllers/app.py:61 +msgid "Failed to analysis applications." +msgstr "分析应用失败。" + +#: backend/app/controllers/requirement.py:51 +msgid "Failed to set up app." +msgstr "初始化应用失败。" + +#: backend/app/controllers/setting.py:17 backend/app/controllers/setting.py:29 +#: backend/app/controllers/setting.py:41 backend/app/controllers/setting.py:53 +msgid "Failed to get git config list." +msgstr "获取Git配置失败。" + +#: backend/app/controllers/step_api.py:31 msgid "Failed to clarify API." msgstr "接口澄清失败。" -#: backend/app/controllers/step_code.py:21 +#: backend/app/controllers/step_code.py:22 msgid "Failed to edit file with new task." msgstr "修改代码失败。" -#: backend/app/controllers/step_code.py:34 +#: backend/app/controllers/step_code.py:37 msgid "Failed to check file." msgstr "代码检查失败。" -#: backend/app/controllers/step_code.py:50 +#: backend/app/controllers/step_code.py:55 msgid "Failed to merge old and new code." msgstr "新旧代码整合失败。" -#: backend/app/controllers/step_code.py:68 +#: backend/app/controllers/step_code.py:75 msgid "Failed to reference repair no reference file found." msgstr "根据参考文件调整代码失败,参考文件不存在。" -#: backend/app/controllers/step_code.py:72 +#: backend/app/controllers/step_code.py:79 msgid "Reference repair failed for unknown reasons." msgstr "根据参考文件调整代码失败,原因未知。" -#: backend/app/controllers/step_devops.py:50 +#: backend/app/controllers/step_devops.py:69 msgid "Compile check pass." msgstr "编译检查通过。" -#: backend/app/controllers/step_devops.py:57 +#: backend/app/controllers/step_devops.py:76 msgid "Compile check failed for unknown reasons." msgstr "编译检查失败,原因未知。" -#: backend/app/controllers/step_devops.py:72 +#: backend/app/controllers/step_devops.py:93 msgid "Static code scan passed." msgstr "静态扫描通过。" -#: backend/app/controllers/step_devops.py:79 +#: backend/app/controllers/step_devops.py:100 msgid "Static code scan failed for unknown reasons." msgstr "静态扫描失败,原因未知。" -#: backend/app/controllers/step_requirement.py:20 +#: backend/app/controllers/step_requirement.py:24 msgid "Please select the application you want to develop." msgstr "请先选择要开发的应用。" -#: backend/app/controllers/step_requirement.py:28 +#: backend/app/controllers/step_requirement.py:35 msgid "Failed to clarify requirement." msgstr "需求澄清失败。" @@ -76,20 +89,19 @@ msgstr "需求澄清失败。" msgid "Failed to split task." msgstr "任务分解失败。" -#: backend/app/controllers/task.py:39 -msgid "Failed to set up app." -msgstr "初始化应用失败。" - -#: backend/app/controllers/user.py:28 +#: backend/app/controllers/user.py:47 msgid "Login successful." msgstr "登录成功。" -#: backend/app/controllers/user.py:38 +#: backend/app/controllers/user.py:49 +msgid "Invalid username or password" +msgstr "用户名或者密码错误" + +#: backend/app/controllers/user.py:57 msgid "Logout successful." msgstr "登出成功。" -#: backend/app/controllers/user.py:54 -#, fuzzy +#: backend/app/controllers/user.py:73 msgid "success." msgstr "登录成功。" @@ -105,12 +117,11 @@ msgstr "创建 workspace 成功。" msgid "Failed to create workspace." msgstr "创建 workspace 失败。" -#: backend/app/controllers/workspace.py:72 -#, fuzzy -msgid "Push code successfully." -msgstr "保存推送成功。" - -#: backend/app/controllers/workspace.py:74 -#, fuzzy +#: backend/app/controllers/workspace.py:73 +#: backend/app/controllers/workspace.py:80 msgid "Failed to push code." msgstr "代码推送失败。" + +#: backend/app/controllers/workspace.py:78 +msgid "Push code successfully." +msgstr "推送代码成功。" diff --git a/i18n/zh_controllers.po~ b/i18n/zh_controllers.po~ index 28952181..ae9f0b38 100644 --- a/i18n/zh_controllers.po~ +++ b/i18n/zh_controllers.po~ @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-02 18:55+0800\n" +"POT-Creation-Date: 2023-08-08 16:16+0800\n" "PO-Revision-Date: 2023-07-17 14:55+0800\n" "Last-Translator: booboo \n" "Language-Team: Language i18n/zh\n" @@ -28,23 +28,23 @@ msgstr "获取应用失败。" msgid "Failed to clarify API." msgstr "接口澄清失败。" -#: backend/app/controllers/step_code.py:22 +#: backend/app/controllers/step_code.py:21 msgid "Failed to edit file with new task." msgstr "修改代码失败。" -#: backend/app/controllers/step_code.py:35 +#: backend/app/controllers/step_code.py:34 msgid "Failed to check file." msgstr "代码检查失败。" -#: backend/app/controllers/step_code.py:51 +#: backend/app/controllers/step_code.py:50 msgid "Failed to merge old and new code." msgstr "新旧代码整合失败。" -#: backend/app/controllers/step_code.py:69 +#: backend/app/controllers/step_code.py:68 msgid "Failed to reference repair no reference file found." msgstr "根据参考文件调整代码失败,参考文件不存在。" -#: backend/app/controllers/step_code.py:73 +#: backend/app/controllers/step_code.py:72 msgid "Reference repair failed for unknown reasons." msgstr "根据参考文件调整代码失败,原因未知。" @@ -72,7 +72,7 @@ msgstr "请先选择要开发的应用。" msgid "Failed to clarify requirement." msgstr "需求澄清失败。" -#: backend/app/controllers/step_subtask.py:65 +#: backend/app/controllers/step_subtask.py:64 msgid "Failed to split task." msgstr "任务分解失败。" @@ -93,14 +93,24 @@ msgstr "登出成功。" msgid "success." msgstr "登录成功。" -#: backend/app/controllers/workspace.py:23 +#: backend/app/controllers/workspace.py:27 msgid "Saved code successfully." msgstr "保存代码成功。" -#: backend/app/controllers/workspace.py:43 +#: backend/app/controllers/workspace.py:50 msgid "Create workspace successfully." msgstr "创建 workspace 成功。" -#: backend/app/controllers/workspace.py:45 +#: backend/app/controllers/workspace.py:52 msgid "Failed to create workspace." msgstr "创建 workspace 失败。" + +#: backend/app/controllers/workspace.py:72 +#, fuzzy +msgid "Push code successfully." +msgstr "保存推送成功。" + +#: backend/app/controllers/workspace.py:74 +#, fuzzy +msgid "Failed to push code." +msgstr "代码推送失败。" diff --git a/i18n/zh_frontend.po b/i18n/zh_frontend.po index e2382193..b0d4bdac 100644 --- a/i18n/zh_frontend.po +++ b/i18n/zh_frontend.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 22:27+0800\n" +"POT-Creation-Date: 2023-08-29 17:28+0800\n" "PO-Revision-Date: 2023-07-17 18:36+0800\n" "Last-Translator: booboo \n" "Language-Team: Language i18n/zh\n" @@ -383,3 +383,23 @@ msgstr "当前版本暂不支持历史需求恢复,您可以访问 workspace #: backend/app/pkgs/tools/i18b.py:120 msgid "Notice" msgstr "注意" + +#: backend/app/pkgs/tools/i18b.py:121 +msgid "Username" +msgstr "用户名" + +#: backend/app/pkgs/tools/i18b.py:122 +msgid "Password" +msgstr "密码" + +#: backend/app/pkgs/tools/i18b.py:123 +msgid "Register" +msgstr "注册" + +#: backend/app/pkgs/tools/i18b.py:124 +msgid "Email" +msgstr "邮箱" + +#: backend/app/pkgs/tools/i18b.py:125 +msgid "Phone" +msgstr "手机号" diff --git a/i18n/zh_frontend.po~ b/i18n/zh_frontend.po~ index 238641ef..e2382193 100644 --- a/i18n/zh_frontend.po~ +++ b/i18n/zh_frontend.po~ @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 22:13+0800\n" +"POT-Creation-Date: 2023-08-26 22:27+0800\n" "PO-Revision-Date: 2023-07-17 18:36+0800\n" "Last-Translator: booboo \n" "Language-Team: Language i18n/zh\n" @@ -373,3 +373,13 @@ msgstr "完成度评分" #: backend/app/pkgs/tools/i18b.py:118 msgid "Requirement satisfaction_rating" msgstr "满意度评分" + +#: backend/app/pkgs/tools/i18b.py:119 +msgid "" +"Historical requirement recovery is not supported at this time, please visit " +"workspace to obtain the code results" +msgstr "当前版本暂不支持历史需求恢复,您可以访问 workspace 获取之前的代码结果" + +#: backend/app/pkgs/tools/i18b.py:120 +msgid "Notice" +msgstr "注意"