Skip to content

Commit 1a435d3

Browse files
style: change button style
1 parent 0778e3e commit 1a435d3

File tree

9 files changed

+59
-16
lines changed

9 files changed

+59
-16
lines changed

frontend/src/assets/iconfont/iconfont.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@font-face {
22
font-family: "iconfont"; /* Project id 4776196 */
3-
src: url('iconfont.woff2?t=1745909790481') format('woff2'),
4-
url('iconfont.woff?t=1745909790481') format('woff'),
5-
url('iconfont.ttf?t=1745909790481') format('truetype'),
6-
url('iconfont.svg?t=1745909790481#iconfont') format('svg');
3+
src: url('iconfont.woff2?t=1750234328196') format('woff2'),
4+
url('iconfont.woff?t=1750234328196') format('woff'),
5+
url('iconfont.ttf?t=1750234328196') format('truetype'),
6+
url('iconfont.svg?t=1750234328196#iconfont') format('svg');
77
}
88

99
.iconfont {
@@ -14,6 +14,14 @@
1414
-moz-osx-font-smoothing: grayscale;
1515
}
1616

17+
.p-start:before {
18+
content: "\e688";
19+
}
20+
21+
.p-stop:before {
22+
content: "\e750";
23+
}
24+
1725
.p-node-4:before {
1826
content: "\e73c";
1927
}

frontend/src/assets/iconfont/iconfont.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/assets/iconfont/iconfont.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55
"css_prefix_text": "p-",
66
"description": "",
77
"glyphs": [
8+
{
9+
"icon_id": "15838584",
10+
"name": "arrow-right-filling",
11+
"font_class": "start",
12+
"unicode": "e688",
13+
"unicode_decimal": 59016
14+
},
15+
{
16+
"icon_id": "212329",
17+
"name": "stop",
18+
"font_class": "stop",
19+
"unicode": "e750",
20+
"unicode_decimal": 59216
21+
},
822
{
923
"icon_id": "7712749",
1024
"name": "node-4",

frontend/src/assets/iconfont/iconfont.svg

Lines changed: 4 additions & 0 deletions
Loading
216 Bytes
Binary file not shown.
124 Bytes
Binary file not shown.
180 Bytes
Binary file not shown.

frontend/src/components/status/index.vue

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<el-tooltip v-if="msg" effect="dark" placement="bottom">
2+
<el-tooltip v-if="msg && msg != ''" effect="dark" placement="bottom">
33
<template #content>
44
<div class="content">{{ msg }}</div>
55
</template>
@@ -12,19 +12,30 @@
1212
</span>
1313
</el-tag>
1414
</el-tooltip>
15-
16-
<el-tag size="small" v-else :type="getType(statusItem)" round effect="light">
17-
<span class="flx-align-center">
15+
<span v-else>
16+
<el-tag size="small" :type="getType(statusItem)" round effect="light" v-if="!operate">
17+
<span class="flx-align-center">
18+
{{ $t('commons.status.' + statusItem) }}
19+
<el-icon v-if="loadingIcon(statusItem)" class="is-loading">
20+
<Loading />
21+
</el-icon>
22+
</span>
23+
</el-tag>
24+
<el-button size="small" v-else :type="getType(statusItem)" plain round>
1825
{{ $t('commons.status.' + statusItem) }}
1926
<el-icon v-if="loadingIcon(statusItem)" class="is-loading">
2027
<Loading />
2128
</el-icon>
22-
<el-icon size="15" v-if="operate">
23-
<CaretRight v-if="statusItem == 'running'" />
24-
<CaretBottom v-if="statusItem == 'stopped'" />
29+
<el-icon size="15" v-else>
30+
<svg-icon
31+
iconName="p-stop"
32+
class="status-icon"
33+
v-if="statusItem == 'stopped' || statusItem == 'exited'"
34+
></svg-icon>
35+
<svg-icon iconName="p-start" class="svg-icon" v-if="statusItem == 'running'"></svg-icon>
2536
</el-icon>
26-
</span>
27-
</el-tag>
37+
</el-button>
38+
</span>
2839
</template>
2940

3041
<script lang="ts" setup>
@@ -33,6 +44,7 @@ import { computed } from 'vue';
3344
const props = defineProps({
3445
status: String,
3546
msg: String,
47+
hasIcon: Boolean,
3648
operate: {
3749
type: Boolean,
3850
default: false,
@@ -64,9 +76,9 @@ const getType = (status: string) => {
6476
case 'unhealthy':
6577
case 'failed':
6678
case 'lost':
79+
case 'exited':
6780
return 'danger';
6881
case 'paused':
69-
case 'exited':
7082
case 'dead':
7183
case 'removing':
7284
case 'deleted':
@@ -105,4 +117,9 @@ const loadingIcon = (status: string): boolean => {
105117
width: 300px;
106118
word-break: break-all;
107119
}
120+
121+
.status-icon {
122+
width: 1em;
123+
height: 1em;
124+
}
108125
</style>

frontend/src/views/container/container/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
<el-table-column :label="$t('commons.table.status')" min-width="100" prop="state" sortable>
113113
<template #default="{ row }">
114114
<el-dropdown placement="bottom">
115-
<Status :key="row.state" :status="row.state"></Status>
115+
<Status :key="row.state" :status="row.state" :operate="true"></Status>
116116
<template #dropdown>
117117
<el-dropdown-menu>
118118
<el-dropdown-item

0 commit comments

Comments
 (0)