| <link rel="import" href="chrome://resources/html/polymer.html"> |
| |
| <link rel="import" href="chrome://resources/cr_components/chromeos/network/mojo_interface_provider.html"> |
| <link rel="import" href="chrome://resources/cr_elements/action_link_css.html"> |
| <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_listener_behavior.html"> |
| <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> |
| <link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html"> |
| <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html"> |
| <link rel="import" href="chrome://resources/html/action_link.html"> |
| <link rel="import" href="chrome://resources/html/i18n_behavior.html"> |
| <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> |
| <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> |
| <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html"> |
| <link rel="import" href="network_config_input.html"> |
| <link rel="import" href="network_config_select.html"> |
| <link rel="import" href="network_config_toggle.html"> |
| <link rel="import" href="network_password_input.html"> |
| <link rel="import" href="network_shared_css.html"> |
| |
| <dom-module id="network-config"> |
| <template> |
| <style include="network-shared action-link iron-flex"> |
| #spinner-container { |
| height: 200px; |
| } |
| </style> |
| |
| <template is="dom-if" if="[[!managedProperties_]]" restamp> |
| <div id="spinner-container" class="layout vertical center-center"> |
| <paper-spinner-lite active></paper-spinner-lite> |
| </div> |
| </template> |
| |
| <template is="dom-if" if="[[managedProperties_]]" restamp> |
| <!-- SSID (WiFi) --> |
| <template is="dom-if" if="[[isWiFi_(mojoType_)]]" restamp> |
| <network-config-input id="ssid" label="[[i18n('OncWiFi-SSID')]]" |
| value="{{configProperties_.wifi.ssid}}" |
| readonly="[[hasGuid_(guid)]]" |
| on-enter="onEnterPressedInInput_"> |
| </network-config-input> |
| </template> |
| |
| <!-- Security (WiFi and Ethernet) --> |
| <template is="dom-if" if="[[securityIsVisible_(mojoType_)]]" restamp> |
| <network-config-select id="security" |
| label="[[i18n('OncWiFi-Security')]]" |
| value="{{securityType}}" key="security" |
| disabled="[[!securityIsEnabled_(guid, mojoType_)]]" |
| items="[[getSecurityItems_(mojoType_)]]" |
| onc-prefix="WiFi.Security" |
| property="[[getManagedSecurity_(managedProperties_)]]"> |
| </network-config-select> |
| </template> |
| |
| <!-- Passphrase (WiFi) --> |
| <template is="dom-if" restamp |
| if="[[configRequiresPassphrase_(mojoType_, securityType)]]"> |
| <network-password-input id="wifi-passphrase" |
| label="[[i18n('OncWiFi-Passphrase')]]" |
| value="{{configProperties_.wifi.passphrase}}" |
| on-enter="onEnterPressedInInput_" |
| property="[[managedProperties_.typeProperties.wifi.passphrase]]"> |
| </network-password-input> |
| </template> |
| |
| <!-- VPN --> |
| <template is="dom-if" if="[[showVpn_]]" restamp> |
| <network-config-input label="[[i18n('OncVPN-Host')]]" |
| value="{{configProperties_.vpn.host}}" |
| property="[[managedProperties_.typeProperties.vpn.host]]"> |
| </network-config-input> |
| <network-config-input label="[[i18n('OncName')]]" |
| value="{{configProperties_.name}}" |
| readonly="[[hasGuid_(guid)]]"> |
| </network-config-input> |
| <network-config-select id="outer" label="[[i18n('OncVPN-Type')]]" |
| value="{{vpnType_}}" items="[[vpnTypeItems_]]" |
| onc-prefix="VPN.Type" disabled="[[hasGuid_(guid)]]" |
| property="[[managedProperties_.typeProperties.vpn.type]]"> |
| </network-config-select> |
| <template is="dom-if" if="[[!showVpn_.OpenVPN]]"> |
| <network-config-input label="[[i18n('OncVPN-L2TP-Username')]]" |
| value="{{configProperties_.vpn.l2tp.username}}" |
| property="[[managedProperties_.typeProperties.vpn.l2tp.username]]" |
| > |
| </network-config-input> |
| <network-password-input label="[[i18n('OncVPN-L2TP-Password')]]" |
| value="{{configProperties_.vpn.l2tp.password}}" |
| property="[[managedProperties_.typeProperties.vpn.l2tp.password]]" |
| > |
| </network-password-input> |
| <network-config-input label="[[i18n('OncVPN-IPsec-Group')]]" |
| value="{{configProperties_.vpn.ipSec.group}}" |
| property="[[managedProperties_.typeProperties.vpn.ipSec.group]]"> |
| </network-config-input> |
| <template is="dom-if" if="[[!showVpn_.Cert]]"> |
| <network-password-input label="[[i18n('OncVPN-IPsec-PSK')]]" |
| value="{{configProperties_.vpn.ipSec.psk}}" |
| property="[[managedProperties_.typeProperties.vpn.ipSec.psk]]"> |
| </network-password-input> |
| </template> |
| </template> |
| <template is="dom-if" if="[[showVpn_.OpenVPN]]"> |
| <network-config-input label="[[i18n('OncVPN-OpenVPN-Username')]]" |
| value="{{configProperties_.vpn.openVpn.username}}" |
| property="[[managedProperties_.typeProperties.vpn.openVpn.username]]"> |
| </network-config-input> |
| <network-password-input label="[[i18n('OncVPN-OpenVPN-Password')]]" |
| value="{{configProperties_.vpn.openVpn.password}}" |
| property="[[managedProperties_.typeProperties.vpn.openVpn.password]]"> |
| </network-password-input> |
| <network-config-input label="[[i18n('OncVPN-OpenVPN-OTP')]]" |
| value="{{configProperties_.vpn.openVpn.otp}}" |
| property="[[managedProperties_.typeProperties.vpn.openVpn.otp]]"> |
| </network-config-input> |
| </template> |
| <template is="dom-if" if="[[showVpn_.Cert]]"> |
| <network-config-select id="vpnServerCa" |
| label="[[i18n('OncEAP-ServerCA')]]" |
| value="{{selectedServerCaHash_}}" items="[[serverCaCerts_]]" |
| cert-list |
| property="[[getManagedVpnServerCaRefs_(managedProperties_)]]"> |
| </network-config-select> |
| <network-config-select id="vpnUserCert" |
| label="[[i18n('OncEAP-UserCert')]]" |
| value="{{selectedUserCertHash_}}" items="[[userCerts_]]" |
| cert-list |
| property="[[getManagedVpnClientCertType_(managedProperties_)]]"> |
| </network-config-select> |
| </template> |
| <network-config-toggle label="[[i18n('networkConfigSaveCredentials')]]" |
| checked="{{vpnSaveCredentials_}}" |
| property="[[getManagedVpnSaveCredentials_(managedProperties_)]]"> |
| </network-config-toggle> |
| </template> |
| |
| <!-- EAP (WiFi, Ethernet) --> |
| <template is="dom-if" if="[[showEap_]]" restamp> |
| <network-config-select id="outer" label="[[i18n('OncEAP-Outer')]]" |
| value="{{eapProperties_.outer}}" items="[[eapOuterItems_]]" |
| onc-prefix="EAP.Outer" hidden="[[!showEap_.Outer]]" |
| property="[[managedEapProperties_.outer]]"> |
| </network-config-select> |
| <network-config-select id="inner" label="[[i18n('OncEAP-Inner')]]" |
| value="{{eapProperties_.inner}}" |
| items="[[getEapInnerItems_(eapProperties_.outer)]]" |
| onc-prefix="EAP.Inner" hidden="[[!showEap_.Inner]]" |
| property="[[managedEapProperties_.inner]]"> |
| </network-config-select> |
| <network-config-select id="serverCa" label="[[i18n('OncEAP-ServerCA')]]" |
| value="{{selectedServerCaHash_}}" items="[[serverCaCerts_]]" |
| hidden="[[!showEap_.ServerCA]]" cert-list |
| property="[[managedEapProperties_.useSystemCAs]]" |
| device-certs-only="[[deviceCertsOnly_]]"> |
| </network-config-select> |
| <network-config-input label="[[i18n('OncEAP-SubjectMatch')]]" |
| value="{{eapProperties_.subjectMatch}}" |
| hidden="[[!showEap_.SubjectMatch]]" |
| property="[[managedEapProperties_.subjectMatch]]"> |
| </network-config-input> |
| <network-config-select id="userCert" label="[[i18n('OncEAP-UserCert')]]" |
| value="{{selectedUserCertHash_}}" items="[[userCerts_]]" |
| hidden="[[!showEap_.UserCert]]" cert-list |
| property="[[managedEapProperties_.clientCertType]]" |
| device-certs-only="[[deviceCertsOnly_]]"> |
| </network-config-select> |
| <network-config-input label="[[i18n('OncEAP-Identity')]]" |
| value="{{eapProperties_.identity}}" hidden="[[!showEap_.Identity]]" |
| property="[[managedEapProperties_.identity]]"> |
| </network-config-input> |
| <network-password-input label="[[i18n('OncEAP-Password')]]" |
| value="{{eapProperties_.password}}" hidden="[[!showEap_.Password]]" |
| property="[[managedEapProperties_.password]]"> |
| </network-password-input> |
| <network-config-input label="[[i18n('OncEAP-AnonymousIdentity')]]" |
| value="{{eapProperties_.anonymousIdentity}}" |
| hidden="[[!showEap_.AnonymousIdentity]]" |
| property="[[managedEapProperties_.anonymousIdentity]]"> |
| </network-config-input> |
| <network-config-toggle label="[[i18n('networkConfigSaveCredentials')]]" |
| checked="{{eapProperties_.saveCredentials}}" |
| property="[[managedEapProperties_.saveCredentials]]"> |
| </network-config-toggle> |
| </template> |
| |
| <!-- Share (WiFi) --> |
| <template is="dom-if" if="[[shareIsVisible_(managedProperties_)]]" |
| restamp> |
| <div class="property-box"> |
| <div id="shareLabel" class="start"> |
| [[i18n('networkConfigShare')]] |
| </div> |
| <cr-toggle id="share" checked="{{shareNetwork_}}" |
| disabled="[[!shareIsEnabled_(configProperties_.*, |
| eapProperties_.*, shareAllowEnable)]]" |
| aria-labeledby="shareLabel" on-change="onShareChanged_"> |
| </cr-toggle> |
| </div> |
| </template> |
| |
| <!-- AutoConnect (WiFi) --> |
| <template is="dom-if" if="[[configCanAutoConnect_(mojoType_)]]" restamp> |
| <div class="property-box"> |
| <div id="autoConnectLabel" class="start"> |
| [[i18n('networkAutoConnect')]] |
| </div> |
| <template is="dom-if" |
| if="[[isAutoConnectEnforcedByPolicy_(globalPolicy_)]]" restamp> |
| <cr-policy-indicator indicator-type="devicePolicy"> |
| </cr-policy-indicator> |
| </template> |
| <cr-toggle id="autoConnect" checked="{{autoConnect_}}" |
| disabled="[[autoConnectDisabled_(globalPolicy_)]]" |
| aria-labeledby="autoConnectLabel"> |
| </cr-toggle> |
| </div> |
| </template> |
| |
| <!-- Hidden Network Warning --> |
| <template is="dom-if" if="{{hiddenNetworkWarning_}}" restamp> |
| <div> |
| <iron-icon icon="cr:warning"></iron-icon> |
| [[i18nAdvanced('hiddenNetworkWarning')]] |
| </div> |
| </template> |
| </template> |
| </template> |
| <script src="network_config.js"></script> |
| </dom-module> |