Browse Source
* feat: support upload driver from local * feat: support get origin driver file name * fix: checkstyle * fix: compile error * feat: update docsmaster
vran
3 years ago
committed by
GitHub
61 changed files with 343 additions and 171 deletions
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 2.1 KiB |
@ -1 +1 @@ |
|||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.9effab81.js"></script><script defer="defer" type="module" src="/js/app.75e63a52.js"></script><link href="/css/chunk-vendors.81898547.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fb0c8458.js" nomodule></script><script defer="defer" src="/js/app-legacy.cf3474d2.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> |
|||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.9effab81.js"></script><script defer="defer" type="module" src="/js/app.bc6973d3.js"></script><link href="/css/chunk-vendors.81898547.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fb0c8458.js" nomodule></script><script defer="defer" src="/js/app-legacy.f8c04b90.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@ |
|||
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[17],{5430:function(e,a,t){t.d(a,{v:function(){return r}});var o=t(3872);const n="/api/v1.0/operation_logs",r=e=>o.Z.get(n,{params:e})},6017:function(e,a,t){t.r(a),t.d(a,{default:function(){return j}});var o=t(6252),n=t(3577);const r={key:0},l=(0,o.Uk)("成功"),u={key:1},i=(0,o.Uk)("失败"),p={key:0},g={key:1},s={key:1},c={key:1},d={key:1};function w(e,a,t,w,m,P){const h=(0,o.up)("el-table-column"),f=(0,o.up)("arrow-down"),j=(0,o.up)("el-icon"),L=(0,o.up)("el-dropdown-item"),k=(0,o.up)("el-dropdown-menu"),v=(0,o.up)("el-dropdown"),b=(0,o.up)("el-tag"),y=(0,o.up)("el-link"),O=(0,o.up)("el-table"),C=(0,o.up)("el-main"),W=(0,o.up)("el-pagination"),_=(0,o.up)("el-footer"),D=(0,o.up)("el-container");return(0,o.wg)(),(0,o.j4)(D,null,{default:(0,o.w5)((()=>[(0,o.Wm)(C,null,{default:(0,o.w5)((()=>[(0,o.Wm)(O,{data:m.projectOperationLogPageData.data},{default:(0,o.w5)((()=>[(0,o.Wm)(h,{prop:"id",label:""}),(0,o.Wm)(h,{prop:"operationModule",label:"系统模块"}),(0,o.Wm)(h,{prop:"operatorNickname",label:"操作人"}),(0,o.Wm)(h,{prop:"operationName",label:"操作"}),(0,o.Wm)(h,{label:"状态"},{header:(0,o.w5)((()=>[(0,o.Wm)(v,null,{dropdown:(0,o.w5)((()=>[(0,o.Wm)(k,null,{default:(0,o.w5)((()=>[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(m.logStatusMap,((e,a)=>((0,o.wg)(),(0,o.j4)(L,{key:a,onClick:a=>P.onLogStatusFilter(e),icon:e.icon},{default:(0,o.w5)((()=>[(0,o.Uk)((0,n.zw)(e.text),1)])),_:2},1032,["onClick","icon"])))),128))])),_:1})])),default:(0,o.w5)((()=>[(0,o._)("span",null,[(0,o.Uk)((0,n.zw)(m.logStatusColumnLabel)+" ",1),(0,o.Wm)(j,null,{default:(0,o.w5)((()=>[(0,o.Wm)(f)])),_:1})])])),_:1})])),default:(0,o.w5)((e=>[e.row.isSuccess?((0,o.wg)(),(0,o.iD)("span",r,[(0,o.Wm)(b,{type:"success"},{default:(0,o.w5)((()=>[l])),_:1})])):((0,o.wg)(),(0,o.iD)("span",u,[(0,o.Wm)(b,{type:"danger"},{default:(0,o.w5)((()=>[i])),_:1})]))])),_:1}),(0,o.Wm)(h,{label:"错误信息"},{default:(0,o.w5)((e=>[e.row.isSuccess?((0,o.wg)(),(0,o.iD)("span",p)):((0,o.wg)(),(0,o.iD)("span",g,(0,n.zw)(e.row.operationResponse.errMessage),1))])),_:1}),(0,o.Wm)(h,{label:"涉及分组"},{default:(0,o.w5)((e=>[e.row.involvedGroup?((0,o.wg)(),(0,o.j4)(y,{key:0},{default:(0,o.w5)((()=>[(0,o.Uk)((0,n.zw)(e.row.involvedGroup.name),1)])),_:2},1024)):((0,o.wg)(),(0,o.iD)("span",s," - "))])),_:1}),(0,o.Wm)(h,{label:"涉及项目"},{default:(0,o.w5)((e=>[e.row.involvedProject?((0,o.wg)(),(0,o.j4)(y,{key:0},{default:(0,o.w5)((()=>[(0,o.Uk)((0,n.zw)(e.row.involvedProject.name),1)])),_:2},1024)):((0,o.wg)(),(0,o.iD)("span",c," - "))])),_:1}),(0,o.Wm)(h,{label:"涉及用户"},{default:(0,o.w5)((e=>[e.row.involvedUser?((0,o.wg)(),(0,o.j4)(y,{key:0},{default:(0,o.w5)((()=>[(0,o.Uk)((0,n.zw)(e.row.involvedUser.nickname),1)])),_:2},1024)):((0,o.wg)(),(0,o.iD)("span",d," - "))])),_:1}),(0,o.Wm)(h,{prop:"createAt",label:"记录时间"})])),_:1},8,["data"])])),_:1}),(0,o.Wm)(_,null,{default:(0,o.w5)((()=>[(0,o.Wm)(W,{layout:"prev, pager, next","hide-on-single-page":!1,currentPage:m.projectOperationLogPageData.number,"page-size":m.projectOperationLogPageData.size,"page-count":m.projectOperationLogPageData.totalPages,onCurrentChange:P.onProjectOperationLogCurrentPageChange},null,8,["currentPage","page-size","page-count","onCurrentChange"])])),_:1})])),_:1})}var m=t(5430),P={data(){return{projectOperationLogPageData:{data:[],number:1,size:10,totalElements:0,totalPages:1},projectOperationLogPageQuery:{page:0,size:10,isSuccess:null,involveProjectId:null,module:null},logStatusColumnLabel:"全部",logStatusMap:[{text:"全部",icon:"List",value:null},{text:"成功",icon:"CircleCheck",value:!0},{text:"失败",icon:"CircleClose",value:!1}]}},created(){this.fetchProjectOperationLogs()},methods:{fetchProjectOperationLogs(e){this.projectOperationLogPageQuery.page=e?e-1:null,(0,m.v)(this.projectOperationLogPageQuery).then((e=>{e.errCode||(this.projectOperationLogPageData.data=e.data.content,this.projectOperationLogPageData.number=e.data.number+1,this.projectOperationLogPageData.size=e.data.size,this.projectOperationLogPageData.totalPages=e.data.totalPages,this.projectOperationLogPageData.totalElements=e.data.totalElements)}))},onProjectOperationLogCurrentPageChange(e){e&&e-1!=this.projectOperationLogPageQuery.page&&(this.projectOperationLogPageQuery.page=e-1,this.fetchProjectOperationLogs(e))},onQuery(){this.fetchProjectOperationLogs()},onLogStatusFilter(e){this.projectOperationLogPageQuery.isSuccess=e.value,null==e.value?this.logStatusColumnLabel="状态":this.logStatusColumnLabel=e.text,this.onQuery()}}},h=t(3744);const f=(0,h.Z)(P,[["render",w]]);var j=f}}]); |
|||
//# sourceMappingURL=17.177f76a3.js.map
|
|||
//# sourceMappingURL=17.f8914b9e.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,59 @@ |
|||
package com.databasir.core.domain.database.validator; |
|||
|
|||
import com.databasir.core.domain.DomainErrors; |
|||
import com.databasir.core.domain.database.data.DatabaseTypeCreateRequest; |
|||
import com.databasir.core.domain.database.data.DatabaseTypeUpdateRequest; |
|||
import com.databasir.core.domain.database.data.DriverClassNameResolveRequest; |
|||
import com.databasir.dao.impl.DatabaseTypeDao; |
|||
import com.databasir.dao.tables.pojos.DatabaseTypePojo; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.Objects; |
|||
|
|||
@Component |
|||
@RequiredArgsConstructor |
|||
public class DatabaseTypeUpdateValidator { |
|||
|
|||
private final DatabaseTypeDao databaseTypeDao; |
|||
|
|||
public void validRequestRequiredParams(DatabaseTypeCreateRequest request) { |
|||
if (StringUtils.isAllBlank(request.getJdbcDriverFilePath(), request.getJdbcDriverFileUrl())) { |
|||
throw DomainErrors.DRIVER_URL_AND_PATH_MUST_NOT_BE_ALL_BLANK.exception(); |
|||
} |
|||
} |
|||
|
|||
public void validRequestRequiredParams(DatabaseTypeUpdateRequest request) { |
|||
if (StringUtils.isAllBlank(request.getJdbcDriverFilePath(), request.getJdbcDriverFileUrl())) { |
|||
throw DomainErrors.DRIVER_URL_AND_PATH_MUST_NOT_BE_ALL_BLANK.exception(); |
|||
} |
|||
} |
|||
|
|||
public void validRequestRequiredParams(DriverClassNameResolveRequest request) { |
|||
if (StringUtils.isAllBlank(request.getJdbcDriverFilePath(), request.getJdbcDriverFileUrl())) { |
|||
throw DomainErrors.DRIVER_URL_AND_PATH_MUST_NOT_BE_ALL_BLANK.exception(); |
|||
} |
|||
} |
|||
|
|||
public void validDatabaseTypeIfNecessary(DatabaseTypeUpdateRequest request, DatabaseTypePojo origin) { |
|||
if (!Objects.equals(request.getDatabaseType(), origin.getDatabaseType())) { |
|||
if (databaseTypeDao.existsByDatabaseType(request.getDatabaseType())) { |
|||
throw DomainErrors.DATABASE_TYPE_NAME_DUPLICATE.exception(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
public boolean shouldReloadDriver(DatabaseTypeUpdateRequest request, DatabaseTypePojo origin) { |
|||
if (!Objects.equals(request.getDatabaseType(), origin.getDatabaseType())) { |
|||
return true; |
|||
} |
|||
if (!Objects.equals(request.getJdbcDriverFileUrl(), origin.getJdbcDriverFileUrl())) { |
|||
return true; |
|||
} |
|||
if (!Objects.equals(request.getJdbcDriverFilePath(), origin.getJdbcDriverFilePath())) { |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
} |
@ -1 +1 @@ |
|||
Subproject commit 2c50a58ba5bcbbe28b8e7d76a66589c27454b6dc |
|||
Subproject commit 6dac399b514868bc6be0209da9c4cbb0f8759ca0 |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 139 KiB |
Loading…
Reference in new issue