Browse Source

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

pull/794/head
zhengkunwang223 2 years ago committed by GitHub
parent
commit
9f12a91f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      frontend/src/components/app-layout/footer/index.vue
  2. 44
      frontend/src/components/system-upgrade/index.vue
  3. 4
      frontend/src/lang/modules/en.ts
  4. 4
      frontend/src/lang/modules/zh.ts

2
frontend/src/components/app-layout/footer/index.vue

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

44
frontend/src/components/system-upgrade/index.vue

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

4
frontend/src/lang/modules/en.ts

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

4
frontend/src/lang/modules/zh.ts

@ -904,6 +904,7 @@ const message = {
upgradeNotes: '更新内容',
upgradeNow: '立即更新',
source: '下载源',
hasNewVersion: '有新版本',
safe: '安全',
safeEntrance: '安全入口',
@ -947,6 +948,9 @@ const message = {
doc: '官方文档',
star: '点亮 Star',
description: '1Panel现代化开源的 Linux 服务器运维管理面板',
forum: '论坛',
doc2: '文档',
currentVersion: '当前运行版本',
},
app: {
app: '应用',

Loading…
Cancel
Save