|
595 | 595 |
|
596 | 596 | detailView: { |
597 | 597 | name: 'Guest network details', |
598 | | - viewAll: { path: '_zone.guestIpRanges', label: 'IP ranges' }, //jessica |
| 598 | + viewAll: { path: '_zone.guestIpRanges', label: 'IP ranges' }, |
599 | 599 | actions: { |
600 | 600 | edit: { |
601 | 601 | label: 'Edit', |
|
928 | 928 | createForm: { |
929 | 929 | title: 'Add F5', |
930 | 930 | fields: { |
931 | | - name: { |
932 | | - label: 'Name', |
933 | | - validation: { required: true } |
| 931 | + url: { |
| 932 | + label: 'URL' |
934 | 933 | }, |
935 | | - ipaddress: { |
936 | | - label: 'IP Address', |
937 | | - validation: { required: true } |
| 934 | + username: { |
| 935 | + label: 'Username' |
938 | 936 | }, |
939 | | - supportedServices: { |
940 | | - label: 'Supported Services', |
941 | | - isBoolean: true, |
942 | | - multiArray: { |
943 | | - serviceA: { label: 'Service A' }, |
944 | | - serviceB: { label: 'Service B' }, |
945 | | - serviceC: { label: 'Service C' } |
| 937 | + password: { |
| 938 | + label: 'Password', |
| 939 | + isPassword: true |
| 940 | + }, |
| 941 | + networkdevicetype: { |
| 942 | + label: 'Network device type', |
| 943 | + select: function(args) { |
| 944 | + var items = []; |
| 945 | + items.push({id: "F5BigIpLoadBalancer", description: "F5 Big Ip Load Balancer"}); |
| 946 | + args.response.success({data: items}); |
946 | 947 | } |
947 | | - } |
| 948 | + } |
948 | 949 | } |
949 | 950 | }, |
950 | | - action: function(args) { |
951 | | - args.response.success(); |
| 951 | + action: function(args) { |
| 952 | + var zoneObj = args.context.zones[0]; |
| 953 | + var physicalNetworkObj; |
| 954 | + $.ajax({ |
| 955 | + url: createURL("listPhysicalNetworks&zoneId=" + zoneObj.id), |
| 956 | + dataType: "json", |
| 957 | + async: false, |
| 958 | + success: function(json) { |
| 959 | + var items = json.listphysicalnetworksresponse.physicalnetwork; |
| 960 | + physicalNetworkObj = items[0]; |
| 961 | + } |
| 962 | + }); |
| 963 | + |
| 964 | + var array1 = []; |
| 965 | + array1.push("&physicalnetworkid=" + physicalNetworkObj.id) |
| 966 | + array1.push("&url=" + todb(args.data.url)); |
| 967 | + array1.push("&username=" + todb(args.data.username)); |
| 968 | + array1.push("&password=" + todb(args.data.password)); |
| 969 | + array1.push("&networkdevicetype=" + todb(args.data.networkdevicetype)); |
| 970 | + $.ajax({ |
| 971 | + url: createURL("addF5LoadBalancer" + array1.join("")), |
| 972 | + dataType: "json", |
| 973 | + success: function(json) { |
| 974 | + //jessica |
| 975 | + var jid = json.addf5bigiploadbalancerresponse.jobid; |
| 976 | + args.response.success( |
| 977 | + {_custom: |
| 978 | + {jobId: jid, |
| 979 | + getUpdatedItem: function(json) { |
| 980 | + var item = json.queryasyncjobresultresponse.jobresult.loadbalancer; |
| 981 | + return {data: item}; |
| 982 | + } |
| 983 | + } |
| 984 | + } |
| 985 | + ); |
| 986 | + } |
| 987 | + }); |
952 | 988 | }, |
953 | 989 | messages: { |
954 | 990 | notification: function(args) { |
955 | 991 | return 'Added new F5'; |
956 | 992 | } |
957 | 993 | }, |
958 | 994 | notification: { |
959 | | - poll: testData.notifications.testPoll |
| 995 | + poll: pollAsyncJobResult |
960 | 996 | } |
961 | 997 | } |
962 | 998 | }, |
|
0 commit comments