Browse Source

fix: 优化分组显示 (#371)

pull/372/head
ssongliu 2 years ago committed by GitHub
parent
commit
66a345364f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      backend/app/service/group.go
  2. 4
      frontend/src/components/group/index.vue
  3. 2
      frontend/src/lang/modules/en.ts
  4. 4
      frontend/src/lang/modules/zh.ts
  5. 2
      frontend/src/views/home/index.vue

2
backend/app/service/group.go

@ -22,7 +22,7 @@ func NewIGroupService() IGroupService {
}
func (u *GroupService) List(req dto.GroupSearch) ([]dto.GroupInfo, error) {
groups, err := groupRepo.GetList(commonRepo.WithByType(req.Type))
groups, err := groupRepo.GetList(commonRepo.WithByType(req.Type), commonRepo.WithOrderBy("created_at desc"))
if err != nil {
return nil, constant.ErrRecordNotFound
}

4
frontend/src/components/group/index.vue

@ -20,7 +20,7 @@
<el-form ref="groupForm" v-if="row.edit" :model="row">
<el-form-item prop="name" v-if="row.edit" :rules="Rules.name">
<el-input v-model="row.name"></el-input>
<div style="margin-top: 20px; width: 100%"><el-input v-model="row.name" /></div>
</el-form-item>
</el-form>
</template>
@ -145,7 +145,7 @@ const openCreate = () => {
isDefault: false,
edit: true,
};
data.value.push(g);
data.value.unshift(g);
};
const deleteGroup = (index: number) => {

2
frontend/src/lang/modules/en.ts

@ -229,7 +229,7 @@ const message = {
io: 'Disk IO',
totalSend: 'Total send',
totalRecv: 'Total recv',
rwPerSecond: 'RW per second',
rwPerSecond: 'IO times',
ioDelay: 'IO delay',
time: 'Times',
uptime: 'Up Time',

4
frontend/src/lang/modules/zh.ts

@ -234,8 +234,8 @@ const message = {
io: '磁盘 IO',
totalSend: '总发送',
totalRecv: '总接收',
rwPerSecond: '每秒读写',
ioDelay: 'IO 延迟',
rwPerSecond: '读写次数',
ioDelay: '读写延迟',
time: '次',
uptime: '启动时间',
runningTime: '运行时间',

2
frontend/src/views/home/index.vue

@ -104,7 +104,7 @@
<el-tag>
{{ $t('home.rwPerSecond') }}: {{ currentChartInfo.ioCount }} {{ $t('home.time') }}
</el-tag>
<el-tag>{{ $t('home.rwPerSecond') }}: {{ currentInfo.ioTime }} ms</el-tag>
<el-tag>{{ $t('home.ioDelay') }}: {{ currentInfo.ioTime }} ms</el-tag>
</div>
<div v-if="chartOption === 'io'" style="margin-top: 40px">

Loading…
Cancel
Save