Skip to content

Commit ae82cc0

Browse files
committed
fix: Improve System Overview tab UI - user name truncation and status column style
1 parent 4c73439 commit ae82cc0

File tree

1 file changed

+76
-9
lines changed
  • quantdinger_vue/src/views/user-manage

1 file changed

+76
-9
lines changed

quantdinger_vue/src/views/user-manage/index.vue

Lines changed: 76 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,24 @@
204204
>
205205
<!-- Strategy Status -->
206206
<template slot="strategyStatus" slot-scope="text">
207-
<a-badge :status="text === 'running' ? 'processing' : 'default'" />
208-
<a-tag :color="text === 'running' ? 'green' : 'default'" size="small">
209-
{{ text === 'running' ? ($t('systemOverview.running') || 'Running') : ($t('systemOverview.stopped') || 'Stopped') }}
210-
</a-tag>
207+
<span class="status-cell">
208+
<span class="status-dot" :class="text === 'running' ? 'dot-running' : 'dot-stopped'" />
209+
<span :class="text === 'running' ? 'status-running' : 'status-stopped'">
210+
{{ text === 'running' ? ($t('systemOverview.running') || 'Running') : ($t('systemOverview.stopped') || 'Stopped') }}
211+
</span>
212+
</span>
211213
</template>
212214

213215
<!-- User Column -->
214216
<template slot="userInfo" slot-scope="text, record">
215-
<span class="user-cell">
216-
<a-icon type="user" style="margin-right: 4px; color: #1890ff" />
217-
{{ record.nickname || record.username || '-' }}
218-
</span>
217+
<a-tooltip :title="(record.nickname || record.username || '-')">
218+
<span class="user-cell">
219+
<a-avatar size="small" :style="{ backgroundColor: getUserColor(record.user_id), fontSize: '11px', marginRight: '6px' }">
220+
{{ (record.nickname || record.username || '?').charAt(0).toUpperCase() }}
221+
</a-avatar>
222+
<span class="user-name">{{ truncate(record.nickname || record.username || '-', 8) }}</span>
223+
</span>
224+
</a-tooltip>
219225
</template>
220226

221227
<!-- Symbol Column -->
@@ -751,6 +757,11 @@ export default {
751757
this.loadSystemStrategies()
752758
},
753759
760+
getUserColor (userId) {
761+
const colors = ['#1890ff', '#722ed1', '#13c2c2', '#fa8c16', '#eb2f96', '#52c41a', '#2f54eb', '#faad14']
762+
return colors[(userId || 0) % colors.length]
763+
},
764+
754765
formatNumber (num) {
755766
if (!num && num !== 0) return '0'
756767
return Number(num).toLocaleString('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 2 })
@@ -1209,8 +1220,64 @@ export default {
12091220
margin-top: 2px;
12101221
}
12111222
1223+
// Status cell
1224+
.status-cell {
1225+
display: inline-flex;
1226+
align-items: center;
1227+
gap: 6px;
1228+
white-space: nowrap;
1229+
1230+
.status-dot {
1231+
display: inline-block;
1232+
width: 7px;
1233+
height: 7px;
1234+
border-radius: 50%;
1235+
flex-shrink: 0;
1236+
1237+
&.dot-running {
1238+
background: #52c41a;
1239+
box-shadow: 0 0 6px rgba(82, 196, 26, 0.5);
1240+
animation: pulse-green 2s infinite;
1241+
}
1242+
1243+
&.dot-stopped {
1244+
background: #d9d9d9;
1245+
}
1246+
}
1247+
1248+
.status-running {
1249+
color: #52c41a;
1250+
font-weight: 500;
1251+
font-size: 13px;
1252+
}
1253+
1254+
.status-stopped {
1255+
color: #999;
1256+
font-size: 13px;
1257+
}
1258+
}
1259+
1260+
@keyframes pulse-green {
1261+
0%, 100% { opacity: 1; }
1262+
50% { opacity: 0.5; }
1263+
}
1264+
1265+
// User cell
12121266
.user-cell {
1213-
font-size: 13px;
1267+
display: inline-flex;
1268+
align-items: center;
1269+
max-width: 100%;
1270+
overflow: hidden;
1271+
white-space: nowrap;
1272+
cursor: default;
1273+
1274+
.user-name {
1275+
font-size: 13px;
1276+
overflow: hidden;
1277+
text-overflow: ellipsis;
1278+
white-space: nowrap;
1279+
max-width: 80px;
1280+
}
12141281
}
12151282
12161283
.indicator-name {

0 commit comments

Comments
 (0)