From 2041fd24c9562641913a7ba33600a06108c56827 Mon Sep 17 00:00:00 2001 From: chenhq Date: Tue, 31 Oct 2023 09:23:49 +0800 Subject: [PATCH] Translate new page --- webmeter/core/engine.py | 4 +++ webmeter/core/utils.py | 1 + webmeter/static/js/lan.js | 38 ++++++++++++++++++++++ webmeter/templates/analysis.html | 18 +++++------ webmeter/templates/config.html | 21 ++++++------ webmeter/templates/result.html | 22 ++++++------- webmeter/view/page.py | 4 ++- webmeter/webmeter/app.db | Bin 0 -> 98304 bytes webmeter/webmeter/plan01/plan.jmx | 52 ++++++++++++++++++++++++++++++ 9 files changed, 130 insertions(+), 30 deletions(-) create mode 100644 webmeter/webmeter/app.db create mode 100644 webmeter/webmeter/plan01/plan.jmx diff --git a/webmeter/core/engine.py b/webmeter/core/engine.py index 7bc6eaa..5c39aaa 100644 --- a/webmeter/core/engine.py +++ b/webmeter/core/engine.py @@ -34,6 +34,10 @@ def write_JmeterFile(cls, file, content) -> None: file_path = os.path.join(cls.JMETER_DIR, 'bin', file) Common.write_file_content(file_path, content) + @classmethod + def remote_hosts(cls): + pass + @classmethod def run(cls, content: dict, remote=False) -> int: diff --git a/webmeter/core/utils.py b/webmeter/core/utils.py index ccbfd35..5261740 100644 --- a/webmeter/core/utils.py +++ b/webmeter/core/utils.py @@ -3,6 +3,7 @@ from enum import Enum, unique import platform import psutil +import time from loguru import logger from xml.etree import ElementTree from typing import Optional diff --git a/webmeter/static/js/lan.js b/webmeter/static/js/lan.js index 22e6746..785b550 100644 --- a/webmeter/static/js/lan.js +++ b/webmeter/static/js/lan.js @@ -56,6 +56,25 @@ const ENGLISH = { 'browser_compatible_headers': 'Browser-compatible headers', 'parameters': 'Parameters', 'body_data': 'Body Data', + 'task':'Task', + 'plan':'Plan', + 'model':'Model', + 'threads':'Threads', + 'success_num':'Success Num', + 'fail_num':'Fail Num', + 'status':'Status', + 'start_time':'Start Time', + 'end_time':'End Time', + 'jmeter_config': 'JMETER CONFIG', + 'dashboard': 'Dashboard', + 'charts':'Charts', + 'test_and_report_info': 'Test and Report information', + 'requests_summary':'Requests Summary', + 'statistics':'Statistics', + 'response_times_over_time':'Response Times Over Time (ms)', + 'latencies_over_time': 'Latencies Over Time (ms)', + 'connect_time_over_time':'Connect Time Over Time (ms)', + 'screenshot':'ScreenShot' } @@ -117,4 +136,23 @@ const CHINESE = { 'browser_compatible_headers': '与浏览器兼容的头', 'parameters': '参数', 'body_data': '消息体数据', + 'task':'任务', + 'plan':'测试计划', + 'model':'模式', + 'threads':'线程数', + 'success_num':'成功数', + 'fail_num':'失败数', + 'status':'状态', + 'start_time':'开始时间', + 'end_time':'结束时间', + 'jmeter_config': 'JMETER配置文件', + 'dashboard': '汇总', + 'charts':'图表', + 'test_and_report_info': '测试和报告数据信息', + 'requests_summary':'请求详细', + 'statistics':'统计', + 'response_times_over_time':'响应时间(毫秒)', + 'latencies_over_time': '延迟时间(毫秒)', + 'connect_time_over_time':'连接时间(毫秒)', + 'screenshot':'截图' } \ No newline at end of file diff --git a/webmeter/templates/analysis.html b/webmeter/templates/analysis.html index 689c058..00c95c5 100644 --- a/webmeter/templates/analysis.html +++ b/webmeter/templates/analysis.html @@ -110,7 +110,7 @@

@@ -120,10 +120,10 @@

- +
-

Test and Report information

+

@@ -151,7 +151,7 @@

Test and Report information

-

Requests Summary

+

@@ -188,7 +188,7 @@

Requests Summary

-

Statistics

+

@@ -232,10 +232,10 @@

Statistics

- +
-
Response Times Over Time (ms)
+
-
Latencies Over Time (ms)
+
-
Connect Time Over Time (ms)
+
diff --git a/webmeter/templates/config.html b/webmeter/templates/config.html index b26f7bc..eb951c2 100644 --- a/webmeter/templates/config.html +++ b/webmeter/templates/config.html @@ -90,29 +90,32 @@

- JMETER CONFIG +
+ {% if platform == 'windows' %}
-
- - -
-
- - -
+ {% else %} +
+ + +
+ {% endif %} +
+ + +
diff --git a/webmeter/templates/result.html b/webmeter/templates/result.html index 967fa0d..87910bb 100644 --- a/webmeter/templates/result.html +++ b/webmeter/templates/result.html @@ -88,12 +88,12 @@

- TASK +

@@ -101,15 +101,15 @@

- - - - - - - - - + + + + + + + + + diff --git a/webmeter/view/page.py b/webmeter/view/page.py index 59abf9d..9541db0 100644 --- a/webmeter/view/page.py +++ b/webmeter/view/page.py @@ -4,6 +4,7 @@ from fastapi.responses import RedirectResponse from fastapi import APIRouter import os +from core.utils import Common router = APIRouter() @@ -29,4 +30,5 @@ async def result(request: Request, plan: str, task: str): @router.get("/config", response_class=HTMLResponse) async def result(request: Request): - return templates.TemplateResponse("config.html", {"request": request}) \ No newline at end of file + platform = Common.pc_platform() + return templates.TemplateResponse("config.html", {"request": request, 'platform': platform}) \ No newline at end of file diff --git a/webmeter/webmeter/app.db b/webmeter/webmeter/app.db new file mode 100644 index 0000000000000000000000000000000000000000..470f35d0adad5c60569b0c2f707c48484d178611 GIT binary patch literal 98304 zcmeI*(Qn&C9Kdm3u1n&ysmHp`n*zgIg{TFk>C(VjAw*$?m6eut?M5F^6`E{|)~2IP z83^rR<6q!^;4k2T7myG_yzYT_Kxh)0GzN5l1P`3gcI%`GlTbrL_l?rTKA(U0^T&6o zE_Kp#XD7?ml5=rob-7S=a>jl`2;)V^F$|+m{Tx<5;muYH9pQ?47Lny~X)V>9#4neln2U$vQX&-KLZfs9xVb6#Gl zl&dSN3yanAaw%9jSf74PCGRML0;gZ^=Dv0yZa9`p}D4*MqQ+Gz+V$)Pz*)Zox`; znck4~@sw>O&@@>^T8eQo0M|O74rquAWw}zj;U-j~8sZdWLcy2q1s}0tg_000IagfB*t}MPOcb8b@+{v1F`waL{|tBRk|j z4xGphWluaelpPw$omA87N^zjDv{EUF4Y6@bJ)g)83}pvSJm(B$M~6m6b0_NxhVvI< zIA2=UkvLn>v!vy_B%i_LI42-5I_I{1Q0*~0R#|00D*ra&>@pTdJi!vlcqoazhziI zTi;o?{!KjgK>z^+5I_I{1Q0*~0R#|00D=Epz><9;@;Lxmw;t=3eco3Ggr9Bj=l|at z)^F+)0N?)S+0q~a2q1s}0tg_000IagfB*sr?0`T@9ufYx8_2E2m?@8#eyKnIzvo^5 z|C@Dh2O1;<0tg_000IagfB*srAb(k~9u>}DH5I_I{ z1Q0*~0R#|0009JcLBN)|;KKfze_JRUm8<_b7&|0$!6pBj^}T-?=wJVT+pzwyezI=w z!g0_f0tg_000IagfB*srAb|Auq%ndbfB*srAbxE0D z#mnVNX|3e_{a;vr8S2gr0R#|0009ILKmY**5I_I{1oohSl&0y=|2GV4V-Fr6hlBtE z2q1s}0tg_000IagfWSj6&?z4?!^;5t`Tu>xy8jS^aOemifB*srAb + + + + false + false + true + + + + + + + + Thread Group Comment + continue + + false + 1 + + 500 + 1 + false + + + true + + + + + + + www.baidu.com + + https + + /?tn=02003390_42_hao_pg + GET + true + false + true + false + + + + HTTP Request Comment + + + + + + \ No newline at end of file
PLANTASKMODELTHREADSSUCCESS NUMFAILED NUMSTATUSSTART TIMEEND TIME