Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/listsubdomains/index.cmb.min.js

define("app/index",["angular","lodash","cjt/core","cjt/modules","cjt/directives/toggleSortDirective","cjt/directives/searchDirective","cjt/directives/pageSizeDirective","cjt/filters/startFromFilter","cjt/decorators/paginationDecorator"],(function(t,e){"use strict";var i="whm.listSubdomains";return function(){t.module(i,["cjt2.config.whm.configProvider","cjt2.whm"]),require(["cjt/bootstrap"],(function(r){var a=t.module(i);a.value("PAGE",PAGE),a.controller("tableCtrl",["$scope","$filter",function(t,i){t.subdomains=[],PAGE.domains.forEach((function(e){e.subdomains.forEach((function(i){i.user=e.user,i.domain=e.domain,i.parked=e.parked,i.user=e.user,t.subdomains.push(i)}))}));var r={filter:i("filter"),orderBy:i("orderBy"),startFrom:i("startFrom"),limitTo:i("limitTo")};t.meta={sortReverse:!1,sortBy:"domain",sortDirection:"asc",filterValue:PAGE.searchDomain?PAGE.searchDomain:"",maxPages:5,totalItems:t.subdomains.length,currentPage:1,pageSize:10,pageSizes:[10,20,50,100],start:0,limit:10},t.sortList=function(e){t.fetch()},t.selectPage=function(e){t.fetch()},t.selectPageSize=function(e){t.fetch()},t.searchList=function(e){t.fetch()},t.fetch=function(){var i=t.subdomains;if(i=""!==t.meta.filterValue?r.filter(t.subdomains,t.meta.filterValue,!1):t.subdomains,""!==t.meta.sortDirection&&""!==t.meta.sortBy&&(i=r.orderBy(i,t.meta.sortBy,"asc"!==t.meta.sortDirection)),t.meta.totalItems=i.length,t.meta.totalItems>e.min(t.meta.pageSizes)){var a=(t.meta.currentPage-1)*t.meta.pageSize,o=t.meta.pageSize;i=r.limitTo(r.startFrom(i,a),o),t.showPager=!0,t.meta.start=a+1,t.meta.limit=a+i.length}else t.showPager=!1,0===i.length?t.meta.start=0:t.meta.start=1,t.meta.limit=i.length;t.filteredList=i},t.fetch()}]),r(document,i)}))}}));
Back to Directory File Manager