mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
0.14.0
This commit is contained in:
parent
49cb4807c5
commit
77ba370fec
@ -13,7 +13,7 @@ import (
|
||||
"github.com/gotoeasy/glang/cmn"
|
||||
)
|
||||
|
||||
var glcLatest string = ver.VERSION
|
||||
var glcLatest string = ""
|
||||
|
||||
// 查询是否测试模式
|
||||
func TestModeController(req *gweb.HttpRequest) *gweb.HttpResult {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.1.0",
|
||||
"@gotoeasy/glcui": "^0.1.8",
|
||||
"@gotoeasy/glcui": "^0.1.15",
|
||||
"@imengyu/vue3-context-menu": "^1.3.0",
|
||||
"@vueuse/core": "^10.2.1",
|
||||
"axios": "^1.4.0",
|
||||
|
||||
@ -9,8 +9,8 @@ dependencies:
|
||||
specifier: ^2.1.0
|
||||
version: 2.1.0(vue@3.3.4)
|
||||
'@gotoeasy/glcui':
|
||||
specifier: ^0.1.8
|
||||
version: 0.1.8
|
||||
specifier: ^0.1.15
|
||||
version: 0.1.15
|
||||
'@imengyu/vue3-context-menu':
|
||||
specifier: ^1.3.0
|
||||
version: 1.3.0
|
||||
@ -772,8 +772,8 @@ packages:
|
||||
resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==}
|
||||
dev: true
|
||||
|
||||
/@gotoeasy/glcui@0.1.8:
|
||||
resolution: {integrity: sha512-vzP/1/jp4kCo0OsAKs9yEhlZh3/HYXJ1udrxL8slVGSlzdN8SNTiRctRr4Ik0IRnzH7b5gOqg32HJ3xAaKN0ig==}
|
||||
/@gotoeasy/glcui@0.1.15:
|
||||
resolution: {integrity: sha512-Htk1iNsX46ROcCCxNZFjOY2fON33AN/H3Os5yApZA+r/2ljsXyYOCzyIFP5pGMHNkgfAH9HaEyynqnG5M+18dQ==}
|
||||
dev: false
|
||||
|
||||
/@humanwhocodes/config-array@0.11.10:
|
||||
|
||||
@ -189,12 +189,9 @@ export const uploadAction = (url, data = {}, params = {}) =>
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* TODO 文件下载请求
|
||||
*/
|
||||
|
||||
// ------------------------------------------------
|
||||
export const getUrl = getRequestUrl;
|
||||
window.$getUrl = getUrl;
|
||||
|
||||
// 以下全局自动import,供直接使用
|
||||
export const $post = postAction;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
</el-form-item> -->
|
||||
<el-form-item class="c-search-form-item">
|
||||
<el-input v-model="formData.searchKeys" placeholder="请输入关键词检索,支持多关键词" input-style="width:500px;height: 30px"
|
||||
@keyup.enter="fnSearch">
|
||||
maxlength="1000" @keyup.enter="fnSearch">
|
||||
<template #append>
|
||||
<el-button type="primary" class="c-btn-search" style="height:30px;color: white; background-color:#0081dd"
|
||||
@click="fnSearch">
|
||||
|
||||
@ -69,27 +69,6 @@ $emitter.on('$layout:SwitchMaximizePage', () => {
|
||||
themeState.pageMaximize = !themeState.pageMaximize;
|
||||
});
|
||||
|
||||
// // ------------ 检索一览页面用 ------------
|
||||
// const downPanelWidth = computed(() => {
|
||||
// let menu = 0;
|
||||
// if (themeStore.layout !== 'HeaderMainFooter' && !themeState.tabsMaximize && !themeState.pageMaximize) {
|
||||
// menu = themeStore.menuCollapse ? themeStore.menuCollapseWidth : themeStore.menuExpandWidth;
|
||||
// }
|
||||
// const margin = themeStore.mainPanelMarginLeft + themeStore.mainPanelMarginRight;
|
||||
// const padding = themeStore.mainPanelPaddingLeft + themeStore.mainPanelPaddingRight;
|
||||
// return `calc(100vw - ${menu + margin + padding + 8}px)`
|
||||
// });
|
||||
// const downPanelPadding = computed(() => {
|
||||
// const left = themeStore.mainPanelPaddingLeft - 8;
|
||||
// const right = themeStore.mainPanelPaddingRight;
|
||||
// return `16px ${right}px 16px ${left}px`
|
||||
// });
|
||||
// const downPanelMarginLeft = computed(() => {
|
||||
// let margin = themeStore.mainPanelPaddingLeft - 8;
|
||||
// margin < 0 && (margin = 0);
|
||||
// return `-${margin}px`;
|
||||
// });
|
||||
|
||||
// ------------ iframe ------------
|
||||
const iframeHeight = computed(() => {
|
||||
const header = ((themeState.pageMaximize || themeState.tabsMaximize) ? 0 : themeStore.headerHeight);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="copyright">Copyright © 2022-Present gotoeasy.top</div>
|
||||
<div class="copyright">Copyright © 2022-present gotoeasy.top</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -8,7 +8,7 @@ import { useThemeStore } from '~/pkgs';
|
||||
const themeStore = useThemeStore();
|
||||
</script>
|
||||
|
||||
<style scoped lang="css">
|
||||
<style lang="css">
|
||||
.copyright {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
@ -68,7 +68,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElNotification } from 'element-plus';
|
||||
import { gxUtil, useThemeStore, useTokenStore } from '~/pkgs';
|
||||
import { userLogout } from '~/api';
|
||||
|
||||
@ -79,6 +78,7 @@ const themeStore = useThemeStore();
|
||||
const formData = ref({ oldPassword: '', password1: '', password2: '' });
|
||||
const form = ref(); // 表单实例
|
||||
const dialog = ref();
|
||||
const checkVersionDone = ref(false)
|
||||
|
||||
const validatePass2 = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
@ -131,9 +131,7 @@ const svgLogoColor = computed(() => {
|
||||
return '#eeeeee';
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
checkVersion();
|
||||
});
|
||||
onMounted(() => checkVersion());
|
||||
|
||||
const fnChangePsw = (form) => {
|
||||
form.validate(valid => {
|
||||
@ -174,8 +172,8 @@ const clickLogo = () => {
|
||||
};
|
||||
|
||||
function checkVersion() {
|
||||
if (!window.$checkVersionDone) {
|
||||
window.$checkVersionDone = true;
|
||||
if (!checkVersionDone.value) {
|
||||
checkVersionDone.value = true;
|
||||
// 从后台服务读取当前运行版本,避免多处维护版本号
|
||||
$post('/v1/version/info', {}, null, { 'Content-Type': 'application/x-www-form-urlencoded' }).then(rs => {
|
||||
if (rs.success) {
|
||||
@ -183,16 +181,6 @@ function checkVersion() {
|
||||
if (rs.result.latest && normalizeVer(rs.result.version) < normalizeVer(rs.result.latest)) {
|
||||
verInfo.value = `当前版本 ${rs.result.version} ,有新版本 ${rs.result.latest} 可更新`
|
||||
}
|
||||
// 有新版本时,左上角图标鼠标悬停显示提示(最新版本号的查询服务并不保证随时可用)
|
||||
fetch(`https://glc.gotoeasy.top/glogcenter/current/version.json?v=${rs.result.version}`)
|
||||
.then(response => response.json())
|
||||
.then(data => { // 最新版本(服务不保证可用,可能查不到,仅查到有新版本时更新tip)
|
||||
if (data.version && normalizeVer(rs.result.version) < normalizeVer(data.version)) {
|
||||
verInfo.value = `当前版本 ${rs.result.version} ,有新版本 ${data.version} 可更新`;
|
||||
notifyUpdate(rs.result.version, data.version);
|
||||
}
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -204,26 +192,6 @@ function normalizeVer(ver) {
|
||||
return `v${100 + (ary[0] - 0)}.${1000 + (ary[1] - 0)}.${1000 + (ary[2] - 0)}`
|
||||
}
|
||||
|
||||
function notifyUpdate(over, nver) {
|
||||
let duration = 5000;
|
||||
let disabled = ""
|
||||
let showClose = true
|
||||
if ((nver.substring(1, 4) - 0) - (over.substring(1, 4) - 0) > 0) {
|
||||
// 重大版本更新时,不自动关闭
|
||||
localStorage.removeItem("NotNotify")
|
||||
disabled = "disabled"
|
||||
showClose = false
|
||||
duration = 0
|
||||
} else if (localStorage.getItem('NotNotify')) {
|
||||
return;
|
||||
}
|
||||
let message = `有新版本 ${nver} 可以更新`;
|
||||
message += `,<span style="color:blue" class="hand" onclick="window.open('https://github.com/gotoeasy/glogcenter', '_blank')">点击查看</span>`
|
||||
message += `<br><br>`
|
||||
message += `<input class="hand" type="checkbox" ${disabled} id="ccvvuu" onclick="localStorage.setItem('NotNotify', this.checked?'1':'')"><label class="hand" for="ccvvuu"> 不再提醒</label>`
|
||||
ElNotification({ title: "提示", message, type: "info", position: 'bottom-right', dangerouslyUseHTMLString: true, duration, showClose });
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@ -32,8 +32,7 @@
|
||||
popper-class="c-datapicker" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户">
|
||||
<el-input v-model="formData.user" :disabled="readonly" placeholder="请输入用户" maxlength="100"
|
||||
style="width:420px;" />
|
||||
<el-input v-model="formData.user" placeholder="请输入用户" maxlength="100" style="width:420px;" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</SearchForm>
|
||||
@ -81,7 +80,7 @@
|
||||
|
||||
<script setup>
|
||||
import { useEmitter, usePageMainHooks, useTabsState } from "~/pkgs";
|
||||
import { userLogout } from "~/api";
|
||||
import { userLogout, enableLogin } from "~/api";
|
||||
|
||||
const tabsState = useTabsState();
|
||||
const emitter = useEmitter(tabsState.activePath);
|
||||
@ -96,7 +95,7 @@ const { formData, visible, tableData, tableHeight, pageSettingStore, showTableLo
|
||||
const showTestBtn = ref(false); // 是否显示生成测试数据按钮
|
||||
const autoSearchMode = ref(false); // 自动查询
|
||||
const table = ref(); // 表格实例
|
||||
const tid = ref('glcSearchMain'); // 表格ID
|
||||
const tid = ref('searchMain231126'); // 表格ID
|
||||
const info = ref(''); // 底部提示信息
|
||||
const storageOptions = ref([]) // 日志仓
|
||||
const systemSet = new Set();
|
||||
@ -189,7 +188,7 @@ const shortcuts = ref([
|
||||
]);
|
||||
|
||||
// 初期默认检索
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
const configStore = $emitter.emit('$table:config', { id: tid.value });
|
||||
!configStore.columns.length && $emitter.emit('$table:config', { id: tid.value, update: true }); // 首次使用开启默认布局
|
||||
// 日志仓列表查询
|
||||
@ -240,6 +239,8 @@ onMounted(() => {
|
||||
}
|
||||
});
|
||||
|
||||
// 检查下,避免不需要登录又还显示着登录状态
|
||||
await enableLogin();
|
||||
});
|
||||
|
||||
// 清除日志仓条件时,重新拉取最新日志仓列表
|
||||
|
||||
@ -54,7 +54,7 @@ const opt = {
|
||||
const { visible, tableData, getTableHeight, pageSettingStore, showTableLoadding } = usePageMainHooks(opt);
|
||||
|
||||
const table = ref(); // 表格实例
|
||||
const tid = ref('storagesMain'); // 表格ID
|
||||
const tid = ref('storagesMain231126'); // 表格ID
|
||||
const info = ref(''); // 底部提示信息
|
||||
|
||||
const tableHeight = computed(() => getTableHeight(false, true, 19)); // 表格高度
|
||||
|
||||
@ -51,7 +51,7 @@ const opt = { emitter, pageSettingStore: usePageSettingStore() };
|
||||
const { visible, tableData, getTableHeight, pageSettingStore, showTableLoadding } = usePageMainHooks(opt);
|
||||
|
||||
const table = ref(); // 表格实例
|
||||
const tid = ref('userMain'); // 表格ID
|
||||
const tid = ref('userMain231126'); // 表格ID
|
||||
|
||||
const tableHeight = computed(() => getTableHeight(false, true, 19)); // 表格高度
|
||||
|
||||
|
||||
@ -3,26 +3,26 @@
|
||||
<el-card shadow="never">
|
||||
|
||||
<el-form-item label="账号" prop="username">
|
||||
<el-input v-model="formData.username" :disabled="!isCreateMode" placeholder="请输入账号" />
|
||||
<el-input v-model="formData.username" :disabled="!isCreateMode" placeholder="请输入账号" maxlength="100" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="!readonly" label="密码" prop="password1">
|
||||
<el-input v-model="formData.password1" type="password" :placeholder="isCreateMode ? '请输入密码' : '需要修改密码时请输入'"
|
||||
autocomplete="new-password" />
|
||||
autocomplete="new-password" maxlength="100" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="!readonly" label="确认密码" prop="password2">
|
||||
<el-input v-model="formData.password2" type="password" :placeholder="isCreateMode ? '请输入密码' : '需要修改密码时请输入'"
|
||||
autocomplete="new-password" />
|
||||
autocomplete="new-password" maxlength="100" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="系统权限" prop="roles">
|
||||
<el-input v-model="formData.systems" :disabled="readonly"
|
||||
:placeholder="readonly ? '' : '请输入可访问系统,多系统时逗号分隔,不填或*代表全部'" />
|
||||
:placeholder="readonly ? '' : '请输入可访问系统,多系统时逗号分隔,不填或*代表全部'" maxlength="1000" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.note" type="textarea" :disabled="readonly" resize="none"
|
||||
<el-input v-model="formData.note" type="textarea" :disabled="readonly" resize="none" maxlength="2000"
|
||||
:autosize="{ minRows: 4, maxRows: 4 }" :placeholder="readonly ? '' : '请输入备注'" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<el-form ref="form" :model="formData" :rules="rules" size="large">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="formData.username" placeholder="请输入用户名">
|
||||
<el-input v-model="formData.username" placeholder="请输入用户名" maxlength="100">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon">
|
||||
<user />
|
||||
@ -18,7 +18,8 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input v-model="formData.password" type="password" placeholder="请输入密码" autocomplete="new-password">
|
||||
<el-input v-model="formData.password" type="password" placeholder="请输入密码" autocomplete="new-password"
|
||||
maxlength="100">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon">
|
||||
<lock />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user