Skip to content

Commit 80d05ea

Browse files
committed
fix: 修复TypeScript类型错误和SCSS变量
- 修复AddTask中createTask改为addTask - 修复parseHttpRequest返回类型处理 - 修复Home.vue中taskStats索引类型 - 修复Layout.vue中键盘事件类型 - 批量替换Config组件中的SCSS变量为CSS变量 - 构建成功通过
1 parent ed7262e commit 80d05ea

9 files changed

Lines changed: 158 additions & 59 deletions

File tree

src/backEnd/static/tmp.svg

Lines changed: 99 additions & 0 deletions
Loading

src/frontEnd/src/components.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ declare module 'vue' {
2525
FileUpload: typeof import('primevue/fileupload')['default']
2626
GuidedParamEditor: typeof import('./components/GuidedParamEditor.vue')['default']
2727
GuidedParamEditorDialog: typeof import('./components/GuidedParamEditorDialog.vue')['default']
28-
HelloWorld: typeof import('./components/HelloWorld.vue')['default']
2928
HttpCodeEditor: typeof import('./components/HttpCodeEditor.vue')['default']
3029
IconField: typeof import('primevue/iconfield')['default']
3130
InlineMessage: typeof import('primevue/inlinemessage')['default']
@@ -39,7 +38,6 @@ declare module 'vue' {
3938
RouterLink: typeof import('vue-router')['RouterLink']
4039
RouterView: typeof import('vue-router')['RouterView']
4140
SearchFilterBar: typeof import('./components/SearchFilterBar.vue')['default']
42-
SelectButton: typeof import('primevue/selectbutton')['default']
4341
Slider: typeof import('primevue/slider')['default']
4442
StatCard: typeof import('./components/StatCard.vue')['default']
4543
Tag: typeof import('primevue/tag')['default']

src/frontEnd/src/views/AddTask/index.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ import Divider from 'primevue/divider'
157157
import HttpCodeEditor from '@/components/HttpCodeEditor.vue'
158158
import CommandLinePreview from '@/components/CommandLinePreview.vue'
159159
import { parseHttpRequest } from '@/utils/httpRequestParser'
160-
import { createTask } from '@/api/task'
160+
import { addTask } from '@/api/task'
161161
162162
const router = useRouter()
163163
const toast = useToast()
@@ -269,10 +269,12 @@ function onInputChange() {
269269
function parseInput() {
270270
try {
271271
const result = parseHttpRequest(inputContent.value)
272-
if (result) {
273-
rawHttpContent.value = result.raw
274-
parsedRequest.value = result.parsed
272+
if (result.success) {
273+
rawHttpContent.value = result.rawHttp || ''
274+
parsedRequest.value = result.data
275275
toast.add({ severity: 'success', summary: '解析成功', life: 2000 })
276+
} else {
277+
toast.add({ severity: 'error', summary: '解析失败', detail: result.error, life: 3000 })
276278
}
277279
} catch (error) {
278280
toast.add({ severity: 'error', summary: '解析失败', detail: String(error), life: 3000 })
@@ -301,8 +303,8 @@ async function submitTask() {
301303
302304
submitting.value = true
303305
try {
304-
const result = await createTask({
305-
request: rawHttpContent.value,
306+
const result = await addTask({
307+
scanUrl: rawHttpContent.value,
306308
options: {
307309
level: configOptions.level ? configOptions.levelValue : undefined,
308310
threads: configOptions.threads ? configOptions.threadsValue : undefined,

src/frontEnd/src/views/Config/components/DefaultConfigPanel.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,23 +298,23 @@ onMounted(async () => {
298298
.left-panel, .right-panel {
299299
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.7) 100%);
300300
border: 1px solid rgba(226, 232, 240, 0.5);
301-
border-radius: $border-radius;
301+
border-radius: var(--p-border-radius);
302302
padding: 16px;
303303
}
304304
305305
.section-title {
306306
font-weight: 600;
307307
font-size: 15px;
308-
color: $text-color;
308+
color: var(--p-text-color);
309309
margin-bottom: 16px;
310310
padding-bottom: 8px;
311-
border-bottom: 2px solid $primary-color;
311+
border-bottom: 2px solid var(--p-primary-color);
312312
}
313313
314314
.section-subtitle {
315315
font-weight: 600;
316316
font-size: 14px;
317-
color: $text-color;
317+
color: var(--p-text-color);
318318
margin-bottom: 12px;
319319
}
320320
@@ -333,17 +333,17 @@ onMounted(async () => {
333333
min-width: 100px;
334334
font-size: 13px;
335335
font-weight: 500;
336-
color: $text-color;
336+
color: var(--p-text-color);
337337
}
338338
339339
.param-desc {
340340
font-size: 12px;
341-
color: $text-color-secondary;
341+
color: var(--p-text-color)-secondary;
342342
}
343343
344344
.checkbox-label {
345345
font-size: 13px;
346-
color: $text-color;
346+
color: var(--p-text-color);
347347
}
348348
}
349349
@@ -402,7 +402,7 @@ onMounted(async () => {
402402
403403
.source-desc {
404404
font-size: 12px;
405-
color: $text-color-secondary;
405+
color: var(--p-text-color)-secondary;
406406
margin-left: 28px;
407407
margin-bottom: 8px;
408408
}
@@ -431,7 +431,7 @@ onMounted(async () => {
431431
432432
.option-desc {
433433
font-size: 12px;
434-
color: $text-color-secondary;
434+
color: var(--p-text-color)-secondary;
435435
margin-left: 28px;
436436
margin-top: 4px;
437437
}
@@ -444,7 +444,7 @@ onMounted(async () => {
444444
gap: 16px;
445445
padding: 12px;
446446
background: rgba(248, 250, 252, 0.5);
447-
border-radius: $border-radius;
447+
border-radius: var(--p-border-radius);
448448
449449
.persist-option {
450450
display: flex;
@@ -459,7 +459,7 @@ onMounted(async () => {
459459
460460
.preview-section {
461461
background: #1e1e1e;
462-
border-radius: $border-radius;
462+
border-radius: var(--p-border-radius);
463463
overflow: hidden;
464464
465465
.section-title {

src/frontEnd/src/views/Config/components/HistoryConfigPanel.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,16 @@ onMounted(() => {
273273
.search-section {
274274
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.7) 100%);
275275
border: 1px solid rgba(226, 232, 240, 0.5);
276-
border-radius: $border-radius;
276+
border-radius: var(--p-border-radius);
277277
padding: 12px;
278278
279279
.search-title {
280280
font-weight: 600;
281281
font-size: 14px;
282-
color: $text-color;
282+
color: var(--p-text-color);
283283
margin-bottom: 10px;
284284
padding-bottom: 6px;
285-
border-bottom: 2px solid $primary-color;
285+
border-bottom: 2px solid var(--p-primary-color);
286286
}
287287
288288
.search-row {
@@ -293,7 +293,7 @@ onMounted(() => {
293293
294294
label {
295295
font-size: 13px;
296-
color: $text-color;
296+
color: var(--p-text-color);
297297
}
298298
299299
.search-input {
@@ -309,30 +309,30 @@ onMounted(() => {
309309
310310
.options-label {
311311
font-size: 13px;
312-
color: $text-color-secondary;
312+
color: var(--p-text-color)-secondary;
313313
}
314314
315315
.checkbox-text {
316316
font-size: 13px;
317-
color: $text-color;
317+
color: var(--p-text-color);
318318
}
319319
}
320320
}
321321
322322
.table-section {
323323
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.7) 100%);
324324
border: 1px solid rgba(226, 232, 240, 0.5);
325-
border-radius: $border-radius;
325+
border-radius: var(--p-border-radius);
326326
padding: 12px;
327327
flex: 1;
328328
329329
.table-title {
330330
font-weight: 600;
331331
font-size: 14px;
332-
color: $text-color;
332+
color: var(--p-text-color);
333333
margin-bottom: 12px;
334334
padding-bottom: 8px;
335-
border-bottom: 2px solid $primary-color;
335+
border-bottom: 2px solid var(--p-primary-color);
336336
}
337337
}
338338
@@ -351,7 +351,7 @@ onMounted(() => {
351351
justify-content: space-between;
352352
padding: 10px 12px;
353353
background: rgba(248, 250, 252, 0.5);
354-
border-radius: $border-radius;
354+
border-radius: var(--p-border-radius);
355355
356356
.left-buttons, .right-buttons {
357357
display: flex;
@@ -360,7 +360,7 @@ onMounted(() => {
360360
361361
.status-text {
362362
font-size: 13px;
363-
color: $text-color-secondary;
363+
color: var(--p-text-color)-secondary;
364364
}
365365
}
366366
</style>

src/frontEnd/src/views/Config/components/PresetConfigPanel.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,13 @@ onMounted(() => {
504504
.search-section {
505505
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.7) 100%);
506506
border: 1px solid rgba(226, 232, 240, 0.5);
507-
border-radius: $border-radius;
507+
border-radius: var(--p-border-radius);
508508
padding: 12px;
509509
510510
.search-title {
511511
font-weight: 600;
512512
font-size: 13px;
513-
color: $text-color;
513+
color: var(--p-text-color);
514514
margin-bottom: 8px;
515515
}
516516
@@ -522,7 +522,7 @@ onMounted(() => {
522522
523523
label {
524524
font-size: 13px;
525-
color: $text-color;
525+
color: var(--p-text-color);
526526
}
527527
528528
.search-input {
@@ -531,7 +531,7 @@ onMounted(() => {
531531
532532
.checkbox-text {
533533
font-size: 13px;
534-
color: $text-color;
534+
color: var(--p-text-color);
535535
}
536536
}
537537
}
@@ -551,16 +551,16 @@ onMounted(() => {
551551
.table-section {
552552
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.7) 100%);
553553
border: 1px solid rgba(226, 232, 240, 0.5);
554-
border-radius: $border-radius;
554+
border-radius: var(--p-border-radius);
555555
padding: 12px;
556556
557557
.table-title {
558558
font-weight: 600;
559559
font-size: 14px;
560-
color: $text-color;
560+
color: var(--p-text-color);
561561
margin-bottom: 12px;
562562
padding-bottom: 8px;
563-
border-bottom: 2px solid $primary-color;
563+
border-bottom: 2px solid var(--p-primary-color);
564564
}
565565
}
566566
@@ -575,10 +575,10 @@ onMounted(() => {
575575
576576
.status-bar {
577577
font-size: 13px;
578-
color: $text-color-secondary;
578+
color: var(--p-text-color)-secondary;
579579
padding: 8px 12px;
580580
background: rgba(248, 250, 252, 0.5);
581-
border-radius: $border-radius;
581+
border-radius: var(--p-border-radius);
582582
}
583583
584584
.dialog-form, .import-form {
@@ -594,7 +594,7 @@ onMounted(() => {
594594
label {
595595
font-size: 13px;
596596
font-weight: 500;
597-
color: $text-color-secondary;
597+
color: var(--p-text-color)-secondary;
598598
}
599599
}
600600
}

0 commit comments

Comments
 (0)