Skip to content

Commit

Permalink
refactor: adjust certificate editor
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Nov 15, 2024
1 parent 0e519eb commit 20acd3e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
32 changes: 13 additions & 19 deletions Benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,23 @@ Requests/sec: 117876.05
Transfer/sec: 15.40MB
```

## Nginx --> Nginx

## Pingap --> Nginx

```bash
wrk 'http://127.0.0.1:6200/ping' --latency
wrk 'http://127.0.0.1:6101/ping' --latency

Running 10s test @ http://127.0.0.1:6200/ping
Running 10s test @ http://127.0.0.1:6101/ping
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 287.76us 2.00ms 43.08ms 98.30%
Req/Sec 64.58k 4.49k 79.88k 87.13%
Latency 221.18us 394.85us 13.41ms 99.53%
Req/Sec 24.98k 0.90k 26.78k 89.60%
Latency Distribution
50% 73.00us
75% 81.00us
90% 88.00us
99% 8.16ms
1298148 requests in 10.10s, 185.70MB read
Requests/sec: 128518.38
Transfer/sec: 18.38MB
```


## Pingap --> Nginx

```bash
wrk 'http://127.0.0.1:6101/ping' --latency
50% 212.00us
75% 226.00us
90% 240.00us
99% 305.00us
502003 requests in 10.10s, 71.81MB read
Requests/sec: 49706.13
Transfer/sec: 7.11MB
```
5 changes: 3 additions & 2 deletions benches/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ http {

upstream backend {
server 127.0.0.1:6200;
keepalive 300;
keepalive 30;
}


sendfile on;
keepalive_timeout 65;
keepalive_requests 1000000;
keepalive_requests 1000;
server {
listen 6201;
#server_name localhost;
#access_log /tmp/access.log access;
location / {
default_type text/json;
proxy_http_version 1.1;
proxy_pass http://backend;
}

Expand Down
1 change: 1 addition & 0 deletions web/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default {
machineMemory: "Machine Memory",
yes: "Yes",
no: "No",
to: "To",
},
basic: {
name: "Name",
Expand Down
1 change: 1 addition & 0 deletions web/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default {
machineMemory: "机器内存",
yes: "是",
no: "否",
to: "至",
},
basic: {
name: "名称",
Expand Down
6 changes: 6 additions & 0 deletions web/src/pages/Certificates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export default function Certificates() {
currentCertificate,
config.certificates,
);
const countLines = (value: string) => {
const count = value.split("\n").length;
return Math.min(Math.max(3, count), 8);
};

const items: ExFormItem[] = [
{
Expand All @@ -70,6 +74,7 @@ export default function Certificates() {
defaultValue: certificateConfig.tls_cert,
span: 6,
category: ExFormItemCategory.TEXTAREA,
rows: countLines(certificateConfig.tls_cert || ""),
},
{
name: "tls_key",
Expand All @@ -78,6 +83,7 @@ export default function Certificates() {
defaultValue: certificateConfig.tls_key,
span: 6,
category: ExFormItemCategory.TEXTAREA,
rows: countLines(certificateConfig.tls_key || ""),
},
{
name: "tls_chain",
Expand Down
4 changes: 3 additions & 1 deletion web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export default function Home() {
const data = infos[name];
if (data) {
results[name] =
formatDate(data.not_before) + " : " + formatDate(data.not_after);
formatDate(data.not_before) +
` ${homeI18n("to")} ` +
formatDate(data.not_after);
}
});
setValidity(results);
Expand Down

0 comments on commit 20acd3e

Please sign in to comment.