fix: sql脚本默认账号密码调整&终端默认配色调整

This commit is contained in:
meilin.huang
2022-08-04 20:47:13 +08:00
parent 12f8cf0111
commit e1afb1ed54
6 changed files with 47 additions and 13 deletions

View File

@@ -107,11 +107,11 @@ const themeConfigModule: Module<ThemeConfigState, RootStateTypes> = {
layout: 'classic',
// ssh终端字体颜色
terminalForeground: '#7e9192',
terminalForeground: '#d0d0d0',
// ssh终端背景色
terminalBackground: '#002833',
terminalBackground: '#1c1c1c',
// ssh终端cursor色
terminalCursor: '#268F81',
terminalCursor: '#e4c9af',
terminalFontSize: 15,

View File

@@ -100,9 +100,17 @@
<el-button type="primary" size="small" @click="tableCreateDialog.visible = true">创建表</el-button>
</el-row>
<el-table v-loading="tableInfoDialog.loading" border stripe :data="tableInfoDialog.infos" size="small">
<el-table-column property="tableName" label="表名" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column property="tableComment" label="备注" min-width="150" show-overflow-tooltip></el-table-column>
<el-table v-loading="tableInfoDialog.loading" border stripe :data="filterTableInfos" size="small">
<el-table-column property="tableName" label="表名" min-width="150" show-overflow-tooltip>
<template #header>
<el-input v-model="tableInfoDialog.tableNameSearch" size="small" placeholder="表名: 输入可过滤" clearable />
</template>
</el-table-column>
<el-table-column property="tableComment" label="备注" min-width="150" show-overflow-tooltip>
<template #header>
<el-input v-model="tableInfoDialog.tableCommentSearch" size="small" placeholder="备注: 输入可过滤" clearable />
</template>
</el-table-column>
<el-table-column
prop="tableRows"
label="Rows"
@@ -244,7 +252,7 @@
</template>
<script lang='ts'>
import { toRefs, reactive, onMounted, defineComponent } from 'vue';
import { toRefs, reactive, computed, onMounted, defineComponent } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { formatByteSize } from '@/common/utils/format';
import DbEdit from './DbEdit.vue';
@@ -317,6 +325,8 @@ export default defineComponent({
loading: false,
visible: false,
infos: [],
tableNameSearch: '',
tableCommentSearch: '',
},
columnDialog: {
visible: false,
@@ -345,6 +355,26 @@ export default defineComponent({
state.projects = await projectApi.accountProjects.request(null);
});
const filterTableInfos = computed(() => {
const infos = state.tableInfoDialog.infos;
const tableNameSearch = state.tableInfoDialog.tableNameSearch;
const tableCommentSearch = state.tableInfoDialog.tableCommentSearch;
if (!tableNameSearch && !tableCommentSearch) {
return infos;
}
return infos.filter((data: any) => {
let tnMatch = true;
let tcMatch = true;
if (tableNameSearch) {
tnMatch = data.tableName.toLowerCase().includes(tableNameSearch.toLowerCase());
}
if (tableCommentSearch) {
tcMatch = data.tableComment.includes(tableCommentSearch);
}
return tnMatch && tcMatch;
});
});
const choose = (item: any) => {
if (!item) {
return;
@@ -572,6 +602,7 @@ export default defineComponent({
return {
...toRefs(state),
filterTableInfos,
enums,
search,
choose,

View File

@@ -65,9 +65,9 @@ export default defineComponent({
// cursorStyle: 'underline', //光标样式
disableStdin: false,
theme: {
foreground: getThemeConfig.value.terminalForeground || '#7e9192', //字体
background: getThemeConfig.value.terminalBackground || '#002833', //背景色
cursor: getThemeConfig.value.terminalCursor || '#268F81', //设置光标
foreground: getThemeConfig.value.terminalForeground || '#d0d0d0', //字体
background: getThemeConfig.value.terminalBackground || '#1c1c1c', //背景色
cursor: getThemeConfig.value.terminalCursor || '#e4c9af', //设置光标
} as any,
});
const fitAddon = new FitAddon();

View File

@@ -21,6 +21,9 @@ func PwdAesEncrypt(password string) string {
// 使用config.yml的aes.key进行密码解密
func PwdAesDecrypt(encryptPwd string) string {
if encryptPwd == "" {
return ""
}
aes := config.Conf.Aes
if aes == nil {
return encryptPwd

View File

@@ -260,7 +260,7 @@ DROP TABLE IF EXISTS `t_redis`;
CREATE TABLE `t_redis` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`host` varchar(255) COLLATE utf8mb4_bin NOT NULL,
`password` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
`password` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
`db` int(32) DEFAULT NULL,
`mode` varchar(32) DEFAULT NULL,
`enable_ssh_tunnel` tinyint(2) DEFAULT NULL COMMENT '是否启用ssh隧道',
@@ -304,7 +304,7 @@ CREATE TABLE `t_sys_account` (
-- Records of t_sys_account
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_account` VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, '2021-11-17 16:30:02', '12.0.216.228', '2020-01-01 19:00:00', 1, 'admin', '2020-01-01 19:00:00', 1, 'admin');
INSERT INTO `t_sys_account` VALUES (1, 'admin', '$2a$10$w3Wky2U.tinvR7c/s0aKPuwZsIu6pM1/DMJalwBDMbE6niHIxVrrm', 1, '2021-11-17 16:30:02', '12.0.216.228', '2020-01-01 19:00:00', 1, 'admin', '2020-01-01 19:00:00', 1, 'admin');
COMMIT;
-- ----------------------------

View File

@@ -10,4 +10,4 @@
服务关闭:./shutdown.sh
直接通过 host:ip即可访问项目
初始账号 admin/123456
初始账号 admin/admin123.