fix 工作空间中不存在资产管理相关的数据添加默认缺省页(仅管理员显示)

This commit is contained in:
bwcx_jzy 2023-03-15 17:56:45 +08:00
parent 139077edc6
commit 96d1101d97
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
7 changed files with 56 additions and 18 deletions

View File

@ -13,6 +13,7 @@
1. 【server】修复 插件端在线升级页面无法正常使用(调用到服务端在线升级接口)
2. 【server】优化 节点在线升级统一管理避免出现 null
3. 【server】修复 节点信息编码在部分接口出现 NPE (感谢@酱总)
4. 【server】优化 工作空间中不存在资产管理相关的数据添加默认缺省页(仅管理员显示)
### ❌ 不兼容功能

View File

@ -1,7 +1,14 @@
<template>
<div class="full-content">
<template v-if="this.getUserInfo && this.getUserInfo.systemUser && !this.loading && this.listQuery.total <= 0">
<a-result title="当前工作空间还没有 Docker" sub-title="请到系统管理-> 资产管理-> Docker管理添加Docker或者将已添加的Docker授权关联到此工作空间">
<template #extra>
<router-link to="/system/assets/docker-list"> <a-button key="console" type="primary">现在就去</a-button></router-link>
</template>
</a-result>
</template>
<!-- 数据表格 -->
<a-table size="middle" :data-source="list" :columns="columns" @change="changePage" :pagination="pagination" bordered rowKey="id" :row-selection="rowSelection">
<a-table v-else size="middle" :data-source="list" :columns="columns" @change="changePage" :pagination="pagination" bordered rowKey="id" :row-selection="rowSelection">
<template slot="title">
<a-space>
<a-input v-model="listQuery['%name%']" @pressEnter="loadData" placeholder="名称" class="search-input-item" />
@ -122,7 +129,7 @@ export default {
props: {},
data() {
return {
loading: false,
loading: true,
listQuery: Object.assign({}, PAGE_DEFAULT_LIST_QUERY),
list: [],
@ -171,7 +178,7 @@ export default {
};
},
computed: {
...mapGetters(["getCollapsed", "getWorkspaceId"]),
...mapGetters(["getCollapsed", "getWorkspaceId", "getUserInfo"]),
pagination() {
return COMPUTED_PAGINATION(this.listQuery);
},

View File

@ -1,6 +1,13 @@
<template>
<div class="full-content">
<a-table size="middle" :data-source="list" :columns="columns" @change="changePage" :pagination="pagination" bordered :rowKey="(record, index) => index">
<template v-if="this.getUserInfo && this.getUserInfo.systemUser && !this.loading && this.listQuery.total <= 0">
<a-result title="当前工作空间还没有 Docker 集群" sub-title="请到系统管理-> 资产管理-> Docker管理添加Docker并创建集群或者将已存在的的 Docker 集群授权关联到此工作空间">
<template #extra>
<router-link to="/system/assets/docker-list"> <a-button key="console" type="primary">现在就去</a-button></router-link>
</template>
</a-result>
</template>
<a-table v-else size="middle" :data-source="list" :columns="columns" @change="changePage" :pagination="pagination" bordered :rowKey="(record, index) => index">
<template slot="title">
<a-space>
<a-input v-model="listQuery['%name%']" @pressEnter="loadData" placeholder="名称" class="search-input-item" />
@ -84,7 +91,7 @@ export default {
props: {},
data() {
return {
loading: false,
loading: true,
listQuery: Object.assign({}, PAGE_DEFAULT_LIST_QUERY),
list: [],
temp: {},
@ -105,7 +112,7 @@ export default {
customRender: (text) => {
return parseTime(text);
},
width: 170,
width: "170px",
},
{
title: "集群创建时间",
@ -141,7 +148,7 @@ export default {
};
},
computed: {
...mapGetters(["getCollapsed"]),
...mapGetters(["getCollapsed", "getUserInfo"]),
pagination() {
return COMPUTED_PAGINATION(this.listQuery);
},

View File

@ -1,6 +1,13 @@
<template>
<div class="full-content">
<a-table :columns="columns" :data-source="list" bordered size="middle" rowKey="id" :pagination="pagination" @change="changePage" :row-selection="rowSelection">
<template v-if="this.getUserInfo && this.getUserInfo.systemUser && !this.loading && this.listQuery.total <= 0">
<a-result title="当前工作空间还没有节点" sub-title="请到系统管理-> 资产管理-> 机器管理添加节点或者将已添加的节点授权关联到此工作空间">
<template #extra>
<router-link to="/system/assets/machine-list"> <a-button key="console" type="primary">现在就去</a-button></router-link>
</template>
</a-result>
</template>
<a-table v-else :columns="columns" :data-source="list" bordered size="middle" rowKey="id" :pagination="pagination" @change="changePage" :row-selection="rowSelection">
<template slot="title">
<a-space>
<a-input v-model="listQuery['%name%']" @pressEnter="loadData" placeholder="节点名称" />
@ -265,7 +272,7 @@ export default {
},
data() {
return {
loading: false,
loading: true,
listQuery: Object.assign({}, PAGE_DEFAULT_LIST_QUERY),
statusMap,
@ -308,7 +315,7 @@ export default {
};
},
computed: {
...mapGetters(["getCollapsed", "getWorkspaceId"]),
...mapGetters(["getCollapsed", "getWorkspaceId", "getUserInfo"]),
pagination() {
return COMPUTED_PAGINATION(this.listQuery);
},

View File

@ -1,7 +1,14 @@
<template>
<div class="full-content">
<div>
<a-card :headStyle="{ padding: '0 6px' }" :bodyStyle="{ padding: '10px' }">
<template v-if="this.getUserInfo && this.getUserInfo.systemUser && !this.loading && this.listQuery.total <= 0">
<a-result title="当前工作空间还没有节点" sub-title="请到系统管理-> 资产管理-> 机器管理添加节点或者将已添加的节点授权关联到此工作空间">
<template #extra>
<router-link to="/system/assets/machine-list"> <a-button key="console" type="primary">现在就去</a-button></router-link>
</template>
</a-result>
</template>
<a-card v-else :headStyle="{ padding: '0 6px' }" :bodyStyle="{ padding: '10px' }">
<template slot="title">
<a-row>
<a-space>
@ -204,7 +211,7 @@
</div>
</template>
<script>
// import { getStatist, status, statusStat } from "@/api/node-stat";
import { mapGetters } from "vuex";
import {} from "@/api/node";
import { PAGE_DEFAULT_LIST_QUERY, PAGE_DEFAULT_SHOW_TOTAL, formatDuration, parseTime, formatPercent2Number } from "@/utils/const";
import NodeTop from "@/pages/node/node-layout/node-top";
@ -215,7 +222,7 @@ export default {
components: { NodeTop },
data() {
return {
loading: false,
loading: true,
statusMap,
listQuery: Object.assign({}, PAGE_DEFAULT_LIST_QUERY, {
limit: 8,
@ -230,7 +237,10 @@ export default {
refreshInterval: 5,
};
},
computed: {},
computed: {
...mapGetters(["getUserInfo"]),
},
watch: {},
created() {
this.loadData();

View File

@ -184,7 +184,7 @@
<a-form-model-item prop="token" label="私人令牌" help="使用私人令牌,可以在你不输入账号密码的情况下对你账号内的仓库进行管理,你可以在创建令牌时指定令牌所拥有的权限。">
<a-tooltip :title="`${giteeImportForm.type} 的令牌${importTypePlaceholder[giteeImportForm.type]}`">
<a-input v-model="giteeImportForm.token" :placeholder="importTypePlaceholder[giteeImportForm.type]">
<a-select slot="addonBefore" v-model="giteeImportForm.type" @change="importTypeChange">
<a-select slot="addonBefore" v-model="giteeImportForm.type">
<a-select-option value="gitee"> gitee </a-select-option>
<a-select-option value="github"> github </a-select-option>
<a-select-option value="gitlab"> gitlab </a-select-option>
@ -375,7 +375,6 @@ export default {
},
handleAddGitee() {
this.giteeImportVisible = true;
this.importTypeChange(this.giteeImportForm.type);
},
handleGiteeImportFormOk() {
this.$refs["giteeImportForm"].validate((valid) => {

View File

@ -1,7 +1,14 @@
<template>
<div class="full-content">
<template v-if="this.getUserInfo && this.getUserInfo.systemUser && !this.loading && this.listQuery.total <= 0">
<a-result title="当前工作空间还没有SSH" sub-title="请到系统管理-> 资产管理-> SSH管理添加SSH或者将已添加的SSH授权关联到此工作空间">
<template #extra>
<router-link to="/system/assets/ssh-list"> <a-button key="console" type="primary">现在就去</a-button></router-link>
</template>
</a-result>
</template>
<!-- 数据表格 -->
<a-table :data-source="list" :columns="columns" size="middle" :pagination="pagination" @change="changePage" bordered rowKey="id" :row-selection="rowSelection">
<a-table v-else :data-source="list" :columns="columns" size="middle" :pagination="pagination" @change="changePage" bordered rowKey="id" :row-selection="rowSelection">
<template slot="title">
<a-space>
<a-input class="search-input-item" @pressEnter="loadData" v-model="listQuery['%name%']" placeholder="ssh名称" />
@ -288,7 +295,7 @@ export default {
};
},
computed: {
...mapGetters(["getWorkspaceId"]),
...mapGetters(["getWorkspaceId", "getUserInfo"]),
pagination() {
return COMPUTED_PAGINATION(this.listQuery);