💄 修改样式.

This commit is contained in:
lijiahang
2024-05-31 13:36:49 +08:00
parent fc34b24029
commit 7bfa8a73be
30 changed files with 81 additions and 42 deletions

View File

@@ -70,12 +70,11 @@ docker compose up -d
## 项目文档 ## 项目文档
* [文档地址](https://lijiahangmax.github.io/orion-visor/#/) * [文档地址](https://lijiahangmax.github.io/open-orion/orion-visor/)
* [docker安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/docker-install) * [安装文档](https://lijiahangmax.github.io/open-orion/orion-visor/quickstart/docker.html)
* [普通安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/install) * [更新日志](https://lijiahangmax.github.io/open-orion/orion-visor/update/change-log.html)
* [更新日志](https://lijiahangmax.github.io/orion-visor/#/about/change-log) * [操作手册](https://lijiahangmax.github.io/open-orion/orion-visor/operator/asset.html)
* [操作手册](https://lijiahangmax.github.io/orion-visor/#/operator/asset) * [常见问题](https://lijiahangmax.github.io/open-orion/orion-visor/support/faq.html)
* [常见问题](https://lijiahangmax.github.io/orion-visor/#/quickstart/faq)
## 技术栈 ## 技术栈

View File

@@ -40,6 +40,12 @@
------------------------------ ------------------------------
<p><b>⛔⛔此页面已不再维护, 请跳转至
<a target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor">这里</a>
查看最新文档 ❗</b></p>
------------------------------
**`orion-visor`** 提供一站式服务器运维解决方案。 **`orion-visor`** 提供一站式服务器运维解决方案。
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。 * **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
@@ -70,9 +76,8 @@ docker compose up -d
## 项目文档 ## 项目文档
* [文档地址](https://lijiahangmax.github.io/orion-visor/#/) * [文档地址](/)
* [docker安装](/quickstart/docker-install) * [安装文档](/quickstart/docker-install)
* [普通安装](/quickstart/install)
* [更新日志](/about/change-log) * [更新日志](/about/change-log)
* [操作手册](/operator/asset) * [操作手册](/operator/asset)
* [常见问题](/quickstart/faq) * [常见问题](/quickstart/faq)

View File

@@ -1,4 +1,4 @@
# orion-visor <small>2.0.3</small> # orion-visor
> 一款高颜值、现代化的智能运维&轻量堡垒机平台。 > 一款高颜值、现代化的智能运维&轻量堡垒机平台。

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){ }, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){

View File

@@ -195,7 +195,7 @@ orion:
api: api:
# 公共 api 前缀 # 公共 api 前缀
prefix: /orion-visor/api prefix: /orion-visor/api
# 是否开启跨域 # 是否允许跨域
cors: true cors: true
websocket: websocket:
# 公共 websocket 前缀 # 公共 websocket 前缀

View File

@@ -2,11 +2,9 @@
<a-layout-footer class="footer"> <a-layout-footer class="footer">
<a-space direction="vertical" size="small"> <a-space direction="vertical" size="small">
<a-space size="large"> <a-space size="large">
<!-- <a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor">官网</a-link> -->
<!-- <a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor">教程</a-link> -->
<a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor">github</a-link> <a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor">github</a-link>
<a-link target="_blank" href="https://gitee.com/lijiahangmax/orion-visor">gitee</a-link> <a-link target="_blank" href="https://gitee.com/lijiahangmax/orion-visor">gitee</a-link>
<a-link target="_blank" href="https://lijiahangmax.github.io/orion-visor">文档</a-link> <a-link target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor">文档</a-link>
<a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE">License</a-link> <a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE">License</a-link>
<a-link target="_blank" :href="`https://github.com/lijiahangmax/orion-visor/releases/tag/v${version}`">v{{ version }} Community</a-link> <a-link target="_blank" :href="`https://github.com/lijiahangmax/orion-visor/releases/tag/v${version}`">v{{ version }} Community</a-link>
</a-space> </a-space>

View File

@@ -5,7 +5,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -74,7 +74,7 @@
type="warning" type="warning"
@ok="deleteSelectRows"> @ok="deleteSelectRows">
<a-button v-permission="['asset:host-connect-log:management:delete']" <a-button v-permission="['asset:host-connect-log:management:delete']"
type="secondary" type="primary"
status="danger" status="danger"
:disabled="selectedKeys.length === 0"> :disabled="selectedKeys.length === 0">
删除 删除

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -61,7 +61,7 @@
type="warning" type="warning"
@ok="deleteSelectRows"> @ok="deleteSelectRows">
<a-button v-permission="['infra:operator-log:delete', 'asset:host-sftp-log:management:delete']" <a-button v-permission="['infra:operator-log:delete', 'asset:host-sftp-log:management:delete']"
type="secondary" type="primary"
status="danger" status="danger"
:disabled="selectedKeys.length === 0"> :disabled="selectedKeys.length === 0">
删除 删除

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -5,7 +5,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -17,10 +17,10 @@
<a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor/issues">上报 bug</a-link> <a-link target="_blank" href="https://github.com/lijiahangmax/orion-visor/issues">上报 bug</a-link>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-link target="_blank" href="https://lijiahangmax.github.io/orion-visor">操作文档</a-link> <a-link target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor/operator/asset.html">操作手册</a-link>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-link target="_blank" href="https://lijiahangmax.github.io/orion-visor/#/about/update-log">更新日志</a-link> <a-link target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor/update/change-log.html">更新日志</a-link>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>

View File

@@ -85,7 +85,7 @@
type="warning" type="warning"
@ok="deleteSelectRows"> @ok="deleteSelectRows">
<a-button v-permission="['asset:exec-command-log:delete']" <a-button v-permission="['asset:exec-command-log:delete']"
type="secondary" type="primary"
status="danger" status="danger"
:disabled="selectedKeys.length === 0"> :disabled="selectedKeys.length === 0">
删除 删除

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -5,7 +5,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -85,7 +85,7 @@
type="warning" type="warning"
@ok="deleteSelectRows"> @ok="deleteSelectRows">
<a-button v-permission="['asset:upload-task:delete']" <a-button v-permission="['asset:upload-task:delete']"
type="secondary" type="primary"
status="danger" status="danger"
:disabled="selectedKeys.length === 0"> :disabled="selectedKeys.length === 0">
删除 删除

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -70,7 +70,7 @@
type="warning" type="warning"
@ok="deleteSelectRows"> @ok="deleteSelectRows">
<a-button v-permission="['asset:exec-job-log:delete']" <a-button v-permission="['asset:exec-job-log:delete']"
type="secondary" type="primary"
status="danger" status="danger"
:disabled="selectedKeys.length === 0"> :disabled="selectedKeys.length === 0">
删除 删除

View File

@@ -5,7 +5,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -63,6 +63,21 @@
</template> </template>
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
<!-- 删除 -->
<a-popconfirm :content="`确认删除选中的 ${selectedKeys.length} 条记录吗?`"
position="br"
type="warning"
@ok="deleteSelectRows">
<a-button v-permission="['infra:dict-key:delete']"
type="primary"
status="danger"
:disabled="selectedKeys.length === 0">
删除
<template #icon>
<icon-delete />
</template>
</a-button>
</a-popconfirm>
</a-space> </a-space>
</div> </div>
</template> </template>
@@ -71,6 +86,8 @@
ref="tableRef" ref="tableRef"
:loading="loading" :loading="loading"
:columns="columns" :columns="columns"
v-model:selected-keys="selectedKeys"
:row-selection="rowSelection"
:data="tableRenderData" :data="tableRenderData"
:pagination="pagination" :pagination="pagination"
@page-change="(page) => fetchTableData(page, pagination.pageSize)" @page-change="(page) => fetchTableData(page, pagination.pageSize)"
@@ -144,24 +161,26 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { DictKeyQueryRequest, DictKeyQueryResponse } from '@/api/system/dict-key'; import type { DictKeyQueryRequest, DictKeyQueryResponse } from '@/api/system/dict-key';
import { reactive, ref, onMounted } from 'vue'; import { reactive, ref, onMounted } from 'vue';
import { deleteDictKey, getDictKeyPage, refreshCache } from '@/api/system/dict-key'; import { deleteDictKey, batchDeleteDictKey, getDictKeyPage, refreshCache } from '@/api/system/dict-key';
import { Message } from '@arco-design/web-vue'; import { Message } from '@arco-design/web-vue';
import useLoading from '@/hooks/loading'; import useLoading from '@/hooks/loading';
import columns from '../types/table.columns'; import columns from '../types/table.columns';
import { usePagination } from '@/types/table'; import { usePagination, useRowSelection } from '@/types/table';
import { dictValueTypeKey } from '../types/const'; import { dictValueTypeKey } from '../types/const';
import { copy } from '@/hooks/copy'; import { copy } from '@/hooks/copy';
import { useCacheStore, useDictStore } from '@/store'; import { useCacheStore, useDictStore } from '@/store';
import { getDictValueList } from '@/api/system/dict-value'; import { getDictValueList } from '@/api/system/dict-value';
const tableRenderData = ref<DictKeyQueryResponse[]>([]);
const emits = defineEmits(['openAdd', 'openUpdate', 'openView']); const emits = defineEmits(['openAdd', 'openUpdate', 'openView']);
const pagination = usePagination(); const pagination = usePagination();
const rowSelection = useRowSelection();
const { loading, setLoading } = useLoading(); const { loading, setLoading } = useLoading();
const { toOptions, getDictValue } = useDictStore(); const { toOptions, getDictValue } = useDictStore();
const cacheStore = useCacheStore(); const cacheStore = useCacheStore();
const selectedKeys = ref<number[]>([]);
const tableRenderData = ref<DictKeyQueryResponse[]>([]);
const formModel = reactive<DictKeyQueryRequest>({ const formModel = reactive<DictKeyQueryRequest>({
id: undefined, id: undefined,
keyName: undefined, keyName: undefined,
@@ -186,6 +205,23 @@
} }
}; };
// 删除选中行
const deleteSelectRows = async () => {
try {
setLoading(true);
// 调用删除接口
await batchDeleteDictKey(selectedKeys.value);
Message.success(`成功删除 ${selectedKeys.value.length} 条数据`);
selectedKeys.value = [];
cacheStore.reset('dictKeys');
// 重新加载数据
fetchTableData();
} catch (e) {
} finally {
setLoading(false);
}
};
// 添加后回调 // 添加后回调
const addedCallback = () => { const addedCallback = () => {
fetchTableData(); fetchTableData();
@@ -238,6 +274,7 @@
pagination.total = data.total; pagination.total = data.total;
pagination.current = request.page; pagination.current = request.page;
pagination.pageSize = request.limit; pagination.pageSize = request.limit;
selectedKeys.value = [];
} catch (e) { } catch (e) {
} finally { } finally {
setLoading(false); setLoading(false);

View File

@@ -5,7 +5,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -55,7 +55,7 @@
type="warning" type="warning"
@ok="deleteSelectRows"> @ok="deleteSelectRows">
<a-button v-permission="['infra:dict-value:delete']" <a-button v-permission="['infra:dict-value:delete']"
type="secondary" type="primary"
status="danger" status="danger"
:disabled="selectedKeys.length === 0"> :disabled="selectedKeys.length === 0">
删除 删除

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -32,7 +32,7 @@
type="warning" type="warning"
@ok="deleteSelectRows"> @ok="deleteSelectRows">
<a-button v-permission="['infra:operator-log:delete']" <a-button v-permission="['infra:operator-log:delete']"
type="secondary" type="primary"
status="danger" status="danger"
:disabled="selectedKeys.length === 0"> :disabled="selectedKeys.length === 0">
删除 删除

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {

View File

@@ -6,7 +6,7 @@ const columns = [
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
slotName: 'id', slotName: 'id',
width: 70, width: 100,
align: 'left', align: 'left',
fixed: 'left', fixed: 'left',
}, { }, {