diff --git a/jccm/src/Frontend/Components/Login.js b/jccm/src/Frontend/Components/Login.js index 5c97fb2..fbdf1ea 100644 --- a/jccm/src/Frontend/Components/Login.js +++ b/jccm/src/Frontend/Components/Login.js @@ -56,6 +56,7 @@ export const Login = ({ isOpen, onClose }) => { setIsUserLoggedIn, setCurrentActiveThemeName, getConsoleWindowWidth, + settings, } = useStore(); const { showMessageBar } = useMessageBar(); const [cloudList, setCloudList] = useState([]); @@ -95,6 +96,8 @@ export const Login = ({ isOpen, onClose }) => { const [isGoogleSSOLogin, setIsGoogleSSOLogin] = useState(false); + const ignoreCaseInName = settings?.ignoreCaseInName || false; + const togglePasswordVisibility = () => { setPasswordVisible(!passwordVisible); @@ -247,7 +250,7 @@ export const Login = ({ isOpen, onClose }) => { return { status: 'two_factor' }; } else { // console.log('Login successful!'); - // await eventBus.emit('cloud-inventory-refresh'); + // await eventBus.emit('cloud-inventory-refresh', {force: true, ignoreCaseInName}); return { status: 'success', @@ -294,9 +297,10 @@ export const Login = ({ isOpen, onClose }) => { Constants.getActiveThemeName(data?.user?.theme) ); - setTimeout(async () => { - await eventBus.emit('cloud-inventory-refresh'); - }, 1000); + await eventBus.emit('cloud-inventory-refresh', { + force: true, + ignoreCaseInName, + }); onClose(); } else if (response.status === 'two_factor') { diff --git a/jccm/src/Frontend/Layout/Contents.js b/jccm/src/Frontend/Layout/Contents.js deleted file mode 100644 index e69de29..0000000 diff --git a/jccm/src/Frontend/Layout/Devices.js b/jccm/src/Frontend/Layout/Devices.js index fa501f9..385f582 100644 --- a/jccm/src/Frontend/Layout/Devices.js +++ b/jccm/src/Frontend/Layout/Devices.js @@ -11,11 +11,9 @@ export const getDeviceFacts = async (device, upperSerialNumber=false, bastionHos } }; -export const adoptDevices = async (device, jsiTerm=false, deleteOutboundSSHTerm=false, bastionHost = {}) => { +export const adoptDevices = async (device, jsiTerm=false, deleteOutboundSSHTerm=false, bastionHost = {}, ignoreCaseInName = false) => { const { address, port, username, password, organization, site } = device; - const response = await electronAPI.saAdoptDevice({ address, port, username, password, organization, site, jsiTerm, deleteOutboundSSHTerm, bastionHost }); - - // console.log('>>>>adoptDevices -> response: ', response); + const response = await electronAPI.saAdoptDevice({ address, port, username, password, organization, site, jsiTerm, deleteOutboundSSHTerm, bastionHost, ignoreCaseInName }); if (response?.adopt) { return { status: true, result: response.reply }; @@ -26,8 +24,8 @@ export const adoptDevices = async (device, jsiTerm=false, deleteOutboundSSHTerm= }; export const releaseDevices = async (deviceInfo) => { - const { organization, serialNumber} = deviceInfo; - const response = await electronAPI.saReleaseDevice({ organization, serial: serialNumber }); + const { organization, serialNumber, ignoreCaseInName = false} = deviceInfo; + const response = await electronAPI.saReleaseDevice({ organization, serial: serialNumber, ignoreCaseInName }); if (response.release) { return { status: true, result: response.reply }; diff --git a/jccm/src/Frontend/Layout/GlobalSettings/GeneralCard.js b/jccm/src/Frontend/Layout/GlobalSettings/GeneralCard.js index 70145a2..1e4a40e 100644 --- a/jccm/src/Frontend/Layout/GlobalSettings/GeneralCard.js +++ b/jccm/src/Frontend/Layout/GlobalSettings/GeneralCard.js @@ -62,6 +62,15 @@ export const GeneralCard = () => { saveFunction(); }; + const saveIgnoreCase = (newIgnoreCase) => { + const saveFunction = async () => { + const newSettings = { ...settings, ignoreCase: newIgnoreCase }; + setSettings(newSettings); + exportSettings(newSettings); + }; + saveFunction(); + }; + const saveDeleteOutboundSSHTerm = (newDeleteOutboundSSHTerm) => { const saveFunction = async () => { const newSettings = { @@ -93,6 +102,12 @@ export const GeneralCard = () => { saveDeleteOutboundSSHTerm(checked); }; + const onChangeIgnoreCase = async (event) => { + const checked = event.currentTarget.checked; + saveIgnoreCase(checked); + }; + + return (