Skip to content

Commit

Permalink
Remove more variables found by oxlint no-unused-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed Aug 30, 2024
1 parent 18db1d6 commit 221f823
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 28 deletions.
2 changes: 0 additions & 2 deletions src/components/vm/disks/diskAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@ const AddDiskModalFooter = ({
target: diskParams.target,
permanent: diskParams.permanent,
hotplug,
vmName: vm.name,
vmId: vm.id,
cacheMode: diskParams.cacheMode,
busType: diskParams.busType,
Expand All @@ -785,7 +784,6 @@ const AddDiskModalFooter = ({
target: diskParams.target,
permanent: diskParams.permanent,
hotplug,
vmName: vm.name,
vmId: vm.id,
cacheMode: diskParams.cacheMode,
shareable: volume && volume.format === "raw" && isVolumeUsed[diskParams.existingVolumeName].length > 0,
Expand Down
4 changes: 1 addition & 3 deletions src/components/vm/disks/vmDiskColumns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ DiskSourceCell.propTypes = {
idPrefix: PropTypes.string.isRequired,
};

export const DiskExtras = ({ idPrefix, cache, type, io, discard, serial, errorPolicy }) => {
export const DiskExtras = ({ idPrefix, cache, type, io, discard, serial }) => {
const addOptional = (chunks, value, type, descr) => {
if (value) {
chunks.push(
Expand Down Expand Up @@ -112,7 +112,6 @@ DiskExtras.propTypes = {
cache: PropTypes.string,
io: PropTypes.string,
discard: PropTypes.string,
errorPolicy: PropTypes.string,
idPrefix: PropTypes.string.isRequired,
};

Expand All @@ -121,7 +120,6 @@ export const RemoveDiskModal = ({ vm, disk, storagePools, onAddErrorNotification
return domainDetachDisk({
connectionName: vm.connectionName,
id: vm.id,
name: vm.name,
target: disk.target,
live: vm.state === 'running',
persistent: vm.persistent,
Expand Down
3 changes: 1 addition & 2 deletions src/components/vm/disks/vmDisksCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ export const VmDisksCard = ({ vm, vms, disks, renderCapacity, supportedDiskBusTy
type={disk.driver.type}
io={disk.driver.io}
discard={disk.driver.discard}
serial={disk.serial}
errorPolicy={disk.driver.errorPolicy} />
serial={disk.serial} />
});
}

Expand Down
8 changes: 3 additions & 5 deletions src/components/vm/filesystems/vmFilesystemsCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,13 @@ export const VmFilesystemsCard = ({ connectionName, vmName, vmState, filesystems
);
};

export const VmFilesystemActions = ({ connectionName, objPath, vmName, vmState }) => {
export const VmFilesystemActions = ({ connectionName, vmName, vmState }) => {
const Dialogs = useDialogs();
const idPrefix = `${vmId(vmName)}-filesystems`;

function open() {
Dialogs.show(<VmFilesystemAddModal connectionName={connectionName}
vmName={vmName}
objPath={objPath} />);
vmName={vmName} />);
}

const addButton = (
Expand All @@ -115,7 +114,7 @@ export const VmFilesystemActions = ({ connectionName, objPath, vmName, vmState }
return vmState == 'shut off' ? addButton : <Tooltip content={_("Adding shared directories is possible only when the guest is shut off")}>{addButton}</Tooltip>;
};

const VmFilesystemAddModal = ({ connectionName, objPath, vmName }) => {
const VmFilesystemAddModal = ({ connectionName, vmName }) => {
const Dialogs = useDialogs();
const [additionalOptionsExpanded, setAdditionalOptionsExpanded] = useState(false);
const [dialogError, setDialogError] = useState();
Expand Down Expand Up @@ -143,7 +142,6 @@ const VmFilesystemAddModal = ({ connectionName, objPath, vmName }) => {
})
.then(() => domainCreateFilesystem({
connectionName,
objPath,
vmName,
source,
target: mountTag,
Expand Down
4 changes: 2 additions & 2 deletions src/components/vm/hostdevs/hostDevAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function devicesHaveAChild(selectableDevices) {
return Object.values(all).sort(a => a.hasChildren ? 1 : -1);
}

const DevRow = ({ idPrefix, type, selectableDevices, setSelectableDevices }) => {
const DevRow = ({ idPrefix, selectableDevices, setSelectableDevices }) => {
function getSource(nodeDev, id) {
const cells = [];
if (nodeDev.capability.type === "usb_device") {
Expand Down Expand Up @@ -218,7 +218,7 @@ const AddHostDev = ({ idPrefix, vm }) => {
const body = (
<Form isHorizontal>
<TypeRow type={type} setType={setTypeWrapper} />
<DevRow idPrefix={idPrefix} type={type} selectableDevices={selectableDevices} setSelectableDevices={setSelectableDevices} />
<DevRow idPrefix={idPrefix} selectableDevices={selectableDevices} setSelectableDevices={setSelectableDevices} />
</Form>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/vm/overview/bootOrder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function getBootOrder(vm) {
return bootOrder;
}

export const BootOrderLink = ({ vm, idPrefix, nodeDevices }) => {
export const BootOrderLink = ({ vm, idPrefix }) => {
const Dialogs = useDialogs();

function open() {
Expand Down
1 change: 0 additions & 1 deletion src/components/vm/overview/cpuModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ export const CPUModal = ({ vm, maxVcpu, models }) => {
setIsLoading(true);
domainSetCpuMode({
name: vm.name,
id: vm.id,
connectionName: vm.connectionName,
mode: cpuMode,
model: cpuModel
Expand Down
6 changes: 2 additions & 4 deletions src/components/vm/overview/vmOverviewCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class VmOverviewCard extends React.Component {
}

render() {
const { vm, vms, nodeDevices, libvirtVersion } = this.props;
const { vm, vms, libvirtVersion } = this.props;
const idPrefix = vmId(vm.name);

const autostart = (
Expand Down Expand Up @@ -191,8 +191,7 @@ class VmOverviewCard extends React.Component {
<DescriptionListGroup>
<DescriptionListTerm>{_("Boot order")}</DescriptionListTerm>
<DescriptionListDescription id={`${idPrefix}-boot-order`}>
<BootOrderLink vm={vm} idPrefix={idPrefix}
nodeDevices={nodeDevices} />
<BootOrderLink vm={vm} idPrefix={idPrefix} />
</DescriptionListDescription>
</DescriptionListGroup>

Expand Down Expand Up @@ -289,7 +288,6 @@ VmOverviewCard.propTypes = {
vms: PropTypes.array.isRequired,
config: PropTypes.object.isRequired,
libvirtVersion: PropTypes.number.isRequired,
nodeDevices: PropTypes.array.isRequired,
};

export default VmOverviewCard;
4 changes: 1 addition & 3 deletions src/components/vm/vmDetailsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const VmDetailsPage = ({
maxVcpu={vm.capabilities.maxVcpu}
cpuModels={vm.capabilities.cpuModels}
cpuHostModel={vm.capabilities.cpuHostModel}
nodeDevices={nodeDevices} libvirtVersion={libvirtVersion} />,
libvirtVersion={libvirtVersion} />,
},
{
id: `${vmId(vm.name)}-usage`,
Expand Down Expand Up @@ -208,13 +208,11 @@ export const VmDetailsPage = ({
</>
),
actions: <VmFilesystemActions connectionName={vm.connectionName}
objPath={vm.id}
vmName={vm.name}
memory={vm.memory}
vmState={vm.state} />,
body: <VmFilesystemsCard connectionName={vm.connectionName}
filesystems={vm.filesystems}
objPath={vm.id}
vmName={vm.name}
vmState={vm.state} />
}
Expand Down
5 changes: 1 addition & 4 deletions src/libvirtApi/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export function domainAttachDisk({
format,
target,
vmId,
vmName,
permanent,
hotplug,
cacheMode,
Expand Down Expand Up @@ -354,7 +353,7 @@ export async function domainCreate({
}
}

export function domainCreateFilesystem({ connectionName, objPath, vmName, source, target, xattr }) {
export function domainCreateFilesystem({ connectionName, vmName, source, target, xattr }) {
const options = { err: "message" };
if (connectionName === "system")
options.superuser = "try";
Expand Down Expand Up @@ -478,7 +477,6 @@ export function domainDesktopConsole({
}

export async function domainDetachDisk({
name,
connectionName,
id: vmPath,
target,
Expand Down Expand Up @@ -892,7 +890,6 @@ export function domainSendNMI({

export function domainSetCpuMode({
name,
id: objPath,
connectionName,
mode,
model,
Expand Down
1 change: 0 additions & 1 deletion src/libvirtApi/storageVolume.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export async function storageVolumeCreateAndAttach({
format,
target,
vmId,
vmName,
permanent,
hotplug,
cacheMode,
Expand Down

0 comments on commit 221f823

Please sign in to comment.