|
463 | 463 | id: 'portableIpRanges', |
464 | 464 | label: 'Portable IP Ranges', |
465 | 465 | fields: { |
466 | | - name: { label: 'label.name' }, |
467 | | - gslbdomainname: { label: 'GSLB Domain Name' }, |
468 | | - gslblbmethod: { label: 'Algorithm' } |
| 466 | + startip: { label: 'label.start.IP' }, |
| 467 | + endip: { label: 'label.end.IP' }, |
| 468 | + gateway: { label: 'label.gateway' }, |
| 469 | + netmask: { label: 'label.netmask' }, |
| 470 | + vlan: { label: 'label.vlan' } |
469 | 471 | }, |
470 | 472 | dataProvider: function(args) { |
471 | 473 | $.ajax({ |
|
474 | 476 | regionid: args.context.regions[0].id |
475 | 477 | }, |
476 | 478 | success: function(json) { |
477 | | - var items = json.listportableipresponse.portableip; |
| 479 | + var items = json.listportableipresponse.portableiprange; |
478 | 480 | args.response.success({ |
479 | 481 | data: items |
480 | 482 | }); |
|
483 | 485 | args.response.error(parseXMLHttpResponse(json)); |
484 | 486 | } |
485 | 487 | }); |
486 | | - } |
| 488 | + }, |
| 489 | + actions: { |
| 490 | + add: { |
| 491 | + label: 'Add Portable IP Range', |
| 492 | + |
| 493 | + messages: { |
| 494 | + notification: function(args) { |
| 495 | + return 'Add Portable IP Range'; |
| 496 | + } |
| 497 | + }, |
| 498 | + |
| 499 | + createForm: { |
| 500 | + title: 'Add Portable IP Range', |
| 501 | + fields: { |
| 502 | + startip: { |
| 503 | + label: 'label.start.IP', |
| 504 | + validation: { required: true } |
| 505 | + }, |
| 506 | + endip: { |
| 507 | + label: 'label.end.IP', |
| 508 | + validation: { required: true } |
| 509 | + }, |
| 510 | + gateway: { |
| 511 | + label: 'label.gateway', |
| 512 | + validation: { required: true } |
| 513 | + }, |
| 514 | + netmask: { |
| 515 | + label: 'label.netmask', |
| 516 | + validation: { required: true } |
| 517 | + }, |
| 518 | + vlan: { |
| 519 | + label: 'label.vlan', |
| 520 | + validation: { required: false } |
| 521 | + } |
| 522 | + } |
| 523 | + }, |
| 524 | + action: function(args) { |
| 525 | + var data = { |
| 526 | + regionid: args.context.regions[0].id, |
| 527 | + startip: args.data.startip, |
| 528 | + endip: args.data.endip, |
| 529 | + gateway: args.data.gateway, |
| 530 | + netmask: args.data.netmask |
| 531 | + }; |
| 532 | + if(args.data.vlan != null && args.data.vlan.length > 0) { |
| 533 | + $.extend(data, { |
| 534 | + vlan: args.data.vlan |
| 535 | + }) |
| 536 | + } |
| 537 | + $.ajax({ |
| 538 | + url: createURL('createPortableIpRange'), |
| 539 | + data: data, |
| 540 | + success: function(json) { |
| 541 | + var jid = json.createportableiprangeresponse.jobid; |
| 542 | + args.response.success({ |
| 543 | + _custom: { |
| 544 | + jobId: jid, |
| 545 | + getUpdatedItem: function(json) { |
| 546 | + return json.queryasyncjobresultresponse.jobresult.portableiprange; |
| 547 | + } |
| 548 | + } |
| 549 | + }); |
| 550 | + }, |
| 551 | + error: function(data) { |
| 552 | + args.response.error(parseXMLHttpResponse(data)); |
| 553 | + } |
| 554 | + }); |
| 555 | + }, |
| 556 | + notification: { |
| 557 | + poll: pollAsyncJobResult |
| 558 | + } |
| 559 | + } |
| 560 | + } |
487 | 561 | } |
488 | 562 | }, |
489 | 563 |
|
|
0 commit comments