Skip to content

Commit 2e50d1c

Browse files
authored
ui: add colors for some texts and buttons (#504)
Co-authored-by: rick <[email protected]>
1 parent d9724e8 commit 2e50d1c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

console/atest-ui/src/views/TestCase.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ const duplicateTestCase = () => {
529529
<el-button type="primary" @click="saveTestCase" :icon="Edit" :loading="saveLoading"
530530
v-if="!Cache.GetCurrentStore().readOnly"
531531
>{{ t('button.save') }}</el-button>
532-
<el-button type="primary" @click="deleteTestCase" :icon="Delete">{{ t('button.delete') }}</el-button>
532+
<el-button type="danger" @click="deleteTestCase" :icon="Delete">{{ t('button.delete') }}</el-button>
533533
<el-button type="primary" @click="openDuplicateTestCaseDialog" :icon="CopyDocument">{{ t('button.duplicate') }}</el-button>
534534
<el-button type="primary" @click="openCodeDialog">{{ t('button.generateCode') }}</el-button>
535535
</div>

console/atest-ui/src/views/TestSuite.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ const targetSuiteDuplicateName = ref('')
331331
<el-button type="primary" @click="save" disabled v-if="Cache.GetCurrentStore().readOnly">{{
332332
t('button.save')
333333
}}</el-button>
334-
<el-button type="primary" @click="del" :icon="Delete" test-id="suite-del-but">{{
334+
<el-button type="danger" @click="del" :icon="Delete" test-id="suite-del-but">{{
335335
t('button.delete')
336336
}}</el-button>
337337
<el-button type="primary" @click="convert" test-id="convert">{{

console/atest-ui/src/views/TestingPanel.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const { t } = useI18n()
1616
interface Tree {
1717
id: string
1818
label: string
19+
method: string
1920
parent: string
2021
parentID: string
2122
store: string
@@ -41,6 +42,7 @@ const handleTreeClick = (data: Tree) => {
4142
data.children?.push({
4243
id: data.label,
4344
label: item.name,
45+
method: item.request.method,
4446
kind: data.kind,
4547
store: data.store,
4648
parent: data.label,
@@ -328,7 +330,16 @@ const suiteKinds = [{
328330
@node-click="handleTreeClick"
329331
@current-change="handleTreeClick"
330332
data-intro="This is the test suite tree. You can click the test suite to edit it."
331-
/>
333+
>
334+
<template #default="{ node, data }">
335+
<span class="custom-tree-node">
336+
<el-text class="mx-1" v-if="data.method === 'POST'" type="success">{{ node.label }}</el-text>
337+
<el-text class="mx-1" v-else-if="data.method === 'PUT'" type="warning">{{ node.label }}</el-text>
338+
<el-text class="mx-1" v-else-if="data.method === 'DELETE'" type="danger">{{ node.label }}</el-text>
339+
<el-text class="mx-1" v-else>{{ node.label }}</el-text>
340+
</span>
341+
</template>
342+
</el-tree>
332343
<TemplateFunctions/>
333344
</el-aside>
334345

0 commit comments

Comments
 (0)