Skip to content

Commit

Permalink
feat:op中客户端管理新增IP和版本的筛选 TencentBlueKing#1521 (TencentBlueKing#1522)
Browse files Browse the repository at this point in the history
* feat:op中客户端管理新增IP和版本的筛选 TencentBlueKing#1521

* feat:op中客户端管理新增IP和版本的筛选 TencentBlueKing#1521
  • Loading branch information
lannoy0523 authored Dec 7, 2023
1 parent d19db7b commit 0636476
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ interface FsClientClient {
@RequestParam repoName: String?,
@RequestParam pageNumber: Int?,
@RequestParam pageSize: Int?,
@RequestParam online: Boolean?
@RequestParam online: Boolean?,
@RequestParam ip: String?,
@RequestParam version: String?,
): Response<Page<ClientDetail>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ data class ClientListRequest(
val projectId: String?,
val repoName: String?,
val online:Boolean?,
val ip: String?,
val version: String?,
val pageNumber: Int = DEFAULT_PAGE_NUMBER,
val pageSize: Int = DEFAULT_PAGE_SIZE
)
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ class ClientHandler(
repoName = request.queryParamOrNull(ClientListRequest::repoName.name),
pageNumber = request.queryParamOrNull(ClientListRequest::pageNumber.name)?.toInt() ?: DEFAULT_PAGE_NUMBER,
pageSize = request.queryParamOrNull(ClientListRequest::pageSize.name)?.toInt() ?: DEFAULT_PAGE_SIZE,
online = request.queryParamOrNull(ClientListRequest::online.name)?.toBoolean()
online = request.queryParamOrNull(ClientListRequest::online.name)?.toBoolean(),
ip = request.queryParamOrNull(ClientListRequest::ip.name),
version = request.queryParamOrNull(ClientListRequest::version.name)
)
return ReactiveResponseBuilder.success(clientService.listClients(listRequest))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class ClientService(
request.projectId?.let { criteria.and(TClient::projectId.name).isEqualTo(request.projectId) }
request.repoName?.let { criteria.and(TClient::repoName.name).isEqualTo(request.repoName) }
request.online?.let { criteria.and(TClient::online.name).isEqualTo(request.online) }
request.ip?.let { criteria.and(TClient::ip.name).isEqualTo(request.ip) }
request.version?.let { criteria.and(TClient::version.name).isEqualTo(request.version) }
val query = Query(criteria)
val count = clientRepository.count(query)
val data = clientRepository.find(query.with(pageRequest))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class FsClientController(
request.repoName,
request.pageNumber,
request.pageSize,
request.online
request.online,
request.ip,
request.version
)
}
}
12 changes: 7 additions & 5 deletions src/frontend/devops-op/src/api/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ import request from '@/utils/request'
export const DEFAULT_PAGE_SIZE = 10
const PREFIX = '/opdata/api/fs-client'

export function queryFileSystemClient(projectId, repoName, pageNumber, online) {
export function queryFileSystemClient(body) {
return request({
url: `${PREFIX}/list/`,
method: 'get',
params: {
pageNumber: pageNumber,
pageNumber: body.pageNumber,
pageSize: DEFAULT_PAGE_SIZE,
projectId: projectId === '' ? null : projectId,
repoName: repoName === '' ? null : repoName,
online: online === '' ? null : online
projectId: body.projectId === '' ? null : body.projectId,
repoName: body.repoName === '' ? null : body.repoName,
online: body.online === '' ? null : body.online,
ip: body.ip === '' ? null : body.ip,
version: body.version === '' ? null : body.version
}
})
}
16 changes: 14 additions & 2 deletions src/frontend/devops-op/src/views/node/FileSystem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
/>
</el-select>
</el-form-item>
<el-form-item style="margin-left: 15px" label="IP" prop="ip">
<el-input v-model="clientQuery.ip" type="text" size="small" width="50" placeholder="请输入ip" />
</el-form-item>
<el-form-item style="margin-left: 15px" label="版本" prop="version">
<el-input v-model="clientQuery.version" type="text" size="small" width="50" placeholder="请输入版本号" />
</el-form-item>
<el-form-item>
<el-button
size="mini"
Expand Down Expand Up @@ -103,7 +109,9 @@ export default {
projectId: '',
repoName: '',
pageNumber: 1,
online: ''
online: '',
ip: '',
version: ''
},
clients: [],
options: [{
Expand Down Expand Up @@ -165,6 +173,8 @@ export default {
query.projectId = this.clientQuery.projectId
query.repoName = this.clientQuery.repoName
query.online = this.clientQuery.online
query.ip = this.clientQuery.ip
query.version = this.clientQuery.version
this.$router.push({ path: '/nodes/FileSystem', query: query })
},
onRouteUpdate(route) {
Expand All @@ -174,6 +184,8 @@ export default {
clientQuery.repoName = query.repoName ? query.repoName : ''
clientQuery.pageNumber = query.page ? Number(query.page) : 1
clientQuery.online = query.online ? query.online : ''
clientQuery.ip = query.ip ? query.ip : ''
clientQuery.version = query.version ? query.version : ''
this.$nextTick(() => {
this.queryClients(clientQuery)
})
Expand All @@ -190,7 +202,7 @@ export default {
doQueryClients(clientQuery) {
this.loading = true
let promise = null
promise = queryFileSystemClient(clientQuery.projectId, clientQuery.repoName, clientQuery.pageNumber, clientQuery.online)
promise = queryFileSystemClient(clientQuery)
promise.then(res => {
this.clients = res.data.records
this.total = res.data.totalRecords
Expand Down

0 comments on commit 0636476

Please sign in to comment.