feat: 框架代码同步 (#173)

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-08-29 17:21:06 +08:00
committed by GitHub
parent b9b228c9e1
commit c088492cfa
95 changed files with 3055 additions and 2140 deletions

View File

@ -10,15 +10,15 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"ace-builds": "^1.35.4",
"aieditor": "^1.0.13",
"axios": "^1.7.3",
"ace-builds": "^1.36.0",
"aieditor": "^1.0.14",
"axios": "^1.7.5",
"clipboard": "^2.0.11",
"core-js": "^3.38.0",
"core-js": "^3.38.1",
"cropperjs": "^1.6.2",
"crypto-js": "^4.2.0",
"echarts": "^5.5.1",
"element-plus": "^2.8.0",
"element-plus": "^2.8.1",
"json-bigint": "^1.0.0",
"json5-to-table": "^0.1.8",
"markdown-it": "^14.1.0",
@ -28,8 +28,8 @@
"qrcodejs2": "^0.0.2",
"sortablejs": "^1.15.2",
"vkbeautify": "^0.99.3",
"vue": "^3.4.37",
"vue-i18n": "^9.13.1",
"vue": "^3.4.38",
"vue-i18n": "^9.14.0",
"vue-router": "^4.4.3",
"vue3-ace-editor": "^2.2.4",
"vue3-json-viewer": "^2.2.2",
@ -41,8 +41,8 @@
"prettier": "^3.3.3",
"prettier-plugin-organize-attributes": "^1.0.0",
"sass": "^1.77.8",
"terser": "^5.31.5",
"vite": "^5.4.0"
"terser": "^5.31.6",
"vite": "^5.4.2"
},
"browserslist": [
"> 1%",

View File

@ -15,4 +15,15 @@ export default {
return await http.get(this.url, data, config)
},
},
/**
* 系统是否已经安全停止
*/
isSystemSafetyStopped: {
url: `${config.API_URL}/api/probe/is.system.safety.stopped`,
name: `系统是否已经安全停止`,
get: async function (data = {}, config = {}) {
return await http.get(this.url, data, config)
},
},
}

View File

@ -5,6 +5,17 @@
import config from '@/config'
import http from '@/utils/request'
export default {
/**
* 批量删除缓存项
*/
bulkDeleteEntry: {
url: `${config.API_URL}/api/sys/cache/bulk.delete.entry`,
name: `批量删除缓存项`,
post: async function (data = {}, config = {}) {
return await http.post(this.url, data, config)
},
},
/**
* 缓存统计
*/
@ -16,6 +27,17 @@ export default {
},
},
/**
* 删除缓存项
*/
deleteEntry: {
url: `${config.API_URL}/api/sys/cache/delete.entry`,
name: `删除缓存项`,
post: async function (data = {}, config = {}) {
return await http.post(this.url, data, config)
},
},
/**
* 获取所有缓存项
*/

View File

@ -5,6 +5,17 @@
import config from '@/config'
import http from '@/utils/request'
export default {
/**
* 执行SQL语句
*/
executeSql: {
url: `${config.API_URL}/api/sys/tools/execute.sql`,
name: `执行SQL语句`,
post: async function (data = {}, config = {}) {
return await http.post(this.url, data, config)
},
},
/**
* 获取更新日志
*/
@ -48,4 +59,15 @@ export default {
return await http.post(this.url, data, config)
},
},
/**
* 系统停机
*/
shutdown: {
url: `${config.API_URL}/api/sys/tools/shutdown`,
name: `系统停机`,
get: async function (data = {}, config = {}) {
return await http.get(this.url, data, config)
},
},
}

View File

@ -7,6 +7,29 @@ const T = {
top: '40',
containLabel: true,
},
pie: {
label: {
color: '#999',
},
},
gauge: {
axisTick: {
lineStyle: {
color: '#999',
},
},
splitLine: {
lineStyle: {
color: '#999',
},
},
axisLabel: {
color: '#999',
},
title: {
color: '#999',
},
},
legend: {
textStyle: {
color: '#999',

View File

@ -167,7 +167,7 @@ export default {
}
[data-theme='dark'] .sc-filter-my-list li {
color: #d0d0d0;
color: #c0c0c0;
}
[data-theme='dark'] .sc-filter-my-list li:hover {

View File

@ -88,6 +88,6 @@ export default {
}
[data-theme='dark'] .sc-page-header__title h2 {
color: #d0d0d0;
color: #c0c0c0;
}
</style>

View File

@ -100,6 +100,6 @@ export default {
}
.dark .sc-statistic-content {
color: #d0d0d0;
color: #c0c0c0;
}
</style>

View File

@ -490,7 +490,7 @@ export default {
this.loading = true
try {
await this.exportApi.post(this.getQueryParams())
this.$message.success(`数据已导出(上限1万条)`)
this.$message.success(`数据已导出(上限2万条)`)
} catch {}
this.loading = false
},

View File

@ -571,4 +571,20 @@ textarea {
color: var(--el-color-info-light-3);
}
}
}
.sc-statistic-error a {
font-size: inherit;
font-weight: inherit;
color: var(--el-color-danger) !important;
&:after {
border-bottom: 1px solid var(--el-color-danger) !important;
bottom: 0;
content: '';
height: 0;
left: 0;
position: absolute;
right: 0;
}
}

View File

@ -108,4 +108,8 @@ html.dark {
.ace_gutter {
background: var(--el-bg-color-overlay);
}
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
--el-table-row-hover-bg-color: unset;
}
}

View File

@ -302,4 +302,8 @@
.el-descriptions__body .el-descriptions__table .el-descriptions__cell {
font-size: inherit;
}
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
--el-table-row-hover-bg-color: #fffaf0;
}

View File

@ -62,10 +62,24 @@
</el-button-group>
</form>
</div>
<div class="right-panel"></div>
<div class="right-panel">
<el-button :disabled="selection.length === 0" @click="batchDel" icon="el-icon-delete" plain type="danger"></el-button>
</div>
</el-header>
<el-main v-loading="loading" class="nopadding">
<sc-table v-if="tableData.length > 0" :data="tableData" :page-size="100" hide-refresh pagination-layout="total" stripe>
<sc-table
v-if="tableData.length > 0"
:data="tableData"
:page-size="100"
@selection-change="
(items) => {
selection = items
}
"
hide-refresh
pagination-layout="total"
stripe>
<el-table-column type="selection" />
<el-table-column :label="$t('键名')" prop="key" />
<el-table-column :label="$t('数据类型')" align="center" prop="type" width="100" />
<el-table-column :label="$t('过期时间')" align="right" prop="expireTime" width="200" />
@ -73,7 +87,14 @@
:buttons="[
{
icon: 'el-icon-view',
click: rowClick,
click: viewClick,
},
{
icon: 'el-icon-delete',
type: 'danger',
confirm: true,
title: '删除缓存',
click: delClick,
},
]"
:vue="this"
@ -94,6 +115,7 @@ export default {
},
data() {
return {
selection: [],
loading: true,
dialog: {
info: false,
@ -113,6 +135,24 @@ export default {
}
},
methods: {
//批量删除
async batchDel() {
let loading
try {
await this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning',
})
loading = this.$loading()
const res = await this.$API.sys_cache.bulkDeleteEntry.post({
items: this.selection,
})
this.$message.success(`删除 ${res.data}`)
} catch {
//
}
await this.getData()
loading?.close()
},
reset() {
this.query.keywords = ''
this.search()
@ -120,10 +160,19 @@ export default {
search() {
this.getData()
},
async rowClick(row) {
async delClick(row) {
try {
const res = await this.$API.sys_cache.deleteEntry.post({ key: row.key })
this.$message.success(`删除 ${res.data}`)
} catch {
//
}
await this.getData()
},
async viewClick(row) {
this.dialog.info = true
await this.$nextTick()
this.$refs.info.open(
await this.$refs.info.open(
() => this.$t('缓存详情'),
() => this.$API.sys_cache.getEntry.post({ key: row.key }),
)

View File

@ -227,7 +227,7 @@ export default {
const apiCrcs = data.data.rows?.map((x) => x.apiPathCrc32)
const ips = data.data.rows?.map((x) => x.createdClientIp) ?? []
const res = await Promise.all([
ownerIds && ownerIds.length > 0
ownerIds && ownerIds.length > 0 && this.$GLOBAL.permissions.some((x) => x === '*/*/*' || x === 'sys/log/operation/user')
? this.$API.sys_user.query.post({
dynamicFilter: {
field: 'id',