1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

style: Optimize layout style (#7359)

This commit is contained in:
2024-12-13 22:33:56 +08:00 committed by GitHub
parent 229254e3d3
commit 2d098f8078
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 64 additions and 32 deletions

View File

@ -93,7 +93,7 @@ import { ElMessageBox } from 'element-plus';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const { isDarkTheme } = storeToRefs(globalStore); const { isDarkTheme, docsUrl } = storeToRefs(globalStore);
const mobile = computed(() => { const mobile = computed(() => {
return globalStore.isMobile(); return globalStore.isMobile();
@ -129,7 +129,7 @@ const toLxware = () => {
}; };
const toDoc = () => { const toDoc = () => {
window.open('https://1panel.cn/docs/', '_blank', 'noopener,noreferrer'); window.open(docsUrl.value, '_blank', 'noopener,noreferrer');
}; };
const toForum = () => { const toForum = () => {

View File

@ -1798,7 +1798,7 @@ const message = {
all: 'All', all: 'All',
version: 'Version', version: 'Version',
detail: 'Details', detail: 'Details',
params: 'Edit parameters', params: 'Edit',
install: 'Install', install: 'Install',
author: 'Author', author: 'Author',
source: 'Source', source: 'Source',
@ -1855,7 +1855,7 @@ const message = {
installPrompt: 'No apps installed yet', installPrompt: 'No apps installed yet',
updateHelper: 'Editing parameters may cause the application to fail to start. Please proceed with caution.', updateHelper: 'Editing parameters may cause the application to fail to start. Please proceed with caution.',
updateWarn: 'Update parameters need to rebuild the application, Do you want to continue? ', updateWarn: 'Update parameters need to rebuild the application, Do you want to continue? ',
busPort: 'Service Port', busPort: 'Port',
syncStart: 'Start syncing! Please refresh the app store later', syncStart: 'Start syncing! Please refresh the app store later',
advanced: 'Advanced Settings', advanced: 'Advanced Settings',
cpuCore: 'core(s)', cpuCore: 'core(s)',

View File

@ -48,6 +48,7 @@ const GlobalStore = defineStore({
state.themeConfig.theme === 'dark' || state.themeConfig.theme === 'dark' ||
(state.themeConfig.theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches), (state.themeConfig.theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches),
isDarkGoldTheme: (state) => state.themeConfig.primary === '#F0BE96' && state.isProductPro, isDarkGoldTheme: (state) => state.themeConfig.primary === '#F0BE96' && state.isProductPro,
docsUrl: (state) => (state.isIntl ? 'https://docs.1panel.hk' : 'https://1panel.cn/docs'),
}, },
actions: { actions: {
setOpenMenuTabs(openMenuTabs: boolean) { setOpenMenuTabs(openMenuTabs: boolean) {

View File

@ -30,7 +30,6 @@
min-width: auto !important; min-width: auto !important;
} }
.d-description { .d-description {
display: block !important;
overflow: inherit !important; overflow: inherit !important;
} }
} }

View File

@ -13,37 +13,41 @@
.d-name { .d-name {
height: 20%; height: 20%;
.name { .name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 120px;
font-weight: 500; font-weight: 500;
font-size: 18px; font-size: 18px;
color: var(--panel-text-color); color: var(--panel-text-color);
} }
.status { .status {
margin-left: 10px; margin-left: 5px;
} }
.h-button { .h-button {
float: right; float: right;
margin-right: 10px; margin-right: 5px;
} }
.msg { .msg {
margin-left: 10px; margin-left: 5px;
}
.el-button + .el-button {
margin-left: 6px;
} }
} }
.d-description { .d-description {
margin-top: 10px; margin-top: 10px;
overflow: hidden; overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
.el-tag { .el-tag {
margin-right: 5px; margin-right: 5px;
} }
}
.description { .description {
margin-top: 10px; margin-top: 10px;
font-size: 14px; font-size: 14px;
color: var(--el-text-color-regular); color: var(--el-text-color-regular);
} }
}
.d-button { .d-button {
margin-top: 10px; margin-top: 10px;
min-width: 440px; min-width: 440px;

View File

@ -94,11 +94,11 @@
:md="24" :md="24"
:lg="12" :lg="12"
:xl="12" :xl="12"
class="install-card-col-12" :class="mode === 'upgrade' ? 'upgrade-card-col-12' : 'install-card-col-12'"
> >
<div class="install-card"> <div class="install-card">
<el-card class="e-card"> <el-card class="e-card">
<el-row :gutter="20"> <el-row :gutter="10">
<el-col :xs="3" :sm="3" :md="3" :lg="4" :xl="4"> <el-col :xs="3" :sm="3" :md="3" :lg="4" :xl="4">
<div class="icon" @click.stop="openDetail(installed.appKey)"> <div class="icon" @click.stop="openDetail(installed.appKey)">
<el-avatar <el-avatar
@ -112,9 +112,10 @@
<div class="a-detail"> <div class="a-detail">
<div class="d-name"> <div class="d-name">
<el-button link type="info"> <el-button link type="info">
<el-tooltip effect="dark" :content="installed.name" placement="top">
<span class="name">{{ installed.name }}</span> <span class="name">{{ installed.name }}</span>
</el-tooltip>
</el-button> </el-button>
<span class="status"> <span class="status">
<Status :key="installed.status" :status="installed.status"></Status> <Status :key="installed.status" :status="installed.status"></Status>
</span> </span>
@ -210,7 +211,7 @@
{{ $t('commons.button.upgrade') }} {{ $t('commons.button.upgrade') }}
</el-button> </el-button>
</div> </div>
<div class="d-description"> <div class="d-description flex flex-wrap items-center justify-start gap-1.5">
<el-button class="tagMargin" plain size="small"> <el-button class="tagMargin" plain size="small">
{{ $t('app.version') }}{{ $t('commons.colon') }}{{ installed.version }} {{ $t('app.version') }}{{ $t('commons.colon') }}{{ installed.version }}
</el-button> </el-button>
@ -237,17 +238,16 @@
{{ $t('app.busPort') }}{{ $t('commons.colon') {{ $t('app.busPort') }}{{ $t('commons.colon')
}}{{ installed.httpsPort }} }}{{ installed.httpsPort }}
</el-button> </el-button>
</div>
<div class="description"> <div class="description">
<span> <span>
{{ $t('app.alreadyRun') }}{{ $t('commons.colon') }} {{ $t('app.alreadyRun') }}{{ $t('commons.colon') }}
{{ getAge(installed.createdAt) }} {{ getAge(installed.createdAt) }}
</span> </span>
</div> </div>
</div>
<div class="app-divider" /> <div class="app-divider" />
<div <div
class="d-button flex flex-wrap items-center justify-start gap-3" class="d-button flex flex-wrap items-center justify-start gap-1.5"
v-if="mode === 'installed' && installed.status != 'Installing'" v-if="mode === 'installed' && installed.status != 'Installing'"
> >
<el-button <el-button
@ -386,7 +386,7 @@ const sync = () => {
try { try {
await SyncInstalledApp(); await SyncInstalledApp();
MsgSuccess(i18n.global.t('app.syncSuccess')); MsgSuccess(i18n.global.t('app.syncSuccess'));
search(); await search();
} finally { } finally {
syncLoading.value = false; syncLoading.value = false;
} }
@ -631,10 +631,31 @@ onUnmounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
@import '../index.scss'; @import '../index.scss';
@media only screen and (max-width: 1300px) { @media only screen and (max-width: 1400px) {
.install-card-col-12 { .install-card-col-12 {
max-width: 100%; max-width: 100%;
flex: 0 0 100%; flex: 0 0 100%;
.a-detail {
.d-name {
.name {
max-width: 300px;
}
}
}
}
}
@media only screen and (max-width: 1499px) {
.upgrade-card-col-12 {
max-width: 100%;
flex: 0 0 100%;
.a-detail {
.d-name {
.name {
max-width: 300px;
}
}
}
} }
} }
@ -647,4 +668,9 @@ onUnmounted(() => {
margin-left: 0; margin-left: 0;
} }
} }
.d-description {
.el-button + .el-button {
margin-left: 0;
}
}
</style> </style>

View File

@ -45,7 +45,9 @@ import { onMounted, ref } from 'vue';
import SystemUpgrade from '@/components/system-upgrade/index.vue'; import SystemUpgrade from '@/components/system-upgrade/index.vue';
import { GlobalStore } from '@/store'; import { GlobalStore } from '@/store';
import PrimaryLogo from '@/assets/images/1panel-logo.svg?component'; import PrimaryLogo from '@/assets/images/1panel-logo.svg?component';
import { storeToRefs } from 'pinia';
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const { docsUrl } = storeToRefs(globalStore);
const version = ref(); const version = ref();
const loading = ref(); const loading = ref();
@ -55,7 +57,7 @@ const search = async () => {
}; };
const toDoc = () => { const toDoc = () => {
window.open('https://1panel.cn/docs/', '_blank', 'noopener,noreferrer'); window.open(docsUrl.value, '_blank', 'noopener,noreferrer');
}; };
const toGithub = () => { const toGithub = () => {
window.open('https://github.com/1Panel-dev/1Panel', '_blank', 'noopener,noreferrer'); window.open('https://github.com/1Panel-dev/1Panel', '_blank', 'noopener,noreferrer');