Skip to content

Commit

Permalink
Merge pull request #9160 from lockiechen/issue_9156
Browse files Browse the repository at this point in the history
bug: 流水线无编辑权限时loading遮罩无法关闭 issue #9156
  • Loading branch information
bkci-bot authored Jul 25, 2023
2 parents 81d0f93 + be80d1b commit 9e503a9
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 23 deletions.
11 changes: 7 additions & 4 deletions src/frontend/devops-metrics/public/login_success.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登陆成功</title>
<title>登录成功</title>
</head>

<body>
<script>
var params = new URLSearchParams(window.location.href)
window.opener && window.opener.postMessage({ target: 'bk-login', result: true }, params.get('from'))
var params = new URLSearchParams(window.location.href)
window.opener && window.opener.postMessage({target: 'bk-login', result: true}, params.get('from'))
</script>
</body>
</html>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</pipeline-bread-crumb>
<aside class="pipeline-detail-right-aside">
<bk-button
:disabled="loading || (!isRunning && !canManualStartup)"
:disabled="loading || !isRunning"
:icon="loading ? 'loading' : ''"
outline
:theme="isRunning ? 'warning' : 'default'"
Expand Down Expand Up @@ -53,12 +53,6 @@
isRunning () {
return ['RUNNING', 'QUEUE'].indexOf(this.execDetail?.status) > -1
},
canManualStartup () {
return this.curPipeline ? this.curPipeline.canManualStartup : false
},
pipelineStatus () {
return this.canManualStartup ? 'ready' : 'disable'
},
buildNumConf () {
return {
latestBuildNum: this.execDetail?.latestBuildNum ?? 1,
Expand All @@ -70,6 +64,11 @@
}
},
watch: {
'$route.params.buildNo': function (newBuildNum, oldBuildNum) {
if (newBuildNum !== oldBuildNum) {
this.loading = false
}
},
'execDetail.status': function (newStatus, oldStatus) {
if (newStatus !== oldStatus) {
this.loading = false
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/devops-pipeline/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ request.interceptors.response.use(response => {
} else if (httpStatus === 400) {
const errorMsg = { httpStatus, message: (window.pipelineVue.$i18n && window.pipelineVue.$i18n.t('err400')) || 'service is abnormal' }
return Promise.reject(errorMsg)
} else if (httpStatus > 400) {
const err = {
message: `unknow Error httpStatus: ${httpStatus}`,
httpStatus
}
return Promise.reject(err)
}

return response.data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@
}
},
fetchError (error) {
this.isLoading = false
if (error.code === 403) {
this.isLoading = false
this.hasNoPermission = true
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/frontend/devops-pipeline/src/views/subpages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
</template>

<script>
import { mapActions, mapState } from 'vuex'
import emptyTips from '@/components/devops/emptyTips'
import MiniMap from '@/components/MiniMap'
import { navConfirm } from '@/utils/util'
import { PipelineEditTab, BaseSettingTab, NotifyTab } from '@/components/PipelineEditTabs/'
import { BaseSettingTab, NotifyTab, PipelineEditTab } from '@/components/PipelineEditTabs/'
import emptyTips from '@/components/devops/emptyTips'
import pipelineOperateMixin from '@/mixins/pipeline-operate-mixin'
import { navConfirm } from '@/utils/util'
import { mapActions, mapState } from 'vuex'
export default {
components: {
Expand Down Expand Up @@ -144,6 +144,7 @@
if (val && val.instanceFromTemplate) this.requestMatchTemplateRules(val.templateId)
},
fetchError (error) {
this.isLoading = false
if (error.code === 403) {
this.hasNoPermission = true
this.removeLeaveListenr()
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-repo/src/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"manualConfig": "手动配置",
"updateRepo": "更新本地的repo信息",
"artifactSearchPlaceholder": "请输入制品名称,按Enter键搜索",
"loginRepo": "在命令行执行以下命令登陆仓库",
"loginRepo": "在命令行执行以下命令登录仓库",
"cmdTag": "在命令行执行以下命令给本地镜像打标签",
"cmdPush": "在命令行执行以下命令进行推送",
"cmdPull": "在命令行执行以下命令进行拉取",
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-repo/src/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"manualConfig": "手动配置",
"updateRepo": "更新本地的repo信息",
"artifactSearchPlaceholder": "请输入制品名称,按Enter键搜索",
"loginRepo": "在命令行执行以下命令登陆仓库",
"loginRepo": "在命令行执行以下命令登录仓库",
"cmdTag": "在命令行执行以下命令给本地镜像打标签",
"cmdPush": "在命令行执行以下命令进行推送",
"cmdPull": "在命令行执行以下命令进行拉取",
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-ticket/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const store = {
{
id: 'ACCESSTOKEN',
name: 'accessToken',
desc: '一个访问令牌包含了此登陆会话的安全信息,用于关联Gitlab类型代码库,'
desc: '一个访问令牌包含了此登录会话的安全信息,用于关联Gitlab类型代码库,'
},
{
id: 'SECRETKEY',
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/locale/ticket/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"switchProject": "切换项目",
"applyPermission": "申请权限",
"noData": "暂无数据",
"noresultsFound":"未搜索到任何的结果",
"noresultsFound": "未搜索到任何的结果",
"credential": {
"nameTips": "在流水线中通过变量引用凭证时,仅支持通过名称引用",
"emptyCredential": "暂无凭据",
Expand Down Expand Up @@ -66,8 +66,8 @@
"tokenPlaceholder": "请输入token",
"tokenRequired": "token不能为空",
"passwordDesc": "用于蓝盾平台中需要加密保存的信息,如证书密码、脚本中需要加密字段等,",
"accessTokenDesc": "一个访问令牌包含了此登陆会话的安全信息,用于关联Gitlab类型代码库,",
"appIdDesc": "用来设置key value的键值对类型,例如bugly原子要填的用户帐号密码、api调用等,",
"accessTokenDesc": "一个访问令牌包含了此登录会话的安全信息,用于关联Gitlab类型代码库,",
"appIdDesc": "用来设置key value的键值对类型,例如bugly原子要填的用户账号密码、api调用等,",
"sshKeyDesc": "SSH包含公钥和私钥,用于关联SVN类型代码库,SSH配置说明请参考蓝盾文档中心,",
"sshKeyTokenDesc": "用于使用ssh方式关联Git类型代码库,",
"passwordTokenDesc": "用于使用http方式关联Git类型代码库,",
Expand Down Expand Up @@ -123,4 +123,4 @@
"userCertFile": "服务端证书文件",
"userKeyFile": "服务端密钥文件"
}
}
}

0 comments on commit 9e503a9

Please sign in to comment.