Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#10695 from lockiechen/issue_10612_fix
Browse files Browse the repository at this point in the history
feat:依赖的服务未部署时的交互优化 issue TencentBlueKing#10612
  • Loading branch information
mingshewhe authored Jul 19, 2024
2 parents e9e8840 + d04b0d2 commit def264e
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions src/frontend/devops-nav/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@
oHead.appendChild(oStyle)
}

function loadJsAssets(isVendors) {
for (var i = 0; i < window.jsAssets.length; i++) {
var js = window.jsAssets[i]
if (isVendors ? js.indexOf('vendors') > -1 : js.indexOf('vendors') === -1) {
importScript(js, document.body)
}
}
}

function isValidPid(projectList, pid) {
for (var i = 0; i < projectList.length; i++) {
var proj = projectList[i]
Expand All @@ -78,13 +87,6 @@
return false
}

for (var i = 0; i < window.jsAssets.length; i++) {
var js = window.jsAssets[i]
if (js.indexOf('vendors') > -1) {
importScript(js, document.body)
}
}

function getCookie(cname) {
try {
var name = cname + '='
Expand Down Expand Up @@ -124,7 +126,7 @@
'; path=/'
}

window.setProjectIdCookie = function (projectId) {
function setProjectIdCookie (projectId) {
try {
var domainMatch = location.hostname.match(/([^.]+\.)?([^\.]+\..+)/)
var topDomain =
Expand Down Expand Up @@ -214,7 +216,9 @@
<!-- devops:assets -->
<!-- end devops:assets -->


<script>
loadJsAssets(true)
</script>
<script>
window.getLoginUrl = function () {
const loginUrl = LOGIN_SERVICE_URL.startsWith('//') ? `${location.protocol}${LOGIN_SERVICE_URL}` : LOGIN_SERVICE_URL
Expand Down Expand Up @@ -531,15 +535,6 @@
)
}

function loadJsAssets() {
for (var i = 0; i < window.jsAssets.length; i++) {
var js = window.jsAssets[i]
if (js.indexOf('vendors') === -1) {
importScript(js, document.body)
}
}
}

function handleVisibilityChange() {
if (!document.hidden && window.GLOBAL_PID) {
window.setProjectIdCookie(window.GLOBAL_PID)
Expand Down

0 comments on commit def264e

Please sign in to comment.