From 02577ef74629af54e0258f6174b6c7ba3374e297 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 14 Apr 2023 17:18:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20OpenResty=20=E5=8D=87=E7=BA=A7=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=BD=AC=E5=88=B0=E5=88=9B=E5=BB=BA=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E5=A4=84=20(#647)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/website/runtime/index.vue | 47 +----------- .../views/website/website/create/index.vue | 76 ++++++++++++++----- 2 files changed, 60 insertions(+), 63 deletions(-) diff --git a/frontend/src/views/website/runtime/index.vue b/frontend/src/views/website/runtime/index.vue index 6fb6a28e8..5f201b30e 100644 --- a/frontend/src/views/website/runtime/index.vue +++ b/frontend/src/views/website/runtime/index.vue @@ -8,7 +8,7 @@ }, ]" /> - + - - - {{ $t('runtime.openrestryWarn') }} - - - {{ $t('runtime.toupgrade') }} - - - @@ -90,8 +81,6 @@ import CreateRuntime from '@/views/website/runtime/create/index.vue'; import Status from '@/components/status/index.vue'; import i18n from '@/lang'; import { useDeleteData } from '@/hooks/use-delete-data'; -import { CheckAppInstalled } from '@/api/modules/app'; -import router from '@/routers'; const paginationConfig = reactive({ currentPage: 1, @@ -122,7 +111,6 @@ const buttons = [ const loading = ref(false); const items = ref([]); const createRef = ref(); -const versionExist = ref(false); const search = async () => { req.page = paginationConfig.currentPage; @@ -151,44 +139,11 @@ const openDelete = async (row: Runtime.Runtime) => { search(); }; -const onCheck = async () => { - try { - const res = await CheckAppInstalled('openresty'); - if (res.data && res.data.version) { - if (compareVersions(res.data.version, '1.21.4')) { - versionExist.value = true; - } - } - } catch (error) {} -}; - -function compareVersions(version1: string, version2: string): boolean { - const v1 = version1.split('.'); - const v2 = version2.split('.'); - const len = Math.max(v1.length, v2.length); - - for (let i = 0; i < len; i++) { - const num1 = parseInt(v1[i] || '0'); - const num2 = parseInt(v2[i] || '0'); - - if (num1 !== num2) { - return num1 > num2 ? true : false; - } - } - - return false; -} - -const goRouter = async () => { - router.push({ name: 'AppUpgrade' }); -}; - onMounted(() => { search(); timer = setInterval(() => { search(); }, 10000 * 3); - onCheck(); }); onUnmounted(() => { diff --git a/frontend/src/views/website/website/create/index.vue b/frontend/src/views/website/website/create/index.vue index 340c12d4c..3c476b9dd 100644 --- a/frontend/src/views/website/website/create/index.vue +++ b/frontend/src/views/website/website/create/index.vue @@ -41,7 +41,7 @@ - + + + + {{ $t('runtime.openrestryWarn') }} + +