Skip to content

Commit

Permalink
feat:op客户端管理新增用户ID查询,项目id调整为模糊查询 #2548
Browse files Browse the repository at this point in the history
* feat:op客户端管理新增用户ID查询 #2548

* feat: 项目id调整模糊查询 #2548
  • Loading branch information
lannoy0523 authored Sep 19, 2024
1 parent 0983967 commit 24b1943
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ interface FsClientClient {
@RequestParam pageSize: Int?,
@RequestParam online: Boolean?,
@RequestParam ip: String?,
@RequestParam version: String?,
@RequestParam userId: String?,
@RequestParam version: String?
): Response<Page<ClientDetail>>

@GetMapping("/daily/list")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data class ClientListRequest(
val online:Boolean?,
val ip: String?,
val version: String?,
val userId: 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 @@ -73,7 +73,8 @@ class ClientHandler(
pageSize = request.queryParamOrNull(ClientListRequest::pageSize.name)?.toInt() ?: DEFAULT_PAGE_SIZE,
online = request.queryParamOrNull(ClientListRequest::online.name)?.toBoolean(),
ip = request.queryParamOrNull(ClientListRequest::ip.name),
version = request.queryParamOrNull(ClientListRequest::version.name)
version = request.queryParamOrNull(ClientListRequest::version.name),
userId = request.queryParamOrNull(ClientListRequest::userId.name)
)
return ReactiveResponseBuilder.success(clientService.listClients(listRequest))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ class ClientService(
suspend fun listClients(request: ClientListRequest): Page<ClientDetail> {
val pageRequest = Pages.ofRequest(request.pageNumber, request.pageSize)
val criteria = Criteria()
request.projectId?.let { criteria.and(TClient::projectId.name).isEqualTo(it) }
request.projectId?.let { criteria.and(TClient::projectId.name).regex(convertToRegex(it)) }
request.repoName?.let { criteria.and(TClient::repoName.name).isEqualTo(it) }
request.online?.let { criteria.and(TClient::online.name).isEqualTo(it) }
request.ip?.let { criteria.and(TClient::ip.name).regex(convertToRegex(it)) }
request.version?.let { criteria.and(TClient::version.name).regex(convertToRegex(it)) }
request.userId?.let { criteria.and(TClient::userId.name).isEqualTo(it) }
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 @@ -67,6 +67,7 @@ class FsClientController(
request.pageSize,
request.online,
request.ip,
request.userId,
request.version
)
}
Expand Down
1 change: 1 addition & 0 deletions src/frontend/devops-op/src/api/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function queryFileSystemClient(body) {
pageSize: body.pageSize,
projectId: body.projectId === '' ? null : body.projectId,
repoName: body.repoName === '' ? null : body.repoName,
userId: body.userId === '' ? null : body.userId,
online: body.online === '' ? null : body.online,
ip: body.ip === '' ? null : body.ip,
version: body.version === '' ? null : body.version
Expand Down
8 changes: 7 additions & 1 deletion src/frontend/devops-op/src/views/node/FileSystem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
</template>
</el-autocomplete>
</el-form-item>
<el-form-item style="margin-left: 15px" label="用户Id" prop="version">
<el-input v-model="clientQuery.userId" type="text" size="small" width="50" placeholder="请输入用户ID" />
</el-form-item>
<el-form-item style="margin-left: 15px" label="是否在线" prop="online">
<el-select v-model="clientQuery.online" clearable placeholder="请选择">
<el-option
Expand Down Expand Up @@ -137,7 +140,8 @@ export default {
online: '',
ip: '',
version: '',
mountPoint: ''
mountPoint: '',
userId: ''
},
clients: [],
options: [{
Expand Down Expand Up @@ -204,6 +208,7 @@ export default {
}
query.projectId = this.clientQuery.projectId
query.repoName = this.clientQuery.repoName
query.userId = this.clientQuery.userId
query.online = this.clientQuery.online
query.ip = this.clientQuery.ip
query.version = this.clientQuery.version
Expand All @@ -215,6 +220,7 @@ export default {
const clientQuery = this.clientQuery
clientQuery.projectId = query.projectId ? query.projectId : ''
clientQuery.repoName = query.repoName ? query.repoName : ''
clientQuery.userId = query.userId ? query.userId : ''
clientQuery.pageNumber = query.page ? Number(query.page) : 1
clientQuery.pageSize = query.pageSize ? Number(query.pageSize) : 10
clientQuery.online = query.online ? query.online : ''
Expand Down

0 comments on commit 24b1943

Please sign in to comment.