optimize styles and release v4.0.4

This commit is contained in:
RockYang
2024-04-23 18:46:32 +08:00
parent be3245666e
commit 61b2dbc9f1
30 changed files with 1178 additions and 92 deletions

View File

@@ -123,28 +123,6 @@
<i class="iconfont icon-export"></i>
<span>导出会话</span>
</el-button>
<el-tooltip class="box-item"
effect="dark"
content="部署文档"
placement="bottom">
<a href="https://ai.r9it.com/docs/install/" target="_blank">
<el-button type="primary" circle>
<i class="iconfont icon-book"></i>
</el-button>
</a>
</el-tooltip>
<el-tooltip class="box-item"
effect="dark"
content="项目源码"
placement="bottom">
<a href="https://github.com/yangjian102621/chatgpt-plus" target="_blank">
<el-button type="success" circle>
<i class="iconfont icon-github"></i>
</el-button>
</a>
</el-tooltip>
</div>
</div>

View File

@@ -937,8 +937,6 @@ const generate = () => {
httpPost("/api/mj/image", params.value).then(() => {
ElMessage.success("绘画任务推送成功,请耐心等待任务执行...")
power.value -= mjPower.value
//params.value = copyObj(initParams)
imgList.value = []
}).catch(e => {
ElMessage.error("任务推送失败:" + e.message)
})

View File

@@ -1,5 +1,31 @@
<template>
<div class="index-page" :style="{height: winHeight+'px'}">
<div class="menu-box">
<el-menu
mode="horizontal"
:ellipsis="false"
>
<div class="menu-item">
<el-image :src="logo" alt="Geek-AI"/>
<div class="title">{{ title }}</div>
</div>
<div class="menu-item">
<a href="https://ai.r9it.com/docs/install/" target="_blank">
<el-button type="primary" round>
<i class="iconfont icon-book"></i>
<span>部署文档</span>
</el-button>
</a>
<a href="https://github.com/yangjian102621/chatgpt-plus" target="_blank">
<el-button type="success" round>
<i class="iconfont icon-github"></i>
<span>项目源码</span>
</el-button>
</a>
</div>
</el-menu>
</div>
<div class="content">
<h1>欢迎使用 {{ title }}</h1>
<p>{{ slogan }}</p>
@@ -41,13 +67,15 @@ import {ElMessage} from "element-plus";
const router = useRouter()
const title = ref("Geek-AI 创作系统")
const logo = ref("/images/logo.png")
const slogan = ref("我辈之人,先干为敬,陪您先把 AI 用起来")
const size = Math.max(window.innerWidth * 0.5, window.innerHeight * 0.8)
const winHeight = window.innerHeight - 150
onMounted(() => {
httpGet("/api/config/get?key=system").then(res => {
title.value = res.data['title']
title.value = res.data.title
logo.value = res.data.logo
}).catch(e => {
ElMessage.error("获取系统配置失败:" + e.message)
})
@@ -112,6 +140,7 @@ const init = () => {
</script>
<style lang="stylus" scoped>
@import '@/assets/iconfont/iconfont.css'
.index-page {
margin: 0
background-color #007bff /* 科技蓝色背景 */
@@ -122,13 +151,46 @@ const init = () => {
align-items baseline
padding-top 150px
.container {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
.menu-box {
position absolute
top 0
width 100%
display flex
.el-menu {
padding 0 30px
width 100%
display flex
justify-content space-between
background none
border none
.menu-item {
display flex
padding 20px 0
color #ffffff
.title {
font-size 24px
padding 10px 10px 0 10px
}
.el-image {
height 50px
}
.el-button {
margin-left 10px
span {
margin-left 5px
}
}
}
}
}
.content {
text-align: center;
position relative

View File

@@ -229,7 +229,7 @@ const register = function () {
align-items center
.contain {
padding 0 40px 20px 40px;
padding 20px 40px 20px 40px;
width 100%
color #ffffff
border-radius 10px;

View File

@@ -152,7 +152,7 @@
</el-form-item>
<el-form-item label="绑定API-KEY" prop="apikey">
<el-select v-model="item.key_id" placeholder="请选择 API KEY">
<el-select v-model="item.key_id" placeholder="请选择 API KEY" clearable>
<el-option v-for="v in apiKeys" :value="v.id" :label="v.name" :key="v.id">
{{ v.name }}
<el-text type="info" size="small">{{ substr(v.api_url, 50) }}</el-text>
@@ -313,7 +313,8 @@ const save = function () {
}
if (valid) {
showDialog.value = false
httpPost('/api/admin/model/save', item.value).then((res) => {
item.value.key_id = parseInt(item.value.key_id)
httpPost('/api/admin/model/save', item.value).then(() => {
ElMessage.success('操作成功!')
fetchData()
}).catch((e) => {

View File

@@ -257,6 +257,20 @@
<el-tab-pane label="菜单配置" name="menu">
<Menu/>
</el-tab-pane>
<el-tab-pane label="授权激活" name="license">
<div class="container">
<el-form :model="system" label-width="150px" label-position="right">
<el-form-item label="许可授权码" prop="license">
<el-input v-model="license"/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="active">立即激活</el-button>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
@@ -330,6 +344,19 @@ const save = function (key) {
}
}
// 激活授权
const license = ref("")
const active = () => {
if (license.value === "") {
return ElMessage.error("请输入授权码")
}
httpPost("/api/admin/active", {license: license.value}).then(res => {
ElMessage.success("授权成功,机器编码为:" + res.data)
}).catch(e => {
ElMessage.error(e.message)
})
}
const configKey = ref("")
const beforeUpload = (key) => {
configKey.value = key