Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#982 from lannoy0523/issue_977
Browse files Browse the repository at this point in the history
feat:新增440页面 TencentBlueKing#977
  • Loading branch information
owenlxu authored Jul 21, 2023
2 parents c8ed5d0 + cbd246e commit d030ef7
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 5 deletions.
59 changes: 59 additions & 0 deletions src/frontend/devops-repository/src/components/Exception/440.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<div class="empty-data-container flex-center" :class="{ 'hidden': isLoading }" style="background-color: white">
<div class="flex-column flex-center">
<img width="480" height="240" style="float: left;margin-right: 3px" src="/ui/440.svg" />
<span class="mt5 empty-data-title">{{ $t('noBusinessTip') }}</span>
<span class="mt5 empty-data-subtitle">{{ $t('noBusinessSubTip') }}</span>
</div>
</div>
</template>
<script>
export default {
name: 'emptyData',
props: {
search: {
type: Boolean,
default: false
},
exStyle: {
type: String,
default: ''
},
title: {
type: String,
default () {
return this.$t('noData')
}
},
searchTitle: {
type: String,
default () {
return this.$t('noSearchData')
}
},
subTitle: String,
isLoading: {
type: Boolean,
default: false
}
}
}
</script>
<style lang="scss" scoped>
.empty-data-container {
&.hidden {
visibility: hidden;
}
.empty-data-title {
margin-top: 18px;
font-size: 24px;
line-height: 32px;
}
.empty-data-subtitle {
margin-top: 16px;
font-size: 14px;
line-height: 22px;
color: var(--fontSubsidiaryColor);
}
}
</style>
7 changes: 7 additions & 0 deletions src/frontend/devops-repository/src/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const commonPackageDetail = () => import('@repository/views/repoCommon/commonPac

const repoSearch = () => import('@repository/views/repoSearch')

const WebError440 = () => import('@repository/components/Exception/440')

const routes = [
{
path: '/ui/:projectId/preview',
Expand All @@ -55,6 +57,11 @@ const routes = [
]
}
},
{
path: '440',
name: '440',
component: WebError440
},
{
path: 'repoConfig/:repoType',
name: 'repoConfig',
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/devops-repository/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ request.interceptors.response.use(response => {
} else {
window.repositoryVue.$store.commit('SHOW_LOGIN_DIALOG')
}
} else if (status === 440) {
const projectId = localStorage.getItem('projectId')
const path = '/ui/' + projectId + '/440'
window.repositoryVue.$router.push(path)
}
return Promise.reject({ status, message }) // eslint-disable-line
}, errorHandler)
Expand Down
9 changes: 6 additions & 3 deletions src/frontend/devops-repository/src/views/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="bkrepo-view flex-align-center">
<div class="nav-submain-list" :class="{ 'hidden-menu': hiddenMenu }">
<div class="nav-submain-list" :class="{ 'hidden-menu': hiddenMenu }" v-if="routerStatus">
<router-link
class="nav-submain-item flex-align-center"
:class="{ 'active-link': breadcrumb.find(route => route.name === name) }"
Expand Down Expand Up @@ -31,7 +31,7 @@
:size="14" :name="hiddenMenu ? 'dedent' : 'indent'" />
</div>
<div class="m10 bkrepo-view-main flex-column flex-1">
<breadcrumb class="mb10 repo-breadcrumb">
<breadcrumb class="mb10 repo-breadcrumb" v-if="routerStatus">
<bk-breadcrumb-item :to="{ name: 'repositories' }">{{$t('repoList')}}</bk-breadcrumb-item>
</breadcrumb>
<router-view class="flex-1"></router-view>
Expand All @@ -45,12 +45,15 @@
components: { Breadcrumb },
data () {
return {
hiddenMenu: false
hiddenMenu: false,
routerStatus: true
}
},
computed: {
...mapState(['userInfo', 'projectList']),
menuList () {
const routerName = this.$route.name
if (routerName === '440') this.routerStatus = false
if (MODE_CONFIG === 'ci' || this.projectList.length) {
const showRepoScan = RELEASE_MODE !== 'community' || SHOW_ANALYST_MENU
return {
Expand Down
86 changes: 86 additions & 0 deletions src/frontend/devops-repository/static/440.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/frontend/locale/repository/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,5 +759,7 @@
"scanTime":"Scan time",
"exportReportInfo":"Artifact scan record is generating report, please wait ...",
"exportLeakReportInfo":"Security vulnerability information is being reported, please wait...",
"errorPlanNameTips":"Please enter a plan name of 2-32 characters"
"errorPlanNameTips":"Please enter a plan name of 2-32 characters",
"noBusinessTip": "No Business Authorization",
"noBusinessSubTip": "No Access To This App"
}
4 changes: 3 additions & 1 deletion src/frontend/locale/repository/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,7 @@
"noFilenameErrorInfo":"抱歉,服务器获取文件名称异常,请稍后重试",
"batchDownloadBackTypeErrorInfo":"批量下载文件失败,请稍后重试",
"batchDownloadingInfo":"您批量选中的文件正在进行下载中,请稍候...",
"errorPlanNameTips":"请输入 2-32 位字符的计划名称"
"errorPlanNameTips":"请输入 2-32 位字符的计划名称",
"noBusinessTip": "无业务权限",
"noBusinessSubTip": "无该应用访问权限"
}

0 comments on commit d030ef7

Please sign in to comment.