From c9cb8d433b7ed5f4d37cd8d946c2593d4d886ce1 Mon Sep 17 00:00:00 2001 From: Grzegorz Raguza Date: Fri, 3 Sep 2021 17:56:54 +0000 Subject: Change filtering virtual media When Virtual Media image was configured and connected entry did not appear on the UI after opening in the new tab or after page refresh. The cause was filtering predicate. Proxy devices has transferProtocolType eq to 'OEM', legacy the onces that has no transferProtocolType. For mouting from the share the property exists and has value of 'CIFS'. I added object with all protocols (see docs), and change the filtering for legacy devices. New condition is all accept 'OEM'. Signed-off-by: Grzegorz Raguza Change-Id: I7ba123f19f924536f131ec40d15715b7f50fc985 --- src/store/modules/Operations/VirtualMediaStore.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/store/modules') diff --git a/src/store/modules/Operations/VirtualMediaStore.js b/src/store/modules/Operations/VirtualMediaStore.js index 7c183b0e..3ae08a11 100644 --- a/src/store/modules/Operations/VirtualMediaStore.js +++ b/src/store/modules/Operations/VirtualMediaStore.js @@ -1,6 +1,18 @@ import api from '@/store/api'; import i18n from '@/i18n'; +const transferProtocolType = { + CIFS: 'CIFS', + FTP: 'FTP', + SFTP: 'SFTP', + HTTP: 'HTTP', + HTTPS: 'HTTPS', + NFS: 'NFS', + SCP: 'SCP', + TFTP: 'TFTP', + OEM: 'OEM', +}; + const VirtualMediaStore = { namespaced: true, state: { @@ -29,7 +41,7 @@ const VirtualMediaStore = { id: i18n.t('pageVirtualMedia.defaultDeviceName'), websocket: '/vm/0/0', file: null, - transferProtocolType: 'OEM', + transferProtocolType: transferProtocolType.OEM, isActive: false, }; commit('setProxyDevicesData', [device]); @@ -53,7 +65,7 @@ const VirtualMediaStore = { }; }); const proxyDevices = deviceData - .filter((d) => d.transferProtocolType === 'OEM') + .filter((d) => d.transferProtocolType === transferProtocolType.OEM) .map((device) => { return { ...device, @@ -61,7 +73,7 @@ const VirtualMediaStore = { }; }); const legacyDevices = deviceData - .filter((d) => !d.transferProtocolType) + .filter((d) => d.transferProtocolType !== transferProtocolType.OEM) .map((device) => { return { ...device, -- cgit v1.2.3