Skip to content

Commit

Permalink
fix: 优化 devops 控制台交互体验、样式、延长请求超时时间到 60秒;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Aug 6, 2021
1 parent 5c1a3ce commit b3ea99f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/devops-admin/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth'
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 5000 // request timeout
timeout: 60000 // request timeout
})

// request interceptor
Expand Down
12 changes: 10 additions & 2 deletions packages/devops-admin/src/views/development/function_logs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<!-- 数据检索区 -->
<div class="filter-container">
<el-input
size="small"
v-model="listQuery.keyword"
placeholder="Request ID"
style="width: 320px;margin-right: 10px;"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
<el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
搜索
</el-button>
</div>
Expand All @@ -20,7 +21,7 @@
v-loading="listLoading"
:data="list"
border
fit
size="mini"
highlight-current-row
style="width: 100%;"
>
Expand Down Expand Up @@ -230,3 +231,10 @@ export default {
}
}
</script>
<style scoped>
.pagination-container {
padding: 0;
margin-top: 10px;
}
</style>
55 changes: 33 additions & 22 deletions packages/devops-admin/src/views/development/functions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
<el-input
v-model="listQuery.keyword"
placeholder="搜索"
size="mini"
style="width: 200px;margin-right: 10px;"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
<el-button size="mini" class="filter-item" type="default" icon="el-icon-search" @click="handleFilter">
搜索
</el-button>
<el-button v-permission="'function.create'" class="filter-item" type="primary" icon="el-icon-search" @click="showCreateForm">
<el-button size="mini" v-permission="'function.create'" class="filter-item" type="primary" icon="el-icon-plus" @click="showCreateForm">
新建函数
</el-button>
<el-checkbox class="filter-item" v-model="listQuery.onlyEnabled" label="" :indeterminate="false" @change="handleFilter">只看已启用</el-checkbox>
</div>

<!-- 标签类别 -->
Expand All @@ -33,23 +35,13 @@
v-loading="listLoading"
:data="list"
border
fit
size="small"
highlight-current-row
style="width: 100%;"
>
<el-table-column
label="ID"
prop="_id"
align="center"
min-width="100"
>
<template slot-scope="{row}">
<span>{{ row._id }}</span>
</template>
</el-table-column>
<el-table-column label="函数标识" min-width="100">
<template slot-scope="{row}">
<div class="func-name">
<div class="func-name" v-clipboard:message="row.name">
{{ row.name }}
</div>
</template>
Expand All @@ -59,7 +51,7 @@
<span class="link-type" @click="showUpdateForm(row)">{{ row.label }}</span>
</template>
</el-table-column>
<el-table-column label="标签" width="150">
<el-table-column label="标签" min-width="200">
<template slot-scope="{row}">
<el-tag v-for="tag in row.tags" :key="tag" style="margin-right: 6px;" type="primary" size="mini">{{ tag }}</el-tag>
</template>
Expand Down Expand Up @@ -88,16 +80,16 @@
<el-tag v-if="row.status === 1" type="success" size="mini" style="font-weight: bold">
</el-tag>
<el-tag v-if="row.status === 0" type="info" size="mini" style="font-weight: bold">
<el-tag v-if="row.status === 0" type="warning" size="mini" style="font-weight: bold">
</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="380" class-name="small-padding">
<template slot-scope="{row,$index}">
<el-button v-permission="'function.edit'" type="primary" size="mini" @click="showUpdateForm(row)">
<!-- <el-button v-permission="'function.edit'" type="primary" size="mini" @click="showUpdateForm(row)">
编辑
</el-button>
</el-button> -->
<el-button v-permission="'function.debug'" type="success" size="mini" @click="handleShowDetail(row)">
调试
</el-button>
Expand Down Expand Up @@ -133,6 +125,9 @@
label-width="120px"
style="width: 400px; margin-left:20px;"
>
<el-form-item label="ID" prop="_id" v-if="form._id">
<div :value="form._id">{{ form._id }}</div>
</el-form-item>
<el-form-item label="显示名称" prop="label">
<el-input v-model="form.label" placeholder="函数显示名,可为中文" />
</el-form-item>
Expand Down Expand Up @@ -235,9 +230,10 @@ export default {
listLoading: true,
listQuery: {
page: 1,
limit: 20,
limit: 10,
keyword: undefined,
tag: ''
tag: '',
onlyEnabled: true, // 只看启用的函数
},
form: getDefaultFormValue(),
dialogFormVisible: false,
Expand Down Expand Up @@ -279,7 +275,7 @@ export default {
this.listLoading = true
// 拼装查询条件 by this.listQuery
const { limit, page, keyword, tag } = this.listQuery
const { limit, page, keyword, tag, onlyEnabled} = this.listQuery
const query = { }
if (keyword) {
query['$or'] = [
Expand All @@ -293,6 +289,10 @@ export default {
query['tags'] = tag
}
if(onlyEnabled) {
query['status'] = 1
}
// 执行数据查询
const res = await db.collection('__functions')
.where(query)
Expand Down Expand Up @@ -486,8 +486,15 @@ export default {
</script>
<style lang="scss" scoped>
.filter-container {
padding: 0;
.filter-item {
margin-left: 10px;
}
}
.tag-selector {
margin: 20px 0;
margin: 10px 0 10px;
display: flex;
.label {
Expand All @@ -508,4 +515,8 @@ export default {
margin-left: 10px;
vertical-align: bottom;
}
.pagination-container {
padding: 0;
margin-top: 10px;
}
</style>

0 comments on commit b3ea99f

Please sign in to comment.