终端颜色配置.

This commit is contained in:
lijiahang
2024-03-01 15:56:00 +08:00
parent 7e91ef8386
commit 55373bb7dc
9 changed files with 47 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
> 一款开箱即用的运维平台。
- 易用 便捷
- 友好 易用
- 安全 稳定
- 智能 高效

View File

@@ -1,13 +1,13 @@
> 版本号严格遵循 Semver 规范。
[//]: # (🐞修复 [如何升级](/about/update.md?id=_100))
[//]: # (🐞修复)
## 1.0.0
`2024-03-01` `release`
🌈 终端标签颜色
🔨 展数据模块添加缓存
🌈 用户自定义终端标签颜色
🔨 展数据模块添加缓存
[如何升级](/about/update.md?id=_100)

View File

@@ -5,5 +5,15 @@
> sql 脚本
```sql
INSERT INTO `dict_key` VALUES (32, 'terminalTabColor', 'COLOR', '[]', '终端标签页颜色', '2024-03-01 15:01:44', '2024-03-01 15:01:44', '1', '1', 0);
INSERT INTO `dict_value` VALUES (203, 32, 'terminalTabColor', 'rgb(var(--red-6))', '红色', '{}', 10, '2024-03-01 15:07:41', '2024-03-01 15:07:41', '1', '1', 0);
INSERT INTO `dict_value` VALUES (204, 32, 'terminalTabColor', 'rgb(var(--orange-6))', '橙色', '{}', 20, '2024-03-01 15:07:55', '2024-03-01 15:07:55', '1', '1', 0);
INSERT INTO `dict_value` VALUES (205, 32, 'terminalTabColor', 'rgb(var(--yellow-6))', '黄色', '{}', 30, '2024-03-01 15:08:13', '2024-03-01 15:08:13', '1', '1', 0);
INSERT INTO `dict_value` VALUES (206, 32, 'terminalTabColor', 'rgb(var(--green-6))', '绿色', '{}', 40, '2024-03-01 15:08:23', '2024-03-01 15:08:23', '1', '1', 0);
INSERT INTO `dict_value` VALUES (207, 32, 'terminalTabColor', 'rgb(var(--cyan-6))', '青色', '{}', 50, '2024-03-01 15:08:46', '2024-03-01 15:08:46', '1', '1', 0);
INSERT INTO `dict_value` VALUES (208, 32, 'terminalTabColor', 'rgb(var(--blue-6))', '浅蓝', '{}', 60, '2024-03-01 15:11:01', '2024-03-01 15:11:01', '1', '1', 0);
INSERT INTO `dict_value` VALUES (209, 32, 'terminalTabColor', 'rgb(var(--arcoblue-6))', '蓝色', '{}', 70, '2024-03-01 15:11:11', '2024-03-01 15:11:11', '1', '1', 0);
INSERT INTO `dict_value` VALUES (210, 32, 'terminalTabColor', 'rgb(var(--purple-6))', '紫色', '{}', 80, '2024-03-01 15:11:20', '2024-03-01 15:11:20', '1', '1', 0);
INSERT INTO `dict_value` VALUES (211, 32, 'terminalTabColor', 'rgb(var(--pinkpurple-6))', '粉紫', '{}', 90, '2024-03-01 15:11:41', '2024-03-01 15:11:41', '1', '1', 0);
INSERT INTO `dict_value` VALUES (213, 32, 'terminalTabColor', 'rgb(var(--gray-6))', '灰色', '{}', 100, '2024-03-01 15:12:01', '2024-03-01 15:39:34', '1', '1', 0);
```

View File

@@ -2,8 +2,12 @@
主机终端页面 支持 SSH, SFTP。
打开后默认会进入新建连接页面, 页面的主机数据是用户授权的资产数据。
鼠标移入列表内的主机上时, 右侧会出现 `打开 SSH` `打开 SFTP` `连接设置` `收藏` 的按钮。
点击 `连接设置` 后, 会弹出模态框, 可以自定义配置连接主机的 密码/秘钥/身份, 仅对自己生效, 不会修改全局配置, `秘钥` `身份` 数据是用户授权的资产数据。
鼠标移入列表内的主机上时, 右侧会出现 `打开 SSH` `打开 SFTP` `主机设置` `收藏` 的按钮。
> 主机设置
* SSH 配置: 可以自定义配置连接主机的 密码/秘钥/身份, 仅对自己生效, 不会修改全局配置, `秘钥` `身份` 数据是用户授权的资产数据
* 标签颜色: 自定义配置标签的颜色, 可以用来区分环境等
> 顶部状态栏

View File

@@ -17,7 +17,7 @@ public interface DataExtraCacheKeyDefine {
CacheKeyDefine DATA_EXTRA = new CacheKeyBuilder()
.key("data:extra:{}:{}:{}")
.desc("数据展信息 ${userId} ${type} ${item}")
.desc("数据展信息 ${userId} ${type} ${item}")
.type(String.class)
.struct(RedisCacheStruct.HASH)
.timeout(1, TimeUnit.DAYS)

View File

@@ -7,7 +7,7 @@ export default {
'login.form.userName.placeholder': '用户名',
'login.form.password.placeholder': '密码',
'login.form.login': '登录',
'login.banner.slogan1': '开箱即用的运维平台',
'login.banner.slogan1': '开箱即用的一站式智能运维平台',
'login.banner.subSlogan1': '一站式操作 智能运维 让运维变得更简单',
'login.banner.slogan2': '内置权限角色管理',
'login.banner.subSlogan2': '让每一次操作都安全可控可追溯',

View File

@@ -14,11 +14,11 @@
</div>
</div>
<!-- 其他颜色 -->
<template v-for="color in TabColors">
<template v-for="color in toOptions(terminalTabColorKey)">
<div class="color-wrapper"
:class="[formModel.color === color ? 'selected-color' : '']"
:style="{ '--color': `${color}` }"
@click="clickColor(color)">
:class="[formModel.color === color.value ? 'selected-color' : '']"
:style="{ '--color': `${color.value}` }"
@click="clickColor(color.value as string)">
<div class="color-item">
<div class="color-item-dot" />
</div>
@@ -37,14 +37,17 @@
<script lang="ts" setup>
import type { ColorExtraSettingModel } from '../../../types/terminal.type';
import { onMounted, ref } from 'vue';
import { TabColors } from '../../../types/terminal.const';
import { terminalTabColorKey } from '../../../types/terminal.const';
import { getHostExtraItem } from '@/api/asset/host-extra';
import { useDictStore } from '@/store';
const props = defineProps<{
hostId: number,
item: string
}>();
const { toOptions } = useDictStore();
const formModel = ref<ColorExtraSettingModel>({
color: ''
});

View File

@@ -48,20 +48,6 @@ export const ExtraSettingItems = {
COLOR: 'color'
};
// tab 颜色
export const TabColors = [
'rgb(var(--red-6))',
'rgb(var(--orange-6))',
'rgb(var(--yellow-6))',
'rgb(var(--green-6))',
'rgb(var(--cyan-6))',
'rgb(var(--blue-6))',
'rgb(var(--arcoblue-6))',
'rgb(var(--purple-6))',
'rgb(var(--pinkpurple-6))',
'rgb(var(--gray-6))',
];
// 主机额外配置 ssh 认证方式
export const ExtraSshAuthType = {
// 使用默认认证方式
@@ -380,10 +366,14 @@ export const connectStatusKey = 'terminalConnectStatus';
// 终端类型
export const terminalEmulationTypeKey = 'terminalEmulationType';
// 终端标签颜色
export const terminalTabColorKey = 'terminalTabColor';
// 加载的字典值
export const dictKeys = [
fontFamilyKey, fontSizeKey,
fontWeightKey, cursorStyleKey,
newConnectionTypeKey, extraSshAuthTypeKey,
connectStatusKey, terminalEmulationTypeKey
connectStatusKey, terminalEmulationTypeKey,
terminalTabColorKey
];

View File

@@ -108,6 +108,7 @@ INSERT INTO `dict_key` VALUES (27, 'hostConnectType', 'STRING', '[]', '主机连
INSERT INTO `dict_key` VALUES (28, 'hostConnectStatus', 'STRING', '[{\"name\": \"color\", \"type\": \"COLOR\"}]', '主机连接状态', '2023-12-26 23:23:51', '2023-12-26 23:28:15', '1', '1', 0);
INSERT INTO `dict_key` VALUES (29, 'terminalConnectStatus', 'INTEGER', '[{\"name\": \"status\", \"type\": \"STRING\"}]', '终端连接状态', '2024-01-09 00:32:00', '2024-01-09 00:32:16', '1', '1', 0);
INSERT INTO `dict_key` VALUES (31, 'terminalEmulationType', 'STRING', '[]', '伪终端类型', '2024-01-11 23:35:01', '2024-01-11 23:35:01', '1', '1', 0);
INSERT INTO `dict_key` VALUES (32, 'terminalTabColor', 'COLOR', '[]', '终端标签页颜色', '2024-03-01 15:01:44', '2024-03-01 15:01:44', '1', '1', 0);
-- 字典值
INSERT INTO `dict_value` VALUES (3, 4, 'systemMenuType', '1', '父菜单', '{}', 10, '2023-10-26 15:58:59', '2023-10-26 15:58:59', '1', '1', 0);
@@ -258,3 +259,13 @@ INSERT INTO `dict_value` VALUES (199, 2, 'operatorLogType', 'host-terminal:sftp-
INSERT INTO `dict_value` VALUES (200, 2, 'operatorLogType', 'host-terminal:sftp-set-content', '修改文件内容', '{}', 80, '2024-02-23 17:54:37', '2024-02-23 17:54:37', '1', '1', 0);
INSERT INTO `dict_value` VALUES (201, 2, 'operatorLogType', 'host-terminal:sftp-upload', '上传文件', '{}', 90, '2024-02-23 17:54:52', '2024-02-23 17:54:52', '1', '1', 0);
INSERT INTO `dict_value` VALUES (202, 2, 'operatorLogType', 'host-terminal:sftp-download', '下载文件', '{}', 100, '2024-02-23 17:55:03', '2024-02-23 17:55:03', '1', '1', 0);
INSERT INTO `dict_value` VALUES (203, 32, 'terminalTabColor', 'rgb(var(--red-6))', '红色', '{}', 10, '2024-03-01 15:07:41', '2024-03-01 15:07:41', '1', '1', 0);
INSERT INTO `dict_value` VALUES (204, 32, 'terminalTabColor', 'rgb(var(--orange-6))', '橙色', '{}', 20, '2024-03-01 15:07:55', '2024-03-01 15:07:55', '1', '1', 0);
INSERT INTO `dict_value` VALUES (205, 32, 'terminalTabColor', 'rgb(var(--yellow-6))', '黄色', '{}', 30, '2024-03-01 15:08:13', '2024-03-01 15:08:13', '1', '1', 0);
INSERT INTO `dict_value` VALUES (206, 32, 'terminalTabColor', 'rgb(var(--green-6))', '绿色', '{}', 40, '2024-03-01 15:08:23', '2024-03-01 15:08:23', '1', '1', 0);
INSERT INTO `dict_value` VALUES (207, 32, 'terminalTabColor', 'rgb(var(--cyan-6))', '青色', '{}', 50, '2024-03-01 15:08:46', '2024-03-01 15:08:46', '1', '1', 0);
INSERT INTO `dict_value` VALUES (208, 32, 'terminalTabColor', 'rgb(var(--blue-6))', '浅蓝', '{}', 60, '2024-03-01 15:11:01', '2024-03-01 15:11:01', '1', '1', 0);
INSERT INTO `dict_value` VALUES (209, 32, 'terminalTabColor', 'rgb(var(--arcoblue-6))', '蓝色', '{}', 70, '2024-03-01 15:11:11', '2024-03-01 15:11:11', '1', '1', 0);
INSERT INTO `dict_value` VALUES (210, 32, 'terminalTabColor', 'rgb(var(--purple-6))', '紫色', '{}', 80, '2024-03-01 15:11:20', '2024-03-01 15:11:20', '1', '1', 0);
INSERT INTO `dict_value` VALUES (211, 32, 'terminalTabColor', 'rgb(var(--pinkpurple-6))', '粉紫', '{}', 90, '2024-03-01 15:11:41', '2024-03-01 15:11:41', '1', '1', 0);
INSERT INTO `dict_value` VALUES (213, 32, 'terminalTabColor', 'rgb(var(--gray-6))', '灰色', '{}', 100, '2024-03-01 15:12:01', '2024-03-01 15:39:34', '1', '1', 0);