feat: 关于页面更新
This commit is contained in:
parent
958c815ec2
commit
7c3f8884be
24
ui/src/api/license.ts
Normal file
24
ui/src/api/license.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { Result } from '@/request/Result'
|
||||||
|
import { get, post, del, put } from '@/request/index'
|
||||||
|
import { type Ref } from 'vue'
|
||||||
|
|
||||||
|
const prefix = '/license'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得license信息
|
||||||
|
*/
|
||||||
|
const getLicense: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => {
|
||||||
|
return get(`${prefix}/profile`, undefined, loading)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 更新license信息
|
||||||
|
* @param 参数 license_file:file
|
||||||
|
*/
|
||||||
|
const putLicense: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (data, loading) => {
|
||||||
|
return put(`${prefix}/profile`, data, undefined, loading)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getLicense,
|
||||||
|
putLicense
|
||||||
|
}
|
||||||
@ -14,3 +14,8 @@ export enum ValidCount {
|
|||||||
Dataset = 50,
|
Dataset = 50,
|
||||||
User = 2
|
User = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum EditionType {
|
||||||
|
Standard = '社区版',
|
||||||
|
Enterprise = '专业版'
|
||||||
|
}
|
||||||
|
|||||||
@ -9,31 +9,55 @@
|
|||||||
<LogoFull height="59px" />
|
<LogoFull height="59px" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="about-ui">
|
<div class="about-ui" v-loading="loading">
|
||||||
<el-card shadow="hover" class="mb-16" @click="toUrl('https://maxkb.cn/docs/')">
|
<div class="flex">
|
||||||
<div class="flex align-center cursor">
|
<span class="label">授权给</span><span>{{ licenseInfo?.corporation || '-' }}</span>
|
||||||
<AppIcon iconName="app-reading" class="mr-16 ml-8" style="font-size: 24px"></AppIcon>
|
|
||||||
<span>{{ $t('layout.topbar.wiki') }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
<div class="flex">
|
||||||
<el-card shadow="hover" class="mb-16" @click="toUrl('https://github.com/1Panel-dev/MaxKB')">
|
<span class="label">ISV</span><span>{{ licenseInfo?.isv || '-' }}</span>
|
||||||
<div class="flex align-center cursor">
|
|
||||||
<AppIcon iconName="app-github" class="mr-16 ml-8" style="font-size: 24px"></AppIcon>
|
|
||||||
<span>{{ $t('layout.topbar.github') }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
<div class="flex">
|
||||||
<el-card shadow="hover" class="mb-16" @click="toUrl('https://bbs.fit2cloud.com/c/mk/11')">
|
<span class="label">过期时间</span><span>{{ licenseInfo?.expired || '-' }}</span>
|
||||||
<div class="flex align-center cursor">
|
|
||||||
<AppIcon iconName="app-help" class="mr-16 ml-8" style="font-size: 24px"></AppIcon>
|
|
||||||
<span>{{ $t('layout.topbar.forum') }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
<div class="flex">
|
||||||
|
<span class="label">版本</span
|
||||||
|
><span>{{
|
||||||
|
licenseInfo?.edition ? EditionType[licenseInfo.edition as keyof typeof EditionType] : '-'
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">{{ $t('layout.topbar.avatar.version') }}:{{ user.version }}</div>
|
<div class="flex">
|
||||||
|
<span class="label">版本号</span><span>{{ licenseInfo?.licenseVersion || '-' }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex">
|
||||||
|
<span class="label">序列号</span><span>{{ licenseInfo?.serialNo || '-' }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex">
|
||||||
|
<span class="label">备注</span><span>{{ licenseInfo?.remark || '-' }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-16 flex align-center" v-hasPermission="new Role('ADMIN')">
|
||||||
|
<el-upload
|
||||||
|
ref="uploadRef"
|
||||||
|
action="#"
|
||||||
|
:auto-upload="false"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-change="onChange"
|
||||||
|
>
|
||||||
|
<el-button class="border-primary">更新 License</el-button>
|
||||||
|
</el-upload>
|
||||||
|
|
||||||
|
<el-button class="border-primary ml-16" @click="toSupport">获取技术支持</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="text-center">{{ $t('layout.topbar.avatar.version') }}:{{ user.version }}</div> -->
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
|
import licenseApi from '@/api/license'
|
||||||
|
import { EditionType } from '@/enums/common'
|
||||||
|
import { Role } from '@/utils/permission/type'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
const { user } = useStore()
|
const { user } = useStore()
|
||||||
const isDefaultTheme = computed(() => {
|
const isDefaultTheme = computed(() => {
|
||||||
@ -41,12 +65,29 @@ const isDefaultTheme = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const aboutDialogVisible = ref(false)
|
const aboutDialogVisible = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
const licenseInfo = ref<any>(null)
|
||||||
|
|
||||||
const open = () => {
|
const open = () => {
|
||||||
|
getLicenseInfo()
|
||||||
aboutDialogVisible.value = true
|
aboutDialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function toUrl(url: string) {
|
const onChange = (file: any) => {
|
||||||
|
let fd = new FormData()
|
||||||
|
fd.append('license_file', file.raw)
|
||||||
|
licenseApi.putLicense(fd, loading).then((res: any) => {
|
||||||
|
getLicenseInfo()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function getLicenseInfo() {
|
||||||
|
licenseApi.getLicense(loading).then((res: any) => {
|
||||||
|
licenseInfo.value = res.data?.license
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function toSupport() {
|
||||||
|
const url = 'https://support.fit2cloud.com/'
|
||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,13 +110,15 @@ defineExpose({ open })
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.about-ui {
|
.about-ui {
|
||||||
width: 360px;
|
width: 450px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
line-height: 36px;
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
width: 180px;
|
width: 150px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
color: var(--app-text-color-secondary);
|
color: var(--app-text-color-secondary);
|
||||||
}
|
}
|
||||||
@ -86,6 +129,4 @@ defineExpose({ open })
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export default {
|
|||||||
MenuItem: {
|
MenuItem: {
|
||||||
application: "应用",
|
application: "应用",
|
||||||
dataset: "知识库",
|
dataset: "知识库",
|
||||||
setting: "系统设置"
|
setting: "系统管理"
|
||||||
},
|
},
|
||||||
avatar: {
|
avatar: {
|
||||||
resetPassword: "修改密码",
|
resetPassword: "修改密码",
|
||||||
|
|||||||
@ -299,6 +299,10 @@ h5 {
|
|||||||
.border-t-dashed {
|
.border-t-dashed {
|
||||||
border-top: 1px dashed var(--el-border-color);
|
border-top: 1px dashed var(--el-border-color);
|
||||||
}
|
}
|
||||||
|
.border-primary {
|
||||||
|
border: 1px solid var(--el-color-primary);
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
.cursor {
|
.cursor {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
<h5 class="mb-16">页面预览</h5>
|
<h5 class="mb-16">页面预览</h5>
|
||||||
<el-button type="primary" link @click="resetForm"> 恢复默认 </el-button>
|
<el-button type="primary" link @click="resetForm"> 恢复默认 </el-button>
|
||||||
</div>
|
</div>
|
||||||
|
<el-scrollbar>
|
||||||
<div class="theme-preview">
|
<div class="theme-preview">
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
@ -107,7 +108,8 @@
|
|||||||
<el-text type="info"> 显示在网页 Tab 的平台名称 </el-text>
|
<el-text type="info"> 显示在网页 Tab 的平台名称 </el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="欢迎语" prop="slogan">
|
<el-form-item label="欢迎语" prop="slogan">
|
||||||
<el-input v-model="themeForm.slogan" placeholder="请输入欢迎语"> </el-input>
|
<el-input v-model="themeForm.slogan" placeholder="请输入欢迎语">
|
||||||
|
</el-input>
|
||||||
<el-text type="info"> 产品 Logo 下的 欢迎语 </el-text>
|
<el-text type="info"> 产品 Logo 下的 欢迎语 </el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -115,7 +117,7 @@
|
|||||||
>
|
>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
</el-scrollbar>
|
||||||
<div class="mt-16">
|
<div class="mt-16">
|
||||||
<el-text type="info">默认为 MaxKB 登录界面,支持自定义设置</el-text>
|
<el-text type="info">默认为 MaxKB 登录界面,支持自定义设置</el-text>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user