File: //usr/local/packages/@appstore/SMBService/ui/domain-filter.js
/* Copyright (c) 2026 Synology Inc. All rights reserved. */
Ext.define("SYNO.SDS.SMBService.Domain.Filter",{extend:"SYNO.ux.ComboBox",constructor:function(t){var e=Ext.apply({width:100,hideLabel:!1,valueField:"value",displayField:"domain",store:{xtype:"arraystore",autoDestroy:!0,fields:["domain","value","comment"]},resizable:!0,mode:"local",triggerAction:"all",editable:!1,value:"",tpl:'<tpl for="."><div ext:qtip="{comment}" class="x-combo-list-item">{domain}</div></tpl>',forceSelection:!0,listeners:{select:this.onSelect}},t);this.callParent([e])},updateList:function(t){var e=[],a=!0;Ext.each(t,(function(t){var i,o=(i=t,[Ext.util.Format.htmlEncode(i[0]),i[1],Ext.util.Format.htmlEncode(Ext.util.Format.htmlEncode(i[2]))]);"object"==typeof o?(e.push(o),o[1]&&o[1]===this.getValue()&&(a=!1)):(e.push([o,o,o]),o===this.getValue()&&(a=!1))}),this),this.getStore().loadData(e),a&&0!==e.length&&(this.setValue(e[0][1]||""),this.module.currDomain=e[0][1]||"")},onSelect:function(t,e){var a="",i=this.grid.getStore();this.grid&&t.data&&t.data.value&&(a=t.data.value),this.module.currDomain=a,i.baseParams.domain_name=this.module.currDomain,i.load({params:{offset:0}}),this.collapse()}});