feat: 页脚增加论坛、文档入口 (#792)

pull/794/head
zhengkunwang223 2023-04-26 15:36:11 +08:00 committed by GitHub
parent dd0ca4bcaf
commit 9f12a91f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 9 deletions

View File

@ -7,7 +7,7 @@
<a href="https://fit2cloud.com/" target="_blank">Copyright © 2014-2023 FIT2CLOUD 飞致云</a> <a href="https://fit2cloud.com/" target="_blank">Copyright © 2014-2023 FIT2CLOUD 飞致云</a>
</div> </div>
<div class="footer-right"> <div class="footer-right">
<SystemUpgrade /> <SystemUpgrade :footer="true" />
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,9 +1,24 @@
<template> <template>
<div> <div>
<span class="version">{{ version }}</span> <span v-if="props.footer">
<el-badge is-dot class="item" v-if="version !== 'Waiting' && globalStore.hasNewVersion"> <el-button type="primary" link @click="toForum">
<el-button style="margin-top: -8px" type="primary" link @click="onLoadUpgradeInfo"> <span>{{ $t('setting.forum') }}</span>
{{ $t('setting.upgradeCheck') }} </el-button>
<el-divider direction="vertical" />
<el-button type="primary" link @click="toDoc">
<span>{{ $t('setting.doc2') }}</span>
</el-button>
<el-divider direction="vertical" />
</span>
<span class="version">{{ $t('setting.currentVersion') + version }}</span>
<el-badge
is-dot
class="item"
v-if="version !== 'Waiting' && globalStore.hasNewVersion"
style="margin-top: -6px"
>
<el-button type="primary" link @click="onLoadUpgradeInfo">
<span style="font-size: 14px">{{ $t('setting.hasNewVersion') }}</span>
</el-button> </el-button>
</el-badge> </el-badge>
<el-button <el-button
@ -13,11 +28,10 @@
link link
@click="onLoadUpgradeInfo" @click="onLoadUpgradeInfo"
> >
{{ $t('setting.upgradeCheck') }} {{ $t('setting.upgradeCheck') }}
</el-button> </el-button>
<el-tag v-if="version === 'Waiting'" round style="margin-left: 10px">{{ $t('setting.upgrading') }}</el-tag> <el-tag v-if="version === 'Waiting'" round style="margin-left: 10px">{{ $t('setting.upgrading') }}</el-tag>
</div> </div>
<el-drawer :close-on-click-modal="false" :key="refresh" v-model="drawerVisiable" size="50%" append-to-body> <el-drawer :close-on-click-modal="false" :key="refresh" v-model="drawerVisiable" size="50%" append-to-body>
<template #header> <template #header>
<DrawerHeader :header="$t('setting.upgrade')" :back="handleClose" /> <DrawerHeader :header="$t('setting.upgrade')" :back="handleClose" />
@ -50,6 +64,7 @@
</el-drawer> </el-drawer>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import DrawerHeader from '@/components/drawer-header/index.vue';
import { getSettingInfo, loadReleaseNotes, loadUpgradeInfo, upgrade } from '@/api/modules/setting'; import { getSettingInfo, loadReleaseNotes, loadUpgradeInfo, upgrade } from '@/api/modules/setting';
import MdEditor from 'md-editor-v3'; import MdEditor from 'md-editor-v3';
import i18n from '@/lang'; import i18n from '@/lang';
@ -61,12 +76,17 @@ import { ElMessageBox } from 'element-plus';
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const version = ref(); const version = ref();
let loading = ref(false); const loading = ref(false);
const drawerVisiable = ref(false); const drawerVisiable = ref(false);
const upgradeInfo = ref(); const upgradeInfo = ref();
const refresh = ref(); const refresh = ref();
const upgradeVersion = ref(); const upgradeVersion = ref();
const props = defineProps({
footer: {
type: Boolean,
default: false,
},
});
const search = async () => { const search = async () => {
const res = await getSettingInfo(); const res = await getSettingInfo();
@ -77,6 +97,14 @@ const handleClose = () => {
drawerVisiable.value = false; drawerVisiable.value = false;
}; };
const toDoc = () => {
window.open('https://1panel.cn/docs/', '_blank');
};
const toForum = () => {
window.open('https://bbs.fit2cloud.com/c/1p/7', '_blank');
};
const onLoadUpgradeInfo = async () => { const onLoadUpgradeInfo = async () => {
loading.value = true; loading.value = true;
await loadUpgradeInfo() await loadUpgradeInfo()

View File

@ -918,6 +918,7 @@ const message = {
upgradeNotes: 'Release note', upgradeNotes: 'Release note',
upgradeNow: 'Upgrade now', upgradeNow: 'Upgrade now',
source: 'Download source', source: 'Download source',
hasNewVersion: 'New version Available',
monitor: 'Monitor', monitor: 'Monitor',
enableMonitor: 'Enable', enableMonitor: 'Enable',
@ -941,6 +942,9 @@ const message = {
doc: 'Official document', doc: 'Official document',
star: 'Star', star: 'Star',
description: '1Panel, Modern, open source Linux server operation and maintenance management panel.', description: '1Panel, Modern, open source Linux server operation and maintenance management panel.',
forum: 'Forum',
doc2: 'Document',
currentVersion: 'Version',
}, },
app: { app: {
app: 'Application', app: 'Application',

View File

@ -904,6 +904,7 @@ const message = {
upgradeNotes: '', upgradeNotes: '',
upgradeNow: '', upgradeNow: '',
source: '', source: '',
hasNewVersion: '',
safe: '', safe: '',
safeEntrance: '', safeEntrance: '',
@ -947,6 +948,9 @@ const message = {
doc: '', doc: '',
star: ' Star', star: ' Star',
description: '1Panel Linux ', description: '1Panel Linux ',
forum: '',
doc2: '',
currentVersion: '',
}, },
app: { app: {
app: '', app: '',