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

feat: Open international professional features (#7472)

This commit is contained in:
2024-12-20 15:04:26 +08:00 committed by GitHub
parent a77ebd3eb6
commit 50c01762e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 100 additions and 94 deletions

View File

@ -5,8 +5,8 @@
<el-link type="primary" :underline="false" @click="toForum">
<span class="font-normal">{{ $t('setting.forum') }}</span>
</el-link>
<el-divider direction="vertical" v-if="!globalStore.isIntl" />
<el-link type="primary" :underline="false" @click="toDoc" v-if="!globalStore.isIntl">
<el-divider direction="vertical" />
<el-link type="primary" :underline="false" @click="toDoc">
<span class="font-normal">{{ $t('setting.doc2') }}</span>
</el-link>
<el-divider direction="vertical" />
@ -17,7 +17,7 @@
</div>
<div class="flex flex-wrap items-center">
<el-link :underline="false" class="-ml-2" type="primary" @click="toLxware">
{{ $t(globalStore.isIntl || !isProductPro ? 'license.community' : 'license.pro') }}
{{ $t(!isProductPro ? 'license.community' : 'license.pro') }}
</el-link>
<el-link :underline="false" class="version" type="primary" @click="copyText(version)">
{{ version }}
@ -125,6 +125,8 @@ const handleClose = () => {
const toLxware = () => {
if (!globalStore.isIntl) {
window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer');
} else {
window.open('https://1panel.hk' + '', '_blank', 'noopener,noreferrer');
}
};

View File

@ -134,11 +134,9 @@ function getCheckedLabels(json: Node): string[] {
const search = async () => {
await checkIsSystemIntl();
let checkedLabels: any[] = [];
if (!globalStore.isIntl) {
const res = await getSettingInfo();
const json: Node = JSON.parse(res.data.xpackHideMenu);
checkedLabels = getCheckedLabels(json);
}
const res = await getSettingInfo();
const json: Node = JSON.parse(res.data.xpackHideMenu);
checkedLabels = getCheckedLabels(json);
let rstMenuList: RouteRecordRaw[] = [];
menuStore.menuList.forEach((item) => {
@ -146,6 +144,9 @@ const search = async () => {
let menuChildren: RouteRecordRaw[] = [];
if (menuItem.path === '/xpack') {
if (checkedLabels.length) {
menuItem.children = menuItem.children.filter((child: any) => {
return !(globalStore.isIntl && child.path.includes('/xpack/alert'));
});
menuItem.children.forEach((child: any) => {
for (const str of checkedLabels) {
if (child.name === str) {

View File

@ -10,7 +10,7 @@ router.beforeEach((to, from, next) => {
axiosCanceler.removeAllPending();
const globalStore = GlobalStore();
if (globalStore.isIntl && to.path.includes('xpack')) {
if (globalStore.isIntl && to.path.includes('/xpack/alert')) {
next({ name: '404' });
NProgress.done();
return;

View File

@ -49,7 +49,7 @@ html {
--panel-terminal-tag-hover-text-color: #575758;
--panel-terminal-bg-color: #1e1e1e;
--panel-logs-bg-color: #1e1e1e;
--panel-alert-bg-color: rgba(0, 94, 235, 0.03);;
--panel-alert-bg-color: rgba(0, 94, 235, 0.03);
--panel-alert-bg: #e2e4ec;
--panel-path-bg: #ffffff;

View File

@ -9,7 +9,7 @@
]"
>
<template #route-button>
<div class="router-button" v-if="!isProductPro && !globalStore.isIntl">
<div class="router-button" v-if="!isProductPro">
<el-button link type="primary" @click="toUpload">
{{ $t('license.levelUpPro') }}
</el-button>

View File

@ -16,7 +16,7 @@
<SystemUpgrade />
</div>
<div class="flex w-full justify-center my-5 flex-wrap md:flex-row gap-4">
<el-link @click="toDoc" class="system-link" v-if="!globalStore.isIntl">
<el-link @click="toDoc" class="system-link">
<el-icon><Document /></el-icon>
<span>{{ $t('setting.doc2') }}</span>
</el-link>

View File

@ -9,8 +9,6 @@
<script lang="ts" setup>
import i18n from '@/lang';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();
const buttons = [
{
@ -38,8 +36,4 @@ const buttons = [
path: '/settings/about',
},
];
if (globalStore.isIntl) {
buttons.splice(4, 1);
}
</script>

View File

@ -124,7 +124,7 @@
</el-input>
</el-form-item>
<el-form-item v-if="!globalStore.isIntl" :label="$t('setting.proxy')" prop="proxyShow">
<el-form-item :label="$t('setting.proxy')" prop="proxyShow">
<el-input disabled v-model="form.proxyShow">
<template #append>
<el-button @click="onChangeProxy" icon="Setting">
@ -166,7 +166,7 @@
<span class="input-help">{{ $t('setting.developerModeHelper') }}</span>
</el-form-item>
<el-form-item v-if="!globalStore.isIntl" :label="$t('setting.advancedMenuHide')">
<el-form-item :label="$t('setting.advancedMenuHide')">
<el-input disabled v-model="form.proHideMenus">
<template #append>
<el-button v-show="!show" @click="onChangeHideMenus" icon="Setting">

View File

@ -50,81 +50,90 @@
</template>
</el-input>
</el-form-item>
<el-form-item prop="hasSpec">
<el-checkbox v-model="dialogData.rowData!.hasSpec" :label="$t('toolbox.clam.cron')" />
</el-form-item>
<el-form-item prop="spec" v-if="dialogData.rowData!.hasSpec && isProductPro">
<div class="grid sm:grid-cols-4 gap-4 grid-cols-1">
<el-select v-model="dialogData.rowData!.specObj.specType" @change="changeSpecType()">
<el-option
v-for="item in specOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-select
v-if="dialogData.rowData!.specObj.specType === 'perWeek'"
v-model="dialogData.rowData!.specObj.week"
>
<el-option
v-for="item in weekOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-input
v-if="hasDay(dialogData.rowData!.specObj)"
v-model.number="dialogData.rowData!.specObj.day"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.day')" placement="top">
{{ $t('commons.units.dayUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="hasHour(dialogData.rowData!.specObj)"
v-model.number="dialogData.rowData!.specObj.hour"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.hour')" placement="top">
{{ $t('commons.units.hourUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="dialogData.rowData!.specObj.specType !== 'perNSecond'"
v-model.number="dialogData.rowData!.specObj.minute"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.minute')" placement="top">
{{ $t('commons.units.minuteUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="dialogData.rowData!.specObj.specType === 'perNSecond'"
v-model.number="dialogData.rowData!.specObj.second"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.second')" placement="top">
{{ $t('commons.units.secondUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
</div>
</el-form-item>
<div v-if="globalStore.isIntl">
<el-form-item v-if="(dialogData.rowData!.hasSpec) && !isProductPro">
<span>{{ $t('toolbox.clam.alertHelper') }}</span>
<el-button link type="primary" @click="toUpload">
{{ $t('license.levelUpPro') }}
</el-button>
</el-form-item>
</div>
<div v-if="!globalStore.isIntl">
<el-form-item prop="hasSpec">
<el-checkbox v-model="dialogData.rowData!.hasSpec" :label="$t('toolbox.clam.cron')" />
</el-form-item>
<el-form-item prop="spec" v-if="dialogData.rowData!.hasSpec && isProductPro">
<div class="grid sm:grid-cols-4 gap-4 grid-cols-1">
<el-select v-model="dialogData.rowData!.specObj.specType" @change="changeSpecType()">
<el-option
v-for="item in specOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-select
v-if="dialogData.rowData!.specObj.specType === 'perWeek'"
v-model="dialogData.rowData!.specObj.week"
>
<el-option
v-for="item in weekOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-input
v-if="hasDay(dialogData.rowData!.specObj)"
v-model.number="dialogData.rowData!.specObj.day"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.day')" placement="top">
{{ $t('commons.units.dayUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="hasHour(dialogData.rowData!.specObj)"
v-model.number="dialogData.rowData!.specObj.hour"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.hour')" placement="top">
{{ $t('commons.units.hourUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="dialogData.rowData!.specObj.specType !== 'perNSecond'"
v-model.number="dialogData.rowData!.specObj.minute"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.minute')" placement="top">
{{ $t('commons.units.minuteUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="dialogData.rowData!.specObj.specType === 'perNSecond'"
v-model.number="dialogData.rowData!.specObj.second"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.second')" placement="top">
{{ $t('commons.units.secondUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
</div>
</el-form-item>
<el-form-item prop="hasAlert">
<el-checkbox v-model="dialogData.rowData!.hasAlert" :label="$t('alert.isAlert')" />
<span class="input-help">{{ $t('alert.clamHelper') }}</span>