fix: 优化移动端运行时样式 (#6460)

This commit is contained in:
ssongliu 2024-09-11 22:02:11 +08:00 committed by GitHub
parent 6ae9b982a9
commit fc70345fcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 58 additions and 38 deletions

View file

@ -1,7 +1,7 @@
<template> <template>
<div class="flex w-full flex-col gap-2 md:justify-between md:flex-row"> <div>
<div class="flex flex-wrap gap-4"> <div class="flex w-full flex-col gap-2 md:flex-row">
<span v-if="props.footer"> <div class="flex flex-wrap" v-if="props.footer">
<el-button type="primary" link @click="toForum"> <el-button type="primary" link @click="toForum">
<span class="font-normal">{{ $t('setting.forum') }}</span> <span class="font-normal">{{ $t('setting.forum') }}</span>
</el-button> </el-button>
@ -13,30 +13,35 @@
<el-button type="primary" link @click="toGithub"> <el-button type="primary" link @click="toGithub">
<span class="font-normal">{{ $t('setting.project') }}</span> <span class="font-normal">{{ $t('setting.project') }}</span>
</el-button> </el-button>
<el-divider direction="vertical" /> <el-divider v-if="!mobile" direction="vertical" />
</span> </div>
</div> <div class="flex flex-wrap">
<div class="flex flex-wrap"> <el-button type="primary" link @click="toHalo">
<el-button type="primary" link @click="toHalo"> <span class="font-normal">
<span class="font-normal">{{ isProductPro ? $t('license.pro') : $t('license.community') }}</span> {{ isProductPro ? $t('license.pro') : $t('license.community') }}
</el-button> </span>
<span class="version" @click="copyText(version)">{{ version }}</span>
<el-badge is-dot style="margin-top: -3px" v-if="version !== 'Waiting' && globalStore.hasNewVersion">
<el-button type="primary" link @click="onLoadUpgradeInfo">
<span class="font-normal">({{ $t('setting.hasNewVersion') }})</span>
</el-button> </el-button>
</el-badge> <span class="version" @click="copyText(version)">{{ version }}</span>
<el-button <el-badge is-dot style="margin-top: -3px" v-if="version !== 'Waiting' && globalStore.hasNewVersion">
v-if="version !== 'Waiting' && !globalStore.hasNewVersion" <el-button type="primary" link @click="onLoadUpgradeInfo">
type="primary" <span class="font-normal">({{ $t('setting.hasNewVersion') }})</span>
link </el-button>
@click="onLoadUpgradeInfo" </el-badge>
> <el-button
<span>({{ $t('setting.upgradeCheck') }})</span> v-if="version !== 'Waiting' && !globalStore.hasNewVersion"
</el-button> type="primary"
<el-tag v-if="version === 'Waiting'" round style="margin-left: 10px">{{ $t('setting.upgrading') }}</el-tag> link
@click="onLoadUpgradeInfo"
>
<span>({{ $t('setting.upgradeCheck') }})</span>
</el-button>
<el-tag v-if="version === 'Waiting'" round style="margin-left: 10px">
{{ $t('setting.upgrading') }}
</el-tag>
</div>
</div> </div>
</div> </div>
<el-drawer <el-drawer
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
@ -86,7 +91,7 @@ import i18n from '@/lang';
import 'md-editor-v3/lib/style.css'; import 'md-editor-v3/lib/style.css';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { copyText } from '@/utils/util'; import { copyText } from '@/utils/util';
import { onMounted, ref } from 'vue'; import { onMounted, ref, computed } from 'vue';
import { GlobalStore } from '@/store'; import { GlobalStore } from '@/store';
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
@ -94,6 +99,10 @@ import { storeToRefs } from 'pinia';
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const { isDarkTheme } = storeToRefs(globalStore); const { isDarkTheme } = storeToRefs(globalStore);
const mobile = computed(() => {
return globalStore.isMobile();
});
const version = ref<string>(''); const version = ref<string>('');
const isProductPro = ref(); const isProductPro = ref();
const loading = ref(false); const loading = ref(false);

View file

@ -4,7 +4,7 @@
<RouterButton :buttons="buttons"> <RouterButton :buttons="buttons">
<template #route-button> <template #route-button>
<div class="pr-5 mt-1"> <div class="pr-5 mt-1">
<el-badge is-dot :hidden="canUpdate"> <el-badge is-dot :hidden="!canUpdate">
<el-button @click="sync" type="primary" plain :disabled="syncing"> <el-button @click="sync" type="primary" plain :disabled="syncing">
{{ $t('app.syncAppList') }} {{ $t('app.syncAppList') }}
</el-button> </el-button>

View file

@ -8,10 +8,10 @@
<PrimaryLogo v-else /> <PrimaryLogo v-else />
</div> </div>
<h3 class="description">{{ globalStore.themeConfig.title || $t('setting.description') }}</h3> <h3 class="description">{{ globalStore.themeConfig.title || $t('setting.description') }}</h3>
<h3> <div class="flex justify-center">
<SystemUpgrade /> <SystemUpgrade />
</h3> </div>
<div style="margin-top: 10px"> <div class="flex w-full justify-center my-5 flex-wrap md:flex-row gap-4">
<el-link @click="toDoc" class="system-link"> <el-link @click="toDoc" class="system-link">
<el-icon><Document /></el-icon> <el-icon><Document /></el-icon>
<span>{{ $t('setting.doc2') }}</span> <span>{{ $t('setting.doc2') }}</span>

View file

@ -84,8 +84,8 @@
fix fix
/> />
<fu-table-operations <fu-table-operations
:ellipsis="10" :ellipsis="mobile ? 0 : 10"
width="300px" :min-width="mobile ? 'auto' : 300"
:buttons="buttons" :buttons="buttons"
:label="$t('commons.table.operate')" :label="$t('commons.table.operate')"
fixed="right" fixed="right"
@ -103,7 +103,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue'; import { onMounted, onUnmounted, reactive, ref, computed } from 'vue';
import { Runtime } from '@/api/interface/runtime'; import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime'; import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util'; import { dateFormat } from '@/utils/util';
@ -120,6 +120,7 @@ import AppResources from '@/views/website/runtime/php/check/index.vue';
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
import { containerPrune } from '@/api/modules/container'; import { containerPrune } from '@/api/modules/container';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { GlobalStore } from '@/store';
let timer: NodeJS.Timer | null = null; let timer: NodeJS.Timer | null = null;
const loading = ref(false); const loading = ref(false);
@ -130,6 +131,11 @@ const dialogPortJumpRef = ref();
const composeLogRef = ref(); const composeLogRef = ref();
const checkRef = ref(); const checkRef = ref();
const globalStore = GlobalStore();
const mobile = computed(() => {
return globalStore.isMobile();
});
const paginationConfig = reactive({ const paginationConfig = reactive({
cacheSizeKey: 'runtime-page-size', cacheSizeKey: 'runtime-page-size',
currentPage: 1, currentPage: 1,

View file

@ -84,10 +84,9 @@
/> />
<fu-table-operations <fu-table-operations
:ellipsis="mobile ? 0 : 3" :ellipsis="mobile ? 0 : 3"
width="300px" :min-width="mobile ? 'auto' : 300"
:buttons="buttons" :buttons="buttons"
:min-width="mobile ? 'auto' : 200" fixed="right"
:fixed="mobile ? false : 'right'"
:label="$t('commons.table.operate')" :label="$t('commons.table.operate')"
fix fix
/> />

View file

@ -83,8 +83,8 @@
fix fix
/> />
<fu-table-operations <fu-table-operations
:ellipsis="10" :ellipsis="mobile ? 0 : 10"
width="350px" :min-width="mobile ? 'auto' : 300"
:buttons="buttons" :buttons="buttons"
:label="$t('commons.table.operate')" :label="$t('commons.table.operate')"
fixed="right" fixed="right"
@ -103,7 +103,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue'; import { onMounted, onUnmounted, reactive, ref, computed } from 'vue';
import { Runtime } from '@/api/interface/runtime'; import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime'; import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util'; import { dateFormat } from '@/utils/util';
@ -121,6 +121,7 @@ import AppResources from '@/views/website/runtime/php/check/index.vue';
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
import { containerPrune } from '@/api/modules/container'; import { containerPrune } from '@/api/modules/container';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { GlobalStore } from '@/store';
let timer: NodeJS.Timer | null = null; let timer: NodeJS.Timer | null = null;
const loading = ref(false); const loading = ref(false);
@ -132,6 +133,11 @@ const composeLogRef = ref();
const moduleRef = ref(); const moduleRef = ref();
const checkRef = ref(); const checkRef = ref();
const globalStore = GlobalStore();
const mobile = computed(() => {
return globalStore.isMobile();
});
const paginationConfig = reactive({ const paginationConfig = reactive({
cacheSizeKey: 'runtime-page-size', cacheSizeKey: 'runtime-page-size',
currentPage: 1, currentPage: 1,