This commit is contained in:
gotoeasy 2023-11-16 21:54:48 +08:00
parent 49cb4807c5
commit 77ba370fec
13 changed files with 30 additions and 84 deletions

View File

@ -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 {

View File

@ -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",

View File

@ -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:

View File

@ -189,12 +189,9 @@ export const uploadAction = (url, data = {}, params = {}) =>
});
});
/**
* TODO 文件下载请求
*/
// ------------------------------------------------
export const getUrl = getRequestUrl;
window.$getUrl = getUrl;
// 以下全局自动import供直接使用
export const $post = postAction;

View File

@ -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">

View File

@ -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);

View File

@ -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;

View File

@ -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">

View File

@ -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();
});
//

View File

@ -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)); //

View File

@ -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)); //

View File

@ -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>

View File

@ -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 />