Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Em.I18n.addTranslations({
- "wan.title" : "Internet Ayarları",
- "internet.status.title" : "Ä°nternet Durumu",
- "internet.profile.title" : "Ä°nternet Profilleri",
- "wan.description" : "HG255s öğesinin bağlantı durumunu görüntüleyebilir ve kullanım senaryolarına göre bağlantı parametreleri üzerinde değişiklik yapabilirsiniz.",
- "wan.basic.title" : "Temel Bilgiler",
- "wan.link.title" : "Bağlantı Bilgisi",
- "wan.ppp.title" : "PPP Bilgisi",
- "wan.ip.title" : "IP Bilgisi",
- "internet.status.title.description" : "<b>{{internet.status.title}}</b>, HG255s öğesinin internete bağlı olduğu modu ve bağlantı durumunu görüntüler.",
- "internet.profile.description" : "<b>{{internet.profile.title}}</b> internet erişim modunu ve ilgili parametreleri görüntüler.<ul> <li>{{wan.profile}}:<ul> <li>{{wan.profile_Cable}}:<p>İnternete ağ kabloları veya telefon hatları üzerinden bağlanan kullanıcılar için bu modu seçin.</p></li> <li>{{wan.profile_UMTS}}:<p>Mobil iletişim servis sağlayıcıları tarafından sağlanan veri kanalları üzerinden internete bağlanan kullanıcılar için bu modu seçin. Veri kartı HG255s öğesinin USB bağlantı noktasına takılmalıdır.</p></li> </ul></li> <li>{{wan.VLANEnable}}:<p>Bir VLAN etkinleştirin. İlgili parametreler servis sağlayıcınız tarafından sağlanır.</p></li> <li>{{backup.Mode}}:<p>Sabit hat ve veri kartı hesapları arasında geçiş yaptığınız modu ayarlayın.</p><ul> <li>{{backup.Mode_Disable}}:<p>HG255s internete mevcut oturum açma hesabından bağlanır.</p></li> <li>{{backup.Mode_Backup_Confirm}}:<p>İnternete sabit hat hesabından erişemediğinizde veri kartı hesabına geçiş yapıp yapmayacağınızı belirleyin. Bir web sayfasına erişemezseniz, sistem bir bildirim görüntüler.</p></li> <li>{{backup.Mode_Backup_Auto}}:<p>HG255s internete sabit hat hesabınız üzerinden bağlanır. Sabit hat hesabınız çalışmazsa, HG255s veri kartı hesabınıza geçiş yapar.</p></li></ul></li> <li>{{wan.PPPTrigger}}:<ul> <li>{{wan.PPPTrigger_AlwaysOn}}:<p>HG255s açıldığında, HG255s internete bir çevirmeli bağlantı üzerinden bağlanır. Aylık veya yıllık bir paket kullanıyorsanız bu modu seçin.</p></li> <li>{{wan.PPPTrigger_Manual}}:<p>HG255s açıldıktan sonra, manuel olarak bir çevirmeli ağ bağlantısı oluşturmak için HG255s web sayfasına oturum açın. İnternet erişimine gerek duymuyorsanız, ağ bağlantısını sonlandırın. Süre temelli bir paket kullanıyorsanız bu modu seçin İnternet erişim ücretlerini düşürmenize yardımcı olabilir.</p></li> <li>{{wan.PPPTrigger_OnDemand}}:<p>HG255s açıldıktan sonra, internet erişimine gerek duyduğunuzu tespit ettiğinde bir çevirmeli bağlantı oluşturur. HG255s otomatik bağlantı kesilmesi bekleme süresi içinde internet erişimi istekleri tespit etmezse, HG255s ağ bağlantısını sonlandırır. Farklı zamanlarda internet erişimine gerek duyuyor ve manuel bir bağlantı oluşturmada sorun yaşıyorsanız bu modu seçin.</p></li></ul></li> <li>{{wan.IPVer}}:<p>Değeri servis sağlayıcınız tarafından istenen şekilde ayarlayın. IPv4 ana akım protokoldür ve IPv6 IPv4\'ün bir uzantısıdır.</p></li> <li>{{wan.IPv6AddrType}}:<ul> <li>{{wan.IPv4AddrType_DHCP}}:<p>Servis sağlayıcınızın sunucusu bilgisayarınıza otomatik olarak bir IP adresi tahsis eder.</p></li> <li>{{wan.IPv4AddrType_Static}}:<p>Sabit IP adresi servis sağlayıcınnız tarafından sağlanır.</p></li> <li>{{wan.IPv6AddrType_SLAAC}}:<p>İnternete ilk defa eriştiğinizde, sistem bir adres türü yapılandırır</p></li></ul></li> <li>{{wan.MacColoneEn}}:<p>HG255s bilgisayarınızın MAC adresini internete bağlanmak için kendi MAC adresi olarak kullanır. Örneğin, internete bağlanmak için tek bir bilgisayar kullanıyorsanız, servis sağlayıcı çevrimiçi hesabınızı bilgisayarın MAC adresiyle ilişkilendirir. Bilgisayarın MAC adresini klonlamak için HG255s öğesini kullanabilirsiniz, böylece HG255s servis sağlayıcınızın kimlik doğrulamasını geçebiir ve birden fazla bağlı bilgisayarların internete erişmesine izin verebilir.</p></li></ul>",
- "wan.advanved.hbody" : "GeliÅŸmiÅŸ internet baÄŸlantı parametreleri belirleyebilirsiniz.<ul> <li>{{wan.ServiceList}}:<p>Ä°nternet baÄŸlantı servisi türü. Genel olarak bir aÄŸa eriÅŸtiÄŸinizde <b>INTERNET</b> seçimini yapın.</p></li> <li>{{wan.PPPAuthMode}}:<p><b>{{wan.ConnectionType}}</b> <b>PPP</b> olduÄŸunda doÄŸrulama modu.</p><ul> <li>{{wan.PPPAuthMode_PAP}}:<p>Basit düz metin kimlikd oÄŸrulama modu. Bu mod en az güvenli olandır. Kullanıcı adları ve ÅŸifrelerin kırılması nispeten kolaydır.</p></li> <li>{{wan.PPPAuthMode_CHAP}}:<p>ÅifrelenmiÅŸ kimlik doÄŸrulama modu. Bu mod en güvenli olandır. Åifreniz iletilmedi.</p></li> <li>{{wan.PPPAuthMode_AUTO}}:<p>HG255s servis saÄŸlayıcınızın gerektirdiÄŸi ÅŸekilde bir kimlik doÄŸrulama modu seçer.</p></li></ul></li></ul>",
- "wan.NewItemName" : "Yeni WAN bağlantısı",
- "wan.LanIntf" : "LAN arayüzü",
- "wan.Alias" : "Ad",
- "wan.Enable" : "Bağlantıyı etkinleştir",
- "wan.SelectOther" : "DiÄŸer",
- "wan.AccessType" : "Erişim türü",
- "wan.AccessType_DSL" : "ATM çıkış yolu",
- "wan.AccessType_VDSL" : "PTM çıkış yolu",
- "wan.AccessType_Ethernet" : "Ethernet çıkış yolu",
- "wan.AccessType_UMTS" : "UMTS",
- "wan.profile" : "Ä°nternet profili",
- "wan.profile_Cable" : "Sabit hat",
- "wan.profile_UMTS" : "Veri kartı",
- "wan.PVC" : "VPI/VCI",
- "wan.LinkType" : "Bağlantı modu",
- "wan.LinkType_EoA" : "EoA",
- "wan.LinkType_PPPoA" : "PPPoA",
- "wan.LinkType_IPoA" : "IPoA",
- "wan.EncapMode" : "Sarma modu",
- "wan.EncapMode_LLC" : "LLC",
- "wan.EncapMode_VCMUX" : "VCMUX",
- "wan.AtmQoS" : "Servis türü",
- "wan.AtmQoS_UBR" : "PCR olmadan UBR",
- "wan.AtmQoS_UBR+" : "PCR ile UBR",
- "wan.AtmQoS_CBR" : "CBR",
- "wan.AtmQoS_VBR-nrt" : "Gerçek zamanlı olmayan VBR",
- "wan.AtmQoS_VBR-rt" : "Gerçek zamanlı VBR",
- "wan.DslPeakRate" : "En yüksek hız (hücre/s)",
- "wan.DslSupportRate" : "Desteklenen hız (hücre/s)",
- "wan.DslSupportRate_err" : "Destek hızı, En yüksek hızdan daha büyük olmamalıdır.",
- "wan.DslMaxBurstRate" : "Maksimum çoğuşma değeri (hücre/s)",
- "wan.VLANEnable" : "VLAN\'ı etkinleştir",
- "wan.VLANId" : "VLAN kimliÄŸi",
- "wan.VLAN1p" : "802.1p",
- "wan.Username" : "İnternet hesabı",
- "wan.Password" : "Ä°nternet ÅŸifresi",
- "wan.APN" : "APN",
- "wan.DialNum" : "Çevirme numarası",
- "wan.ServiceList" : "Servis türü",
- "wan.ServiceList_err" : "IPTV seçeneğini seçerseniz, TR069, INTERNET, veya SES servisleri seçilemez.",
- "wan.ConnectionType" : "Bağlantı tipi",
- "wan.ConnectionType_PPP_Routed" : "IP yönlendirme (PPP)",
- "wan.ConnectionType_IP_Routed" : "IP yönlendirme (IP)",
- "wan.ConnectionType_Bridged" : "Köprülü",
- "wan.ConnectionType_DHCP_Spoofed" : "DHCP kimlik gizlendi",
- "wan.dhcpspoof_server_err" : "DHCP ile kimlik gizlenen WAN\'lar {{arg1}} ile iliÅŸkilendirilemiyor.",
- "wan.connType_ipoe" : "IPoE",
- "wan.connType_pppoe" : "PPP",
- "wan.connType_bridge" : "Köprü modu",
- "wan.connType_wauto" : "Otomatik olarak bağlanın",
- "wan.connType_wautohelp" : "Cihaz internete otomatik olarak eriÅŸmeyi deneyecektir.",
- "wan.connType_disconnected" : "İnternete bağlı değilsiniz. Otomatik olarak bağlanma girişiminde bulunmak için bu seçeneği seçin.",
- "wan.connType_wpppoe" : "Kullanıcı hesabıyla bağlanın",
- "wan.connType_wpppoehelp" : "İnternet servisinize abone olduğunuzda, sağlayıcınızdan bir bağlantı hesabı ve şifresi aldınız. Bu çoğu ev ağları için geçerlidir.",
- "wan.connType_wipoe" : "Kullanıcı hesabı olmadan bağlanın",
- "wan.connType_wipoehelp" : "İnternet servisinize abone olduğunuzda, sağlayıcınızdan bir bağlantı hesabı ve şifresi almadınız. Bu okul ve şirket ağları için geçerlidir.",
- "wan.connType_wbridge" : "Başka bir modemle bağlanın",
- "wan.connType_wbridgehelp" : "Köprü modu en iyi halihazırda bir modem bulunan evlerde veya internete bağlanmak için bir bilgisayar çevirmeli bağlantı kullananlarda kullanılır.",
- "wan.connType_wipstatic" : "IP adresini girin",
- "wan.connType_wipstatichelp" : "İnternet servis sağlayıcınız internet erişimi için size bir IP adresi sağlamıştır. Bu bazı ev ağları için kullanılır.",
- "wan.account_err" : "Yanlış internet hesabı tespit edildi.",
- "wan.account_none_err" : "İnternet hesabı boş bırakılamaz. Hesabınızı girin ve tekrar deneyin.",
- "wan.wpin_err" : "Girdiniz yanlıştır. Kalan girişimler: {{arg1}}",
- "wan.pvcscanbtn" : "Tara",
- "wan.pvcconfigbtn" : "Tarama Listesini düzenle",
- "wan.MTU" : "MTU",
- "wan.MRU" : "MRU",
- "wan.MSS" : "MSS",
- "wan.IPv4Enable" : "IPv4\'ü destekle",
- "wan.IPv6Enable" : "IPv6\'yı destekle",
- "wan.NATType" : "NAT türü",
- "wan.NATType_1" : "NAPT",
- "wan.NATType_2" : "Tam konik NAT",
- "wan.NATType_0" : "Devre Dışı",
- "wan.PPPAuthMode" : "PPP kimlik doÄŸrulama modu",
- "wan.PPPAuthMode_AUTO" : "Otomatik",
- "wan.PPPAuthMode_PAP" : "PAP",
- "wan.PPPAuthMode_CHAP" : "CHAP",
- "wan.PPPTrigger" : "PPP tetikleyici modu",
- "wan.PPPTrigger_AlwaysOn" : "Her zaman çevrimiçi",
- "wan.PPPTrigger_Manual" : "Manuel olarak çevir",
- "wan.PPPTrigger_OnDemand" : "İstek üzerine çevir",
- "wan.PPPTrigger_OnDemand2" : "Otomatik bağlantıyı kesme ",
- "wan.PPPIdletime" : "Boş süre",
- "wan.PPPIdletime_60" : "1 dakika",
- "wan.PPPIdletime_120" : "2 dakika",
- "wan.PPPIdletime_180" : "3 dakika",
- "wan.PPPIdletime_300" : "5 dakika",
- "wan.PPPIdletime_600" : "10 dakika",
- "wan.PPPIdletimeOther" : "Boş süreyi manuel olarak ayarla (saniye)",
- "wan.PPPIdletime_tail" : "",
- "wan.PPPoEServiceName" : "PPP servis adı",
- "wan.IPVer" : "IP protokolü sürümü",
- "wan.IPVer_IPv4" : "IPv4",
- "wan.IPVer_IPv6" : "IPv6",
- "wan.IPVer_Both" : "IPv4 + IPv6",
- "wan.IPv4AddrType" : "IPv4 adres türü",
- "wan.IPv4AddrType_DHCP" : "DHCP",
- "wan.IPv4AddrType_Static" : "Statik",
- "wan.IPv4Status" : "IPv4 durumu",
- "wan.IPv4Addr" : "IPv4 adresi",
- "wan.IPv4Mask" : "IPv4 aÄŸ maskesi",
- "wan.IPv4Gateway" : "IPv4 varsayılan ağ geçidi",
- "wan.IPv4PriDns" : "IPv4 birincil DNS sunucusu",
- "wan.IPv4SecDns" : "IPv4 ikincil DNS sunucusu",
- "wan.IPv6AddrType" : "IPv6 adres türü",
- "wan.IPv6AddrType_SLAAC" : "SLAAC",
- "wan.IPv6AddrType_DHCP" : "DHCP",
- "wan.IPv6AddrType_Static" : "Statik",
- "wan.IPv6Status" : "IPv6 durumu",
- "wan.IPv6Addr" : "IPv6 adresi",
- "wan.IPv6Gateway" : "IPv6 varsayılan ağ geçidi",
- "wan.IPv6PriDns" : "IPv6 birincil DNS sunucusu",
- "wan.IPv6SecDns" : "IPv6 ikincil DNS sunucusu",
- "wan.PrefixList" : "IPv6 adresi ön ek listesi",
- "wan.Status" : "Bağlantı Durumu",
- "wan.Connected" : "Bağlandı",
- "wan.Disconnected" : "Bağlı değil",
- "wan.AccessTitle_DSL" : "DSL bağlantısı",
- "wan.AccessTitle_VDSL" : "VDSL bağlantısı",
- "wan.AccessTitle_Ethernet" : "Ethernet bağlantısı",
- "wan.AccessTitle_UMTS" : "UMTS kablosuz bağlantı",
- "wan.too_many_err" : "Bağlantı oluşturma başarısız.",
- "wan.ipoa_err" : "IPoA yalnızca bir IP bağlantısını destekleyebilir.",
- "wan.pppoa_err" : "PPPoA yalnızca bir PPP bağlantısını destekleyebilir.",
- "wan.link_cap_err" : "Bu bağlantı için yalnızca {{arg1}} bağlantıya izin verilmektedir.",
- "wan.ip_conn_err" : "IP ve IP olmayan bağlantılar karıştırılamaz.",
- "wan.bridge_num_err" : "Bu bağlantı için yalnızca bir köprüye izin verilmektedir.",
- "wan.bridge_server_err" : "Köprü modu WAN\'lar {{arg1}} ile ilişkilendirilemiyor.",
- "wan.vlan_err" : "Yalnızca {{arg1}} VLAN\'a izin verilmektedir.",
- "wan.pvc_err" : "Yalnızca {{arg1}} PVC\'ye izin verilmektedir.",
- "wan.pvcnum_err" : "Geçersiz PVC.",
- "wan.MSS_err" : "TCP MSS için değer aralığı [{{arg1}}]. 0 varsayılan değeri ifade eder.",
- "wan.MSS_MTU_err" : "(MTU-MSS) in değerleri 40 tan az olmamalı.",
- "wan.MSS_MRU_err" : "(MRU-MSS) in değerleri 40 tan az olmamalı.",
- "wan.Username_err" : "Yanlış kullanıcı adı.",
- "wan.Password_err" : "Girilen parola geçersiz karakterler içeriyor. Geçerli karakterler rakamları, harfleri ve şu sembolleri içerir: ~ ! @ # $ % ^ & * ( ) - _ + = { } [ ] ?",
- "wan.Password_notinit_err" : "Lütfen parolayı girin.",
- "wan.tunnel_cap_err" : "IP Tüneli etkinleştirildiğinden yalnızca {{arg1}} WAN oluşturulabilir.",
- "wan.ondemand_err" : "Yalnızca INTERNET WAN bağlantıları isteğe bağlı modunu destekleyebilir.",
- "wan.too_many_link_err" : "",
- "wan.MacColoneEn" : "MAC adresini klonla",
- "wan.MacColone" : "MAC adresi kaynağı",
- "wan.CloneMacaddr" : "MAC adresi",
- "wan.CloneMacaddr_err" : "MAC adresi geçerli değil.",
- "wan.WANDHCPOption60" : "",
- "wan.WANDHCPOption60_err" : "",
- "wan.BindDhcpsMacAddr" : "",
- "wan.BindDhcpsMacAddr_err" : "",
- "wan.PeakRate_err" : "En yüksek hızın aralığı [{{arg1}}].",
- "wan.SupportRate_err" : "Destek hızı aralığı: [{{arg1}}]",
- "wan.MaxBurstRate_err" : "Maksimum çoğuşma değerinin aralığı [{{arg1}}].",
- "wan.confirmdelete" : "Bu WAN bağlantısını silmek istediğinizden emin misiniz?",
- "wan.confirmsubmit" : "Değişiklik bu WAN üzerindeki uygulamaları etkileyebilir. Devam edilsin mi?",
- "wan.4in6_ipv4_err" : "",
- "wan.6in4_ipv6_err" : "IPv6 WAN bağlantısına bir 6IN4 tüneli zaten mevcut olduğunda izin verilmez.",
- "wan.wizard.operation" : "",
- "wan.wizard.title" : "Ä°nternete BaÄŸlan",
- "wan.IPv4Addr_err" : "IPv4 adresi geçerli değil.",
- "wan.IPv4Mask_err" : "IPv4 ağ maskesi geçerli değil.",
- "wan.IPv4Gateway_err" : "IPv4 varsayılan ağ geçidi geçerli değil.",
- "wan.IPv4PriDns_err" : "IPv4 birincil DNS sunucusu geçerli değil.",
- "wan.IPv4SecDns_err" : "IPv4 ikincil DNS sunucusu geçerli değil.",
- "wan.IPv6Addr_err" : "IPv6 adresi geçerli değil.",
- "wan.IPv6Gateway_err" : "IPv6 varsayılan ağ geçidi geçerli değil.",
- "wan.IPv6PriDns_err" : "IPv6 birincil DNS sunucusu geçerli değil.",
- "wan.IPv6SecDns_err" : "IPv6 ikincil DNS sunucusu geçerli değil.",
- "wan.tunnel_err" : "VPN tüneli etkin olduğunda IP tüneli çalışamaz.",
- "wan.advanved" : "GeliÅŸmiÅŸ",
- "wan.DNSOverrideAllowed" : "Statik DNS",
- "wan.ACName" : "PPPoE AC-Adı",
- "wan.PPPReset" : "PPPoE\'yi yeniden baÅŸlat",
- "wan.DialNum_err" : "",
- "wan.Username_datacard_err" : "",
- "wan.Password_datacard_err" : "",
- "mwan.title" : "İnternet olmayan WAN Bağlantıları",
- "mwan.description" : "Burada listelenen WAN bağlantıları internet erişimi için değildir. Başlıca olarak IPTV, VoIP ve daha fazlası için kullanılmaktadırlar. Genel olarak, bunların hiçbiri üzerinde değişiklik yapmanız gerekmeyecektir.",
- "eth.title" : "Ethernet Bilgisi",
- "eth.Status" : "Durum",
- "eth.Status_Up" : "Bağlandı",
- "eth.Status_Down" : "Bağlantı kesildi",
- "eth.MaxBitRate" : "Hız (Mbps)",
- "eth.DuplexMode" : "Mod",
- "eth.DuplexMode_Half" : "Yarı çift yönlü",
- "eth.DuplexMode_Full" : "Tam çift yönlü",
- "umts.title" : "Mobil GeniÅŸ Bant Bilgisi",
- "umts.nodatacard" : "Mobil geniÅŸ bant mevcut deÄŸildir.",
- "umts.Mode" : "Sistem modu",
- "umts.Order" : "AÄŸ eriÅŸim dizisi",
- "umts.Band" : "Frekans bandı",
- "umts.Band_DCSSystem" : "GSM DCS sistemleri",
- "umts.Band_ExtGSM900" : "GeniÅŸletilmiÅŸ GSM 900",
- "umts.Band_PriGSM900" : "Birincil GSM 900",
- "umts.Domain" : "Etki alanı",
- "umts.UpstreamMaxRate" : "Maksimum yukarı akım hızı",
- "umts.DownstreamMaxRate" : "Maksimum aşağı akım hızı",
- "umts.SignalQuality" : "Sinyal gücü",
- "umts.ServiceStatus" : "Servis durumu",
- "umts.ServiceDomain" : "Servis etki alanı",
- "umts.RoamStatus" : "Dolaşım durum bilgisi",
- "umts.SystemMode" : "Sistem modu",
- "umts.SIMStatus" : "SIM kart durum bilgisi",
- "umts.SysSubMode" : "Sistem alt modu",
- "umts.UpLoadData" : "Yükleme Verisi",
- "umts.DownLoadData" : "Ä°ndirme Verisi",
- "umts.CurrentUpstreamRate" : "Geçerli yukarı akım hızı",
- "umts.CurrentDownstreamRate" : "Geçerli aşağı akım hızı",
- "umts.NoChange" : "DeÄŸiÅŸiklik yok",
- "umts.Order_GSM" : "GSM\'ye Öncelik Ver",
- "umts.Order_WCDMA" : "WCDMA\'ya öncelik ver",
- "umts.Order_LTE" : "LTE\'ye öncelik tanı",
- "umts.Domain_Any" : "Herhangi bir",
- "umts.Domain_CSOnly" : "Yalnızca CS\'yi destekle",
- "umts.Domain_PSOnly" : "Yalnızca PS\'yi destekle",
- "umts.Domain_CS_PS" : "CS ve PS destekle",
- "umts.srvStatus_NoService" : "Servis yok",
- "umts.srvStatus_LimitedService" : "Sınırlı servis",
- "umts.srvStatus_AvailableService" : "Kullanılabilir servis",
- "umts.srvStatus_LimitedRegionalService" : "Sınırlı bölgesel servis",
- "umts.srvStatus_SleepService" : "Uyku durumu",
- "umts.srvDom_CS_Capable" : "Yalnızca CS",
- "umts.srvDom_PS_Capable" : "Yalnızca PS",
- "umts.srvDom_CS_PS_Capable" : "CS ve PS",
- "umts.srvDom_Searching" : "Aranıyor...",
- "umts.Roam_Normal" : "Normal",
- "umts.Roam" : "Dolaşım",
- "umts.sim_Valid" : "Geçerli",
- "umts.sim_Invalid" : "Geçersiz",
- "umts.sim_CS_Invalid" : "CS\'de geçersiz",
- "umts.sim_PS_Invalid" : "PS\'de geçersiz",
- "umts.sim_PS_CS_Invalid" : "CS ve PS\'de geçersiz",
- "umts.sim_NoCard" : "Kart yok",
- "umts.apn_Char_Err" : "",
- "umts.internet_wizard_login_title" : "Åebeke eriÅŸimi ile ilgili problem olabilir. AÅŸağıda bu problem ile ilgili bilgiler yer almaktadır:",
- "umts.internet_wizard_login_title1" : "1.ETH kablosu bağlı değil. Kabloyu kontrol edin.",
- "umts.internet_wizard_login_title2" : "2.USB aktif. 3G bağlantısını yönetmek için \" 3G \" butonuna tıklayınız.",
- "umts.internet_wizard_login_title3" : "Åebekeye EriÅŸilemiyor.",
- "umts.RedirectLogin" : "GiriÅŸ yap",
- "umts.RedirectWizard" : "3G",
- "umts.RegistedNetwork" : "Registed Network",
- "wan.NetType" : "Network",
- "wan.NetType_Auto" : "Auto",
- "wan.NetType_3G_preferred" : "3G preferred",
- "wan.NetType_3G_only" : "3G only",
- "wan.NetType_2G_preferred" : "2G preferred",
- "wan.NetType_2G_only" : "2G only",
- "wan.Username_notinit_err" : "Kullanıcı adı girin.",
- "atp" : "atp"
- });
- Em.I18n.addTranslations({
- "pin.title":"PIN yönetimi",
- "pin.pin_help":"PIN ...",
- "pin.Status":"PIN durumu",
- "pin.NoDatacard":"Lütfen bir SIM kart takın.",
- "pin.initing":"Veri kartı başlatılıyor... Lütfen bekleyin.",
- "pin.Disabled":"SIM kartınızın PIN yönetimi işlevi devre dışı bırakılmıştır. Etkinleştirmek için PIN'inizi girin.",
- "pin.Ready":"PIN doğrulandı.",
- "pin.pinRequired":"PIN doğrulanmalıdır.",
- "pin.pukRequired":"PIN'iniz kilitlenmiştir. SIM kartınız için yeni bir PIN kodu ayarlamak için PUK'u girin.",
- "pin.block":"Yanlış PUK. SIM kart daimi olarak kilitlendi.",
- "pin.error":"SIM kartı bulunamıyor. Kartı doğru bir biçimde taktığınızdan emin olun.",
- "pin.description":"Bu sayfada PIN durumunu kontrol edebilir ve PIN'ı yönetebilirsiniz.",
- "pin.op.enable":"PIN'i etkinleÅŸtir",
- "pin.op.save":"PIN'i bu aygıta kaydet",
- "pin.op.disable":"PIN'i devre dışı bırak",
- "pin.op.modify":"PIN üzerinde değişiklik yap",
- "pin.op.delete":"Bu aygıtta saklanan PIN'i sil",
- "pin.PINCode":"PIN",
- "pin.PUKCode":"PUK",
- "pin.NewPIN":"Yeni PIN",
- "pin.PINConfirm":"PIN'i onayla",
- "pin.RemainTimes":"Kalan yeniden deneme sayısı",
- "pin.pin_err":"Hatalı PIN.",
- "pin.pinopter_err":"PIN işlemi başarısız.",
- "pin.puk_err":"Yanlış PUK.",
- "pin.pwd_err":"Åifreler eÅŸleÅŸmelidir.",
- "backup.PinOper":"Veri kartını kullanmak için PIN'i girin.",
- "backup.Help":"Sabit bir kablodan internete erişemezsiniz. Veri kartını kullanın.",
- "backup.Mode":"Veri kartı internet modu",
- "backup.Mode_Disable":"Yedekleme Yok",
- "backup.Mode_Backup_Confirm":"Manüel yedekleme",
- "backup.Mode_Backup_Auto":"Otomatik yedekleme",
- "backup.Idletime":"Gecikme zamanını değiştirin",
- "backup.IdletimeNum_err":"Bu değer 15'in katı olmalıdır.",
- "HybridRouteBalance.Bonding":"Hibrid baÄŸlanma"
- });
- var MACRO_NO_SIM_CARD = 255;
- var MACRO_PIN_DISABLE = 258;
- var MACRO_PIN_VALIDATE = 259;
- var MACRO_PIN_REQ = 260;
- var MACRO_PUK_REQ = 261;
- var SIM_CARD_BLOCK = 263;
- var SIM_CARD_ERROR = 264;
- var DATACARD_INIT_START = 289;
- function pageload(controller){
- if (controller) {
- controller.load();
- return;
- }
- }
- function callback_verify_pin(value) {
- var curState = Atp.PinController.content.get("SimState");
- Em.Logger.log(curState);
- if ((!((MACRO_PIN_VALIDATE == curState) &&
- (1 == Atp.PinController.get("action")))) &&
- (MACRO_PUK_REQ != curState)) {
- return null;
- }
- Em.Logger.log("Check now ...");
- var errStruct;
- errStruct = AtpValidator.validate_field(Atp.PinController.get("newpin"), "required", "pin.NewPIN");
- if (errStruct) {
- return errStruct;
- }
- errStruct = null;
- errStruct = AtpValidator.validate_field(Atp.PinController.get("newpinconfirm"), "required", "pin.PINConfirm");
- if (errStruct) {
- return errStruct;
- }
- if (Atp.PinController.get("newpin") == value) {
- return null;
- }
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "pin.PINConfirm";
- errStruct.errId = "pin.pwd_err";
- errStruct['delete'] = false;
- return errStruct;
- }
- Atp.PinModel = Em.Object.extend({
- infoStr: function() {
- var status = this.get("SimState");
- switch (status) {
- case MACRO_NO_SIM_CARD:
- return Em.I18n.t("pin.NoDatacard");
- case SIM_CARD_BLOCK:
- return Em.I18n.t("pin.block");
- case SIM_CARD_ERROR:
- return Em.I18n.t("pin.error");
- case DATACARD_INIT_START:
- return Em.I18n.t("pin.initing");
- case MACRO_PIN_DISABLE:
- return Em.I18n.t("pin.Disabled");
- case MACRO_PIN_VALIDATE:
- return Em.I18n.t("pin.Ready");
- case MACRO_PIN_REQ:
- return Em.I18n.t("pin.pinRequired");
- case MACRO_PUK_REQ:
- return Em.I18n.t("pin.pukRequired");
- default:
- return "";
- }
- }.property("SimState"),
- pinContentIsReady:function(){
- if( typeof this.get("SimState") != "undefined"){
- return true;
- }
- return false;
- }.property("SimState"),
- datacardConnected: function() {
- if (MACRO_NO_SIM_CARD == this.get("SimState")) {
- return false;
- }
- return true;
- }.property("SimState"),
- datacardReady: function () {
- if ((MACRO_PIN_VALIDATE == this.get("SimState")) ||
- (MACRO_PIN_DISABLE == this.get("SimState"))) {
- return true;
- }
- return false;
- }.property("SimState"),
- pukRequired: function () {
- if (MACRO_PUK_REQ == this.get("SimState")) {
- return true;
- }
- return false;
- }.property("SimState"),
- showenablePin: function () {
- if (MACRO_PIN_DISABLE == this.get("SimState"))
- {
- return true;
- }
- return false;
- }.property("SimState"),
- curIsSavePin: function () {
- if (0 == this.get("PinSaveState"))
- {
- return false;
- }
- return true;
- }.property("PinSaveState"),
- showPin: function () {
- if ((MACRO_PIN_VALIDATE == this.get("SimState")) ||
- (MACRO_PIN_DISABLE == this.get("SimState")) ||
- (MACRO_PIN_REQ == this.get("SimState"))) {
- return true;
- }
- return false;
- }.property("SimState"),
- showSubmit: function () {
- if (this.get("showPin") || (MACRO_PUK_REQ == this.get("SimState"))) {
- return true;
- }
- return false;
- }.property("SimState")
- });
- Atp.PinController = Atp.SingleObjController.create({
- objName: 'ntwk/pin',
- contentType:"application/json;charset=UTF-8;enc",
- modelClass: Atp.PinModel,
- action: 0,
- pin: "",
- puk: "",
- newpin: "",
- newpinconfirm: "",
- checkProc: function () {
- var errStruct = null;
- utilRemoveErrors(this);
- if (MACRO_PUK_REQ == this.content.get("SimState")) {
- errStruct = AtpValidator.validate_field(this.get("puk"), "required", "pin.PUKCode");
- }
- if (errStruct) {
- errStruct['delete'] = true;
- utilErrStructPush(this, errStruct);
- }
- errStruct = null;
- if (this.content.get("showPin")) {
- errStruct = AtpValidator.validate_field(this.get("pin"), "required", "pin.PINCode");
- }
- if (errStruct) {
- errStruct['delete'] = true;
- utilErrStructPush(this, errStruct);
- }
- errStruct = callback_verify_pin(this.get("newpinconfirm"));
- if (errStruct) {
- errStruct['delete'] = true;
- utilErrStructPush(this, errStruct);
- }
- utilErrInfoUpdate(this);
- },
- getActionName: function() {
- var curState = this.content.get("SimState");
- if (MACRO_PUK_REQ == curState) {
- return "puk";
- } else if (MACRO_PIN_REQ == curState) {
- return "validate";
- } else if (MACRO_PIN_DISABLE == curState) {
- return "enable";
- }
- else if (MACRO_PIN_VALIDATE != curState) {
- return "";
- }
- if (0 == this.get("action")) {
- return "disable";
- } else if (1 == this.get("action")) {
- return "modify";
- } else if (2 == this.get("action")) {
- if( 0 == this.content.get("PinSaveState")){
- return "save";
- }else{
- return "delete";
- }
- }
- return "delete";
- },
- createSubmitData: function() {
- var data = {};
- data["action"] = this.getActionName();
- data["PINCode"] = this.get("pin");
- data["PUKCode"] = this.get("puk");
- data["newPIN"] = this.get("newpin");
- return utilGetJson(Em.Object.create(data));
- },
- finishProc: function(result) {
- Em.Logger.log("Finish proc now ...");
- if (0 != result.errcode) {
- pageload(this);
- } else {
- this.set("pin", "");
- this.set("puk", "");
- this.set("newpin", "");
- this.set("newpinconfirm", "");
- }
- },
- showChangeContent: function() {
- if (MACRO_PIN_VALIDATE == this.content.get("SimState")) {
- if (1 == this.get("action")) {
- return true;
- }
- return false;
- }
- if (MACRO_PUK_REQ == this.content.get("SimState")) {
- return true;
- }
- return false;
- }.property("content.SimState", "action")
- });
- Atp.PinOperationRadioButton = Atp.RadioButton.extend ({
- group: 'pin_operation'
- });
- Atp.PinView = Em.View.extend({
- controller: Atp.PinController,
- contentBinding: "Atp.PinController.content",
- template: Em.Handlebars.compile(
- '{{view Atp.SuccessView}}\
- <div class="form-horizontal width_100p"> \
- {{ view Atp.LabelView textType="label" labelID="pin.Status" valueBinding="view.content.infoStr" }} \
- {{#if view.content.datacardReady}} \
- <div class="control-group">\
- <label class="control-label"> </label> \
- <div class="controls">\
- {{#if view.content.showenablePin}}\
- {{ view Atp.PinOperationRadioButton titleID="pin.op.enable" option="0" valueBinding="Atp.PinController.action"}} \
- {{else}}\
- {{ view Atp.PinOperationRadioButton titleID="pin.op.disable" option="0" valueBinding="Atp.PinController.action"}} \
- {{ view Atp.PinOperationRadioButton titleID="pin.op.modify" option="1" valueBinding="Atp.PinController.action"}} \
- {{#if view.content.curIsSavePin}}\
- {{ view Atp.PinOperationRadioButton titleID="pin.op.delete" option="2" valueBinding="Atp.PinController.action"}} \
- {{else}}\
- {{ view Atp.PinOperationRadioButton titleID="pin.op.save" option="2" valueBinding="Atp.PinController.action"}} \
- {{/if}}\
- {{/if}}\
- </div>\
- </div> \
- {{/if}} \
- {{#if view.content.pukRequired}} \
- {{ view Atp.LabelView labelID="pin.PUKCode" rule="is_natural|exact_length[8]" valueBinding="view.controller.puk" }} \
- {{/if}} \
- {{#if view.content.showPin}} \
- {{ view Atp.LabelView labelID="pin.PINCode" rule="is_natural|lenrange[4~8]" valueBinding="view.controller.pin" }} \
- {{/if}} \
- {{#if view.controller.showChangeContent}} \
- {{ view Atp.LabelView labelID="pin.NewPIN" rule="is_natural|lenrange[4~8]" valueBinding="view.controller.newpin" }} \
- {{ view Atp.LabelView labelID="pin.PINConfirm" rule="is_natural|lenrange[4~8]|callback_pwdMatch" valueBinding="view.controller.newpinconfirm" }} \
- {{/if}} \
- {{#if view.content.showSubmit}} \
- {{ view Atp.LabelView textType="label" labelID="pin.RemainTimes" valueBinding="view.content.RemainTime" }} \
- {{ view Atp.MySubmitButton}}\
- {{/if}} \
- </div>')
- });
- Atp.WanBackup = Em.Object.extend({
- showIdleTime: function() {
- if ("Disable" == this.get("Mode")) {
- return false;
- }
- return true;
- }.property("Mode")
- });
- Atp.WanbackupController = Atp.SingleObjController.create({
- modelClass: Atp.WanBackup,
- objName: 'ntwk/wanbackup',
- checkProc: function() {
- utilRemoveErrors(Atp.WanbackupController);
- if (!((Atp.WanbackupController.content.get("Idletime"))%15)) {
- return;
- }
- var errStruct = utilCreateDftErrStruct();
- errStruct['delete'] = true;
- errStruct.resId = "backup.Idletime";
- errStruct.errId = "backup.IdletimeNum_err";
- utilErrStructPush(Atp.WanbackupController, errStruct);
- this.showError();
- },
- postMoreWan: function(callback){
- var csrf_obj = utilGetCsrf();
- var post_data = {
- "csrf": csrf_obj,
- "data": this.createSubmitData()
- };
- var self = this;
- this.post($.toJSON(post_data),
- function (result) {
- if (0 != result.errcode) {
- utilStopSubmitDialog();
- utilMarkErrorFields(self, result);
- } else {
- if (callback){
- callback();
- }
- }
- });
- },
- postData: function() {
- utilStartSubmitDialog();
- var csrf_obj = utilGetCsrf();
- var post_data = {
- "csrf": csrf_obj,
- "data": this.createSubmitData()
- };
- var self = this;
- this.post($.toJSON(post_data),
- function (result) {
- if (0 != result.errcode) {
- utilStopSubmitDialog();
- utilMarkErrorFields(self, result);
- } else {
- Atp.WanController.submitDftWan(false, function () {
- pageload();
- Atp.WanController.set("saved", true);
- utilStopSubmitDialog();
- });
- }
- });
- }
- });
- Atp.backupTypeRadioButton = Atp.RadioButton.extend ({
- group: 'backup_type'
- });
- Atp.WanbackupView = Em.View.extend({
- controller: Atp.WanbackupController,
- classNames:'clearboth',
- contentBinding: "Atp.WanbackupController.content",
- change: function() {
- Atp.WanbackupController.checkProc();
- },
- template: Em.Handlebars.compile(
- '{{#if Atp.WanController.activeItem.isDatacardMode}} \
- {{view Atp.PinView}} \
- <br> \
- {{view Atp.SuccessView}}\
- <div class="form-horizontal width_100p clearboth"> \
- <div class="control-group">\
- <label class="control-label third_menu_below_config_font">\
- {{t backup.Mode}}: \
- </label> \
- {{#if view.content.BondingEnable}}\
- <div class="controls paddingtop_8 wordbreak">{{t HybridRouteBalance.Bonding}}</div> \
- {{else}}\
- <div class="controls">\
- {{ view Atp.backupTypeRadioButton titleID="backup.Mode_Backup_Confirm" option="Backup_Confirm" valueBinding="view.content.Mode"}} \
- {{ view Atp.backupTypeRadioButton titleID="backup.Mode_Backup_Auto" option="Backup_Auto" valueBinding="view.content.Mode"}} \
- </div>\
- {{/if}}\
- </div>\
- {{#if view.content.showIdleTime}}\
- {{ view Atp.LabelView labelID="backup.Idletime" valueBinding="view.content.Idletime" }} \
- {{/if}} \
- </div>\
- {{/if}}')
- });
- Atp.WizardRedirectView = Em.View.extend({
- controller: Atp.WanbackupController,
- classNames:'clearboth',
- contentBinding: "Atp.WanbackupController.content",
- template: Em.Handlebars.compile(
- '<div class="form-horizontal"> \
- <div class="control-group">\
- <label class="control-label third_menu_below_config_font">\
- {{t backup.Mode}}: \
- </label> \
- <div class="controls">\
- {{ view Atp.backupTypeRadioButton titleID="backup.Mode_Disable" option="Disable" valueBinding="view.content.Mode"}} \
- {{ view Atp.backupTypeRadioButton titleID="backup.Mode_Backup_Confirm" option="Backup_Confirm" valueBinding="view.content.Mode"}} \
- {{ view Atp.backupTypeRadioButton titleID="backup.Mode_Backup_Auto" option="Backup_Auto" valueBinding="view.content.Mode"}} \
- </div>\
- </div>\
- {{#if view.content.showIdleTime}}\
- {{ view Atp.LabelView labelID="backup.Idletime" valueBinding="view.content.Idletime" }} \
- {{/if}} \
- </div>')
- });
- Atp.WizardPinView = Em.View.extend({
- controller: Atp.PinController,
- contentBinding: "Atp.PinController.content",
- template: Em.Handlebars.compile(
- '<div class="form-horizontal"> \
- {{#if view.content.datacardReady}} \
- <img {{bindAttr src="Atp.WanController.umtsWan.iconPath"}}></img>{{Atp.WanController.umtsWan.connStatusText}}<br/>\
- <img {{bindAttr src="Atp.WanController.defaultWan.iconPath"}}>{{Atp.WanController.defaultWan.connStatusText}}</img>\
- <button class="atp_button" {{action "dialupUmts" target="Atp.WanController"}}>{{Atp.WanController.umtsWan.connActionText}}</button> \
- {{else}} \
- {{view Atp.SuccessView}}\
- {{ t backup.PinOper}} \
- {{#if view.content.pukRequired}} \
- {{ view Atp.LabelView labelID="pin.PUKCode" rule="is_natural|exact_length[8]" valueBinding="view.controller.puk" }} \
- {{/if}} \
- {{#if view.content.showPin}} \
- {{ view Atp.LabelView labelID="pin.PINCode" rule="is_natural|lenrange[4~8]" valueBinding="view.controller.pin" }} \
- {{/if}} \
- {{#if view.controller.showChangeContent}} \
- {{ view Atp.LabelView labelID="pin.NewPIN" rule="is_natural|lenrange[4~8]" valueBinding="view.controller.newpin" }} \
- {{ view Atp.LabelView labelID="pin.PINConfirm" rule="is_natural|lenrange[4~8]|callback_pwdMatch" valueBinding="view.controller.newpinconfirm" }} \
- {{/if}} \
- </div> \
- {{#if view.content.showSubmit}} \
- {{ view Atp.LabelView textType="label" labelID="pin.RemainTimes" valueBinding="view.content.RemainTime" }} \
- {{ view Atp.MySubmitButton}}\
- {{/if}} \
- <br/>\
- {{/if}}')
- });
- var MAX_WAN_PER_LINK = 4;
- var MAX_VLAN_LINKS = 8;
- var MAX_PVC_NUM = 4;
- var MAX_TOTAL_WAN = 8;
- var MAX_PPP_PASSWORD_LENGTH = 64;
- var wanppppasswordrule = "";
- function callback_check_mss_value(value) {
- var intVal = parseInt(value);
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan_internal_edit_view_wan_MSS";
- errStruct.errId = "wan.MSS_err";
- errStruct['delete'] = false;
- var range = "100~1452";
- errStruct.arg1 = "100~1452";
- if ("IP_Routed" == Atp.WanController.activeItem.get("ConnectionType")) {
- range = "100~1460";
- errStruct.arg1 = "100~1460";
- } else if ("PPP_Routed" != Atp.WanController.activeItem.get("ConnectionType")) {
- return null;
- }
- if (Atp.WanController.activeItem.get("IPv6Enable")) {
- if ("100~1452" == range) {
- range = "1240~1452";
- errStruct.arg1 = "1240~1452";
- }
- else if ("100~1460" == range) {
- range = "1240~1460";
- errStruct.arg1 = "1240~1460";
- }
- }
- if(!AtpValidator._hooks.integer(value)){
- return errStruct;
- }
- if (0 == intVal) {
- return null;
- }
- if (!AtpValidator._hooks.range(value, range)) {
- return errStruct;
- }
- return null;
- }
- function callback_check_idletime_value(value) {
- if ("OnDemand" == Atp.WanController.activeItem.get("PPPTrigger")) {
- if(/^(\+|-)?\d+$/.test(value) == false){
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.PPPIdletimeOther";
- errStruct['delete'] = true;
- errStruct.resId = errStruct.resId.replace(/\./g, "_");
- errStruct.errId = "Menu.integer_err";
- return errStruct;
- }
- if ( (parseInt(value) < 30) || (parseInt(value) > 31536000) ){
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.PPPIdletimeOther";
- errStruct['delete'] = true;
- errStruct.resId = errStruct.resId.replace(/\./g, "_");
- errStruct.errId = "Menu.range_err";
- errStruct.arg1 = "30~31536000";
- return errStruct;
- }
- }
- return null;
- }
- function check_mac_addr(value, errStruct){
- var c = '';
- var i = 0, j = 0;
- var num = 0;
- if ( value == '00:00:00:00:00:00' )
- {
- return errStruct;
- }
- addrParts = value.split(':');
- if ( addrParts.length != 6 ) return errStruct;
- for (i = 0; i < 6; i++) {
- if ( addrParts[i] == '' )
- return errStruct;
- if ( addrParts[i].length != 2)
- {
- return errStruct;
- }
- for ( j = 0; j < addrParts[i].length; j++ ) {
- c = addrParts[i].toLowerCase().charAt(j);
- if ((c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'f'))
- continue;
- else
- return errStruct;
- }
- if (i == 0){
- c = addrParts[i].toLowerCase().charAt(1);
- Em.Logger.log("first two letter "+ c);
- if (c > 'a')
- {
- if ((c == 'b') || (c == 'd') || (c == 'f'))
- {
- num = 1;
- }
- else
- {
- num = 0;
- }
- }
- else if (c == 'a')
- {
- num = 1;
- }
- else
- {
- num = c - '0';
- }
- Em.Logger.log("num "+ num);
- if (0 != num%2)
- {
- return errStruct;
- }
- }
- }
- return null;
- }
- function callback_check_macclone_value(value) {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.CloneMacaddr";
- errStruct.errId = "wan.CloneMacaddr_err";
- errStruct['delete'] = false;
- Em.Logger.log("callback_check_macclone_value"+ value);
- return check_mac_addr(value, errStruct);
- }
- function callback_check_dhcp_restriction_value(value) {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.BindDhcpsMacAddr";
- errStruct.errId = "wan.BindDhcpsMacAddr_err";
- errStruct['delete'] = false;
- Em.Logger.log("callback_check_dhcp_restriction_value"+ value);
- return check_mac_addr(value, errStruct);
- }
- function isInteger(value)
- {
- if (/^(\+|-)?\d+$/.test(value))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- function isValidIpAddress(address) {
- var i = 0;
- if ( address == '0.0.0.0' ||address == '127.0.0.1'||
- address == '255.255.255.255' )
- return false;
- var addrParts = address.split('.');
- if ( addrParts.length != 4 ) return false;
- for (i = 0; i < 4; i++) {
- if (isNaN(addrParts[i]) || addrParts[i] ==""
- || addrParts[i].charAt(0) == '+' || addrParts[i].charAt(0) == '-'
- || (addrParts[i].charAt(0) == '0' && addrParts[i].length > 1))
- return false;
- if (addrParts[i].length > 3 || addrParts[i].length < 1)
- {
- return false;
- }
- if (!isInteger(addrParts[i]) || addrParts[i] < 0)
- {
- return false;
- }
- num = parseInt(addrParts[i]);
- if (i == 0 && num == 0)
- {
- return false;
- }
- if ( num < 0 || num > 255 )
- return false;
- }
- return true;
- }
- function getLeftMostZeroBitPos(num)
- {
- var i = 0;
- var numArr = [128, 64, 32, 16, 8, 4, 2, 1];
- for ( i = 0; i < numArr.length; i++ )
- if ( (num & numArr[i]) == 0 )
- return i;
- return numArr.length;
- }
- function getRightMostOneBitPos(num) {
- var i = 0;
- var numArr = [1, 2, 4, 8, 16, 32, 64, 128];
- for ( i = 0; i < numArr.length; i++ )
- if ( ((num & numArr[i]) >> i) == 1 )
- return (numArr.length - i - 1);
- return -1;
- }
- function isValidSubnetMask(mask) {
- var i = 0, num = 0;
- var zeroBitPos = 0, oneBitPos = 0;
- var zeroBitExisted = false;
- if (mask == '0.0.0.0' || mask == '255.255.255.255')
- return false;
- var maskParts = mask.split('.');
- if ( maskParts.length != 4 ) return false;
- for (i = 0; i < 4; i++) {
- if ( isNaN(maskParts[i]) == true || maskParts[i] == ""
- || maskParts[i].charAt(0) == '+' || maskParts[i].charAt(0) == '-'
- || (maskParts[i].charAt(0) == '0'
- && maskParts[i].length > 1))
- return false;
- if (!isInteger(maskParts[i]) || maskParts[i] < 0)
- {
- return false;
- }
- num = parseInt(maskParts[i]);
- if ( num < 0 || num > 255 )
- return false;
- if ( zeroBitExisted == true && num != 0 )
- return false;
- zeroBitPos = getLeftMostZeroBitPos(num);
- oneBitPos = getRightMostOneBitPos(num);
- if ( zeroBitPos < oneBitPos )
- return false;
- if ( zeroBitPos < 8 )
- zeroBitExisted = true;
- }
- return true;
- }
- function IpAddress2DecNum(address)
- {
- if (isValidIpAddress(address) == false)
- {
- return -1;
- }
- var addrParts = address.split('.');
- var num = 0;
- for (i = 0; i < 4; i++)
- {
- num += parseInt(addrParts[i]) * Math.pow(256, 3 - i);
- }
- return num;
- }
- function isBroadcastIpAddress(address)
- {
- if (isValidIpAddress(address) == false)
- {
- return false;
- }
- var addrParts = address.split('.');
- if (addrParts[3] == '255')
- {
- return true;
- }
- return false;
- }
- function isBroadcastIp(ipAddress, subnetMask)
- {
- var maskLenNum = 0;
- tmpMask = subnetMask.split('.');
- tmpIp = ipAddress.split('.');
- if((parseInt(tmpIp[0]) > 223) || ( 127 == parseInt(tmpIp[0])))
- {
- return true;
- }
- for(maskLenNum = 0; maskLenNum < 4; maskLenNum++)
- {
- if(parseInt(tmpMask[maskLenNum]) < 255)
- break;
- }
- tmpNum0 = parseInt(tmpIp[maskLenNum]);
- tmpNum1 = 255 - parseInt(tmpMask[maskLenNum]);
- tmpNum2 = tmpNum0 & tmpNum1;
- if((tmpNum2 != 0) && (tmpNum2 != tmpNum1))
- {
- return false;
- }
- if(maskLenNum == 3)
- {
- return true;
- }
- else if(maskLenNum == 2)
- {
- if(((tmpIp[3] == 0)&&(tmpNum2 == 0))||
- ((tmpIp[3] == 255)&&(tmpNum2 == tmpNum1)))
- {
- return true;
- }
- }
- else if(maskLenNum == 1)
- {
- if(((tmpNum2 == 0)&&(tmpIp[3] == 0)&&(tmpIp[2] == 0)) ||
- ((tmpNum2 == tmpNum1)&&(tmpIp[3] == 255)&&(tmpIp[2] == 255)))
- {
- return true;
- }
- }
- else if(maskLenNum == 0)
- {
- if(((tmpNum2 == 0)&&(tmpIp[3] == 0)&&(tmpIp[2] == 0)&&(tmpIp[1] == 0)) ||
- ((tmpNum2 == tmpNum1)&&(tmpIp[3] == 255)&&(tmpIp[2] == 255) &&(tmpIp[1] == 255)))
- {
- return true;
- }
- }
- return false;
- }
- function isHostIpWithSubnetMask(address, subnet)
- {
- if (isValidIpAddress(address) == false)
- {
- return false;
- }
- if (isValidSubnetMask(subnet) == false)
- {
- return false;
- }
- var addr = IpAddress2DecNum(address);
- var mask = IpAddress2DecNum(subnet);
- if (0 == (addr & (~mask)))
- {
- return false;
- }
- if (isBroadcastIp(address,subnet) == true)
- {
- return false;
- }
- return true;
- }
- function isAbcIpAddress(address)
- {
- if (isValidIpAddress(address) == false)
- {
- return false;
- }
- var addrParts = address.split('.');
- var num = 0;
- num = parseInt(addrParts[0]);
- if (num < 1 || num >= 224 || num == 127)
- {
- return false;
- }
- num = parseInt(addrParts[3]);
- if (num == 255)
- {
- return false;
- }
- return true;
- }
- function callback_check_ipv4static_value(curwan) {
- var errStruct = utilCreateDftErrStruct();
- if (!isValidIpAddress(curwan.get('IPv4Addr')))
- {
- errStruct.resId = "wan.IPv4Addr";
- errStruct.errId = "wan.IPv4Addr_err";
- return errStruct;
- }
- if (!isValidSubnetMask(curwan.get('IPv4Mask')))
- {
- errStruct.resId = "wan.IPv4Mask";
- errStruct.errId = "wan.IPv4Mask_err";
- return errStruct;
- }
- if (!isHostIpWithSubnetMask(curwan.get('IPv4Addr'), curwan.get('IPv4Mask')))
- {
- errStruct.resId = "wan.IPv4Addr";
- errStruct.errId = "wan.IPv4Addr_err";
- return errStruct;
- }
- if (!isAbcIpAddress(curwan.get('IPv4Gateway')))
- {
- errStruct.resId = "wan.IPv4Gateway";
- errStruct.errId = "wan.IPv4Gateway_err";
- return errStruct;
- }
- if (!isAbcIpAddress(curwan.get('IPv4PriDns')))
- {
- errStruct.resId = "wan.IPv4PriDns";
- errStruct.errId = "wan.IPv4PriDns_err";
- return errStruct;
- }
- if (curwan.get('IPv4SecDns') != '' && !isAbcIpAddress(curwan.get('IPv4SecDns')))
- {
- errStruct.resId = "wan.IPv4SecDns";
- errStruct.errId = "wan.IPv4SecDns_err";
- return errStruct;
- }
- return null;
- }
- function callback_is_apn(value)
- {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "internet_profile_view_data_edit_wan_APN";
- errStruct.errId = "umts.apn_Char_Err";
- errStruct['delete'] = false;
- var reg = /^(\s|!|#|\$|\(|\)|\*|-|\.|\/|[0-9A-Za-z]|=|@|\[|\]|\^|_|`|\{|\v|\}|~|[\x7F])*$/;
- if(!reg.exec(value))
- {
- return errStruct;
- }
- return null;
- }
- function callback_is_dial_number(value)
- {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "internet_profile_view_data_edit_wan_DialNum";
- errStruct.errId = "wan.DialNum_err";
- errStruct['delete'] = false;
- var re=/^([0-9\*#\+WP])*$/
- if (value.search(re)==-1)
- {
- return errStruct;
- }
- return null;
- }
- function callback_is_username(value) {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "internet_profile_view_data_edit_wan_Username";
- errStruct.errId = "wan.Username_datacard_err";
- errStruct['delete'] = false;
- var patrn=/^(\s|!|#|\$|\(|\)|\*|-|\.|\/|[0-9A-Za-z]|=|@|\[|\]|\^|_|`|\{|\v|\}|~|[\x7F])*$/;
- if(!patrn.exec(value))
- {
- return errStruct;
- }
- return null;
- }
- function callback_check_ppp_password_value_datacard(value) {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "internet_profile_view_data_edit_wan_Password";
- errStruct.errId = "wan.Password_datacard_err";
- errStruct['delete'] = false;
- needRestorePassword = false;
- var patrn=/^(\s|!|#|\$|\(|\)|\*|-|\.|\/|[0-9A-Za-z]|=|@|\[|\]|\^|_|`|\{|\v|\}|~|[\x7F])*$/;
- if(!patrn.exec(value))
- {
- return errStruct;
- }
- return null;
- }
- var needRestorePassword = false;
- function password_focus_proc() {
- needRestorePassword = false;
- if (!Atp.WanController || !Atp.WanController.activeItem) {
- return;
- }
- if ("@1GV)Z+!" == Atp.WanController.activeItem.get("Password")) {
- Atp.WanController.activeItem.set("Password", "");
- needRestorePassword = true;
- }
- }
- function password_focusout_proc() {
- if (!Atp.WanController || !Atp.WanController.activeItem) {
- return;
- }
- if (needRestorePassword && ("" == Atp.WanController.activeItem.get("Password"))) {
- Atp.WanController.activeItem.set("Password", "@1GV)Z+!");
- }
- }
- function callback_check_ppp_password_value(value) {
- var intVal = parseInt(value);
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "internet_profile_view_data_edit_wan_Password";
- errStruct.errId = "wan.Password_err";
- errStruct['delete'] = false;
- needRestorePassword = false;
- if (value.length > MAX_PPP_PASSWORD_LENGTH) {
- errStruct.errId = "Menu.lenrange_err";
- errStruct.arg1 = "0~64";
- return errStruct;
- }
- if(wanppppasswordrule == ""){
- var patrn=/^[A-Za-z0-9~!@#\$%\^&\*\(\)\-_\+=\{\}\[\]\?]{0,64}$/;
- if(!patrn.exec(value))
- {
- return errStruct;
- }
- }
- return null;
- }
- Atp.AccessTypeController = Atp.SelectController.create({
- prefixName: 'wan.AccessType',
- values: [
- , "Ethernet"
- , "UMTS"
- ]
- });
- function WanBackupData() {
- Atp.WanController.content.forEach(function (wanData){
- wanData.set("originPPPTrigger", wanData.get("PPPTrigger"));
- wanData.set("prevConnectionType", wanData.get("ConnectionType"));
- wanData.set("originConnectionType", wanData.get("ConnectionType"));
- });
- }
- function WanConnTypeChangeProc(wanItem) {
- if (!wanItem) {
- return;
- }
- var curConnType = wanItem.get("ConnectionType");
- if ("Bridged" == wanItem.get("prevConnectionType")) {
- if ("0" == wanItem.get("NATType")) {
- wanItem.set("NATType", "1");
- selectControllerInit(wanItem, "NATType", Atp.NatTypeController);
- }
- }
- wanItem.set("prevConnectionType", curConnType);
- }
- Atp.ConnectionTypeController = Atp.SelectController.create({
- prefixName: 'wan.ConnectionType',
- values: [ "PPP_Routed", "IP_Routed", "Bridged"
- ]
- });
- Atp.NatTypeController = Atp.SelectController.create({
- prefixName: 'wan.NATType',
- values: [ "1",
- "2",
- "0"]
- });
- Atp.UMTSNetTypeController = Atp.SelectController.create({
- prefixName: 'wan.NetType',
- values: [ "Auto", "3G_preferred", "3G_only", "2G_preferred", "2G_only"]
- });
- Atp.IPVersionController = Atp.SelectController.create({
- prefixName: 'wan.IPVer',
- values: [ "IPv4", "IPv6", "Both"]
- });
- Atp.IPv4AddrTypeController = Atp.SelectController.create({
- prefixName: 'wan.IPv4AddrType',
- values: [ "DHCP", "Static"]
- });
- Atp.IPv6AddrTypeController = Atp.SelectController.create({
- prefixName: 'wan.IPv6AddrType',
- values: [ "SLAAC", "Static"]
- });
- Atp.PPPAuthModeController = Atp.SelectController.create({
- prefixName: 'wan.PPPAuthMode',
- values: [ "AUTO", "PAP", "CHAP"]
- });
- Atp.PPPDialIpModeController = Atp.SelectController.create({
- prefixName: 'wan.PPPDialIpMode',
- values: [ "dynamic", "static"]
- });
- Atp.PPPDialModeController = Atp.SelectController.create({
- prefixName: 'wan.PPPTrigger',
- values: [ "AlwaysOn", "Manual", "OnDemand"]
- });
- Atp.AutoDisconnectTimeController = Atp.SelectController.create ({
- prefixName: 'wan.PPPIdletime',
- values: [ "60", "120", "180", "300", "600"],
- otherValue: "",
- isManual: false,
- init: function() {
- this._super();
- this.content.pushObject(Em.Object.create({"name": Em.I18n.t("wan.SelectOther"), "value":"Other"}));
- },
- selectedValue: function(key, value) {
- var self = this;
- if (1 == arguments.length) {
- if (Atp.WanController.activeItem) {
- var selected = self.findProperty('value', Atp.WanController.activeItem.get('PPPIdletime'));
- if (selected && (!self.get('isManual'))) {
- return Atp.WanController.activeItem.get('PPPIdletime');
- }
- else {
- self.set('otherValue', Atp.WanController.activeItem.get('PPPIdletime'));
- return "Other";
- }
- }
- return "Other";
- } else {
- if (value != "Other") {
- self.set('isManual', false);
- Atp.WanController.activeItem.set('PPPIdletime', value);
- }
- else {
- Atp.WanController.activeItem.set('PPPIdletime', self.get("otherValue"));
- }
- return value;
- }
- }.property('Atp.WanController.activeItem.PPPIdletime'),
- valueObserves: function() {
- this.set('isManual', true);
- }.observes('otherValue'),
- isSelectedOther: function() {
- return (this.get('selectedValue') == "Other");
- }.property('selectedValue')
- });
- Atp.ConnTypeRadioButton = Atp.RadioButton.extend ({
- group: 'conn_type'
- });
- Atp.InternetConnTypeRadioButton = Atp.RadioButton.extend ({
- group: 'internet_conn_type'
- });
- Atp.IptvConnTypeRadioButton = Atp.RadioButton.extend ({
- group: 'iptv_conn_type'
- });
- Atp.PPPTriggerRadioButton = Atp.RadioButton.extend ({
- group: 'ppp_type'
- });
- Atp.wanPPPTriggerRadioButton = Atp.RadioButton.extend ({
- group: 'wan_ppp_type'
- });
- Atp.internetPPPTriggerRadioButton = Atp.RadioButton.extend ({
- group: 'internet_ppp_type'
- });
- Atp.Wan = Em.Object.extend({
- newCreated: false,
- init: function() {
- this._super();
- selectControllerInit(this, "AccessType", Atp.AccessTypeController);
- selectControllerInit(this, "ConnectionType", Atp.ConnectionTypeController);
- selectControllerInit(this, "NATType", Atp.NatTypeController);
- selectControllerInit(this, "IPVer", Atp.IPVersionController);
- selectControllerInit(this, "IPv6AddrType", Atp.IPv6AddrTypeController);
- selectControllerInit(this, "IPv4AddrType", Atp.IPv4AddrTypeController);
- selectControllerInit(this, "PPPAuthMode", Atp.PPPAuthModeController);
- selectControllerInit(this, "PPPDialIpMode", Atp.PPPDialIpModeController);
- selectControllerInit(this, "PPPIdletime", Atp.AutoDisconnectTimeController);
- selectControllerInit(this, "NetType", Atp.UMTSNetTypeController);
- },
- updateAccessType: function() {
- selectControllerUpdate(this, "AccessType");
- }.observes("AccessTypeSelected"),
- updateConnectionType: function(){
- selectControllerUpdate(this, "ConnectionType");
- }.observes("ConnectionTypeSelected"),
- updateNATType: function(){
- selectControllerUpdate(this, "NATType");
- }.observes("NATTypeSelected"),
- updateIPVer: function(){
- selectControllerUpdate(this, "IPVer");
- }.observes("IPVerSelected"),
- updateIPv4AddrType: function(){
- selectControllerUpdate(this, "IPv4AddrType");
- }.observes("IPv4AddrTypeSelected"),
- updateIPv6AddrType: function(){
- selectControllerUpdate(this, "IPv6AddrType");
- }.observes("IPv6AddrTypeSelected"),
- updatePPPAuthMode: function() {
- selectControllerUpdate(this, "PPPAuthMode");
- }.observes("PPPAuthModeSelected"),
- updatePPPDialIpMode: function() {
- selectControllerUpdate(this, "PPPDialIpMode");
- }.observes("PPPDialIpModeSelected"),
- updatePPPTrigger: function() {
- selectControllerUpdate(this, "PPPTrigger");
- }.observes("PPPTriggerModeSelected"),
- updatePPPIdletime: function() {
- selectControllerUpdate(this, "PPPIdletime");
- }.observes("PPPIdletimeSelected"),
- updateNetType: function() {
- selectControllerUpdate(this, "NetType");
- }.observes("NetTypeSelected"),
- iconPath: function() {
- if ("UMTS" == this.get("AccessType")) {
- return "/res/top/datacard.png";
- } else if ("Ethernet" == this.get("AccessType")) {
- return "/res/top/ethernet.jpg";
- }
- return "/res/top/dsl.jpg";
- }.property("AccessType"),
- linkLayer: function() {
- if (typeof this.get("LowerLayer") == 'undefined' ){
- return null;
- }
- var wanconndev = this.get("LowerLayer").replace("X_ATP_", "X_");
- var link = null;
- if (!Atp.LinkController) {
- return null;
- }
- Atp.LinkController.content.forEach(function (item) {
- if (item.get("ID") == wanconndev) {
- link = item;
- }
- });
- return link;
- }.property("Atp.LinkController.content.@each.ID", "LowerLayer"),
- isPPPoA: function(){
- var link = this.get("linkLayer");
- if (!link){
- return false;
- }
- if ("PPPoA" == link.get("LinkType")){
- return true;
- }
- return false;
- }.property("Atp.LinkController.content.@each.ID", "Atp.LinkController.content.@each.LinkType", "LowerLayer"),
- needDialButton: function() {
- if ("" == this.get("ID")) {
- return false;
- }
- if (("Manual" == this.get("PPPTrigger")) && ("PPP_Routed" == this.get("ConnectionType"))) {
- return true;
- }
- return false;
- }.property("PPPTrigger", "ID"),
- ipv4StatusText: function() {
- if ("Connected" == this.get("ConnectionStatus")) {
- return Em.I18n.t("Menu.Connected");
- }
- else if ("Connecting" == this.get("ConnectionStatus")) {
- return Em.I18n.t("Menu.Connecting");
- }
- return Em.I18n.t("Menu.Disconnected");
- }.property("ConnectionStatus"),
- ipv6StatusText: function() {
- if ("Connected" == this.get("IPv6ConnectionStatus")) {
- return Em.I18n.t("Menu.Connected");
- }
- else if ("Connecting" == this.get("IPv6ConnectionStatus")) {
- return Em.I18n.t("Menu.Connecting");
- }
- return Em.I18n.t("Menu.Disconnected");
- }.property("IPv6ConnectionStatus"),
- datacardBackupText: function () {
- if (this.get("showDisconnect")) {
- return Em.I18n.t('home.datacard_disconnect');
- }
- return Em.I18n.t('home.datacard_connect');
- }.property("ConnectionStatus", "IPv6ConnectionStatus"),
- connActionText: function () {
- if (this.get("showDisconnect")) {
- return Em.I18n.t('Menu.Disconnect');
- }
- return Em.I18n.t('Menu.Connect');
- }.property("ConnectionStatus", "IPv6ConnectionStatus"),
- showV4Status: function() {
- if (this.get("IPv4Enable")) {
- return true;
- }
- if ("Bridged" == this.get("ConnectionType")) {
- return true;
- }
- return false;
- }.property("IPv4Enable", "ConnectionType"),
- showV6Status: function() {
- if ("Bridged" == this.get("ConnectionType")) {
- return false;
- }
- if (this.get("IPv6Enable")) {
- return true;
- }
- return false;
- }.property("IPv6Enable", "ConnectionType"),
- showStatus: function() {
- return ("Bridged" == this.get("ConnectionType"));
- }.property("ConnectionType"),
- connected: function() {
- if ("Connected" == this.get("ConnectionStatus")) {
- return true;
- }
- if ("Connected" == this.get("IPv6ConnectionStatus")) {
- return true;
- }
- return false;
- }.property("IPv6ConnectionStatus", "ConnectionStatus"),
- showACName: function(){
- if (this.get("connected") && this.get("isPPP") && !this.get("isPPPoA")){
- return true;
- }
- return false;
- }.property("IPv6ConnectionStatus", "ConnectionStatus", "ConnectionType"),
- ipv4Connected: function() {
- if ("Bridged" == this.get("ConnectionType")) {
- return false;
- }
- if ("Connected" == this.get("ConnectionStatus")) {
- return true;
- }
- return false;
- }.property("ConnectionType", "ConnectionStatus"),
- ipv6Connected: function() {
- if ("Connected" == this.get("IPv6ConnectionStatus")) {
- return true;
- }
- return false;
- }.property("IPv6ConnectionStatus"),
- isDialButtonDisabled: function() {
- if (("Connecting" == this.get("ConnectionStatus")) ||
- ("Connecting" == this.get("IPv6ConnectionStatus"))) {
- return true;
- }
- if (("Disconnecting" == this.get("ConnectionStatus")) ||
- ("Disconnecting" == this.get("IPv6ConnectionStatus"))) {
- return true;
- }
- return false;
- }.property("ConnectionStatus", "IPv6ConnectionStatus"),
- showDisconnect: function() {
- if (("Connected" == this.get("ConnectionStatus")) ||
- ("Connected" == this.get("IPv6ConnectionStatus"))) {
- return true;
- }
- if (("Connecting" == this.get("ConnectionStatus")) ||
- ("Connecting" == this.get("IPv6ConnectionStatus"))) {
- return true;
- }
- return false;
- }.property("ConnectionStatus", "IPv6ConnectionStatus"),
- showLinkAccess: function() {
- if ("" == this.get("ID")) {
- if (Atp.AccessTypeController.content.length > 1) {
- return true;
- }
- return false;
- }
- return false;
- }.property('ID'),
- FriendlyName: function(key, value) {
- return this.get('Name');
- }.property('Name'),
- IPv4PriDns: function (key, value) {
- var servers = this.get("IPv4DnsServers");
- if (1 == arguments.length) {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- return servers.substring(0, sep);
- }
- return servers;
- } else {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- servers = value + "," + servers.substring(sep+1);
- } else {
- servers = value;
- }
- this.set("IPv4DnsServers", servers);
- return value;
- }
- }.property("IPv4DnsServers"),
- IPv4SecDns: function (key, value) {
- var servers = this.get("IPv4DnsServers");
- if (1 == arguments.length) {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- return servers.substring(sep+1);
- }
- return "";
- } else {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- servers = servers.substring(0, sep+1) + value;
- } else {
- servers = servers + "," + value;
- }
- this.set("IPv4DnsServers", servers);
- return value;
- }
- }.property("IPv4DnsServers"),
- IPv6PriDns: function (key, value) {
- var servers = this.get("IPv6DnsServers");
- if (1 == arguments.length) {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- return servers.substring(0, sep);
- }
- return servers;
- } else {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- servers = value + "," + servers.substring(sep+1);
- } else {
- servers = value;
- }
- this.set("IPv6DnsServers", servers);
- return value;
- }
- }.property("IPv6DnsServers"),
- IPv6SecDns: function (key, value) {
- var servers = this.get("IPv6DnsServers");
- if (1 == arguments.length) {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- return servers.substring(sep+1);
- }
- return "";
- } else {
- var sep = servers.indexOf(",");
- if (-1 != sep) {
- servers = servers.substring(0, sep+1) + value;
- } else {
- servers = servers + "," + value;
- }
- this.set("IPv6DnsServers", servers);
- return value;
- }
- }.property("IPv6DnsServers"),
- IPVer: function(key, value) {
- if (1 == arguments.length) {
- if (this.get("IPv6Enable")) {
- if (this.get("IPv4Enable")) {
- return "Both";
- }
- return "IPv6";
- }
- return "IPv4";
- } else {
- this.set("IPv4Enable", true);
- if ("IPv6" == value) {
- this.set("IPv6Enable", true);
- this.set("IPv4Enable", false);
- } else if ("IPv4" == value) {
- this.set("IPv6Enable", false);
- } else {
- this.set("IPv6Enable", true);
- }
- return value;
- }
- }.property("IPv4Enable", "IPv6Enable"),
- isAtmMode: function() {
- if ("DSL" == this.get("linkLayer").get("AccessType")) {
- return true;
- }
- return false;
- }.property("AccessType"),
- isEthernetMode: function() {
- if ("Ethernet" == this.get("linkLayer").get("AccessType")) {
- return true;
- }
- return false;
- }.property("AccessType"),
- notDatacardMode: function() {
- if ("UMTS" == this.get("AccessType")) {
- return false;
- }
- return true;
- }.property("AccessType"),
- isDatacardMode: function() {
- if ("UMTS" == this.get("AccessType")) {
- return true;
- }
- return false;
- }.property("AccessType"),
- hasServiceList: function() {
- if (("IP_Routed" == this.get("ConnectionType")) || ("PPP_Routed" == this.get("ConnectionType")) ||
- ("Bridged" == this.get("ConnectionType"))) {
- return true;
- }
- return false;
- }.property("ConnectionType"),
- isRouted: function() {
- if (("IP_Routed" == this.get("ConnectionType")) || ("PPP_Routed" == this.get("ConnectionType"))) {
- return true;
- }
- return false;
- }.property("ConnectionType"),
- isBridge: function() {
- if ("Bridged" == this.get("ConnectionType")) {
- return true;
- }
- return false;
- }.property("ConnectionType"),
- needPPP: function() {
- if (("PPP_Routed" == this.get("ConnectionType")) || ("DHCP_Spoofed" == this.get("ConnectionType"))) {
- return true;
- }
- return false;
- }.property("ConnectionType"),
- isPPP: function(){
- if ("PPP_Routed" !== this.get("ConnectionType")){
- return false;
- }
- return true;
- }.property("ConnectionType"),
- isStaticPPP: function(){
- if ("static" == this.get("PPPDialIpMode")){
- return true;
- }
- return false;
- }.property("PPPDialIpMode"),
- needIPv4AddrType: function() {
- if ("IP_Routed" == this.get("ConnectionType")) {
- if (this.get("IPv4Enable")) {
- return true;
- }
- }
- return false;
- }.property("ConnectionType", "IPv4Enable"),
- needDns:function(){
- if ("IP_Routed" == this.get("ConnectionType") || ("PPP_Routed" == this.get("ConnectionType")) ) {
- if (this.get("IPv4Enable")) {
- return true;
- }
- }
- return false;
- }.property("ConnectionType","IPv4Enable"),
- needIPv6AddrType: function() {
- if (this.get("isRouted")) {
- if ("UMTS" == this.get("AccessType")) {
- return false;
- }
- if (this.get("IPv6Enable")) {
- return true;
- }
- }
- return false;
- }.property("IPv6Enable", "isRouted"),
- isStaticIPv6: function() {
- if ("Static" == this.get("IPv6AddrType")) {
- return true;
- }
- return false;
- }.property("IPv6AddrType"),
- isStaticIPv4: function() {
- if (true == this.get("isPPP")){
- return false;
- }
- if ("Static" == this.get("IPv4AddrType")) {
- return true;
- }
- return false;
- }.property("IPv4AddrType", "ConnectionType"),
- notDhcpSpoof: function() {
- if ("DHCP_Spoofed" == this.get("ConnectionType")) {
- return false;
- }
- return true;
- }.property("ConnectionType"),
- isPPPOnDemand: function() {
- if ("PPP_Routed" == this.get("ConnectionType")) {
- if ("OnDemand" == this.get("PPPTrigger")) {
- return true;
- }
- }
- return false;
- }.property("ConnectionType", "PPPTrigger"),
- IPv4MaskStr: function() {
- if (("" == this.get("IPv4Mask")) && ("PPP_Routed" == this.get("ConnectionType")))
- {
- return "255.255.255.255";
- }
- return this.get("IPv4Mask");
- }.property("IPv4Mask", "ConnectionType"),
- supportTunnel: function() {
- var supportIPv4 = this.get("IPv4Enable");
- var supportIPv6 = this.get("IPv6Enable");
- if (supportIPv4 && supportIPv6) {
- return false;
- }
- if ("UMTS" == this.get("AccessType")) {
- return false;
- }
- if (("IP_Routed" != this.get("ConnectionType")) && ("PPP_Routed" != this.get("ConnectionType"))) {
- return false;
- }
- if ("PPP_Routed" == this.get("ConnectionType")) {
- if ("OnDemand" == this.get("PPPTrigger")) {
- return false;
- }
- }
- return (this.get("ServiceList") == "INTERNET");
- }.property("IPv4Enable", "IPv6Enable", "ConnectionType", "PPPTrigger", "AccessType", "ServiceList"),
- isLoadFinish:function(){
- if ( (typeof this.get("ConnectionStatus") != "undefined") ||
- (typeof this.get("IPv6ConnectionStatus") != "undefined")) {
- return true;
- }
- return false;
- }.property("ConnectionStatus","IPv6ConnectionStatus")
- });
- Atp.DslLinkTypeController = Atp.SelectController.create({
- prefixName: 'wan.LinkType',
- values: [ "EoA", "PPPoA", "IPoA"]
- });
- Atp.DslEncapModeController = Atp.SelectController.create({
- prefixName: 'wan.EncapMode',
- values: [ "LLC", "VCMUX"]
- });
- Atp.DslAtmQoSController = Atp.SelectController.create({
- prefixName: 'wan.AtmQoS',
- values: [ "UBR", "UBR+", "CBR", "VBR-nrt", "VBR-rt"]
- });
- Atp.Link = Em.Object.extend({
- init: function() {
- this._super();
- Em.Logger.log("Init for Link now ...");
- },
- init_for_selectbox: function () {
- selectControllerInit(this, "LinkType", Atp.DslLinkTypeController);
- selectControllerInit(this, "EncapMode", Atp.DslEncapModeController);
- selectControllerInit(this, "AtmQoS", Atp.DslAtmQoSController);
- },
- updateLinkType: function() {
- selectControllerUpdate(this, "LinkType");
- }.observes("LinkTypeSelected"),
- updateEncapMode: function() {
- selectControllerUpdate(this, "EncapMode");
- }.observes("EncapModeSelected"),
- updateAtmQoS: function() {
- selectControllerUpdate(this, "AtmQoS");
- }.observes("AtmQoSSelected"),
- isAtmMode: function () {
- if ("DSL" == this.get("AccessType")) {
- return true;
- }
- return false;
- }.property("AccessType"),
- needAtmQoS: function() {
- var atmqos = this.get("AtmQoS");
- if ("UBR" != atmqos) {
- return true;
- }
- return false;
- }.property("AtmQoS"),
- needAllAtmQos: function() {
- var atmqos = this.get("AtmQoS");
- if (("VBR-nrt" == atmqos) || ("VBR-rt" == atmqos)) {
- return true;
- }
- return false;
- }.property("AtmQoS"),
- syncVlanParams: function(link_to_sync) {
- this.set("VLANEnable", link_to_sync.get("VLANEnable"));
- this.set("VLANId", link_to_sync.get("VLANId"));
- this.set("VLAN1p", link_to_sync.get("VLAN1p"));
- },
- isLinkSame: function(link_to_compare) {
- if (link_to_compare.get("AccessType") != this.get("AccessType")) {
- return false;
- }
- if ("DSL" == this.get("AccessType")) {
- if (link_to_compare.get("PVC") != this.get("PVC")) {
- return false
- }
- }
- if (link_to_compare.get("VLANEnable") != this.get("VLANEnable")) {
- return false;
- }
- if (false != this.get("VLANEnable")) {
- if (link_to_compare.get("VLANId") != this.get("VLANId")) {
- return false;
- }
- }
- return true;
- },
- actualWanNum: function() {
- var num = 0;
- var sameLink = Atp.LinkController.getSameLink(this);
- if (sameLink) {
- num = sameLink.get("wanNum") + 1;
- } else {
- num = this.get("wanNum");
- }
- return num;
- }.property().cacheable(false),
- wanNum: function() {
- var num = 0;
- var self = this;
- Atp.WanController.content.forEach(function (item) {
- if (self.get("ID") == item.get("LowerLayer")) {
- num = num + 1;
- }
- });
- return num;
- }.property().cacheable(false),
- bridgeNum: function() {
- var num = 0;
- var self = this;
- Atp.WanController.content.forEach(function (item) {
- if ("Bridged" == item.get("ConnectionType")) {
- if (item.get("linkLayer") == self) {
- num = num + 1;
- }
- }
- });
- return num;
- }.property().cacheable(false),
- vlanNum: function() {
- var num = 0;
- var self = this;
- Atp.LinkController.content.forEach(function(item) {
- if (item != self) {
- if (item.get("PVC") == self.get("PVC")) {
- num = num + 1;
- }
- }
- });
- return num;
- }.property().cacheable(false),
- ipNum: function() {
- var num = 0;
- var self = this;
- Atp.WanController.content.forEach(function (item) {
- if ("IP_Routed" == item.get("ConnectionType")) {
- if (item.get("linkLayer") == self) {
- num = num + 1;
- }
- }
- });
- return num;
- }.property().cacheable(false),
- isVlanChanged: function() {
- if (this.get("VLANEnable") != this.get("origVLANEnable")) {
- return true;
- }
- if (this.get("VLANId") != this.get("origVLANId")) {
- return true;
- }
- return false;
- }.property("VLANEnable", "VLANId", "origVLANEnable", "origVLANId"),
- isPvcChanged: function() {
- if (this.get("PVC") != this.get("origPVC")) {
- return true;
- }
- return false;
- }.property("PVC", "origPVC"),
- getActualVlanNum: function() {
- var num = 0;
- if ("" == this.get("ID")) {
- if (this.get("VLANEnable")) {
- if (!Atp.LinkController.getSameLink(this)) {
- num = 1;
- }
- }
- return num;
- }
- if (!this.get("VLANEnable")) {
- if (this.get("origVLANEnable")) {
- if (this.get("wanNum") > 1) {
- num = num + 1;
- }
- }
- return num;
- }
- num = num + 1;
- var hasSameLink = Atp.LinkController.getSameLink(this);
- if (this.get("isVlanChanged")) {
- if (hasSameLink) {
- num = num - 1;
- }
- if ((this.get("wanNum") > 1) && this.get("origVLANEnable")) {
- num = num + 1;
- }
- } else if (this.get("isPvcChanged")) {
- if (hasSameLink) {
- num = num - 1;
- }
- if (this.get("wanNum") > 1) {
- num = num + 1;
- }
- }
- return num;
- },
- init: function () {
- this._super();
- }
- });
- function utilIsItemInArray(item, array, num) {
- var idx = 0;
- while (idx < num) {
- if (item == array[idx]) {
- return true;
- }
- idx = idx + 1;
- }
- return false;
- }
- Atp.LinkController = Atp.MultiObjController.create({
- modelClass: Atp.Link,
- objName: 'ntwk/link',
- init: function() {
- this._super();
- },
- getPvcNum: function() {
- var num = 0;
- var pvcs = [];
- this.content.forEach(function (item) {
- if ("DSL" == item.get("AccessType")) {
- if (!utilIsItemInArray(item.get("PVC"), pvcs, num)) {
- if ((item.get("vlanNum") > 0) ||
- (item.get("wanNum") > 0)) {
- pvcs[num] = item.get("PVC");
- num = num + 1;
- }
- }
- }
- });
- return num;
- },
- getVlanNum: function() {
- var num = 0;
- this.content.forEach(function (item) {
- num = num + item.getActualVlanNum();
- });
- return num;
- },
- getSameLink: function(link) {
- var res = null;
- this.content.forEach(function (item) {
- if (item != link) {
- if (item.isLinkSame(link)) {
- res = item;
- }
- }
- });
- return res;
- },
- backupKeyParas: function() {
- this.content.forEach(function(item) {
- item.set("origPVC", item.get("PVC"));
- item.set("origVLANEnable", item.get("VLANEnable"));
- item.set("origVLANId", item.get("VLANId"));
- });
- },
- build_link_err: function(errStruct, sameLink, connType, offset) {
- if ((sameLink.get("bridgeNum") > offset) &&
- ("Bridged" == connType)) {
- errStruct.errId = "wan.bridge_num_err";
- return;
- }
- if (sameLink.get("wanNum") >= (MAX_WAN_PER_LINK + offset)) {
- errStruct.errId = "wan.too_many_link_err";
- return;
- }
- },
- build_server_err: function(errStruct, tr069serverlist, voiceserverlist,connType) {
- if (("Bridged" == connType)
- && (-1 != tr069serverlist)) {
- errStruct.arg1 = "TR069";
- errStruct.errId = "wan.bridge_server_err";
- return;
- }
- if (("Bridged" == connType)
- && (-1 != voiceserverlist)) {
- errStruct.arg1 = "VOICE";
- errStruct.errId = "wan.bridge_server_err";
- return;
- }
- if (("DHCP_Spoofed" == connType)
- && (-1 != tr069serverlist)) {
- errStruct.arg1 = "TR069";
- errStruct.errId = "wan.dhcpspoof_server_err";
- return;
- }
- if (("DHCP_Spoofed" == connType)
- && (-1 != voiceserverlist)) {
- errStruct.arg1 = "VOICE";
- errStruct.errId = "wan.dhcpspoof_server_err";
- return;
- }
- },
- checkConnType: function(connType) {
- var curLink = Atp.LinkController.activeItem;
- if (!curLink) {
- return;
- }
- if ("DSL" != curLink.get("AccessType")) {
- return;
- }
- if ((curLink.get("LinkType") != "IPoA") && (curLink.get("LinkType") != "PPPoA")) {
- return;
- }
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.LinkType";
- if (curLink.get("LinkType") == "IPoA") {
- if (("IP_Routed" != connType) ||
- (curLink.get("actualWanNum") > 1)) {
- errStruct.errId = "wan.ipoa_err";
- }
- } else if (curLink.get("LinkType") == "PPPoA") {
- if (("PPP_Routed" != connType) ||
- (curLink.get("actualWanNum") > 1)) {
- errStruct.errId = "wan.pppoa_err";
- }
- }
- if ("" != errStruct.errId) {
- utilErrStructPush(Atp.WanController, errStruct);
- }
- },
- checkTotalPVC: function() {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.PVC";
- var curPVC = Atp.LinkController.getPvcNum();
- Em.Logger.log("Cur PVC number: " + curPVC);
- if (curPVC > MAX_PVC_NUM) {
- errStruct.errId = "wan.pvc_err";
- errStruct.arg1 = MAX_PVC_NUM;
- utilErrStructPush(Atp.WanController, errStruct);
- return true;
- }
- return false;
- },
- checkTotalVlan: function() {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.VLANId";
- var curVlan = Atp.LinkController.getVlanNum();
- Em.Logger.log("Cur VLAN number: " + curVlan);
- if (curVlan > MAX_VLAN_LINKS) {
- errStruct.errId = "wan.vlan_err";
- errStruct.arg1 = MAX_VLAN_LINKS;
- utilErrStructPush(Atp.WanController, errStruct);
- return true;
- }
- return false;
- },
- checkcurPVC: function() {
- if ("DSL" != Atp.LinkController.activeItem.get("AccessType")) {
- return false;
- }
- var curpvc = Atp.LinkController.activeItem.PVC;
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.PVC";
- if ((curpvc == "PVC:/") || (curpvc == ""))
- {
- errStruct.errId = "wan.pvcnum_err";
- utilErrStructPush(Atp.WanController, errStruct);
- return true;
- }
- var vpi = curpvc.split('/')[0];
- var vci = curpvc.split('/')[1];
- vpi = vpi.split(':')[1];
- if ((vpi == "") || (vci == "")
- || (vpi.length > 1 && vpi[0] == "0")
- || (vci.length > 1 && vci[0] == "0"))
- {
- errStruct.errId = "wan.pvcnum_err";
- utilErrStructPush(Atp.WanController, errStruct);
- return true;
- }
- return false;
- },
- checkProc: function(isMoreWan) {
- if (!Atp.WanController) {
- return;
- }
- if (this.checkTotalPVC()) {
- return;
- }
- if (this.checkcurPVC()){
- return;
- }
- if (this.checkTotalVlan()) {
- return;
- }
- var selected = this.get("activeItem");
- if (!selected) {
- return;
- }
- if (!Atp.WanController.activeItem) {
- return;
- }
- var tr069serverlist = Atp.WanController.activeItem.get("ServiceList").indexOf("TR069");
- var otherserverlist = Atp.WanController.activeItem.get("ServiceList").indexOf("IPTV");
- var voiceserverlist = Atp.WanController.activeItem.get("ServiceList").indexOf("VOICE");
- var internetserverlist = Atp.WanController.activeItem.get("ServiceList").indexOf("INTERNET");
- var connType = Atp.WanController.activeItem.get("ConnectionType");
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.ServiceList";
- if ((-1 != otherserverlist)
- && ((-1 != tr069serverlist) || (-1 != internetserverlist)
- || (-1 != voiceserverlist)
- )) {
- errStruct.errId = "wan.ServiceList_err";
- }
- if ("" != errStruct.errId) {
- utilErrStructPush(Atp.WanController, errStruct);
- }
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.ConnectionType";
- this.build_server_err(errStruct, tr069serverlist, voiceserverlist,connType);
- if ("" != errStruct.errId) {
- utilErrStructPush(Atp.WanController, errStruct);
- }
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.DslSupportRate";
- Em.Logger.log("AtmQoS:"+Atp.LinkController.activeItem.get("AtmQoS"));
- if(("VBR-nrt" == Atp.LinkController.activeItem.get("AtmQoS")) || ("VBR-rt" == Atp.LinkController.activeItem.get("AtmQoS")))
- {
- Em.Logger.log("AtmQoS check come in");
- Em.Logger.log("SupportRate:"+Atp.LinkController.activeItem.get("SupportRate"));
- Em.Logger.log("PeakRate:"+Atp.LinkController.activeItem.get("PeakRate"));
- if (parseInt(Atp.LinkController.activeItem.get("SupportRate")) > parseInt(Atp.LinkController.activeItem.get("PeakRate")))
- {
- errStruct.errId = "wan.DslSupportRate_err";
- }
- }
- if ("" != errStruct.errId) {
- utilErrStructPush(Atp.WanController, errStruct);
- }
- Em.Logger.log("tr069:"+ tr069serverlist + ", other:" + otherserverlist + ", internet:" + internetserverlist);
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.ConnectionType";
- var sameLink;
- sameLink = Atp.LinkController.getSameLink(selected);
- var offSet = 0;
- if ("" == selected.get("ID")) {
- if (!sameLink) {
- return;
- }
- } else if (!sameLink) {
- sameLink = selected;
- offSet = 1;
- }
- this.build_link_err(errStruct, sameLink, connType, offSet);
- if ("" != errStruct.errId) {
- utilErrStructPush(Atp.WanController, errStruct);
- }
- },
- newLink: function (AccessType) {
- if (this.newItem) {
- this.newItem.set("AccessType", AccessType);
- this.set("activeItem", this.newItem);
- return;
- }
- var linkData = {
- "ID": "",
- "Name": "NewLink",
- "AccessType": AccessType,
- "LowerLayer": "",
- "PVC": "PVC:8/35",
- "LinkType": "EoA",
- "EncapMode": "LLC",
- "AtmQoS": "UBR",
- "PeakRate": 0,
- "SupportRate": 0,
- "MaxBurstRate": 0,
- "VLANEnable": false,
- "VLANId": "",
- "VLAN1p": ""
- };
- var link = Atp.Link.create(linkData);
- this.pushObject(link);
- this.set("newItem", link);
- this.set("activeItem", link);
- },
- createNewLink: function(wanID) {
- var link = Atp.Link.create();
- link.set("ID", wanID);
- this.pushObject(link);
- return link;
- }
- });
- Atp.VlanCheckBoxView = Em.View.extend({
- classNames: 'control-group width_100p',
- controllerBinding: 'parentView.controller',
- labelID:'',
- vlanresid:'',
- vlanresip:'',
- isIptv:false,
- elementId:function(){
- return this.get("labelID").replace(/\./g,'_') + this.get("vlanresid") +'vlan';
- }.property(),
- labelinfoID:function(){
- return this.get("elementId")+"_labelinfo";
- }.property(),
- labelText: function(){
- return Em.I18n.t(this.labelID);
- }.property('labelID'),
- checkBoxCtrlId: function() {
- return this.get("elementId") + "_ctrl_checkbox";
- }.property(),
- change:function(){
- var vlanid = 1;
- var vlan1p = 0;
- var vlanebale = true;
- if(this.get("isIptv")){
- vlanid = Atp.IPTVController.content.get("VLANId");
- vlan1p = Atp.IPTVController.content.get("VLAN1p");
- vlanebale = Atp.IPTVController.content.get("VLANEnable");
- }else{
- if(null != Atp.LinkController.activeItem){
- vlanid = Atp.LinkController.activeItem.get("VLANId");
- vlan1p = Atp.LinkController.activeItem.get("VLAN1p");
- vlanebale = Atp.LinkController.activeItem.get("VLANEnable");
- }
- }
- if(vlanebale == false){
- var vlanreg=/^[0-9]+$/;
- var illegalflag = false;
- if(!vlanreg.test(vlanid)){
- utilErrStructRemove(this.get("controller"),this.get("vlanresid"));
- illegalflag = true;
- }else if(parseInt(vlanid) < 0 || parseInt(vlanid) > 4094){
- utilErrStructRemove(this.get("controller"),this.get("vlanresid"));
- illegalflag = true;
- }
- if(illegalflag == true){
- if(this.get("isIptv")){
- Atp.IPTVController.content.set("VLANId",Atp.IPTVController.content.get("VLANId_temp"));
- }else{
- Atp.LinkController.activeItem.set("VLANId",Atp.LinkController.activeItem.get("VLANId_temp"));
- }
- }
- var vlan1preg=/^[0-9]+$/;
- illegalflag = false;
- if(!vlan1preg.test(vlan1p)){
- utilErrStructRemove(this.get("controller"),this.get("vlanresip"));
- illegalflag = true;
- }else if(parseInt(vlan1p) < 0 || parseInt(vlan1p) > 7){
- utilErrStructRemove(this.get("controller"),this.get("vlanresip"));
- illegalflag = true;
- }
- if(illegalflag == true){
- if(this.get("isIptv")){
- Atp.IPTVController.content.set("VLANId",Atp.IPTVController.content.get("VLAN1p_temp"));
- }else{
- Atp.LinkController.activeItem.set("VLAN1p",Atp.LinkController.activeItem.get("VLAN1p_temp"));
- }
- }
- }
- },
- template: Em.Handlebars.compile(' \
- <label {{bindAttr id="view.labelinfoID"}} class="control-label third_menu_below_config_font"> \
- {{view.labelText}}: \
- </label> \
- <div class="controls paddingtop_12"> \
- {{view Atp.Checkbox elementIdBinding="view.checkBoxCtrlId" valueBinding="view.value"}} \
- </div>\
- ')
- })
- Atp.LinkView = Em.View.extend({
- contentBinding: 'parentView.link',
- controller: Atp.WanController,
- elementId: function() {
- return this.get('parentView').get('elementId') + "_link_edit";
- }.property(),
- template: Em.Handlebars.compile(
- '{{#if view.content.isAtmMode }} \
- {{ view Atp.PVCField labelID="wan.PVC" valueBinding="view.content.PVC" }} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.LinkType" controllerBinding="Atp.DslLinkTypeController" valueBinding="view.content.LinkTypeSelected"}} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.AtmQoS" controllerBinding="Atp.DslAtmQoSController" valueBinding="view.content.AtmQoSSelected"}} \
- {{#if view.content.needAtmQoS}} \
- {{ view Atp.LabelView labelID="wan.DslPeakRate" rule="integer" valueBinding="view.content.PeakRate" }} \
- {{#if view.content.needAllAtmQos}} \
- {{ view Atp.LabelView labelID="wan.DslSupportRate" rule="integer" valueBinding="view.content.SupportRate" }} \
- {{ view Atp.LabelView labelID="wan.DslMaxBurstRate" rule="integer" valueBinding="view.content.MaxBurstRate" }} \
- {{/if}} \
- {{/if}} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.EncapMode" controllerBinding="Atp.DslEncapModeController" valueBinding="view.content.EncapModeSelected"}} \
- {{/if}} \
- {{view Atp.VlanCheckBoxView labelID="wan.VLANEnable" valueBinding="view.content.VLANEnable" vlanresip="wan_internal_edit_view_link_edit_wan_VLAN1p" vlanresid="wan_internal_edit_view_link_edit_wan_VLANId"}} \
- {{#if view.content.VLANEnable}} \
- {{ view Atp.LabelView labelID="wan.VLANId" rule="integer||range[0~4094]" valueBinding="view.content.VLANId" }} \
- {{ view Atp.LabelView labelID="wan.VLAN1p" rule="integer||range[0~7]" valueBinding="view.content.VLAN1p" }} \
- {{/if}}')
- });
- var wanpppusernamerule = "";
- var wanppppasswordrule = "";
- function isChineseCharacter(str)
- {
- var reg = /[\u4E00-\u9FA5]|[\uFE30-\uFFA0]/gi;
- if (reg.test(str))
- return true;
- else
- return false;
- }
- Atp.WanModalController = Atp.ModalController.create ({
- header: Em.I18n.t("Menu.tipheader"),
- body: Em.I18n.t("Menu.tipbody")
- });
- Atp.WanController = Atp.MultiObjController.create({
- modelClass: Atp.Wan,
- objName: 'ntwk/wan',
- submittocontinue:false,
- isAutoRefresh:true,
- isEditing:false,
- contentType:"application/json;charset=UTF-8;enp",
- getCurInternetWan: function() {
- var curWanType = Atp.WanController.get("curWan");
- if ("UMTS" == curWanType) {
- curWan = Atp.WanController.get("umtsWan");
- this.set("isCable", false);
- } else {
- curWan = Atp.WanController.getDefaultWan();
- this.set("isCable", true);
- }
- if ("" == curWanType) {
- curWan = null;
- }
- return curWan;
- },
- showpwdtip: function() {
- return (this.content.length < MAX_TOTAL_WAN);
- }.property('content.length'),
- umtsWan: function() {
- var wan = null;
- this.content.forEach(function (item){
- if ("UMTS" == item.get("AccessType")) {
- wan = item;
- }
- });
- return wan;
- }.property("content.@each.AccessType"),
- getWanByID: function(ID) {
- var wan = null;
- this.content.forEach(function (item){
- if (ID == item.get("ID")) {
- wan = item;
- }
- });
- return wan;
- },
- getInternetWanCnt: function() {
- var cnt = 0;
- this.content.forEach(function (item) {
- if (item.get("IsDefault")) {
- if ("UMTS" != item.get("AccessType")) {
- cnt = cnt + 1;
- }
- }
- });
- return cnt;
- },
- getDefaultWan: function() {
- var dsl = null;
- var vdsl = null;
- var eth = null;
- this.content.forEach(function (item) {
- if (item.get("IsDefault")) {
- if ("DSL" == item.get("AccessType")) {
- dsl = item;
- } else if ("VDSL" == item.get("AccessType")) {
- vdsl = item;
- } else if ("Ethernet" == item.get("AccessType")) {
- eth = item;
- }
- }
- });
- if (dsl && dsl.get("connected")) {
- return dsl;
- }
- if (vdsl && vdsl.get("connected")) {
- return vdsl;
- }
- if (eth && eth.get("connected")) {
- return eth;
- }
- if (dsl && ("Down" != dsl.get("AccessStatus"))) {
- return dsl;
- }
- if (vdsl && ("Down" != vdsl.get("AccessStatus"))) {
- return vdsl;
- }
- if (eth && ("Down" != eth.get("AccessStatus"))) {
- return eth;
- }
- if (dsl) {
- return dsl;
- }
- if (vdsl) {
- return vdsl;
- }
- return eth;
- },
- curWan: "",
- checkBridgeNum: function() {
- },
- checkUsername: function(value) {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.Username";
- errStruct.errId = "wan.Username_err";
- errStruct['delete'] = false;
- if(wanpppusernamerule == ""){
- if(value.length > 64)
- {
- return errStruct;
- }
- }
- else{
- var re = eval(wanpppusernamerule);
- if(!re.exec(value)){
- return errStruct;
- }
- }
- return null;
- },
- checkPassword: function(value) {
- return callback_check_ppp_password_value(value);
- },
- checkAlias:function(isMoreWan) {
- if (!isMoreWan) {
- return;
- }
- var alias = Atp.WanController.activeItem.get("Alias");
- if (!alias)
- {
- return;
- }
- alias = alias.replace(/(^\s*)|(\s*$)/g, "");
- if ("" == alias)
- {
- return;
- }
- Atp.WanController.activeItem.set("Alias", alias);
- var passed = true;
- Atp.WanController.content.forEach(function(item) {
- if (item != Atp.WanController.activeItem) {
- if (item.get("Alias") == alias) {
- passed = false;
- }
- }
- });
- if (passed) {
- return;
- }
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.Alias";
- errStruct.errId = "Menu.dup_err";
- utilErrStructPush(Atp.WanController, errStruct);
- },
- checkProc: function(isMoreWan) {
- if((Atp.WanController.activeItem.get("AccessType") != "UMTS") && (Atp.WanController.activeItem.get("ConnectionType") == "PPP_Routed"))
- {
- if(Atp.WanController.activeItem.get("Username") == "")
- return this.createErrStruct('wan.Username_notinit_err', 'wan_Username');
- if(Atp.WanController.activeItem.get("Password") == "")
- return this.createErrStruct('wan.Password_notinit_err', 'wan_Password');
- }
- password_focusout_proc();
- utilRemoveErrors(Atp.WanController);
- utilRemoveErrors(Atp.LinkController);
- utilErrInfoUpdate(this);
- Atp.LinkController.checkConnType(Atp.WanController.activeItem.get("ConnectionType"));
- this.checkAlias(isMoreWan);
- var errStruct = callback_check_mss_value(Atp.WanController.activeItem.get("MSS"));
- if (errStruct) {
- errStruct['delete'] = true;
- utilErrStructPush(Atp.WanController, errStruct);
- }
- var conntype = Atp.WanController.activeItem.get("ConnectionType");
- if (isChineseCharacter(Atp.WanController.activeItem.get("Username"))) {
- return this.createErrStruct('menu.ChineseErr', 'wan_Username');
- }
- if("PPP_Routed" == conntype || "DHCP_Spoofed" == conntype)
- {
- var errStruct = this.checkUsername(Atp.WanController.activeItem.get("Username"));
- if(errStruct){
- errStruct['delete'] = true;
- utilErrStructPush(Atp.WanController, errStruct);
- }
- errStruct = this.checkPassword(Atp.WanController.activeItem.get("Password"));
- if(errStruct){
- errStruct['delete'] = true;
- utilErrStructPush(Atp.WanController, errStruct);
- }
- }
- var enable = Atp.WanController.activeItem.get("MACColoneEnable");
- if ((!isMoreWan) && (enable)) {
- var errStruct = callback_check_macclone_value(Atp.WanController.activeItem.get("MACColone"));
- if (errStruct) {
- errStruct['delete'] = true;
- utilErrStructPush(Atp.WanController, errStruct);
- }
- }
- if("PPP_Routed" != conntype)
- {
- var dhcpmode = Atp.WanController.activeItem.get("IPv4AddrType");
- if ("Static" == dhcpmode && "IPv6" !== Atp.WanController.activeItem.get("IPVer"))
- {
- var errStruct = callback_check_ipv4static_value(Atp.WanController.activeItem);
- if (errStruct) {
- errStruct['delete'] = true;
- utilErrStructPush(Atp.WanController, errStruct);
- }
- }
- }
- if (("IPoA" == Atp.LinkController.activeItem.get("LinkType")) && ("PPP_Routed" == Atp.WanController.activeItem.get("ConnectionType"))) {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.LinkType";
- errStruct.errId = "wan.ipoa_err";
- errStruct['delete'] = true;
- utilErrStructPush(Atp.WanController, errStruct);
- }
- if ("IP_Routed" == Atp.WanController.activeItem.get("ConnectionType")) {
- if (("IPoA" == Atp.LinkController.activeItem.get("LinkType")) && ("DHCP" == Atp.WanController.activeItem.get("IPv4AddrType"))) {
- var errStruct = utilCreateDftErrStruct();
- errStruct.resId = "wan.IPv4AddrType";
- errStruct.errId = "wan.IPoA_DHCP_err";
- errStruct['delete'] = true;
- utilErrStructPush(Atp.WanController, errStruct);
- }
- }
- errStruct = utilCreateDftErrStruct();
- errStruct['delete'] = true;
- if ((-1 == this.activeItem.get("ServiceList").indexOf("INTERNET")) &&
- (-1 == this.activeItem.get("ServiceList").indexOf("IPTV")) &&
- this.activeItem.get("needPPP") &&
- ("OnDemand" == this.activeItem.get("PPPTrigger"))) {
- errStruct.resId = "wan.ServiceList";
- errStruct.errId = "wan.ondemand_err";
- }
- if ("" != errStruct.resId) {
- utilErrStructPush(Atp.WanController, errStruct);
- }
- if (isMoreWan) {
- this.checkBridgeNum();
- }
- Atp.LinkController.checkProc(isMoreWan);
- utilErrInfoUpdate(this);
- },
- dslWan: function() {
- var dsl = null;
- this.content.forEach(function (item){
- if ("DSL" == item.get("AccessType")) {
- dsl = item;
- }
- });
- return dsl;
- }.property(),
- createDefaultObj: function () {
- if (Atp.WanController.content.length >= MAX_TOTAL_WAN) {
- return null;
- }
- if (Atp.WanController.content.length >= MAX_TOTAL_WAN - 1)
- {
- this.set("showpwdtip", false);
- }
- else
- {
- this.set("showpwdtip", true);
- }
- if (this.newItem) {
- this.set("activeItem", this.newItem);
- Atp.LinkController.newLink(this.newItem.get("AccessType"));
- return this.newItem;
- }
- var wanData = {
- "ID": "",
- "Name": Em.I18n.t("wan.NewItemName"),
- "Enable": true,
- "AccessType": Atp.AccessTypeController.values[0],
- "ConnectionType": Atp.ConnectionTypeController.values[0],
- "LowerLayer": "",
- "Username": "",
- "Password": "",
- "NetType": Atp.UMTSNetTypeController.values[0],
- "APN": "123",
- "DialNum": "*99#",
- "ServiceList": "INTERNET",
- "MTU": 1500,
- "MRU": 1492,
- "MSS": 0,
- "MACColoneEnable": false,
- "MACColone": "",
- "NATType": Atp.NatTypeController.values[0],
- "PPPAuthMode": Atp.PPPAuthModeController.values[0],
- "PPPTrigger": Atp.PPPDialModeController.values[0],
- "PPPIdletime": 300,
- "PPPoEServiceName": '',
- "IPv4Enable": true,
- "IPv4AddrType": Atp.IPv4AddrTypeController.values[0],
- "IPv4Addr": "",
- "IPv4Mask": "",
- "IPv4Gateway": "",
- "IPv4DnsServers": "",
- "IPv6Enable": true,
- "IPv6AddrType": 'SLAAC',
- "IPv6Addr": "",
- "IPv6AddrPrefixLen": 64,
- "IPv6Gateway": "",
- "IPv6DnsServers": "",
- "DNSOverrideAllowed": false,
- "IsDefault": false
- };
- Atp.LinkController.newLink(wanData.AccessType);
- var wan = Atp.Wan.create(wanData);
- return wan;
- },
- click_proc: function() {
- Em.Logger.log("click_proc....");
- var self = this;
- if (self.get("submittocontinue") == false)
- {
- this.deleteItem();
- }
- else
- {
- this.submitItem();
- }
- self.set("submittocontinue", false);
- Atp.WanController.set("isAutoRefresh",true);
- },
- modal_cancel: function() {
- Em.Logger.log("modal_cancel....");
- this.set("submittocontinue", false);
- if(Atp.WanController.get("isEditing")){
- Atp.WanController.set("isAutoRefresh",false);
- }else{
- Atp.WanController.set("isAutoRefresh",true);
- }
- },
- deleteItem: function(evt) {
- Em.Logger.log("deleteItem wan.....");
- Atp.WanController.set("isAutoRefresh",false);
- if (false == this.get("showpwdtip"))
- {
- this.set("showpwdtip", true);
- }
- if (evt) {
- var wan = evt.view.get("content");
- this.set("activeItem", wan);
- }
- if (this.get("newItem") == this.get("activeItem")) {
- if (Em.View.views.wan_container) {
- Em.View.views.wan_container.delete_new_wan();
- return;
- }
- }
- if (evt) {
- var self = this;
- var body = Em.I18n.t("wan.confirmdelete");
- Atp.WanModalController.set('body', body);
- Atp.WanModalController.set('controller', self);
- Atp.WanModalController.show();
- return;
- }
- this._super(false, function() {
- utilStopSubmitDialog();
- reloadWanData();
- });
- },
- dialupUmts: function() {
- this.set("activeItem", this.get("umtsWan"));
- this.dialup();
- },
- detectWanStatus: function(curWan) {
- Atp.WanController.load(function() {
- var wanObj = Atp.WanController.getWanByID(curWan);
- if (wanObj && (!wanObj.get("isDialButtonDisabled"))) {
- if (wanObj.get("IPv6Enable")) {
- setTimeout(function () {
- Atp.WanController.delayedReloadData();
- }, 3000);
- } else {
- Atp.WanController.delayedReloadData();
- }
- return;
- }
- var retryCnt = Atp.WanController.get("dialDetectCnt");
- retryCnt = retryCnt + 1;
- if (retryCnt >= 10) {
- Atp.WanController.delayedReloadData();
- return;
- }
- Atp.WanController.set("dialDetectCnt", retryCnt);
- setTimeout(function () {
- Atp.WanController.detectWanStatus(curWan);
- }, 2000);
- });
- },
- delayedReloadData: function() {
- utilStopSubmitDialog();
- if (!(typeof(pageload) == "undefined")) {
- pageload();
- } else if (reloadWanData) {
- reloadWanData();
- }
- },
- dialup: function(evt) {
- Em.Logger.log("dialup.....")
- if (evt) {
- this.set("activeItem", evt.view.get("content"));
- }
- if (!this.get("activeItem")) {
- return;
- }
- Atp.WanController.set("isAutoRefresh",false);
- var content = {};
- content["Path"] = this.get("activeItem").get("ID");
- var trigger = 2;
- if (this.get("activeItem").get("showDisconnect")) {
- trigger = 1;
- }
- content["Trigger"] = trigger;
- var csrf_obj = utilGetCsrf();
- var post_data = {
- "csrf": csrf_obj,
- "action": "trigger",
- "data": utilGetJson(Em.Object.create(content))
- };
- utilStartSubmitDialog();
- if(typeof post_data["data"]["Password"] != "undefined"){
- post_data["data"]["Password"] = this.enc(post_data["data"]["Password"]);
- }
- var self = this;
- this.post($.toJSON(post_data), function (result) {
- if (1 == trigger) {
- setTimeout(function () {
- Atp.WanController.delayedReloadData();
- }, 2000);
- } else {
- Atp.WanController.set("dialDetectCnt", 0);
- var detectDelay = 2000;
- if ("UMTS" == self.get("activeItem").get("AccessType")) {
- detectDelay = 4000;
- }
- setTimeout(function () {
- Atp.WanController.detectWanStatus(content["Path"]);
- }, detectDelay);
- }
- Atp.WanController.set("isAutoRefresh",true);
- });
- },
- syncVlanParamsForDftWan: function() {
- var activeLink = Atp.LinkController.get("activeItem");
- if (!activeLink) {
- return;
- }
- this.content.forEach(function(item) {
- if (item.get("IsDefault")
- && item.get('linkLayer')
- && ("UMTS" != item.get("AccessType"))) {
- item.get("linkLayer").syncVlanParams(activeLink);
- }
- });
- },
- submitDftWan: function(haslink, callback) {
- var csrf_obj = utilGetCsrf();
- var jsonData = this.createSubmitData();
- if (haslink) {
- var linkData = Atp.LinkController.createSubmitData();
- jsonData.linkdata = linkData;
- }
- var post_data = {
- "csrf": csrf_obj,
- "action": "update",
- "data": jsonData
- };
- post_data.data.EncodeUsername = true;
- post_data.data.Username = encodeURIComponent(post_data.data.Username);
- if(typeof post_data["data"]["Password"] != "undefined"){
- post_data["data"]["Password"] = this.enc(post_data["data"]["Password"]);
- }
- post_data.data.EncodePPPoEServiceName = true;
- post_data.data.PPPoEServiceName = encodeURIComponent(post_data.data.PPPoEServiceName);
- var self = this;
- this.post($.toJSON(post_data), function (result) {
- if(callback){
- callback(result);
- }
- });
- },
- submitItemWan: function(evt) {
- Em.Logger.log("submitItemWan wan.....");
- this.set("activeItem", evt.view.get("content"));
- this.submitItem();
- },
- submitWanConnection: function(callback){
- Em.Logger.log("submitWanConnection proc....");
- var self = this;
- var csrf_obj = utilGetCsrf();
- var action = "update";
- if (self.activeItem.get("ID") == "") {
- action = "create";
- }
- var linkData = Atp.LinkController.createSubmitData();
- var jsonData = utilGetJson(self.get("activeItem"));
- jsonData.linkdata = linkData;
- var post_data = {
- "csrf": csrf_obj,
- "action": action,
- "data": jsonData
- };
- post_data.data.EncodeUsername = true;
- post_data.data.Username = encodeURIComponent(post_data.data.Username);
- if(typeof post_data["data"]["Password"] != "undefined"){
- post_data["data"]["Password"] = this.enc(post_data["data"]["Password"]);
- }
- post_data.data.EncodePPPoEServiceName = true;
- post_data.data.PPPoEServiceName = encodeURIComponent(post_data.data.PPPoEServiceName);
- self.post($.toJSON(post_data), function (result) {
- if (0 != result.errcode) {
- utilStopSubmitDialog();
- utilMarkErrorFields(self, result);
- bRefresh = false;
- return;
- }
- if (callback && (Em.typeOf(callback) === 'function')) {
- callback(result, self);
- } else {
- self.set("saved", true);
- self.set("show", false);
- self.set("curLine", null);
- reloadWanData();
- utilStopSubmitDialog();
- }
- });
- },
- submitItem: function(callback) {
- Em.Logger.log("submitItem proc....");
- var link = this.activeItem.get("linkLayer");
- Atp.LinkController.set("activeItem", link);
- this.checkProc(true);
- if (this.showError()) {
- return;
- }
- var self = this;
- if ((self.activeItem.get("ID") != "") && (self.activeItem.get("originConnectionType") != self.activeItem.get("ConnectionType"))
- && (self.get("submittocontinue") == false)) {
- Em.Logger.log("ConnectionType changed.");
- var body = Em.I18n.t("wan.confirmsubmit");
- Atp.WanModalController.set('body', body);
- Atp.WanModalController.set('controller', self);
- Atp.WanModalController.show();
- self.set("submittocontinue", true);
- return;
- }
- utilStartSubmitDialog();
- if ("UMTS" == self.activeItem.get("AccessType")) {
- Atp.WanbackupController.postMoreWan(function(){
- self.submitWanConnection(callback);
- });
- return;
- }
- this.submitWanConnection(callback);
- },
- cancel: function(evt) {
- Em.Logger.log("cancel proc....");
- if (evt && evt.view) {
- if (Em.View.views.wan_container) {
- Em.View.views.wan_container.hide_edit_view(evt.view.get("content"));
- this.set('activeItem', null);
- }
- }
- if (Atp.WanDetectController) {
- Atp.WanDetectController.cancel();
- }
- Atp.WanController.set("isAutoRefresh",true);
- },
- pppReset: function(evt){
- Em.Logger.log("pppReset.....");
- if (evt) {
- this.set("activeItem", evt.view.get("content"));
- }
- if (!this.get("activeItem")) {
- return;
- }
- Atp.WanController.set("isAutoRefresh",false);
- var content = {};
- content["ID"] = this.get("activeItem").get("ID");
- var csrf_obj = utilGetCsrf();
- var post_data = {
- "csrf": csrf_obj,
- "action": "pppreset",
- "data": utilGetJson(Em.Object.create(content))
- };
- if(typeof post_data["data"]["Password"] != "undefined"){
- post_data["data"]["Password"] = this.enc(post_data["data"]["Password"]);
- }
- utilStartSubmitDialog();
- var self = this;
- this.post($.toJSON(post_data), function (result) {
- setTimeout(function () {
- Atp.WanController.delayedReloadData();
- Atp.WanController.set("isAutoRefresh",true);
- }, 2000);
- });
- },
- changectrl: function(evt) {
- Em.Logger.log("changectrl wan.....");
- Atp.WanController.content.forEach(function(item) {
- if (Em.View.views.wan_container) {
- Em.View.views.wan_container.hide_edit_view(item);
- }
- });
- var wan = evt.view.get("content");
- if (this.get('activeItem') == wan) {
- this.set('activeItem', null);
- return;
- }
- this.set("activeItem", wan);
- Atp.LinkController.set("activeItem", wan.get("linkLayer"));
- if (Em.View.views.wan_container) {
- Em.View.views.wan_container.show_edit_view(wan);
- }
- }
- });
- Atp.WANTblView = Atp.TableView.extend({
- controller: Atp.WanController,
- DataView: Em.View.extend({
- template: Em.Handlebars.compile(
- '{{view Atp.CheckCtrl labelBinding="content.Name"}}')
- })
- });
- Atp.ServiceListField = Atp.CommaStrField.extend({
- sep: '_',
- data: ["INTERNET"
- ,"TR069"
- ,"VOICE"
- ,"IPTV"
- ],
- updateValue: function(newValue) {
- var childViews = this.get('childViews');
- var listView = childViews[0];
- listView.updateValue(newValue);
- }
- });
- Atp.WanSubmitCtrl = Atp.SubmitCtrl.extend({
- contentBinding: 'parentView.content',
- template: Em.Handlebars.compile('\
- <button class="atp_button" id="wan_submit_cancel" {{action "cancel" target="view.controller"}}>{{t Menu.Cancel}}</button> \
- <button class="atp_button fontweight_thick" id="wan_submit_item" {{action "submitItemWan" target="view.controller"}}>{{t Menu.Submit}}</button>')
- });
- Atp.WANViewInternal = Em.View.extend({
- contentBinding: 'parentView.content',
- linkBinding: 'parentView.link',
- controller: Atp.WanController,
- classNames: 'wanedit width_100p',
- elementId: 'wan_internal_edit_view',
- editViewId: function() {
- var controller = this.get("controller");
- if (controller){
- controller.set("editViewId", this.get('elementId'));
- }
- return this.get('elementId');
- }.property(),
- change: function () {
- var curWan = this.get("content");
- this.controller.set("activeItem", curWan);
- if (Atp.LinkController) {
- Atp.LinkController.set("activeItem", curWan.get("linkLayer"));
- curWan.get("linkLayer").set("AccessType", curWan.get("AccessType"));
- }
- Em.Logger.log("WAN parameters view changed.");
- },
- connTypeChanged: function () {
- if (Atp.WanController) {
- WanConnTypeChangeProc(Atp.WanController.activeItem);
- }
- }.observes("Atp.WanController.activeItem.ConnectionType"),
- template: Em.Handlebars.compile('{{view Atp.SuccessView}} \
- <div class="form-horizontal paddingleft_87"> \
- <p><span class="fontweight_thick">{{t wan.basic.title}}</span></p> \
- {{ view Atp.LabelView textType="checkbox" labelID="wan.Enable" valueBinding="view.content.Enable" }} \
- {{ view Atp.LabelView labelID="wan.Alias" maxlen="64" valueBinding="view.content.Alias" }} \
- {{ view Atp.ServiceListField labelID="wan.ServiceList" valueBinding="view.content.ServiceList" }} \
- {{#if view.content.showLinkAccess}} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.AccessType" controllerBinding="Atp.AccessTypeController" valueBinding="view.content.AccessTypeSelected" }} \
- {{/if}} \
- {{#if view.content.notDatacardMode}} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.ConnectionType" controllerBinding="Atp.ConnectionTypeController" valueBinding="view.content.ConnectionTypeSelected" }} \
- {{#if view.content.isRouted}} \
- {{#if view.content.needPPP}} \
- {{ view Atp.LabelView labelID="wan.MRU" valueBinding="view.content.MRU" }} \
- {{else}} \
- {{ view Atp.LabelView labelID="wan.MTU" valueBinding="view.content.MTU" }} \
- {{/if}} \
- {{ view Atp.LabelView labelID="wan.MSS" rule="callback_MSS" valueBinding="view.content.MSS" }} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.NATType" controllerBinding="Atp.NatTypeController" valueBinding="view.content.NATTypeSelected"}} \
- {{/if}} \
- <p><span class="fontweight_thick">{{t wan.link.title}}</span></p> \
- {{view Atp.LinkView}} \
- {{else}} \
- {{view Atp.WanbackupView}} \
- {{/if}} \
- {{#if view.content.needPPP}} \
- <p><span class="fontweight_thick">{{t wan.ppp.title}}</span></p> \
- {{#if view.content.notDatacardMode}} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.PPPAuthMode" controllerBinding="Atp.PPPAuthModeController" valueBinding="view.content.PPPAuthModeSelected"}} \
- {{/if}} \
- <div class="control-group"> \
- <label class="control-label third_menu_below_config_font">\
- {{t wan.PPPTrigger}}: \
- </label> \
- <div class="controls">\
- {{ view Atp.wanPPPTriggerRadioButton kind="wanppp" titleID="wan.PPPTrigger_AlwaysOn" option="AlwaysOn" valueBinding="view.content.PPPTrigger"}} \
- {{ view Atp.wanPPPTriggerRadioButton kind="wanppp" titleID="wan.PPPTrigger_Manual" option="Manual" valueBinding="view.content.PPPTrigger"}} \
- {{#if view.content.notDhcpSpoof}} \
- {{ view Atp.wanPPPTriggerRadioButton kind="wanppp" titleID="wan.PPPTrigger_OnDemand" option="OnDemand" valueBinding="view.content.PPPTrigger"}} \
- {{/if}} \
- </div>\
- </div>\
- {{#if view.content.isPPPOnDemand}} \
- {{view Atp.LabelView textType="selectbox" labelID="wan.PPPIdletime" controllerBinding="Atp.AutoDisconnectTimeController"}}\
- {{#if Atp.AutoDisconnectTimeController.isSelectedOther }} \
- {{ view Atp.LabelView labelID="wan.PPPIdletimeOther" rule="integer||range[30~31536000]" valueBinding="view.content.PPPIdletime" }} \
- {{/if}} \
- {{/if}} \
- {{ view Atp.LabelView labelID="wan.Username" maxlen="64" valueBinding="view.content.Username" }} \
- {{ view Atp.LabelView labelID="wan.Password" rule="callback_Password" passwordEnable="true" valueBinding="view.content.Password" }} \
- {{#if view.content.isPPPoA}} \
- {{else}} \
- {{ view Atp.LabelView labelID="wan.PPPoEServiceName" maxlen="256" valueBinding="view.content.PPPoEServiceName"}} \
- {{/if}} \
- {{#if view.content.isDatacardMode}} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.NetType" controllerBinding="Atp.UMTSNetTypeController" valueBinding="view.content.NetTypeSelected"}} \
- {{ view Atp.LabelView labelID="wan.APN" maxlen="32" rule="callback_APN" valueBinding="view.content.APN" }} \
- {{ view Atp.LabelView labelID="wan.DialNum" maxlen="32" rule="callback_DialNum" valueBinding="view.content.DialNum" }} \
- {{/if}} \
- {{/if}} \
- {{#if view.content.isRouted}} \
- <p><span class="fontweight_thick">{{t wan.ip.title}}</span></p>\
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.IPVer" controllerBinding="Atp.IPVersionController" valueBinding="view.content.IPVerSelected" }} \
- {{/if}}\
- {{#if view.content.needIPv4AddrType}} \
- \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.IPv4AddrType" controllerBinding="Atp.IPv4AddrTypeController" valueBinding="view.content.IPv4AddrTypeSelected"}} \
- {{#if view.content.isStaticIPv4}} \
- {{ view Atp.IPAddrField labelID="wan.IPv4Addr" valueBinding="view.content.IPv4Addr" }} \
- {{ view Atp.IPAddrField labelID="wan.IPv4Mask" valueBinding="view.content.IPv4Mask" }} \
- {{ view Atp.IPAddrField labelID="wan.IPv4Gateway" valueBinding="view.content.IPv4Gateway" }} \
- {{else}} \
- {{/if}} \
- {{/if}} \
- {{#if view.content.needDns}} \
- {{#if view.content.isStaticIPv4}} \
- {{ view Atp.IPAddrField labelID="wan.IPv4PriDns" valueBinding="view.content.IPv4PriDns" }} \
- {{ view Atp.IPAddrField labelID="wan.IPv4SecDns" valueBinding="view.content.IPv4SecDns" }} \
- {{else}} \
- {{ view Atp.LabelView textType="checkbox" labelID="wan.DNSOverrideAllowed" valueBinding="view.content.DNSOverrideAllowed" }} \
- {{#if view.content.DNSOverrideAllowed}} \
- {{ view Atp.IPAddrField labelID="wan.IPv4PriDns" valueBinding="view.content.IPv4PriDns" }} \
- {{ view Atp.IPAddrField labelID="wan.IPv4SecDns" valueBinding="view.content.IPv4SecDns" }} \
- {{/if}} \
- {{/if}} \
- {{/if}} \
- {{#if view.content.needIPv6AddrType}} \
- {{ view Atp.LabelView textType="selectboxSep" labelID="wan.IPv6AddrType" controllerBinding="Atp.IPv6AddrTypeController" valueBinding="view.content.IPv6AddrTypeSelected" }} \
- {{#if view.content.isStaticIPv6}} \
- {{ view Atp.IPv6AddrField labelID="wan.IPv6Addr" valueBinding="view.content.IPv6AddrSet" lenBinding="view.content.IPv6AddrPrefixLen" controllerBinding="view.controller" }} \
- {{ view Atp.LabelView labelID="wan.IPv6Gateway" valueBinding="view.content.IPv6Gateway" }} \
- {{ view Atp.LabelView labelID="wan.IPv6PriDns" valueBinding="view.content.IPv6PriDns" }} \
- {{ view Atp.LabelView labelID="wan.IPv6SecDns" valueBinding="view.content.IPv6SecDns" }} \
- {{/if}} \
- {{/if}} \
- {{ view Atp.WanSubmitCtrl}}<br> \
- </div><br>')
- });
- Atp.WANViewInternal2 = Em.View.extend({
- contentBinding: 'parentView.content',
- linkBinding: 'parentView.link',
- controller: Atp.WanController,
- classNames: 'wanedit width_100p',
- elementId: 'wan_internal_edit_view',
- editViewId: function() {
- var controller = this.get("controller");
- if (controller){
- controller.set("editViewId", this.get('elementId'));
- }
- return this.get('elementId');
- }.property(),
- change: function () {
- var curWan = this.get("content");
- this.controller.set("activeItem", curWan);
- if (Atp.LinkController) {
- Atp.LinkController.set("activeItem", curWan.get("linkLayer"));
- curWan.get("linkLayer").set("AccessType", curWan.get("AccessType"));
- }
- Em.Logger.log("WAN parameters view changed.");
- },
- connTypeChanged: function () {
- if (Atp.WanController) {
- WanConnTypeChangeProc(Atp.WanController.activeItem);
- }
- }.observes("Atp.WanController.activeItem.ConnectionType"),
- template: Em.Handlebars.compile('{{view Atp.SuccessView}} \
- <div class="margintop_10"> \
- {{ view Atp.LabelView labelID="wan.Username" maxlen="64" valueBinding="view.content.Username" }} \
- {{ view Atp.LabelView labelID="wan.Password" rule="callback_Password" passwordEnable="true" valueBinding="view.content.Password" }} \
- <div class="submit_ctrl_pos margintop_10"> \
- <button class="atp_button fontweight_thick" id="wan_submit_aitem" {{action "submitItemWan" target="view.controller"}}>{{t Menu.Submit}}</button> \
- </div></div><br>')
- });
- Atp.AddWanCtrl = Em.View.extend({
- tagName: 'span',
- attributeBindings: ['style'],
- 'style': 'color=#6C6C6C',
- controller: Atp.WanController,
- click: function(evt) {
- Em.Logger.log("AddWanCtrl click.....");
- Em.View.views.wan_container.create_new_wan();
- Atp.WanController.set("isAutoRefresh",false);
- },
- template: Em.Handlebars.compile('<br><div class="pull-left ic-new ie6image"></div>\
- <a href="#internet" id="create_wan" class="linkcolor">\
- {{t wan.NewItemName}}</a>')
- });
- Atp.WanOperationView = Em.View.extend ({
- contentBinding: 'parentView.content',
- controller: Atp.WanController,
- canEditBinding: 'parentView.canEdit',
- isNotUmtswan: true,
- elementId:function(){
- var content = this.get('content');
- var id = "";
- if("UMTS" == content.get("AccessType")){
- this.set("isNotUmtswan",false);
- }
- if (null === content){
- id = "wan_setup_internet_";
- }
- else{
- if (typeof(content.get("ID")) !== "undefined"){
- id = "wan_setup_"+content.get("ID").replace(/\./g, "_");
- }
- }
- return id;
- }.property(),
- deleteId: function(){
- return this.get("elementId") + "_delete";
- }.property('elementId'),
- changeId: function(){
- return this.get("elementId") + "_change";
- }.property('elementId'),
- pppresetId: function(){
- return this.get("elementId") + "_reset";
- }.property('elementId'),
- template: Em.Handlebars.compile(' \
- {{#if view.content.needDialButton}} \
- <button class="atp_button" {{action "dialup" target="Atp.WanController"}}>{{view.content.connActionText}}</button>\
- {{/if}}\
- {{#if view.canEdit}}\
- {{#if view.isNotUmtswan}}\
- <button class="atp_button" {{bindAttr id="view.deleteId"}} {{action "deleteItem" target="Atp.WanController"}}>{{t Menu.Delete}}</button>\
- {{/if}}\
- <button class="atp_button" {{bindAttr id="view.changeId"}} {{action "changectrl" target="Atp.WanController"}}>{{t Menu.Change}}</button>\
- {{#if view.content.isPPP}}\
- <button class="atp_button" {{bindAttr id="view.pppresetId"}} {{action "pppReset" target="Atp.WanController"}}>{{t wan.PPPReset}}</button>\
- {{/if}}\
- {{/if}}')
- });
- Atp.WanOperationView2 = Em.View.extend ({
- contentBinding: 'parentView.content',
- controller: Atp.WanController,
- canEditBinding: 'parentView.canEdit',
- elementId:function(){
- var content = this.get('content');
- var id = "";
- if (null === content){
- id = "wan_setup_internet_";
- }
- else{
- if (typeof(content.get("ID")) !== "undefined"){
- id = "wan_setup_"+content.get("ID").replace(/\./g, "_");
- }
- }
- return id;
- }.property(),
- changeId: function(){
- return this.get("elementId") + "_change";
- }.property('elementId'),
- template: Em.Handlebars.compile(' \
- {{#if view.content.isEthernetMode}} \
- {{#if view.content.isPPP}} \
- {{ view Atp.WANViewInternal2 }} \
- {{/if}} \
- {{/if}} \
- {{#if view.content.isDatacardMode}} \
- {{ view Atp.PinView }} \
- <br><br> \
- <div class="margintop_10"> \
- {{ view Atp.LabelView labelID="wan.APN" maxlen="32" rule="callback_APN" valueBinding="view.content.APN" }} \
- <div class="submit_ctrl_pos margintop_10"> \
- <button class="atp_button fontweight_thick" id="wan_submit_aitem" {{action "submitItemWan" target="view.controller"}}>{{t Menu.Submit}}</button> \
- </div></div>\
- {{/if}}')
- });
- Atp.WanStatusView = Em.View.extend ({
- canEdit: false,
- init: function() {
- this._super();
- if (this.get("parentView")) {
- this.get("parentView").set("isClosed", false);
- }
- },
- isEdit: function() {
- return Atp.UserLevelController.get('isAdminUser');
- }.property(),
- template: Em.Handlebars.compile('\
- <div class="form-horizontal paddingleft_87"> \
- {{ view Atp.LabelView textType="label" labelID="wan.AccessType" valueBinding="view.content.AccessType" }} \
- {{#if view.content.showV4Status}}\
- {{#if view.content.showStatus}}\
- {{ view Atp.LabelView textType="label" labelID="wan.Status" valueBinding="view.content.ipv4StatusText" }} \
- {{else}}\
- {{ view Atp.LabelView textType="label" labelID="wan.IPv4Status" valueBinding="view.content.ipv4StatusText" }} \
- {{/if}}\
- {{#if view.content.ipv4Connected}}\
- {{ view Atp.LabelView textType="label" labelID="wan.IPv4Addr" valueBinding="view.content.IPv4Addr" }} \
- {{ view Atp.LabelView textType="label" labelID="wan.IPv4PriDns" valueBinding="view.content.IPv4PriDns" }} \
- {{ view Atp.LabelView textType="label" labelID="wan.IPv4SecDns" valueBinding="view.content.IPv4SecDns" }} \
- {{#if view.content.needIPv4AddrType}} \
- {{ view Atp.LabelView textType="label" labelID="wan.IPv4Gateway" valueBinding="view.content.IPv4Gateway" }} \
- {{/if}}\
- {{/if}}\
- {{/if}}\
- {{#if view.content.showV6Status}}\
- {{ view Atp.LabelView textType="label" labelID="wan.IPv6Status" valueBinding="view.content.ipv6StatusText" }} \
- {{#if view.content.ipv6Connected}}\
- {{ view Atp.LabelView textType="label" labelID="wan.IPv6Addr" valueBinding="view.content.IPv6Addr" }} \
- {{ view Atp.LabelView textType="label" labelID="wan.IPv6PriDns" valueBinding="view.content.IPv6PriDns" }} \
- {{ view Atp.LabelView textType="label" labelID="wan.IPv6SecDns" valueBinding="view.content.IPv6SecDns" }} \
- {{ view Atp.LabelView textType="label" labelID="wan.PrefixList" valueBinding="view.content.IPv6PrefixList" }} \
- {{/if}}\
- {{/if}}\
- {{#if view.content.showACName}} \
- {{#if Atp.UserLevelController.isAdminUser}} \
- {{ view Atp.LabelView textType="label" labelID="wan.ACName" valueBinding="view.content.PPPoEACName" }} \
- {{/if}} \
- {{/if}} \
- {{#if view.isEdit}} \
- {{ view Atp.WanOperationView}} \
- {{else}}\
- {{ view Atp.WanOperationView2}} \
- {{/if}} \
- </div>')
- });
- Atp.WANEntryViewCollapse = Atp.CollapseView.extend({
- LabelRes: function() {
- return this.get("LabelId");
- }.property(),
- ctrlId: function() {
- var contentId = this.get('content').ID;
- if (contentId == '') {
- return "new_wan_ctrl";
- }
- return contentId.replace(/\./g, "_") + "_ctrl";
- }.property(),
- toggle_edit_view: function(show) {
- var childViews = this.get('childViews');
- var dataView = childViews[1];
- dataView.toggle_edit_view(show);
- },
- DataView: Em.ContainerView.extend({
- init: function() {
- this._super();
- this.set("editView", null);
- this.get("parentView").set("isClosed", false);
- },
- linkBinding: 'parentView.link',
- contentBinding: 'parentView.content',
- controller: Atp.WanController,
- didInsertElement: function() {
- this.add_status_view();
- },
- add_status_view: function() {
- var childView = Atp.WanStatusView.create(
- {parent: this, content: this.content,
- link: this.content.get("linkLayer"),
- canEdit: true});
- this.get('childViews').pushObject(childView);
- },
- toggle_edit_view: function(show) {
- var childViews = this.get('childViews');
- var dataView = childViews[1];
- if (dataView) {
- if (!show) {
- this.get('childViews').removeAt(1);
- }
- return;
- }
- if (!show) {
- return;
- }
- if (!Atp.UserLevelController.get('isAdminUser')) {
- return;
- }
- var childView = this.createChildView(Atp.WANViewInternal,
- {parent: this, content: this.content,
- link: this.content.get("linkLayer")});
- this.get('childViews').pushObject(childView);
- }
- })
- });
- Atp.WanContainerView = Em.ContainerView.extend({
- didInsertElement:function(){
- setInterval(function(){
- if(Atp.WanController.get("isAutoRefresh")){
- Em.Logger.log("refresh wan data....",Atp.WanController.get("isAutoRefresh"));
- Atp.LinkController.load(function() {
- Atp.LinkController.backupKeyParas();
- Atp.WanController.load(function() {
- WanBackupData();
- if (Em.View.views.wan_container) {
- Em.View.views.wan_container.update_child_views();
- } else {
- setTimeout(function() {
- Em.View.views.wan_container.update_child_views();
- },10);
- }
- });
- });
- }
- },30000);
- },
- show_edit_view: function(wan) {
- Em.Logger.log("show_edit_view...",wan);
- Atp.WanController.set("isEditing",true);
- Atp.WanController.set("isAutoRefresh",false);
- var wanView = this.get_entry_view_by_wan(wan);
- if (wanView) {
- wanView.toggle_edit_view(true);
- }
- },
- hide_edit_view: function(wan) {
- Em.Logger.log("hide_edit_view...",wan);
- var wanView = this.get_entry_view_by_wan(wan);
- if (wanView) {
- wanView.toggle_edit_view(false);
- }
- },
- get_entry_view_by_wan: function(wan) {
- var len = this.get('childViews').length;
- var idx = 0;
- while (idx < len) {
- if (this.get('childViews')[idx].get("content") == wan) {
- return this.get('childViews')[idx];
- }
- idx = idx + 1;
- }
- return null;
- },
- delete_new_wan: function() {
- Em.Logger.log("delete_new_wan......");
- var item = Atp.WanController.newItem;
- if (!item) {
- return;
- }
- var newWanView = this.get_entry_view_by_wan(item);
- if (!newWanView) {
- return;
- }
- Atp.WanController.removeObject(item);
- Atp.WanController.set("newItem", null);
- Atp.WanController.set("activeItem", null);
- this.get('childViews').removeObject(newWanView);
- },
- create_new_wan: function() {
- Em.Logger.log("create_new_wan......");
- if (true != Atp.WanController.hasNewItem()) {
- var newItem = Atp.WanController.createDefaultObj();
- if (newItem) {
- Atp.WanController.pushObject(newItem);
- Atp.WanController.set("newItem", newItem);
- }
- } else {
- return;
- }
- var item = Atp.WanController.newItem;
- if (item) {
- Atp.WanController.set("activeItem", null);
- } else {
- return;
- }
- var childView = this.createChildView(Atp.WANEntryViewCollapse,
- {
- parent: this, content: item,
- link: item.get("linkLayer"),
- LabelId: item.get("Name")
- }
- );
- this.get('childViews').insertAt(0, childView);
- },
- update_child_views: function() {
- var self = this;
- var idx = self.get('childViews').length;
- while (0 != idx) {
- idx = idx - 1;
- self.get('childViews').removeAt(idx);
- }
- Atp.WanController.content.forEach(function (item) {
- var childView = self.createChildView(Atp.WANEntryViewCollapse,
- {parent: self, content: item,
- link: item.get("linkLayer"),
- LabelId: item.get("Name")});
- self.get('childViews').pushObject(childView);
- });
- }
- });
- function reloadWanData() {
- Atp.WanController.set("isAutoRefresh",true);
- Atp.WanController.set("isEditing",false);
- $("#wan_Password").live("focus", password_focus_proc);
- $("#wan_Password").live("focusout", password_focusout_proc);
- Atp.WanController.set("content", []);
- Atp.WanController.set("newItem", null);
- Atp.LinkController.set("content", []);
- Atp.LinkController.set("newItem", null);
- Em.Logger.log("reloadWanData...");
- Atp.LinkController.load(function() {
- Atp.LinkController.backupKeyParas();
- Atp.WanController.load(function() {
- WanBackupData();
- if (Em.View.views.wan_container) {
- Em.View.views.wan_container.update_child_views();
- } else {
- setTimeout(function() {
- Em.View.views.wan_container.update_child_views();
- },10);
- }
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement