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 <grzegorzx.raguza@intel.com>
Change-Id: I7ba123f19f924536f131ec40d15715b7f50fc985
diff --git a/src/store/modules/Operations/VirtualMediaStore.js b/src/store/modules/Operations/VirtualMediaStore.js
index 7c183b0..3ae08a1 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 @@
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 proxyDevices = deviceData
- .filter((d) => d.transferProtocolType === 'OEM')
+ .filter((d) => d.transferProtocolType === transferProtocolType.OEM)
.map((device) => {
return {
...device,
@@ -61,7 +73,7 @@
};
});
const legacyDevices = deviceData
- .filter((d) => !d.transferProtocolType)
+ .filter((d) => d.transferProtocolType !== transferProtocolType.OEM)
.map((device) => {
return {
...device,