[go: up one dir, main page]

blob: 646117071733159f463ad8e3521540d09e672788 [file] [log] [blame]
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.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/action_link_css.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 settings-shared action-link iron-flex">
#spinner-container {
height: 200px;
}
</style>
<template is="dom-if" if="[[waitingForProperties_]]" restamp>
<div id="spinner-container" class="layout vertical center-center">
<paper-spinner-lite active></paper-spinner-lite>
</div>
</template>
<template is="dom-if" if="[[!waitingForProperties_]]" restamp>
<!-- SSID (WiFi) -->
<template is="dom-if" if="[[isType_(NetworkType_.WI_FI, type)]]" restamp>
<network-config-input id="ssid" label="[[i18n('OncWiFi-SSID')]]"
value="{{configProperties_.WiFi.SSID}}" readonly="[[hasGuid_(guid)]]">
</network-config-input>
</template>
<!-- Security (WiFi and Ethernet) -->
<template is="dom-if" if="[[securityIsVisible_(type)]]" restamp>
<network-config-select id="security" label="[[i18n('OncWiFi-Security')]]"
value="{{security_}}"
disabled="[[!securityIsEnabled_(guid, type)]]"
items="[[getSecurityItems_(type)]]"
onc-prefix="WiFi.Security"
property="[[getManagedSecurity_(managedProperties)]]">
</network-config-select>
</template>
<!-- Passphrase (WiFi) -->
<template is="dom-if" if="[[configRequiresPassphrase_(type, security_)]]"
restamp>
<network-password-input label="[[i18n('OncWiFi-Passphrase')]]"
value="{{configProperties_.WiFi.Passphrase}}"
on-enter="connectIfConfigured_"
property="[[managedProperties.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.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.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.VPN.L2TP.Username]]">
</network-config-input>
<network-password-input label="[[i18n('OncVPN-L2TP-Password')]]"
value="{{configProperties_.VPN.L2TP.Password}}"
property="[[managedProperties.VPN.L2TP.Password]]">
</network-password-input>
<network-config-input label="[[i18n('OncVPN-IPsec-Group')]]"
value="{{configProperties_.VPN.IPsec.Group}}"
property="[[managedProperties.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.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.VPN.OpenVPN.Username]]">
</network-config-input>
<network-password-input label="[[i18n('OncVPN-OpenVPN-Password')]]"
value="{{configProperties_.VPN.OpenVPN.Password}}"
property="[[managedProperties.VPN.OpenVPN.Password]]">
</network-password-input>
<network-config-input label="[[i18n('OncVPN-OpenVPN-OTP')]]"
value="{{configProperties_.VPN.OpenVPN.OTP}}"
property="[[managedProperties.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, WiMAX, 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 and WiMAX) -->
<template is="dom-if"
if="[[shareIsVisible_(guid, type, managedProperties)]]" restamp>
<div class="property-box">
<div id="shareLabel" class="start">[[i18n('networkConfigShare')]]</div>
<cr-toggle id="share" checked="{{shareNetwork_}}"
disabled="[[!shareIsEnabled_(guid, configProperties_.*,
security_, eapProperties_.*, shareAllowEnable)]]"
aria-labeledby="shareLabel" on-change="onShareChanged_">
</cr-toggle>
</div>
</template>
<!-- AutoConnect (WiFi) -->
<template is="dom-if" if="[[configCanAutoConnect_(type)]]" 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="{{autoConnect_}}" restamp>
<div>
<iron-icon icon="cr:warning"></iron-icon>
[[i18nAdvanced('hiddenNetworkWarning')]]
</div>
</template>
</template>
</template>
<script src="network_config.js"></script>
</dom-module>