Skip to content

Commit 5c0e214

Browse files
committed
fix: URL解析host字段排除端口 & 优化首页统计卡片尺寸
1 parent 65cc22c commit 5c0e214

4 files changed

Lines changed: 29 additions & 29 deletions

File tree

src/backEnd/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
MAX_TASKS_COUNT_LOCK = threading.Lock()
55

66

7-
VERSION = "1.8.6"
7+
VERSION = "1.8.7"

src/frontEnd/src/utils/httpRequestParser/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface ParsedHttpRequest {
1212
method: string
1313
/** 完整URL */
1414
url: string
15-
/** 主机名(包含端口) */
15+
/** 主机名(不含端口) */
1616
host: string
1717
/** 请求路径(包含查询字符串和hash) */
1818
path: string

src/frontEnd/src/utils/httpRequestParser/urlParser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
export interface UrlParseResult {
8-
/** 主机名(包含端口) */
8+
/** 主机名(不含端口) */
99
host: string
1010
/** 请求路径 */
1111
path: string
@@ -21,7 +21,7 @@ export interface UrlParseResult {
2121
*
2222
* @example
2323
* parseUrl('https://example.com:8080/api/users?id=1')
24-
* // => { host: 'example.com:8080', path: '/api/users?id=1', protocol: 'https' }
24+
* // => { host: 'example.com', path: '/api/users?id=1', protocol: 'https' }
2525
*/
2626
export function parseUrl(urlStr: string): UrlParseResult {
2727
// 默认返回值
@@ -37,7 +37,7 @@ export function parseUrl(urlStr: string): UrlParseResult {
3737
const path = url.pathname + url.search + url.hash
3838

3939
return {
40-
host: url.host,
40+
host: url.hostname, // 使用 hostname 而不是 host,不包含端口
4141
path: path || '/',
4242
protocol: url.protocol.replace(':', '')
4343
}
@@ -51,15 +51,15 @@ export function parseUrl(urlStr: string): UrlParseResult {
5151
* 手动解析URL(当原生URL API失败时的备选方案)
5252
*/
5353
function parseUrlManually(urlStr: string): UrlParseResult | null {
54-
const match = urlStr.match(/^(https?):\/\/([^\/]+)(\/.*)?$/)
54+
const match = urlStr.match(/^(https?):\/\/([^\/:]+)(?::\d+)?(\/.*)?$/)
5555

5656
if (!match) {
5757
return null
5858
}
5959

6060
return {
6161
protocol: match[1] || 'http',
62-
host: match[2] || '',
62+
host: match[2] || '', // 只取主机名,不含端口
6363
path: match[3] || '/'
6464
}
6565
}

src/frontEnd/src/views/Home/index.vue

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function navigateToTasks(filterType: FilterType) {
240240
.home-page {
241241
width: 100%; // 占满主内容区域,不限制最大宽度
242242
margin: 0;
243-
padding: 32px 0; // 只保留上下内边距
243+
padding: 20px 0; // 只保留上下内边距
244244
position: relative;
245245
246246
&::before {
@@ -272,13 +272,13 @@ function navigateToTasks(filterType: FilterType) {
272272
}
273273
274274
.intro-text {
275-
margin-bottom: 40px;
275+
margin-bottom: 24px;
276276
color: $text-color-secondary;
277-
font-size: 16px;
278-
line-height: 1.7;
277+
font-size: 14px;
278+
line-height: 1.6;
279279
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
280280
background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(248, 250, 252, 0.4) 100%);
281-
padding: 20px 24px;
281+
padding: 14px 18px;
282282
border-radius: $border-radius-lg;
283283
border: 1px solid rgba(255, 255, 255, 0.3);
284284
box-shadow: $shadow-raised;
@@ -292,17 +292,17 @@ function navigateToTasks(filterType: FilterType) {
292292
}
293293
294294
.stats-section {
295-
margin-bottom: 48px;
295+
margin-bottom: 28px;
296296
297297
&:last-child {
298298
margin-bottom: 0;
299299
}
300300
}
301301
302302
.section-title {
303-
font-size: 24px;
303+
font-size: 20px;
304304
font-weight: $font-weight-bold;
305-
margin-bottom: 24px;
305+
margin-bottom: 16px;
306306
color: $text-color;
307307
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
308308
background: $gradient-primary;
@@ -326,10 +326,10 @@ function navigateToTasks(filterType: FilterType) {
326326
327327
.stats-grid {
328328
display: grid;
329-
gap: 24px;
329+
gap: 16px;
330330
331331
&.status-stats {
332-
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
332+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
333333
334334
@media (min-width: 1400px) {
335335
grid-template-columns: repeat(4, 1fr);
@@ -345,7 +345,7 @@ function navigateToTasks(filterType: FilterType) {
345345
346346
@media (max-width: 767px) {
347347
grid-template-columns: 1fr;
348-
gap: 20px;
348+
gap: 12px;
349349
}
350350
}
351351
@@ -358,7 +358,7 @@ function navigateToTasks(filterType: FilterType) {
358358
359359
@media (max-width: 767px) {
360360
grid-template-columns: 1fr;
361-
gap: 20px;
361+
gap: 12px;
362362
}
363363
}
364364
}
@@ -417,20 +417,20 @@ function navigateToTasks(filterType: FilterType) {
417417
.stat-content {
418418
display: flex;
419419
align-items: center;
420-
gap: 20px;
421-
padding: 32px;
420+
gap: 14px;
421+
padding: 18px 20px;
422422
position: relative;
423423
z-index: 2;
424424
}
425425
426426
.stat-icon {
427-
width: 72px;
428-
height: 72px;
429-
border-radius: $border-radius-lg;
427+
width: 48px;
428+
height: 48px;
429+
border-radius: $border-radius;
430430
display: flex;
431431
align-items: center;
432432
justify-content: center;
433-
font-size: 32px;
433+
font-size: 22px;
434434
flex-shrink: 0;
435435
position: relative;
436436
transition: $transition-base;
@@ -472,10 +472,10 @@ function navigateToTasks(filterType: FilterType) {
472472
}
473473
474474
.stat-value {
475-
font-size: 36px;
475+
font-size: 26px;
476476
font-weight: $font-weight-bold;
477477
line-height: 1.2;
478-
margin-bottom: 8px;
478+
margin-bottom: 4px;
479479
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
480480
position: relative;
481481
transition: $transition-base;
@@ -487,10 +487,10 @@ function navigateToTasks(filterType: FilterType) {
487487
}
488488
489489
.stat-label {
490-
font-size: 16px;
490+
font-size: 13px;
491491
color: $text-color-secondary;
492492
font-weight: $font-weight-medium;
493-
line-height: 1.4;
493+
line-height: 1.3;
494494
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
495495
transition: $transition-base;
496496

0 commit comments

Comments
 (0)