Skip to content

Commit

Permalink
feat(console): 新建vm新增blockMultiQueue和cache参数 (#2268)
Browse files Browse the repository at this point in the history
* feat(console): 新建vm新增blockMultiQueue和cache参数

* feat(console): change writethrough to writeback
  • Loading branch information
jo-hnny authored Apr 24, 2023
1 parent 064b70f commit 5a87fe7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
}
);

Expand Down
4 changes: 3 additions & 1 deletion web/console/src/webApi/virtual-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion web/console/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = ({ version }) =>
},

'/websocket': {
target: `ws://${Host.split('//')[1]}`,
target: Host.replace(/^http/, 'ws'),
ws: true,
logLevel: 'debug',
secure: false,
Expand Down

0 comments on commit 5a87fe7

Please sign in to comment.