load namespace list when the page opened

This commit is contained in:
zhenorzz 2023-06-20 17:25:17 +08:00
parent 04843c0fff
commit d171343857
3 changed files with 17 additions and 18 deletions

View File

@ -4,7 +4,6 @@
class="navbar-namespace"
trigger="click"
placement="bottom"
@visible-change="handleNamespaceVisible"
@command="handleNamespaceChange"
>
<el-row align="middle">
@ -238,18 +237,18 @@ function showTransformDialog(type: string) {
transformType.value = type
}
function handleNamespaceVisible(visible: boolean) {
if (visible === true) {
namespaceListLoading.value = true
new NamespaceOption()
.request()
.then((response) => {
namespaceList.value = response.data.list
})
.finally(() => {
namespaceListLoading.value = false
})
}
getNamespaceList()
function getNamespaceList() {
namespaceListLoading.value = true
new NamespaceOption()
.request()
.then((response) => {
namespaceList.value = response.data.list
})
.finally(() => {
namespaceListLoading.value = false
})
}
function handleNamespaceChange(namespace: NamespaceUserData) {

View File

@ -231,7 +231,7 @@
<el-row
v-loading="traceLoading"
class="project-detail"
style="flex: 1; align-content: flex-start"
style="flex: 1; padding: 0 10px; align-content: flex-start"
:style="{
width: '100%',
alignContent: 'flex-start',

View File

@ -765,15 +765,15 @@ function publish(data: ProjectData) {
const id = data.id
let color = ''
if (data.environment === 1) {
color = 'color: #F56C6C'
color = 'color: var(--el-color-danger)'
} else if (data.environment === 3) {
color = 'color: #E6A23C'
color = 'color: var(--el-color-warning)'
} else {
color = 'color: #909399'
color = 'color: var(--el-color-info)'
}
ElMessageBox.confirm('', t('tips'), {
message: h('p', null, [
h('span', null, 'Deploy Project: '),
h('span', null, 'Deploy: '),
h(
'b',
{ style: color },