Skip to content

Commit

Permalink
feat:代码库优化一期功能点 #9347
Browse files Browse the repository at this point in the history
  • Loading branch information
vhwweng committed Oct 9, 2023
1 parent 0b8b91c commit 06ab8bf
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
{{ $t('codelib.resetAuth') }}
</h3>
<bk-form
ref="form"
:label-width="120"
:rules="rules"
>
<!-- Github 重置授权 -->
<bk-form-item
Expand Down Expand Up @@ -179,6 +181,7 @@
:label="$t('codelib.codelibCredential')"
:required="true"
property="credentialId"
error-display-type="normal"
>
<bk-select
v-model="newRepoInfo.credentialId"
Expand All @@ -195,7 +198,7 @@
:key="option.credentialId"
:id="option.credentialId"
:name="option.credentialId">
<span>
<span :title="option.credentialId">
{{option.credentialId}}
</span>
<i
Expand Down Expand Up @@ -269,7 +272,16 @@
isSaveLoading: false,
isLoadingTickets: false,
newRepoInfo: {},
cacheRepoInfo: {}
cacheRepoInfo: {},
rules: {
credentialId: [
{
required: true,
message: this.$t('codelib.请选择凭证'),
trigger: 'blur'
}
]
}
}
},
computed: {
Expand Down Expand Up @@ -512,7 +524,10 @@
},
handleConfirm () {
if (this.isOAUTH) return
this.handleUpdateRepo()
this.$refs.form.validate().then(() => {
console.log(12321)
this.handleUpdateRepo()
})
},
handleClose (val) {
if (!val) {
Expand Down Expand Up @@ -542,4 +557,6 @@
color: #979BA5;
}
}
.codelib-credential-selector {
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
'collapse-item-header': true,
'active': activeIndex === index
}" @click="handleShowDetail(item, index)">
<div>
<StatusIcon :status="item.total === item.success ? 'normal' : 'error'"></StatusIcon>
<span v-html="item.eventDesc"></span>
<div class="title">
<StatusIcon class="icon" :status="item.total === item.success ? 'normal' : 'error'"></StatusIcon>
<span class="desc" :title="item.eventDesc" v-html="item.eventDesc"></span>
<span class="trigger-time">
{{ new Date(item.eventTime).toLocaleString().split('.').join('-') }}
</span>
Expand All @@ -26,23 +26,26 @@
({{ item.success }}/{{ item.total }})
</span>
</div>
<bk-icon
:class="{
'right-shape': true,
'right-down': activeIndex === index
}"
svg
type="angle-right"
width="24"
height="24"
/>
<a
v-if="activeIndex === index"
class="one-click-trigger"
@click.stop="handleReplayAll(item.eventId)"
>
{{ $t('codelib.一键重新触发') }}
</a>
<div class="header-right">
<a
v-if="activeIndex === index"
class="one-click-trigger"
@click.stop="handleReplayAll(item.eventId)"
>
{{ $t('codelib.一键重新触发') }}
</a>
<bk-icon
:class="{
'right-shape': true,
'right-down': activeIndex === index
}"
svg
type="angle-right"
width="24"
height="24"
/>
</div>

</div>
<div
class="trigger-list-table"
Expand All @@ -67,7 +70,7 @@
<div class="cell">
<div v-for="i in detail.reasonDetailList" :key="i">
<StatusIcon :status="detail.status"></StatusIcon>
<span style="color: red;">{{ detail.reason }}</span> |
<span style="color: red;">TRIGGER_NOT_MATCH</span> |
<span>{{ i }}</span>
</div>
</div>
Expand Down Expand Up @@ -247,10 +250,29 @@
&.active {
background-color: #E1ECFF;
}
.title {
display: flex;
flex: 1;
overflow: hidden;
align-items: center;
}
.icon {
flex-shrink: 0;
}
.desc {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.header-right {
display: flex;
align-items: center;
flex-shrink: 0;
margin-left: 50px;
.one-click-trigger {
position: absolute;
right: 60px;
font-size: 12px;
margin-right: 20px;
}
}
.right-shape {
Expand All @@ -262,9 +284,11 @@
.trigger-time {
padding-left: 8px;
color: #979BA5;
flex-shrink: 0;
}
.success-num {
padding-left: 24px;
flex-shrink: 0;
&.red {
color: red;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
:key="option.credentialId"
:id="option.credentialId"
:name="option.credentialId">
<span>
<span :title="option.credentialId">
{{option.credentialId}}
</span>
<i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
:key="option.credentialId"
:id="option.credentialId"
:name="option.credentialId">
<span>
<span :title="option.credentialId">
{{option.credentialId}}
</span>
<i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
:key="option.credentialId"
:id="option.credentialId"
:name="option.credentialId">
<span>
<span :title="option.credentialId">
{{option.credentialId}}
</span>
<i
Expand Down
16 changes: 13 additions & 3 deletions src/frontend/devops-codelib/src/components/CodeLibDialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,19 @@
margin-right: 30px;
}
}
.cre-icon {
float: right;
margin-top: 10px;
.bk-option-content {
display: flex;
span {
display: inline-block;
width: 92%;
overflow: hidden;
text-overflow: ellipsis;
}
.cre-icon {
position: absolute;
right: 15px;
margin-top: 10px;
}
}
.flex-content {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-codelib/src/components/status-icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
success: 'green',
error: 'red',
normal: 'gray',
succeed: 'gray',
succeed: 'green',
failed: 'red'
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-codelib/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const codelibConfig = {
gitlab_http: {
credentialTypes: 'ACCESSTOKEN',
addType: 'ACCESSTOKEN',
label: 'Gitlab',
label: 'GitLab',
typeName: 'codeGitLab'
},
tgit: {
Expand Down
5 changes: 3 additions & 2 deletions src/frontend/devops-codelib/src/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,15 @@
},
clearAliasName () {
if (this.aliasName === '') this.refreshCodelibList()
if (this.aliasName === '') {
this.refreshCodelibList()
}
},
switchPage (page, pageSize) {
const { projectId } = this
this.refreshCodelibList(projectId, page, pageSize)
},
async refreshCodelibList (
projectId = this.projectId,
page = this.startPage,
Expand Down
5 changes: 3 additions & 2 deletions src/frontend/locale/codelib/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"关闭 PAC 模式失败": "关闭 PAC 模式失败",
"检测到默认分支仍存在ci 文件目录,关闭 PAC 模式后该目录下的文件修改将": "检测到默认分支仍存在.ci 文件目录,关闭 PAC 模式后该目录下的文件修改将",
"不再同步到蓝盾流水线": "不再同步到蓝盾流水线",
"请先将目录": "请先将目录",
"请先将目录": "请先将目录",
"改名或删除": "改名或删除",
"后重试,避免项目其他成员进行无效的YAML 文件修改": "后重试,避免项目其他成员进行无效的YAML 文件修改",
"。": ".",
Expand Down Expand Up @@ -155,5 +155,6 @@
"事件": "事件",
"流水线数量": "流水线数量",
"操作": "Actions",
"访问令牌": "Access Token"
"访问令牌": "Access Token",
"请选择凭证": "请选择凭证"
}
3 changes: 2 additions & 1 deletion src/frontend/locale/codelib/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,6 @@
"事件": "事件",
"流水线数量": "流水线数量",
"操作": "操作",
"访问令牌": "访问令牌"
"访问令牌": "访问令牌",
"请选择凭证": "请选择凭证"
}

0 comments on commit 06ab8bf

Please sign in to comment.