mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 08:00:53 +00:00
fix: warn on node version mismatch after login (#13691)
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<div v-if="currentNodeVersionMismatch" class="mt-3">
|
||||
<el-alert type="warning" :closable="false" show-icon :title="$t('setting.currentNodeVersionNotSame')" />
|
||||
</div>
|
||||
<div class="mt-3" v-if="showExpiresAt && expiresAlertVisible && productProExpires && productProExpires !== 0">
|
||||
<el-alert type="warning" @close="handleExpiresAlertClose">
|
||||
<template #title>
|
||||
@@ -52,6 +55,8 @@ import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { hasPermissionMetaAccess, hasRouteAccess } from '@/utils/rbac';
|
||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||
import { getSettingBaseInfo } from '@/api/modules/setting';
|
||||
import { listNodes } from '@/utils/node';
|
||||
|
||||
defineOptions({ name: 'RouterButton' });
|
||||
|
||||
@@ -67,7 +72,7 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
const { isEnterprise, isIntl, productProExpires } = useGlobalStore();
|
||||
const { currentNode, isEnterprise, isIntl, isXpackOrEE, productProExpires } = useGlobalStore();
|
||||
const buttonArray = computed(() => {
|
||||
return props.buttons.filter((button) => {
|
||||
if (!hasPermissionMetaAccess(button.permission)) {
|
||||
@@ -82,6 +87,7 @@ const buttonArray = computed(() => {
|
||||
});
|
||||
|
||||
const activeName = ref('');
|
||||
const currentNodeVersionMismatch = ref(false);
|
||||
const expiresInfo = ref(0);
|
||||
const expiresAlertVisible = ref(false);
|
||||
const expiresAlertKey = computed(() => (isEnterprise.value ? 'xpack.expiresEnterpriseAlert' : 'xpack.expiresProAlert'));
|
||||
@@ -113,6 +119,33 @@ watch(
|
||||
},
|
||||
);
|
||||
|
||||
watch([currentNode, isXpackOrEE], checkCurrentNodeVersion, { immediate: true });
|
||||
|
||||
async function checkCurrentNodeVersion() {
|
||||
const checkedNode = currentNode.value;
|
||||
if (checkedNode === 'local' || !isXpackOrEE.value) {
|
||||
currentNodeVersionMismatch.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const [settingRes, nodes] = await Promise.all([getSettingBaseInfo(), listNodes('all')]);
|
||||
if (currentNode.value !== checkedNode) {
|
||||
return;
|
||||
}
|
||||
const currentNodeInfo = nodes.find((item) => item.name === checkedNode);
|
||||
currentNodeVersionMismatch.value = Boolean(
|
||||
currentNodeInfo?.version &&
|
||||
settingRes.data.systemVersion &&
|
||||
currentNodeInfo.version !== settingRes.data.systemVersion,
|
||||
);
|
||||
} catch {
|
||||
if (currentNode.value === checkedNode) {
|
||||
currentNodeVersionMismatch.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function syncActiveName() {
|
||||
if (!buttonArray.value.length) {
|
||||
activeName.value = '';
|
||||
|
||||
@@ -3167,6 +3167,8 @@ const message = {
|
||||
upgradeNow: 'Upgrade now',
|
||||
source: 'Download source',
|
||||
versionNotSame: 'Node version mismatch with the main node. Please upgrade in Node Management before retrying.',
|
||||
currentNodeVersionNotSame:
|
||||
'The current node version does not match the main node. Contact the administrator to upgrade the current node.',
|
||||
versionCompare:
|
||||
'Detected that node {0} is already at the latest upgradable version. Please check the primary node version and try again!',
|
||||
about: 'About',
|
||||
|
||||
@@ -3225,6 +3225,8 @@ const message = {
|
||||
source: 'Fuente de descarga',
|
||||
versionNotSame:
|
||||
'La versión del nodo no coincide con la del nodo principal. Actualiza en la gestión de nodos antes de reintentar.',
|
||||
currentNodeVersionNotSame:
|
||||
'La versión del nodo actual no coincide con la del nodo principal. Contacta con el administrador para actualizar el nodo actual.',
|
||||
versionCompare:
|
||||
'Se detectó que el nodo {0} ya está en la última versión actualizable. Verifica la versión del nodo principal e inténtalo de nuevo.',
|
||||
about: 'Acerca de',
|
||||
|
||||
@@ -3135,6 +3135,8 @@ const message = {
|
||||
upgradeNow: 'ارتقاء اکنون',
|
||||
source: 'منبع دانلود',
|
||||
versionNotSame: 'نسخه گره با گره اصلی مطابقت ندارد. لطفاً قبل از تلاش مجدد در مدیریت گره ارتقاء دهید.',
|
||||
currentNodeVersionNotSame:
|
||||
'نسخه گره فعلی با گره اصلی مطابقت ندارد. برای ارتقای گره فعلی با مدیر سیستم تماس بگیرید.',
|
||||
versionCompare:
|
||||
'تشخیص داده شد که گره {0} در حال حاضر به آخرین نسخه قابل ارتقاء رسیده است. لطفاً نسخه گره اصلی را بررسی کرده و دوباره تلاش کنید!',
|
||||
about: 'درباره',
|
||||
|
||||
@@ -3123,6 +3123,8 @@ const message = {
|
||||
source: 'ソースをダウンロードします',
|
||||
versionNotSame:
|
||||
'ノードのバージョンがメインノードと一致していません。ノード管理でアップグレードしてから再試行してください。',
|
||||
currentNodeVersionNotSame:
|
||||
'現在のノードのバージョンがメインノードと一致していません。管理者に連絡して、現在のノードをアップグレードしてください。',
|
||||
versionCompare:
|
||||
'ノード {0} は既にアップグレード可能な最新バージョンです。マスターノードのバージョンを確認後、再試行してください!',
|
||||
about: 'について',
|
||||
|
||||
@@ -3070,6 +3070,8 @@ const message = {
|
||||
upgradeNow: '지금 업그레이드',
|
||||
source: '다운로드 소스',
|
||||
versionNotSame: '노드 버전이 메인 노드와 일치하지 않습니다. 노드 관리에서 업그레이드한 후 다시 시도해 주세요.',
|
||||
currentNodeVersionNotSame:
|
||||
'현재 노드 버전이 메인 노드와 일치하지 않습니다. 관리자에게 문의하여 현재 노드를 업그레이드하세요.',
|
||||
versionCompare:
|
||||
'노드 {0}이(가) 이미 업그레이드 가능한 최신 버전입니다. 마스터 노드 버전을 확인 후 다시 시도하세요!',
|
||||
about: '정보',
|
||||
|
||||
@@ -3080,6 +3080,8 @@ const message = {
|
||||
upgradeNow: 'ອັບເກຣດດຽວນີ້',
|
||||
source: 'ແຫຼ່ງດາວໂຫຼດ',
|
||||
versionNotSame: 'ເວີຊັນຂອງໂນດບໍ່ກົງກັບໂນດຫຼັກ. ກະລຸນາອັບເກຣດໃນ "ຈັດການໂນດ" ກ່ອນລອງໃໝ່.',
|
||||
currentNodeVersionNotSame:
|
||||
'ເວີຊັນຂອງໂນດປັດຈຸບັນບໍ່ກົງກັບໂນດຫຼັກ. ກະລຸນາຕິດຕໍ່ຜູ້ຄຸ້ມຄອງເພື່ອອັບເກຣດໂນດປັດຈຸບັນ.',
|
||||
versionCompare: 'ກວດພົບວ່າໂນດ {0} ເປັນເວີຊັນຫຼ້າສຸດທີ່ອັບເກຣດໄດ້ແລ້ວ. ກະລຸນາກວດສອບເວີຊັນຂອງໂນດຫຼັກແລ້ວລອງໃໝ່!',
|
||||
about: 'ກ່ຽວກັບ',
|
||||
versionItem: 'ເວີຊັນປັດຈຸບັນ',
|
||||
|
||||
@@ -3198,6 +3198,8 @@ const message = {
|
||||
source: 'Sumber muat turun',
|
||||
versionNotSame:
|
||||
'Versi nod tidak sepadan dengan nod utama. Sila naik taraf di Pengurusan Nod sebelum mencuba semula.',
|
||||
currentNodeVersionNotSame:
|
||||
'Versi nod semasa tidak sepadan dengan nod utama. Hubungi pentadbir untuk menaik taraf nod semasa.',
|
||||
versionCompare:
|
||||
'Nod {0} telah berada pada versi terkini yang boleh dinaik taraf. Sila periksa versi nod utama dan cuba lagi!',
|
||||
about: 'Mengenai',
|
||||
|
||||
@@ -3198,6 +3198,8 @@ const message = {
|
||||
source: 'Fonte para download',
|
||||
versionNotSame:
|
||||
'A versão do nó não corresponde à do nó principal. Atualize na Gestão de Nós antes de tentar novamente.',
|
||||
currentNodeVersionNotSame:
|
||||
'A versão do nó atual não corresponde à do nó principal. Entre em contato com o administrador para atualizar o nó atual.',
|
||||
versionCompare:
|
||||
'Detectado que o nó {0} já está na última versão atualizável. Por favor, verifique a versão do nó principal e tente novamente!',
|
||||
about: 'Sobre',
|
||||
|
||||
@@ -3171,6 +3171,8 @@ const message = {
|
||||
source: 'Источник загрузки',
|
||||
versionNotSame:
|
||||
'Версия узла не совпадает с основной. Пожалуйста, обновите в Управлении узлами перед повторной попыткой.',
|
||||
currentNodeVersionNotSame:
|
||||
'Версия текущего узла не совпадает с версией основного узла. Обратитесь к администратору, чтобы обновить текущий узел.',
|
||||
versionCompare:
|
||||
'Обнаружено, что узел {0} уже имеет последнюю обновляемую версию. Пожалуйста, проверьте версию основного узла и повторите попытку!',
|
||||
about: 'О программе',
|
||||
|
||||
@@ -3207,6 +3207,8 @@ const message = {
|
||||
upgradeNow: 'Şimdi yükselt',
|
||||
source: 'İndirme kaynağı',
|
||||
versionNotSame: 'Düğüm sürümü ana düğümle uyuşmuyor. Lütfen Düğüm Yönetiminde yükseltin ve tekrar deneyin.',
|
||||
currentNodeVersionNotSame:
|
||||
'Geçerli düğüm sürümü ana düğümle uyuşmuyor. Geçerli düğümü yükseltmek için yöneticiyle iletişime geçin.',
|
||||
versionCompare:
|
||||
'{0} düğümünün zaten en son yükseltilebilir sürümde olduğu tespit edildi. Lütfen birincil düğüm sürümünü kontrol edin ve tekrar deneyin!',
|
||||
about: 'Hakkında',
|
||||
|
||||
@@ -2860,6 +2860,7 @@ const message = {
|
||||
upgradeNow: '立即更新',
|
||||
source: '下載源',
|
||||
versionNotSame: '節點版本與主節點不一致,請在節點管理中升級後重試。',
|
||||
currentNodeVersionNotSame: '目前節點版本與主節點不一致,請聯絡管理員升級目前節點。',
|
||||
versionCompare: '偵測到節點 {0} 版本已是目前可升級最新版本,請檢查主節點版本後重試',
|
||||
safe: '安全',
|
||||
passkey: '通行金鑰',
|
||||
|
||||
@@ -2894,6 +2894,7 @@ const message = {
|
||||
upgradeNow: '立即更新',
|
||||
source: '下载源',
|
||||
versionNotSame: '节点版本与主节点不一致,暂不支持切换,请在节点管理中升级后重试!',
|
||||
currentNodeVersionNotSame: '当前节点版本与主节点不一致,请联系管理员升级当前节点。',
|
||||
versionCompare: '检测到节点 {0} 版本已是当前可升级最新版本,请检查主节点版本后重试!',
|
||||
|
||||
safe: '安全',
|
||||
|
||||
Reference in New Issue
Block a user