|
622 | 622 | } |
623 | 623 | }, |
624 | 624 |
|
| 625 | + advSearchFields: { |
| 626 | + name: { label: 'Name' }, |
| 627 | + zoneid: { |
| 628 | + label: 'Zone', |
| 629 | + select: function(args) { |
| 630 | + $.ajax({ |
| 631 | + url: createURL('listZones'), |
| 632 | + data: { |
| 633 | + listAll: true |
| 634 | + }, |
| 635 | + success: function(json) { |
| 636 | + var zones = json.listzonesresponse.zone; |
| 637 | + |
| 638 | + args.response.success({ |
| 639 | + data: $.map(zones, function(zone) { |
| 640 | + return { |
| 641 | + id: zone.id, |
| 642 | + description: zone.name |
| 643 | + }; |
| 644 | + }) |
| 645 | + }); |
| 646 | + } |
| 647 | + }); |
| 648 | + } |
| 649 | + }, |
| 650 | + tagKey: { label: 'Tag Key' }, |
| 651 | + tagValue: { label: 'Tag Value' } |
| 652 | + }, |
| 653 | + |
625 | 654 | dataProvider: function(args) { |
626 | | - var array1 = []; |
627 | | - if(args.filterBy != null) { |
628 | | - if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) { |
629 | | - switch(args.filterBy.search.by) { |
630 | | - case "name": |
631 | | - if(args.filterBy.search.value.length > 0) |
632 | | - array1.push("&keyword=" + args.filterBy.search.value); |
633 | | - break; |
634 | | - } |
635 | | - } |
636 | | - } |
637 | | - |
638 | | - var apiCmd = "listProjects&page=" + args.page + "&pagesize=" + pageSize + array1.join("") + '&listAll=true'; |
639 | | - |
| 655 | + var data = {}; |
| 656 | + listViewDataProvider(args, data); |
| 657 | + |
640 | 658 | if (isDomainAdmin()) { |
641 | | - apiCmd += '&domainid=' + args.context.users[0].domainid; |
| 659 | + $.extend(data, { |
| 660 | + domainid: args.context.users[0].domainid |
| 661 | + }); |
642 | 662 | } |
643 | 663 |
|
644 | 664 | $.ajax({ |
645 | | - url: createURL(apiCmd, { ignoreProject: true }), |
646 | | - dataType: 'json', |
647 | | - async: true, |
| 665 | + url: createURL('listProjects', { ignoreProject: true }), |
| 666 | + data: data, |
648 | 667 | success: function(data) { |
649 | 668 | args.response.success({ |
650 | 669 | data: data.listprojectsresponse.project, |
|
0 commit comments