Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ RemoteSystemsTempFiles
.classpath
.project
.settings
.vscode
.vscode
javaConfig.json
2 changes: 1 addition & 1 deletion .jenkins/ci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node {
continuousIntegrationPipeline(
buildType: "deploy",
sonar: [
enable: true,
enable: false,
projectKey: "eclipse-kura_kura-management-ui",
tokenId: "sonarcloud-token-kura-management-ui",
exclusions: "tests/**/*.java"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.eclipse.kura.web.client.ui.validator.GwtValidators;
import org.eclipse.kura.web.shared.model.GwtPasswordStrenghtRequirements;
import org.gwtbootstrap3.client.ui.Input;
import org.gwtbootstrap3.client.ui.constants.InputType;
import org.gwtbootstrap3.client.ui.form.validator.Validator;

import com.google.gwt.editor.client.Editor;
Expand Down Expand Up @@ -80,4 +81,12 @@ public void setValidators(final Validator<String>... validators) {
public void addValidator(final Validator<String> validator) {
this.validators.add(validator);
}

@Override
public InputType getType() {
if (getElement().getAttribute(TYPE) == null || getElement().getAttribute(TYPE).isEmpty()) {
return null;
}
return InputType.valueOf(getElement().getAttribute(TYPE).toUpperCase());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@
import org.gwtbootstrap3.client.ui.FormLabel;
import org.gwtbootstrap3.client.ui.HelpBlock;
import org.gwtbootstrap3.client.ui.InlineRadio;
import org.gwtbootstrap3.client.ui.Input;
import org.gwtbootstrap3.client.ui.ListBox;
import org.gwtbootstrap3.client.ui.Modal;
import org.gwtbootstrap3.client.ui.ModalBody;
import org.gwtbootstrap3.client.ui.ModalFooter;
import org.gwtbootstrap3.client.ui.PanelHeader;
import org.gwtbootstrap3.client.ui.TextBox;
import org.gwtbootstrap3.client.ui.constants.IconType;
import org.gwtbootstrap3.client.ui.constants.InputType;
import org.gwtbootstrap3.client.ui.constants.ValidationState;
import org.gwtbootstrap3.client.ui.form.error.BasicEditorError;
import org.gwtbootstrap3.client.ui.form.validator.Validator;
Expand Down Expand Up @@ -152,6 +151,8 @@ interface TabWirelessUiUiBinder extends UiBinder<Widget, TabWirelessUi> {
private static final String REGEX_WIFI_SID = "^[^!#;+\\]/\"\\t][^+\\]/\"\\t]{0,31}$";
private static final int MAX_SSID_LENGTH = 32;

private static final String PLACEHOLDER = "Placeholder";

private final GwtSession session;
private final TabIp4Ui tcp4Tab;
private final TabIp6Ui tcp6Tab;
Expand Down Expand Up @@ -190,8 +191,6 @@ interface TabWirelessUiUiBinder extends UiBinder<Widget, TabWirelessUi> {
@UiField
FormLabel labelPassword;
@UiField
FormLabel labelVerify;
@UiField
FormLabel labelPairwise;
@UiField
FormLabel labelGroup;
Expand Down Expand Up @@ -245,8 +244,6 @@ interface TabWirelessUiUiBinder extends UiBinder<Widget, TabWirelessUi> {

@UiField
NewPasswordInput password;
@UiField
Input verify;

@UiField
TextBox rssi;
Expand All @@ -264,7 +261,8 @@ interface TabWirelessUiUiBinder extends UiBinder<Widget, TabWirelessUi> {
Button buttonSsid;

@UiField
FormGroup groupVerify;
Button buttonShowPassword;

@UiField
FormGroup groupRssi;
@UiField
Expand All @@ -281,8 +279,6 @@ interface TabWirelessUiUiBinder extends UiBinder<Widget, TabWirelessUi> {
@UiField
HelpBlock helpPassword;
@UiField
HelpBlock helpVerify;
@UiField
HelpBlock helpShortI;
@UiField
HelpBlock helpLongI;
Expand Down Expand Up @@ -324,8 +320,6 @@ interface TabWirelessUiUiBinder extends UiBinder<Widget, TabWirelessUi> {
@UiField
HelpButton passwordHelp;
@UiField
HelpButton verifyHelp;
@UiField
HelpButton pairwiseHelp;
@UiField
HelpButton groupHelp;
Expand Down Expand Up @@ -407,7 +401,7 @@ private void evalActiveConfig() {
}
}

@UiHandler(value = { "wireless", "ssid", "radio", "security", "password", "verify", "pairwise", "group", "bgscan",
@UiHandler(value = { "wireless", "ssid", "radio", "security", "password", "pairwise", "group", "bgscan",
"longI", "shortI", "radio1", "radio2", "radio3", "radio4", "rssi", "channelList", "countryCode" })
public void onChange(ChangeEvent e) {
setDirty(true);
Expand Down Expand Up @@ -447,8 +441,7 @@ public boolean isValid() {
result &= checkPassword();

result = result && !this.groupWireless.getValidationState().equals(ValidationState.ERROR)
&& !this.groupPassword.getValidationState().equals(ValidationState.ERROR)
&& !this.groupVerify.getValidationState().equals(ValidationState.ERROR);
&& !this.groupPassword.getValidationState().equals(ValidationState.ERROR);

result = result && !this.groupShortI.getValidationState().equals(ValidationState.ERROR)
&& !this.groupLongI.getValidationState().equals(ValidationState.ERROR);
Expand Down Expand Up @@ -589,7 +582,7 @@ private void setValues() {
this.shortI.setValue(String.valueOf(this.activeConfig.getBgscanShortInterval()));
this.longI.setValue(String.valueOf(this.activeConfig.getBgscanLongInterval()));
this.password.setValue(this.activeConfig.getPassword());
this.verify.setValue(this.activeConfig.getPassword());
this.buttonShowPassword.setEnabled(!PLACEHOLDER.equals(TabWirelessUi.this.password.getText()));
this.radio1.setValue(this.activeConfig.pingAccessPoint());
this.radio2.setValue(!this.activeConfig.pingAccessPoint());
this.radio3.setValue(this.activeConfig.ignoreSSID());
Expand Down Expand Up @@ -643,7 +636,9 @@ private void refreshForm() {
if (tcpip4Status.equals(IPV4_STATUS_WAN_MESSAGE) || tcpip6Status.equals(IPV4_STATUS_WAN_MESSAGE)) {
this.wireless.setEnabled(false);
}
this.groupVerify.setVisible(false);
this.password.setType(InputType.PASSWORD);
this.buttonShowPassword.setIcon(IconType.EYE);
this.buttonShowPassword.setEnabled(!PLACEHOLDER.equals(TabWirelessUi.this.password.getText()));

} else if (WIFI_MODE_ACCESS_POINT_MESSAGE.equals(this.wireless.getSelectedItemText())) {
// access point mode
Expand All @@ -655,7 +650,9 @@ private void refreshForm() {
setForm(false);
}

this.groupVerify.setVisible(true);
this.password.setType(InputType.PASSWORD);
this.buttonShowPassword.setIcon(IconType.EYE);
this.buttonShowPassword.setEnabled(!PLACEHOLDER.equals(TabWirelessUi.this.password.getText()));
}

this.radio.setEnabled(true);
Expand All @@ -666,12 +663,12 @@ private void refreshForm() {
if (this.security.getSelectedItemText().equals(WIFI_SECURITY_NONE_MESSAGE)
|| this.security.getSelectedItemText().equals(WIFI_SECURITY_WPA2_WPA3_ENTERPRISE_MESSAGE)) {
this.password.setEnabled(false);
this.verify.setEnabled(false);
this.buttonShowPassword.setEnabled(false);
}

if (this.security.getSelectedItemText().equals(WIFI_SECURITY_WPA2_WPA3_ENTERPRISE_MESSAGE)) {
this.password.setEnabled(false);
this.verify.setEnabled(false);
this.buttonShowPassword.setEnabled(false);
this.wireless8021xTabAnchorItem.setEnabled(true);
} else {
this.wireless8021xTabAnchorItem.setEnabled(false);
Expand All @@ -680,7 +677,7 @@ private void refreshForm() {
if (WIFI_MODE_STATION_MESSAGE.equals(this.wireless.getSelectedItemText())) {
this.ssid.setEnabled(true);
this.buttonSsid.setEnabled(true);
this.verify.setEnabled(false);
this.buttonShowPassword.setEnabled(!PLACEHOLDER.equals(TabWirelessUi.this.password.getText()));
if (!this.security.getSelectedItemText().equals(WIFI_SECURITY_NONE_MESSAGE)) {
if (this.password.getValue() != null && this.password.getValue().length() > 0) {
this.password.setEnabled(true);
Expand Down Expand Up @@ -767,7 +764,7 @@ private void reset() {
}

this.password.setText("");
this.verify.setText("");
this.buttonShowPassword.setEnabled(true);

for (int i = 0; i < this.pairwise.getItemCount(); i++) {
if (this.pairwise.getItemText(i).equals(WIFI_CIPHERS_CCMP_TKIP_MESSAGE)) {
Expand Down Expand Up @@ -811,7 +808,6 @@ private void initHelpButtons() {
this.radioHelp.setHelpText(MSGS.netWifiToolTipRadioMode());
this.securityHelp.setHelpText(MSGS.netWifiToolTipSecurity());
this.passwordHelp.setHelpText(MSGS.netWifiToolTipPassword());
this.verifyHelp.setHelpText(MSGS.netWifiToolTipPassword());
this.pairwiseHelp.setHelpText(MSGS.netWifiToolTipPairwiseCiphers());
this.groupHelp.setHelpText(MSGS.netWifiToolTipGroupCiphers());
this.bgscanHelp.setHelpText(MSGS.netWifiToolTipBgScan());
Expand All @@ -832,7 +828,7 @@ private void initForm() {
this.wireless.addItem(WIFI_MODE_STATION_MESSAGE);
this.wireless.addItem(WIFI_MODE_ACCESS_POINT_MESSAGE);
this.wireless.addMouseOverHandler(event -> {
if (TabWirelessUi.this.wireless.getSelectedItemText().equals(MessageUtils.get(WIFI_MODE_STATION_MESSAGE))) {
if (TabWirelessUi.this.wireless.getSelectedItemText().equals(WIFI_MODE_STATION_MESSAGE)) {
TabWirelessUi.this.helpText.clear();
TabWirelessUi.this.helpText.add(new Span(MSGS.netWifiToolTipWirelessModeStation()));
} else {
Expand Down Expand Up @@ -929,38 +925,38 @@ private void initForm() {
this.password.setAllowBlank(true);
this.password.addMouseOutHandler(event -> resetHelp());

this.password.addKeyUpHandler(event -> {
this.password.validate();

if (TabWirelessUi.this.groupVerify.isVisible()
&& !TabWirelessUi.this.verify.getText().equals(TabWirelessUi.this.password.getText())) {
TabWirelessUi.this.groupVerify.setValidationState(ValidationState.ERROR);
} else {
TabWirelessUi.this.groupVerify.setValidationState(ValidationState.NONE);
}
});
this.password.addKeyUpHandler(event -> this.password.validate());
this.password.addChangeHandler(event -> {
refreshForm();
checkPassword();
});

// Verify Password
this.labelVerify.setText(MSGS.netWifiWirelessVerifyPassword());
this.verify.addMouseOverHandler(event -> {
if (TabWirelessUi.this.verify.isEnabled()) {
TabWirelessUi.this.helpText.clear();
TabWirelessUi.this.helpText.add(new Span(MSGS.netWifiToolTipPassword()));
this.password.setType(InputType.PASSWORD);
this.password.addClickHandler(event -> {
if (TabWirelessUi.this.password.isEnabled()
&& TabWirelessUi.this.password.getText().equals(PLACEHOLDER)) {
TabWirelessUi.this.password.setText("");
this.buttonShowPassword.setEnabled(true);
this.password.validate();
}
});
this.verify.addMouseOutHandler(event -> resetHelp());
this.verify.addChangeHandler(event -> {
refreshForm();
checkPassword();

// Show Password button
this.buttonShowPassword.addClickHandler(event -> {
if (TabWirelessUi.this.buttonShowPassword.isEnabled()) {
if (this.password.getType().equals(InputType.PASSWORD)) {
TabWirelessUi.this.password.setType(InputType.TEXT);
TabWirelessUi.this.buttonShowPassword.setIcon(IconType.EYE_SLASH);
} else {
TabWirelessUi.this.password.setType(InputType.PASSWORD);
TabWirelessUi.this.buttonShowPassword.setIcon(IconType.EYE);
}
}
});

this.verify.addKeyUpHandler(event -> {
refreshForm();
checkPassword();
this.buttonShowPassword.addMouseOverHandler(event -> {
TabWirelessUi.this.helpText.clear();
TabWirelessUi.this.helpText.add(new Span(MSGS.netWifiToolTipShowButtonPassword()));
});

// Pairwise ciphers
Expand Down Expand Up @@ -1636,7 +1632,7 @@ private void setForm(boolean visible) {
this.radio.setEnabled(visible);
this.security.setEnabled(visible);
this.password.setEnabled(visible);
this.verify.setEnabled(visible);
this.buttonShowPassword.setEnabled(visible);
this.pairwise.setEnabled(visible);
this.group.setEnabled(visible);
this.bgscan.setEnabled(visible);
Expand All @@ -1649,7 +1645,6 @@ private void setForm(boolean visible) {
this.radio3.setEnabled(visible);
this.radio4.setEnabled(visible);

this.groupVerify.setVisible(visible);
this.channelList.setEnabled(visible);
this.noChannels.setVisible(false);

Expand All @@ -1667,17 +1662,6 @@ private boolean checkPassword() {
TabWirelessUi.this.helpPassword.setText("");
this.groupPassword.setValidationState(ValidationState.NONE);
}

if (this.verify != null && this.verify.isEnabled() && TabWirelessUi.this.password != null
&& !TabWirelessUi.this.verify.getText().equals(TabWirelessUi.this.password.getText())) {
TabWirelessUi.this.helpVerify.setText(MSGS.netWifiWirelessPasswordDoesNotMatch());
TabWirelessUi.this.groupVerify.setValidationState(ValidationState.ERROR);
result = false;
} else {
TabWirelessUi.this.helpVerify.setText("");
TabWirelessUi.this.groupVerify.setValidationState(ValidationState.NONE);
}

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,8 @@
ui:field="helpPassword" />
<kura:NewPasswordInput type="PASSWORD" b:id="password"
ui:field="password" allowPlaceholder="true"/>
</b:FormGroup>

<b:FormGroup ui:field="groupVerify">
<b:FormLabel for="verify"
ui:field="labelVerify" />
<util:HelpButton ui:field="verifyHelp"/>
<b:HelpBlock color="red"
ui:field="helpVerify" />
<b:Input type="PASSWORD" b:id="verify"
ui:field="verify" />
<b:Button ui:field="buttonShowPassword"
icon="EYE" iconFixedWidth="true" />
</b:FormGroup>

<b:FormGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,8 @@ netWifiToolTipRadioMode=In <i>Access Point</i> mode, select the appropriate spee
netWifiToolTipBand=Select the frequency band to use for this wireless interface.<br><br><ul><li>2.4 GHz band provides the most coverage but transmits data at slower speeds.</li><li>5 GHz band provides less coverage but transmits data at faster speeds.</li></ul>Wireless range decreases with higher frequencies because higher frequencies cannot penetrate solid objects, such as walls and floors. However, higher frequencies allow data to be transmitted faster than lower frequencies.
netWifiToolTipSecurity=Select the appropriate security protocol for your wireless network.<br><br><ul><li>WPA2 is the most secure encryption method available for wireless networks; therefore, we recommend using WPA2 with the CCMP cipher whenever possible.</li><li>WPA2 with CCMP is the only option permitted for high-throughput 802.11n transmissions.</li><li>If you need to support legacy devices on your network, enable WPA encryption with the TKIP cipher for the SSID.</li><li>The WEP protocol is not recommended unless absolutely necessary, as it is widely regarded as insecure.</li></ul>
netWifiToolTipSecurityWPA3=The WPA3-SAE security protocol is experimental. Please check if the device, driver and firmware are compliant with the new standard.
netWifiToolTipPassword=Enter the password for the wireless network.<br><br>* In <i>Access Point</i> mode, both the password and its verification are mandatory. These fields adhere to the system password policy requirements established in Security -> Web Console (this section may not be accessible depending on your permissions). This enforcement applies to all encryption methods, except for WEP, where only compliance with the standard''s password format is checked.<br><br>* In <i>Station</i> mode, please enter the password for the network you wish to connect to.
netWifiToolTipPassword=Enter the password for the wireless network.<br><br>* In <i>Access Point</i> mode, password field adhere to the system password policy requirements established in Security -> Web Console (this section may not be accessible depending on your permissions). This enforcement applies to all encryption methods, except for WEP, where only compliance with the standard''s password format is checked.<br><br>* In <i>Station</i> mode, please enter the password for the network you wish to connect to.
netWifiToolTipShowButtonPassword=Show or hide the entered password. This button is enabled only when the password is manually entered by the user, while it is disabled when the password is loaded from a snapshot.
netWifiToolTipVerifyPassword=In <i>Access Point</i> mode, retype wireless password to verify it. If entries don''t match, the field will be marked invalid with the <i>Passwords do not match</i> error message.
netWifiToolTipChannels=Select the desired channel frequencies over which the device should communicate.
netWifiToolTipPairwiseCiphers=Select the appropriate pairwise cipher (i.e. encryption used for unicast traffic) for this wireless network.<br><br>* CCMP provides Advanced Encryption Standard (AES) data encryption for WPA and WPA2. A radio using WPA/WPA2 with CCMP encrypts traffic for only WPA CCMP clients but not for TKIP clients. The radio disassociates from TKIP clients unless you selected both CCMP and TKIP.<br><br>* TKIP uses the RC4 encryption algorithm. A radio using WPA/WPA2 with TKIP encrypts traffic for only WPA TKIP clients but not for CCMP clients. The radio disassociates from CCMP clients unless you selected both CCMP and TKIP.
Expand Down Expand Up @@ -925,4 +926,4 @@ columnVisibilityErrorLabel=Select at least one column to display
columnVisibilityModalButton={0}/{1} columns
columnVisibilitySelectAllColumnCheckbox=Select all columns
columnVisibilityResetAnchor=Reset visible columns
columnVisibilityModalTitle=Column settings
columnVisibilityModalTitle=Column settings