mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
Merge branch 'main' of github.com:1Panel-dev/MaxKB
This commit is contained in:
commit
96a0e4bc4c
|
|
@ -60,7 +60,8 @@ jobs:
|
|||
else
|
||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||
fi
|
||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache \
|
||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
|
||||
--build-arg DOCKER_IMAGE_TAG=${{ github.event.inputs.dockerImageTag }} --build-arg BUILD_AT=$(TZ=Asia/Shanghai date +'%Y-%m-%dT%H:%M') --build-arg GITHUB_COMMIT=${GITHUB_SHA::8} --no-cache \
|
||||
${DOCKER_IMAGE_TAGS} .
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
|
@ -115,9 +116,9 @@ jobs:
|
|||
else
|
||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||
fi
|
||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache \
|
||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
|
||||
--build-arg DOCKER_IMAGE_TAG=${{ github.event.inputs.dockerImageTag }} --build-arg BUILD_AT=$(TZ=Asia/Shanghai date +'%Y-%m-%dT%H:%M') --build-arg GITHUB_COMMIT=${GITHUB_SHA::8} --no-cache \
|
||||
${DOCKER_IMAGE_TAGS} .
|
||||
env
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ RUN cd ui && \
|
|||
rm -rf ./node_modules
|
||||
|
||||
FROM ghcr.io/1panel-dev/maxkb-python-pg:python3.11.8-pg15.3
|
||||
ARG DOCKER_IMAGE_TAG=dev
|
||||
ARG BUILD_AT
|
||||
ARG GITHUB_COMMIT
|
||||
ENV MAXKB_VERSION ${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_COMMIT})
|
||||
# 创建工作目录
|
||||
RUN mkdir -p /opt/maxkb/app && mkdir -p /opt/maxkb/model && mkdir -p /opt/maxkb/conf
|
||||
# 拷贝项目
|
||||
|
|
|
|||
|
|
@ -124,6 +124,13 @@ const getUserList: (email_or_username: string, loading?: Ref<boolean>) => Promis
|
|||
return get('/user/list', { email_or_username }, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取version
|
||||
*/
|
||||
const getVersion: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => {
|
||||
return get('/profile', undefined, loading)
|
||||
}
|
||||
|
||||
export default {
|
||||
login,
|
||||
register,
|
||||
|
|
@ -134,5 +141,6 @@ export default {
|
|||
sendEmailToCurrent,
|
||||
resetCurrentUserPassword,
|
||||
logout,
|
||||
getUserList
|
||||
getUserList,
|
||||
getVersion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,30 +31,18 @@
|
|||
<span>论坛求助</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<div class="text-center">当前版本号:{{ PackageJSON.version }}</div>
|
||||
</div>
|
||||
<!-- <ul class="about-ui">
|
||||
<li class="flex mb-16">
|
||||
<span class="label text-right">授权数量:</span><span class="text-center">-</span>
|
||||
</li>
|
||||
<li class="flex mb-16">
|
||||
<span class="label text-right">过期时间:</span><span class="text-center">-</span>
|
||||
</li>
|
||||
<li class="flex mb-16">
|
||||
<span class="label text-right">版本:</span><span class="text-center">-</span>
|
||||
</li>
|
||||
<li class="flex">
|
||||
<span class="label text-right">版本号:</span
|
||||
><span class="text-center">{{ PackageJSON.version }}</span>
|
||||
</li>
|
||||
</ul> -->
|
||||
<div class="text-center">版本号:{{ version }}</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import PackageJSON from '../../../../../package.json'
|
||||
import useStore from '@/stores'
|
||||
const defaultTitle = import.meta.env.VITE_APP_TITLE
|
||||
|
||||
const { user } = useStore()
|
||||
const version = user.version
|
||||
|
||||
const aboutDialogVisible = ref(false)
|
||||
|
||||
const open = () => {
|
||||
|
|
@ -69,9 +57,10 @@ defineExpose({ open })
|
|||
</script>
|
||||
<style lang="scss" scope>
|
||||
.about-dialog {
|
||||
padding: 0;
|
||||
padding: 0 0 24px 0;
|
||||
border-radius: 4px;
|
||||
width: 600px;
|
||||
font-weight: 400;
|
||||
.el-dialog__header {
|
||||
background: var(--app-header-bg-color);
|
||||
margin-right: 0;
|
||||
|
|
@ -92,11 +81,11 @@ defineExpose({ open })
|
|||
height: 59px;
|
||||
}
|
||||
.about-ui {
|
||||
padding: 24px;
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
margin-top: 24px;
|
||||
.label {
|
||||
width: 180px;
|
||||
text-align: left;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export interface userStateTypes {
|
|||
userType: number // 1 系统操作者 2 对话用户
|
||||
userInfo: User | null
|
||||
token: any
|
||||
version?: string
|
||||
}
|
||||
|
||||
const useUserStore = defineStore({
|
||||
|
|
@ -13,7 +14,8 @@ const useUserStore = defineStore({
|
|||
state: (): userStateTypes => ({
|
||||
userType: 1,
|
||||
userInfo: null,
|
||||
token: ''
|
||||
token: '',
|
||||
version: ''
|
||||
}),
|
||||
actions: {
|
||||
getToken(): String | null {
|
||||
|
|
@ -42,9 +44,17 @@ const useUserStore = defineStore({
|
|||
changeUserType(num: number) {
|
||||
this.userType = num
|
||||
},
|
||||
|
||||
async asyncGetVersion() {
|
||||
return UserApi.getVersion().then((ok) => {
|
||||
this.version = ok.data?.version || '-'
|
||||
})
|
||||
},
|
||||
|
||||
async profile() {
|
||||
return UserApi.profile().then((ok) => {
|
||||
this.userInfo = ok.data
|
||||
this.asyncGetVersion()
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<el-input
|
||||
v-model="userForm.username"
|
||||
placeholder="请输入用户名"
|
||||
maxlength="64"
|
||||
maxlength="20"
|
||||
show-word-limit
|
||||
>
|
||||
</el-input>
|
||||
|
|
@ -73,8 +73,16 @@ const userForm = ref<any>({
|
|||
})
|
||||
|
||||
const rules = reactive({
|
||||
username: [{ required: true, message: '请输入用户名' }],
|
||||
email: [{ required: true, message: '请输入邮箱' }],
|
||||
username: [
|
||||
{ required: true, message: '请输入用户名', trigger: 'blur' },
|
||||
{
|
||||
min: 6,
|
||||
max: 20,
|
||||
message: '长度在 6 到 20 个字符',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
email: [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
|
|
@ -102,8 +110,8 @@ watch(dialogVisible, (bool) => {
|
|||
phone: '',
|
||||
nick_name: ''
|
||||
}
|
||||
userFormRef.value?.clearValidate()
|
||||
isEdit.value = false
|
||||
userFormRef.value?.clearValidate()
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -99,13 +99,13 @@ watch(dialogVisible, (bool) => {
|
|||
password: '',
|
||||
re_password: ''
|
||||
}
|
||||
userFormRef.value?.clearValidate()
|
||||
}
|
||||
})
|
||||
|
||||
const open = (data: any) => {
|
||||
userId.value = data.id
|
||||
dialogVisible.value = true
|
||||
userFormRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
const submit = async (formEl: FormInstance | undefined) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue