forked from TencentBlueKing/bk-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:平台管理-代码源管理 TencentBlueKing#11379
# Reviewed, transaction id: 29526
- Loading branch information
Showing
39 changed files
with
2,561 additions
and
1,611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# .env.development 开发模式生效 | ||
VITE_AJAX_URL_PREFIX='/' | ||
DEV='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@blueking/eslint-config-bk/tsvue3'], | ||
parserOptions: { | ||
"ecmaVersion": "latest", | ||
project: [ | ||
'./tsconfig.json', | ||
], | ||
}, | ||
rules: { | ||
"indent": [ | ||
"warn", | ||
2 | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module '*.svg' { | ||
const content: any; | ||
export default content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import tailwindcss from 'tailwindcss'; | ||
import autoprefixer from 'autoprefixer'; | ||
|
||
export default { | ||
plugins: [ | ||
tailwindcss, | ||
autoprefixer, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
interface ILoginData { | ||
login_url?: string, | ||
target?: string | ||
} | ||
|
||
const getLoginUrl = () => { | ||
var cUrl = `${location.origin}/public/login_success.html?is_ajax=1`; | ||
if (/=%s/.test(import.meta.env.VITE_LOGIN_SERVICE_URL)) { | ||
return import.meta.env.VITE_LOGIN_SERVICE_URL.replace(/%s/, cUrl) | ||
} else { | ||
const loginUrl = new URL(import.meta.env.VITE_LOGIN_SERVICE_URL) | ||
if (/=$/.test(loginUrl.search)) { | ||
return import.meta.env.VITE_LOGIN_SERVICE_URL + cUrl | ||
} else { | ||
loginUrl.searchParams.append('c_url', cUrl) | ||
return loginUrl.href | ||
} | ||
} | ||
} | ||
|
||
/** 无权限弹窗 */ | ||
class AuthModel { | ||
isShow: boolean; | ||
loginWindow: Window; | ||
checkWindowTimer: number; | ||
|
||
constructor() { | ||
this.isShow = false; | ||
this.loginWindow = null; | ||
this.checkWindowTimer = -1; | ||
window.addEventListener('message', this.messageListener.bind(this), false); | ||
} | ||
showLoginModal(data: ILoginData = {}) { | ||
if (this.isShow) return; | ||
this.isShow = true; | ||
let url = data.login_url; | ||
if (!url) { | ||
url = getLoginUrl() | ||
} | ||
const width = 700; | ||
const height = 510; | ||
const { availHeight, availWidth } = window.screen; | ||
this.loginWindow = window.open(url, '_blank', ` | ||
width=${width}, | ||
height=${height}, | ||
left=${(availWidth - width) / 2}, | ||
top=${(availHeight - height) / 2}, | ||
channelmode=0, | ||
directories=0, | ||
fullscreen=0, | ||
location=0, | ||
menubar=0, | ||
resizable=0, | ||
scrollbars=0, | ||
status=0, | ||
titlebar=0, | ||
toolbar=0, | ||
close=0 | ||
`); | ||
this.checkWinClose(); | ||
} | ||
checkWinClose() { | ||
this.checkWindowTimer && clearTimeout(this.checkWindowTimer); | ||
this.checkWindowTimer = setTimeout(() => { | ||
if (!this.loginWindow || this.loginWindow.closed) { | ||
this.hideLoginModal(); | ||
clearTimeout(this.checkWindowTimer); | ||
return; | ||
} | ||
this.checkWinClose(); | ||
}, 300); | ||
} | ||
messageListener({ data = {} }: MessageEvent) { | ||
if (data === null || typeof data !== 'object' || data.target !== 'bk-login' || !this.loginWindow) return; | ||
|
||
this.hideLoginModal(); | ||
} | ||
hideLoginModal() { | ||
this.isShow = false; | ||
if (this.loginWindow) { | ||
this.loginWindow.close(); | ||
} | ||
this.loginWindow = null; | ||
} | ||
} | ||
|
||
export default new AuthModel(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// import { ProgressStatus, UpgradeStatus } from '@/types'; | ||
|
||
export const BASE_PREFIX = import.meta.env.DEV ? '/ms' : ''; | ||
export const STORE_TYPE = 'DEVX'; | ||
|
||
export const OWNER_PERMISSION_LIST = ['开发', '版本发布', '私有配置', '可见范围', '审批', '成员管理']; | ||
export const DEVELOPER_PERMISSION_LIST = ['开发', '版本发布', '私有配置']; | ||
|
||
export const STEP_CODES = { | ||
COMMIT: 'commit', | ||
BUILD: 'build', | ||
TEST: 'test', | ||
EDIT: 'edit', | ||
APPROVE: 'approve', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
18 changes: 18 additions & 0 deletions
18
src/frontend/devops-platform/src/components/paltform-header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { | ||
defineComponent, | ||
} from 'vue'; | ||
|
||
|
||
export default defineComponent({ | ||
props: { | ||
title: String, | ||
}, | ||
|
||
setup(props, { slots }) { | ||
return () => ( | ||
<h3 class="bg-white h-[52px] leading-[52px] pl-[24px] text-[16px] text-[#313238] shadow-3xl"> | ||
{slots.default?.() ?? props.title} | ||
</h3> | ||
); | ||
}, | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
@import url(./main.css); | ||
@import url(./reset.css); | ||
|
||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
/*CSS Reset*/ | ||
html, | ||
body, | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
TargetNetBehavior, | ||
} from '@/types'; | ||
import { STORE_TYPE, BASE_PREFIX } from '@/common/constants'; | ||
import fetch from './fetch'; | ||
|
||
const projectPerfix = '/project/api/user'; | ||
const storeApiPerfix = '/store/api/user'; | ||
const repositoryApiPerfix = '/repository/api/user'; | ||
const remotedevApiPerfix = '/remotedev/api'; | ||
|
||
export default { | ||
getUser() { | ||
return fetch.get(`${projectPerfix}/users`); | ||
}, | ||
}; |
Oops, something went wrong.