From 5a87fe7329ff72f9ad6fdbf65cb60bca52041861 Mon Sep 17 00:00:00 2001 From: jo-hnny Date: Mon, 24 Apr 2023 16:09:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(console):=20=E6=96=B0=E5=BB=BAvm=E6=96=B0?= =?UTF-8?q?=E5=A2=9EblockMultiQueue=E5=92=8Ccache=E5=8F=82=E6=95=B0=20(#22?= =?UTF-8?q?68)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(console): 新建vm新增blockMultiQueue和cache参数 * feat(console): change writethrough to writeback --- .../virtual-machine/pages/detail/event/index.tsx | 9 +++++---- web/console/src/webApi/virtual-machine.ts | 4 +++- web/console/webpack/webpack.dev.js | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/web/console/src/modules/cluster/components/resource/virtual-machine/pages/detail/event/index.tsx b/web/console/src/modules/cluster/components/resource/virtual-machine/pages/detail/event/index.tsx index 4a2586bf5d..b734f25b10 100644 --- a/web/console/src/modules/cluster/components/resource/virtual-machine/pages/detail/event/index.tsx +++ b/web/console/src/modules/cluster/components/resource/virtual-machine/pages/detail/event/index.tsx @@ -1,8 +1,8 @@ -import React, { useState } from 'react'; -import { Table, TableColumn, Switch, Alert, Justify, Button, Bubble, Text } from 'tea-component'; import { useFetch } from '@src/modules/common/hooks/useFetch'; import { virtualMachineAPI } from '@src/webApi'; import dayjs from 'dayjs'; +import React, { useState } from 'react'; +import { Alert, Bubble, Button, Justify, Switch, Table, TableColumn, Text } from 'tea-component'; import { v4 as uuidv4 } from 'uuid'; const { autotip } = Table.addons; @@ -14,12 +14,13 @@ export const VMEventPanel = ({ clusterId, namespace, name }) => { async () => { const { items } = await virtualMachineAPI.fetchEventList({ clusterId, namespace, name }); - return { data: items.map(_ => ({ ..._, id: uuidv4() })) }; + return { data: items.map(_ => ({ ..._, id: uuidv4() })).reverse() }; }, [clusterId, namespace, name], { fetchAble: !!(clusterId && namespace && name), - polling + polling, + needClearData: false } ); diff --git a/web/console/src/webApi/virtual-machine.ts b/web/console/src/webApi/virtual-machine.ts index edb19fa71c..2ad527c47c 100644 --- a/web/console/src/webApi/virtual-machine.ts +++ b/web/console/src/webApi/virtual-machine.ts @@ -156,12 +156,14 @@ export function createVM({ }, devices: { + blockMultiQueue: true, disks: diskList.map((item, index) => ({ disk: { bus: 'virtio' }, bootOrder: index + 1, - name: item.name + name: item.name, + cache: 'writeback' })), interfaces: [ diff --git a/web/console/webpack/webpack.dev.js b/web/console/webpack/webpack.dev.js index aa3ecfc007..183bd281ff 100644 --- a/web/console/webpack/webpack.dev.js +++ b/web/console/webpack/webpack.dev.js @@ -42,7 +42,7 @@ module.exports = ({ version }) => }, '/websocket': { - target: `ws://${Host.split('//')[1]}`, + target: Host.replace(/^http/, 'ws'), ws: true, logLevel: 'debug', secure: false,