diff --git a/backend/app/controllers/requirement.py b/backend/app/controllers/requirement.py index 224fcb40..71c28997 100644 --- a/backend/app/controllers/requirement.py +++ b/backend/app/controllers/requirement.py @@ -5,6 +5,7 @@ from app.models.requirement import Requirement from app.models.requirement_memory_pro import RequirementMemory from app.models.tenant_pro import Tenant +from app.models.tenant_bill_pro import TenantBill from config import REQUIREMENT_STATUS_NotStarted, GRADE bp = Blueprint('requirement', __name__, url_prefix='/requirement') @@ -19,12 +20,14 @@ def clear_up(): session[session["username"]] = getEmptyTaskInfo() tenant_name = "-" + code_power = '0' if GRADE != "base": tenant = Tenant.get_tenant_baseinfo_by_id(session["tenant_id"]) if tenant: tenant_name = tenant["name"] + code_power = TenantBill.get_total_codepower(session["tenant_id"]) - return {"username": session["username"], "tenant_name": tenant_name, "tenant_id": session["tenant_id"], "info": session[session["username"]]} + return {"username": session["username"], "tenant_name": tenant_name, "tenant_id": session["tenant_id"], "info": session[session["username"]], "code_power": code_power} @bp.route('/setup_app', methods=['POST']) diff --git a/frontend/static/js/coder.js b/frontend/static/js/coder.js index c58f9e05..27fbe96b 100644 --- a/frontend/static/js/coder.js +++ b/frontend/static/js/coder.js @@ -467,9 +467,10 @@ function logincheck() { successCallback = function(data) { var username = data.data.username var tenant = data.data.tenant_name + var code_power = data.data.code_power globalTenantID = data.data.tenant_id $("#current-username").html(username) - $("#current-tenant").html(tenant) + $("#current-tenant").html(tenant+' ('+globalFrontendText['code_power']+':'+code_power+')') $("#watermark-username").html(username) } diff --git a/frontend/static/js/tenant.js b/frontend/static/js/tenant.js index fe658eeb..06d366e3 100644 --- a/frontend/static/js/tenant.js +++ b/frontend/static/js/tenant.js @@ -51,14 +51,13 @@ function getTenantList() { tenants.forEach(function (tenant, element_index, element_array) { str += ` - `+tenant["name"]+`
+ `+tenant["name"]+` `+tenant["current_user_role"]+` - `+tenant["status"]+` + `+tenant["status_name"]+` `+tenant["member_count"]+` - `+tenant["billing_type"]+` + `+tenant["billing_type_name"]+`
`+globalFrontendText["tenant_billing_end"]+`: `+tenant["billing_end"]+` `+tenant["billing_quota"]+` - `+tenant["billing_end"]+` - `+globalFrontendText["enter"]+` | `+globalFrontendText["show_tenant"]+` | `+globalFrontendText["configuration"]+` + `+globalFrontendText["show_tenant"]+` | `+globalFrontendText["configuration"]+` ` $("#tenant_list").html(str) }); @@ -92,7 +91,7 @@ function getTenant(tenant_id) { $("#tenant_description").val(tenants.description) $("#tenant_employee_count").val(tenants.employee_count) $("#tenant_industry_type").val(tenants.industry_type) - $("#tenant_status").val(tenants.status) + $("#tenant_status").val(tenants.status_name) $("#tenant_created_at").val(tenants.created_at) $("#tenant_billing_end").val(tenants.billing_end + " - " + tenants.plus_name) $("#members_count").text(tenants.member_count) @@ -101,6 +100,7 @@ function getTenant(tenant_id) { $("#recharge_company").text(tenants.name) $("#billing_info").text(globalFrontendText["task_limit_msg"] + tenants.billing_quota) + $("#codepower_info").text(globalFrontendText["code_power"] + tenants.code_power) } sendAjaxRequest('/tenant/get_one', 'GET', requestData, successCallback, alertErrorCallback, true, false) @@ -175,13 +175,17 @@ function getBillings(tenant_id) { users.forEach(function (user, element_index, element_array) { expired_at = "" + code_power = 0 if (user["bill_type"].startsWith("Income_")) { expired_at = "
"+globalFrontendText["expired_at"]+user["expired_at"]+"" + code_power = '+' + user["amount"] + '('+user['amount_left']+')' + expired_at + } else { + code_power = '-' + user["amount_used"] } str += ` - `+user["bill_type"]+`
+ `+user["bill_type_name"]+`
`+user["bill_user"]+` - `+user["amount"]+expired_at+` + `+code_power+` `+user["created_at"]+` `+user["remarks"]+` ` diff --git a/frontend/tenant.html b/frontend/tenant.html index c06749ea..3ae10449 100644 --- a/frontend/tenant.html +++ b/frontend/tenant.html @@ -54,7 +54,7 @@
- +
@@ -63,7 +63,6 @@ - diff --git a/frontend/tenant_detail.html b/frontend/tenant_detail.html index 23af3a12..6907a21d 100644 --- a/frontend/tenant_detail.html +++ b/frontend/tenant_detail.html @@ -113,7 +113,7 @@
diff --git a/i18n/en/LC_MESSAGES/frontend.mo b/i18n/en/LC_MESSAGES/frontend.mo index baacd75f..e967b405 100644 Binary files a/i18n/en/LC_MESSAGES/frontend.mo and b/i18n/en/LC_MESSAGES/frontend.mo differ diff --git a/i18n/en_frontend.po b/i18n/en_frontend.po index 77850569..c91407c5 100644 --- a/i18n/en_frontend.po +++ b/i18n/en_frontend.po @@ -271,7 +271,7 @@ msgstr "" #: backend/app/pkgs/tools/i18b.py:93 msgid "Requirement List" -msgstr "Requirement History" +msgstr "Task History" #: backend/app/pkgs/tools/i18b.py:94 msgid "APP List" @@ -417,11 +417,11 @@ msgstr "" #: backend/app/pkgs/tools/i18b.py:129 msgid "Billing type" -msgstr "" +msgstr "Plus type" #: backend/app/pkgs/tools/i18b.py:130 msgid "Billing quota" -msgstr "" +msgstr "Daily task limit" #: backend/app/pkgs/tools/i18b.py:131 msgid "Created" @@ -631,7 +631,7 @@ msgid "CodePower" msgstr "" #: backend/app/pkgs/tools/i18b.py:179 -msgid "Weekly development task limit: " +msgid "Daily development task limit: " msgstr "" #: backend/app/pkgs/tools/i18b.py:180 diff --git a/i18n/en_frontend.po~ b/i18n/en_frontend.po~ index 199ab7b8..cc501a39 100644 --- a/i18n/en_frontend.po~ +++ b/i18n/en_frontend.po~ @@ -271,7 +271,7 @@ msgstr "" #: backend/app/pkgs/tools/i18b.py:93 msgid "Requirement List" -msgstr "Requirement History" +msgstr "Task History" #: backend/app/pkgs/tools/i18b.py:94 msgid "APP List" @@ -417,11 +417,11 @@ msgstr "" #: backend/app/pkgs/tools/i18b.py:129 msgid "Billing type" -msgstr "" +msgstr "Plus type" #: backend/app/pkgs/tools/i18b.py:130 msgid "Billing quota" -msgstr "" +msgstr "Daily task limit" #: backend/app/pkgs/tools/i18b.py:131 msgid "Created" @@ -631,7 +631,7 @@ msgid "CodePower" msgstr "" #: backend/app/pkgs/tools/i18b.py:179 -msgid "Weekly development task limit: " +msgid "Daily development task limit: " msgstr "" #: backend/app/pkgs/tools/i18b.py:180 diff --git a/i18n/zh/LC_MESSAGES/frontend.mo b/i18n/zh/LC_MESSAGES/frontend.mo index 823caa05..9a71176d 100644 Binary files a/i18n/zh/LC_MESSAGES/frontend.mo and b/i18n/zh/LC_MESSAGES/frontend.mo differ diff --git a/i18n/zh_frontend.po b/i18n/zh_frontend.po index b37318b4..d4acd238 100644 --- a/i18n/zh_frontend.po +++ b/i18n/zh_frontend.po @@ -268,11 +268,11 @@ msgstr "开始部署" #: backend/app/pkgs/tools/i18b.py:92 msgid "Start task" -msgstr "开发需求" +msgstr "开始任务" #: backend/app/pkgs/tools/i18b.py:93 msgid "Requirement List" -msgstr "历史需求" +msgstr "历史任务" #: backend/app/pkgs/tools/i18b.py:94 msgid "APP List" @@ -382,7 +382,7 @@ msgstr "满意度评分" msgid "" "Historical requirement recovery is not supported at this time, please visit " "workspace to obtain the code results" -msgstr "当前版本暂不支持历史需求恢复,您可以访问 workspace 获取之前的代码结果" +msgstr "当前版本暂不支持历史任务恢复,您可以访问 workspace 获取之前的代码结果" #: backend/app/pkgs/tools/i18b.py:121 msgid "Notice" @@ -418,11 +418,11 @@ msgstr "企业简介" #: backend/app/pkgs/tools/i18b.py:129 msgid "Billing type" -msgstr "账单类型" +msgstr "会员类型" #: backend/app/pkgs/tools/i18b.py:130 msgid "Billing quota" -msgstr "账单周期内限额" +msgstr "每日任务限额" #: backend/app/pkgs/tools/i18b.py:131 msgid "Created" @@ -627,7 +627,7 @@ msgstr "码力" #: backend/app/pkgs/tools/i18b.py:179 msgid "Weekly development task limit: " -msgstr "每周开发任务限制:" +msgstr "每日开发任务限制:" #: backend/app/pkgs/tools/i18b.py:180 msgid "Expired: " diff --git a/i18n/zh_frontend.po~ b/i18n/zh_frontend.po~ index eb8b2ec6..c6d5a157 100644 --- a/i18n/zh_frontend.po~ +++ b/i18n/zh_frontend.po~ @@ -268,11 +268,11 @@ msgstr "开始部署" #: backend/app/pkgs/tools/i18b.py:92 msgid "Start task" -msgstr "开发需求" +msgstr "开始任务" #: backend/app/pkgs/tools/i18b.py:93 msgid "Requirement List" -msgstr "历史需求" +msgstr "历史任务" #: backend/app/pkgs/tools/i18b.py:94 msgid "APP List" @@ -382,7 +382,7 @@ msgstr "满意度评分" msgid "" "Historical requirement recovery is not supported at this time, please visit " "workspace to obtain the code results" -msgstr "当前版本暂不支持历史需求恢复,您可以访问 workspace 获取之前的代码结果" +msgstr "当前版本暂不支持历史任务恢复,您可以访问 workspace 获取之前的代码结果" #: backend/app/pkgs/tools/i18b.py:121 msgid "Notice" @@ -418,11 +418,11 @@ msgstr "企业简介" #: backend/app/pkgs/tools/i18b.py:129 msgid "Billing type" -msgstr "账单类型" +msgstr "会员类型" #: backend/app/pkgs/tools/i18b.py:130 msgid "Billing quota" -msgstr "账单周期内限额" +msgstr "每日任务限额" #: backend/app/pkgs/tools/i18b.py:131 msgid "Created" @@ -625,7 +625,7 @@ msgstr "码力" #: backend/app/pkgs/tools/i18b.py:179 msgid "Weekly development task limit: " -msgstr "每周开发任务限制:" +msgstr "每日开发任务限制:" #: backend/app/pkgs/tools/i18b.py:180 msgid "Expired: "