From 83bc7d1c81cc4da83e717450e34a9fa553f1c662 Mon Sep 17 00:00:00 2001 From: bfederle Date: Fri, 27 Jan 2012 09:01:57 -0800 Subject: [PATCH] Remove UI test data --- ui/index-test.html | 1571 ------- ui/index.jsp | 2 - ui/scripts-test/accounts.js | 69 - ui/scripts-test/cloudStack.js | 113 - ui/scripts-test/configuration.js | 547 --- ui/scripts-test/dashboard.js | 105 - ui/scripts-test/domains.js | 156 - ui/scripts-test/events.js | 64 - ui/scripts-test/globalSettings.js | 26 - ui/scripts-test/installWizard.js | 287 -- ui/scripts-test/instances.js | 497 -- ui/scripts-test/network.js | 1050 ----- ui/scripts-test/projects.js | 332 -- ui/scripts-test/storage.js | 538 --- ui/scripts-test/system.js | 2073 --------- ui/scripts-test/templates.js | 78 - ui/scripts-test/test-data.js | 6151 ------------------------- ui/scripts-test/zoneWizard.js | 687 --- ui/scripts/accounts.js | 4 +- ui/scripts/cloudStack.js | 6 +- ui/scripts/configuration.js | 4 +- ui/scripts/dashboard.js | 4 +- ui/scripts/domains.js | 8 +- ui/scripts/events.js | 4 +- ui/scripts/installWizard.js | 4 +- ui/scripts/instances.js | 5 +- ui/scripts/network.js | 5 +- ui/scripts/projects.js | 8 +- ui/scripts/storage.js | 7 +- ui/scripts/system.js | 4 +- ui/scripts/templates.js | 4 +- ui/scripts/ui-custom/installWizard.js | 4 +- 32 files changed, 29 insertions(+), 14388 deletions(-) delete mode 100644 ui/index-test.html delete mode 100644 ui/scripts-test/accounts.js delete mode 100644 ui/scripts-test/cloudStack.js delete mode 100644 ui/scripts-test/configuration.js delete mode 100644 ui/scripts-test/dashboard.js delete mode 100644 ui/scripts-test/domains.js delete mode 100644 ui/scripts-test/events.js delete mode 100644 ui/scripts-test/globalSettings.js delete mode 100644 ui/scripts-test/installWizard.js delete mode 100644 ui/scripts-test/instances.js delete mode 100644 ui/scripts-test/network.js delete mode 100644 ui/scripts-test/projects.js delete mode 100644 ui/scripts-test/storage.js delete mode 100644 ui/scripts-test/system.js delete mode 100644 ui/scripts-test/templates.js delete mode 100644 ui/scripts-test/test-data.js delete mode 100644 ui/scripts-test/zoneWizard.js diff --git a/ui/index-test.html b/ui/index-test.html deleted file mode 100644 index ed3d19d9714..00000000000 --- a/ui/index-test.html +++ /dev/null @@ -1,1571 +0,0 @@ - - - - CloudStack - - - - - - - -
- - -
- - - - -
-
-
    -
  • 1Setup
  • -
  • 2Select a template
  • -
  • 3Service Offering
  • -
  • 4Data Disk Offering
  • -
  • 5Network
  • -
  • 6Review
  • -
-
-
-
- -
-
- -
-

Select a zone

-

Descriptive text of what a zone is goes here.

-
-
Description of this select area goes here.
- -
-
- - -
-

Select ISO or template

-

Descriptive text goes here.

-
-
Description of a template goes here.
- - -
-
-
Description of a template goes here.
- - -
-
-
-
- - -
- -
-
-

- Please select a template for your new virtual instance. -

-
-
- - - -
-
-
-
-
-
-
-
-
-
- - -
-
-

- Please select an ISO for your new virtual instance. - You can also choose to upload your own iso as well. -

-
-
- - -
-
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
- - -
- - -
-
- - -
- - - - -
- - - - -
-
-
- - -
- -
-

Either you select a basic zone whose guest network does not include security group service or your selected hypervisor does not have any additional network features or you don't have any zone that has security group enabled.

-

Thus, no additional network features.

-

Please proceed to the next step.

-
- - -
-
-
- Please select networks for your virtual machine -
-
- - - - - - - - - - - -
Networks
-
-
-
-
-
- - - - - - - - - - - -
Add new network
-
-
- - -
-
NEW
-
- - -
-
Name
-
- -
-
- - -
-
Network Offering
-
- -
-
- -
- -
Default
-
-
-
-
-
-
-
- - -
-
- Please select security group(s) for your new virtual instance -
-
-
-
-
-
-
- - -
-
- Please review the following information and confirm that your virtual instance is correct before launch -
-
-
- -
-
- Name (optional) -
-
- -
-
- - -
-
- Add to group (optional) -
-
- -
-
- - -
-
- Zone -
-
- -
-
- Edit -
-
- - -
-
- Hypervisor -
-
- -
-
- Edit -
-
- - -
-
- Template -
-
- -
-
- Edit -
-
- - -
-
- Service offering -
-
- -
-
- Edit -
-
- - -
-
- Data disk offering -
-
- -
-
- Edit -
-
- - -
-
- Primary network -
-
- -
-
- Edit -
-
-
-
-
-
-
- - -
-
-
-
-
-
-
-
-
-
-
- - -
- -
Cancel
- -
-
- - -
-
-
    -
  • 1Zone Type
  • -
  • 2Setup Zone
  • -
  • 3Setup Network
  • -
  • -
  • -
  • -
  • -
  • 4Add Resources
  • -
  • -
  • -
  • -
  • 5Launch
  • -
-
-
- -
-
-
- -
-

Set up zone type

-

Please select a configuration for your zone.

-
-
- Provide a single network where each VM instance is assigned an IP directly from the network. Guest isolation can be provided through layer-3 means such as security groups (IP address source filtering) -
- - -
-
-
- For more sophisticated network topologies. This network model provides the most flexibility in defining guest networks and providing custom network offerings such as firewall, VPN, or load balancer support. -
- - -
-
-
-
-
- - -
-
- A zone is the largest organizational unit in CloudStack, and it typically corresponds to a single datacenter. Zones provide physical isolation and redundancy. A zone consists of one or more pods (each of which contains hosts and primary storage servers) and a secondary storage server which is shared by all pods in the zone. -
-
-
-
-
- - -
- -
- When adding an advanced zone, you need to set up one or more physical networks. Each network corresponds to a NIC on the management server. Each physical network can carry one or more types of traffic, with certain restrictions on how they may be combined.

Drag and drop one or more traffic types onto each physical network. -
-
 Add physical network
- - -
-
Traffic Types
-
    -
  • -
      -
    • -
    -
    -
    Management
    -
    Set up the network for traffic between end-user VMs.
    -
    -
  • -
  • -
      -
    • -
    -
    -
    Public
    -
    Set up the network for traffic between end-user VMs.
    -
    -
  • -
  • -
      -
    • -
    -
    -
    Guest
    -
    Set up the network for traffic between end-user VMs.
    -
    -
  • -
  • -
      -
    • -
    -
    -
    Storage
    -
    Set up the network for traffic between end-user VMs.
    -
    -
  • -
-
- -
-
-
-
-
- - -
- - -
Please specify Netscaler info
-
-
-
-
- - -
- - -
- Public traffic is generated when VMs in the cloud access the internet. Publicly-accessible IPs must be allocated for this purpose. End users can use the CloudStack UI to acquire these IPs to implement NAT between their guest network and their public network.

Provide at lease one range of IP addresses for internet traffic. -
-
-
- - -
- - -
- Each zone must contain in one or more pods, and we will add the first pod now. A pod contains hosts and primary storage servers, which you will add in a later step. First, configure a range of reserved IP addresses for CloudStack's internal management traffic. The reserved IP range must be unique for each zone in the cloud. -
-
-
-
-
- - -
- - -
- Enter the first and last IP addresses that define a range that CloudStack can assign to guest VMs. We strongly recommend the use of multiple NICs. If multiple NICs are used, the guest IPs may be in a separate subnet. If one NIC is used, the guest IPs should be in the same CIDR as the pod's CIDR, but not within the reserved system IP range. -
-
-
-
-
- - -
- - -
- Each pod must contain one or more clusters, and we will add the first cluster now. A cluster provides a way to group hosts. The hosts in a cluster all have identical hardware, run the same hypervisor, are on the same subnet, and access the same shared storage. Each cluster consists of one or more hosts and one or more primary storage servers. -
-
-
-
-
- - -
- -
- Each cluster must contain at lease one host (computer) for guest VMs to run on, and we will add the first host now. For a host to function in CloudStack, you must install hypervisor software on the host, assign an IP address to the host, and ensure the host is connected to the CloudStack management server.

Give the host's DNS or IP address, the user name (usually root) and password, and any labels you use to categorize hosts. -
-
-
-
-
- - -
- -
- Each cluster must contain one or more primary storage servers, and we will add the first one now. Primary storage contains the disk volumes for all the VMs running on hosts in the cluster. Use any standards-compliant protocol that is supported by the underlying hypervisor. -
-
-
-
-
- - -
- -
- Each zone must have at lease one NFS or secondary storage server, and we will add the first one now. Secondary storage stores VM templates, ISO images, and VM disk volume snapshots. This server must be available to all hosts in the zone.

Provide the IP address and exported path. -
-
-
-
-
- - -
-
Launch zone
- -
-
- -
-
- - -
- -
Cancel
- -
-
- - -
-
    -
  • -
    Firewall
    -
    View All
    -
  • -
  • -
    Load Balancing
    -
    View All
    -
  • -
  • -
    Port Forwarding
    -
    View All
    -
  • -
-
- - -
-
    -
  • -
    Static NAT Enabled
    -
    -
  • -
  • -
    Firewall
    -
    View All
    -
  • -
-
- - -
-
- -
-
-
- Compute and Storage -
-
    - -
  • - Virtual Machines -
    -
    - -
    -
    5
    -
    Running
    -
    - - -
    -
    10
    -
    Stopped
    -
    -
    -
  • - - -
  • - Storage -
    -
    -
    10
    -
    volumes
    -
    -
  • - - -
  • - Bandwidth -
    -
    -
    200
    -
    mb/s
    -
    -
  • -
-
-
- - -
-
-
- Users -
-
    -
  • - -
    -
  • -
-
-
-
- -
- -
-
- Networking and Security -
-
    - -
  • -
    -
    IP addresses
    -
  • - - -
  • -
    -
    Load balancing policies
    -
  • - - -
  • -
    -
    Port forwarding policies
    -
  • - - -
  • -
    -
    -
  • - - -
  • -
    -
    -
    - Manage Resources - -
    -
    -
  • -
-
- - -
-
- Events -
- View all - -
-
-
    -
  • -
    -
    -
  • -
-
-
-
- - -
-
-
- Refresh -
-
- - -
-
- Zones -
View more
-
-
    -
  • - Number of Zones - -
  • -
  • - Number of Pods - -
  • -
  • - Number of Clusters - -
  • -
  • - Number of Hosts - -
  • -
-
- - -
-
- Hosts -
View more
-
-
    -
  • - Total Hosts - -
  • -
  • - Total CPU - -
  • -
  • - Total Memory - -
  • -
  • - Total Storage - -
  • -
-
-
- - -
- -
-
    -
  • -
    1
    -
    Guest
    -

    Set up the network for traffic between end-user VMs.

    -
  • -
  • -
    2
    -
    Clusters
    -

    Define one or more clusters to group the compute hosts.

    -
  • -
  • -
    3
    -
    Hosts
    -

    Add hosts to clusters. Hosts run hypervisors and VMs.

    -
  • -
  • -
    4
    -
    Primary Storage
    -

    Add servers to store VM disk volumes in each cluster.

    -
  • -
  • -
    5
    -
    Secondary Storage
    -

    Add servers to store templates, ISOs, and snapshots for the whole zone.

    -
  • -
-
- - -
-
    -
  • -
    1
    -
    Public
    -

    Set up the network for Internet traffic.

    -
  • -
  • -
    2
    -
    Guest
    -

    Set up the network for traffic between end-user VMs.

    -
  • -
  • -
    3
    -
    Clusters
    -

    Define one or more clusters to group the compute hosts.

    -
  • -
  • -
    4
    -
    Hosts
    -

    Add hosts to clusters. Hosts run hypervisors and VMs.

    -
  • -
  • -
    5
    -
    Primary Storage
    -

    Add servers to store VM disk volumes in each cluster.

    -
  • -
  • -
    6
    -
    Secondary Storage
    -

    Add servers to store templates, ISOs, and snapshots for the whole zone.

    -
  • -
-
- - -
-
- Zone Configuration -
-
    -
  • -
    1
    -
    Public
    -
    Configure
    -
  • -
  • -
    Management
    -
    Configure
    -
  • -
  • -
    2
    -
    1
    -
    Guest
    -
    Configure
    -
  • -
-
- - -
-
-
Add Resource
-
-
    -
  • -
    Pods
    -
    View All
    -
  • -
  • -
    3
    -
    2
    -
    Clusters
    -
    View All
    -
  • -
  • -
    4
    -
    3
    -
    Hosts
    -
    View All
    -
  • -
  • -
    5
    -
    4
    -
    Primary Storage
    -
    View All
    -
  • -
  • -
    6
    -
    5
    -
    Secondary Storage
    -
    View All
    -
  • -
-
-
- - -
- -
-
-
General Alerts
-
view all
-
-
    -
  • -
    - Alert 1 -

    Alert 1

    -
    -
  • -
-
- - -
-
-
Host Alerts
-
view all
-
-
    -
  • -
    - Alert 1 -

    Alert 1

    -
    -
  • -
-
- -
-
-
- System Capacity -
- -
- - -
-
    -
  • -
    - Zone: -
    -
    -
    %
    -
    -
    -
    -
    -
    - - / - -
    -
    -
  • -
-
-
-
- - -
-
-
Virtual Machines
- -
-
    -
  • -
    Running VMs
    -
    -
  • -
  • -
    Stopped VMs
    -
    -
  • -
  • -
    Total VMs
    -
    -
  • -
-
-
- -
-
    -
  • - - - - - - -
    My Projects
    -
    - - - - -
    -
    -
  • - -
  • - - - - - - -
    IP Addresses
    - - - - - - - - - -
    -
    Available public IP addresses:
    -
    18
    -
    -
    Owned public IP addresses:
    -
    03
    -
    -
  • -
-
-
- - -
-

Description

- -
-

Schedule:

- -
- - - -
-
- - - -
-
Time
-
- - -
-
- - -
-
Timezone
-
- -
-
- - -
-
Keep
-
- - -
-
-
-
- - -
-
- - - -
-
Time
-
- - - -
-
- - -
-
Timezone
-
- -
-
- - -
-
Keep
-
- - -
-
-
-
- - -
-
- - - -
-
Time
-
- - - -
-
- - -
-
Day of week
-
- -
-
- - -
-
Timezone
-
- -
-
- - -
-
Keep
-
- - -
-
-
-
- - -
-
- - - -
-
Time
-
- - - -
-
- - -
-
Day of month
-
- -
-
- - -
-
Timezone
-
- -
-
- - -
-
Keep
-
- - -
-
-
-
-
- -
-
Add
-
-
- - -
-

Scheduled Snapshots

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Time: min past the hrTimezone:
Keep:
 
Time: Timezone:
Keep:
 
Time: Every Timezone:
Keep:
 
Time: Day of monthTimezone:
Keep:
 
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ui/index.jsp b/ui/index.jsp index a9d5b1441ff..b3b254b6683 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -1536,8 +1536,6 @@ - - diff --git a/ui/scripts-test/accounts.js b/ui/scripts-test/accounts.js deleted file mode 100644 index f4380bd2102..00000000000 --- a/ui/scripts-test/accounts.js +++ /dev/null @@ -1,69 +0,0 @@ -(function(cloudStack) { - cloudStack.sections.accounts = { - title: 'Accounts', - id: 'accounts', - sectionSelect: { - label: 'Select view' - }, - sections: { - accounts: { - type: 'select', - title: 'Accounts', - listView: { - id: 'accounts', - fields: { - name: { label: 'Name', editable: true }, - domain: { label: 'Domain' }, - state: { label: 'State' } - }, - filters: { - mine: { label: 'My Accounts' }, - all: { label: 'All Accounts' } - }, - dataProvider: testData.dataProvider.listView('accounts'), - - detailView: { - name: 'Account details', - viewAll: { path: 'accounts.users', label: 'Users' }, - - tabs: { - details: { - title: 'Details', - fields: [ - { - name: { label: 'Name' } - }, - { - domain: { label: 'Domain' }, - vmlimit: { label: 'VM Limit' }, - vmtotal: { label: 'Total VMs' }, - iplimit: { label: 'IP Limit' }, - iptotal: { label: 'Total IPs' } - } - ], - dataProvider: testData.dataProvider.detailView('accounts') - } - } - } - } - }, - users: { - type: 'select', - title: 'Users', - listView: { - id: 'users', - fields: { - username: { label: 'Username', editable: true }, - email: { label: 'E-mail' }, - state: { label: 'State' } - }, - filters: { - mine: { label: 'My Accounts' }, - all: { label: 'All Accounts' } - }, - dataProvider: testData.dataProvider.listView('users') - } - } - } - }; -})(cloudStack); diff --git a/ui/scripts-test/cloudStack.js b/ui/scripts-test/cloudStack.js deleted file mode 100644 index 5837f68e1b5..00000000000 --- a/ui/scripts-test/cloudStack.js +++ /dev/null @@ -1,113 +0,0 @@ -(function(cloudStack, $, testData) { - $.extend(cloudStack, testData, { - home: 'dashboard', - - sectionPreFilter: function(args) { - var user = args.context.users[0]; - - if (user.role == 'admin') - return args.context.sections; - - return ['dashboard', 'instances', 'storage', 'templates', 'events', 'projects']; - }, - sections: { - dashboard: {}, - instances: {}, - storage: {}, - network: {}, - templates: {}, - accounts: {}, - domains: {}, - events: {}, - system: {}, - projects: {}, - 'global-settings': {}, - configuration: {} - } - }); - - $(function() { - var $container = $('#cloudStack3-container'); - - var loginArgs = { - $container: $container, - - // Use this for checking the session, to bypass login screen - bypassLoginCheck: function(args) { - var disabledLogin = document.location.href.split('?')[1] == 'login=disabled'; - - if (disabledLogin) - return { - user: { - login: 'wchan', - name: 'Will Chan', - role: 'admin' - } - }; - else - return false; - }, - - // Actual login process, via form - loginAction: function(args) { - if (args.data.username != 'invalid'){ - return args.response.success({ - data: { - user: { - username: args.data.username, - name: args.data.name ? args.data.name : args.data.username, - role: args.data.username == 'jdoe' ? 'user' : 'admin' - } - } - }); - } - - return args.response.error(); - }, - - logoutAction: function(args) { - document.location.reload(); - }, - - complete: function(args) { - var context = { - users: [args.user] - }; - var cloudStackArgs = $.extend(cloudStack, { - context: context - }); - - // Check to invoke install wizard - cloudStack.installWizard.check({ - context: context, - response: { - success: function(args) { - if (args.doInstall) { - cloudStack.uiCustom.installWizard({ - $container: $container, - context: context, - complete: function() { - $container.cloudStack(cloudStackArgs); - } - }); - } else { - // Show cloudStack main UI - $container.cloudStack(cloudStackArgs); - } - } - } - }); - - // Logout action - $('#user-options a').live('click', function() { - loginArgs.logoutAction({ - context: cloudStack.context - }); - }); - } - }; - - // Login - cloudStack.uiCustom.login(loginArgs); - }); -})(cloudStack, jQuery, testData); diff --git a/ui/scripts-test/configuration.js b/ui/scripts-test/configuration.js deleted file mode 100644 index 4c6d1a407e4..00000000000 --- a/ui/scripts-test/configuration.js +++ /dev/null @@ -1,547 +0,0 @@ -(function(cloudStack, testData, $) { - cloudStack.sections.configuration = { - title: 'Configuration', - id: 'configuration', - sectionSelect: { - label: 'Select Offering' - }, - sections: { - serviceOfferings: { - type: 'select', - title: 'Service', - listView: { - label: 'Service Offerings', - fields: { - name: { label: 'Name', editable: true }, - storagetype: { label: 'Storage Type' }, - cpuspeed: { label: 'CPU' }, - memory: { label: 'Memory' }, - domain: { label: 'Domain'} - }, - actions: { - add: { - label: 'Add service offering', - - action: function(args) { - args.response.success(); - }, - - messages: { - confirm: function(args) { - return 'Are you sure you want to add ' + args.name + '?'; - }, - success: function(args) { - return 'Your new service offering is being created.'; - }, - notification: function(args) { - return 'Created service offering'; - }, - complete: function(args) { - return 'Service offering has been created'; - } - }, - - createForm: { - title: 'New service offering', - desc: 'Please fill in the following data to add a new service offering.', - fields: { - name: { label: 'Name', editable: true }, - displayText: { label: 'Display Text' }, - storageType: { - label: 'Storage Type', - select: [ - { id: 'shared', description: 'Shared' }, - { id: 'local', description: 'Local' } - ] - }, - cpuCores: { label: '# of CPU cores' }, - cpuSpeed: { label: 'CPU Speed (in MHz)'}, - memory: { label: 'Memory (in MB)' }, - tags: { label: 'Tags' }, - offerHA: { label: 'Offer HA', isBoolean: true }, - isPublic: { label: 'Public', isBoolean: true } - } - }, - - notification: { - poll: testData.notifications.testPoll - } - } - }, - - reorder: { - moveTop: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveBottom: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveUp: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDown: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDrag: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - } - }, - - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: testData.data.serviceOfferings - }); - }); - } - } - }, - - systemServiceOfferings: { - type: 'select', - title: 'System Service', - listView: { - label: 'System Service Offerings', - fields: { - name: { label: 'Name', editable: true }, - storagetype: { label: 'Storage Type' }, - cpuspeed: { label: 'CPU' }, - memory: { label: 'Memory' }, - domain: { label: 'Domain'} - }, - - reorder: { - moveTop: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveBottom: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveUp: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDown: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDrag: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - } - }, - - actions: { - add: { - label: 'Add system service offering', - - action: function(args) { - args.response.success(); - }, - - messages: { - confirm: function(args) { - return 'Are you sure you want to add ' + args.name + '?'; - }, - success: function(args) { - return 'Your new system service offering is being created.'; - }, - notification: function(args) { - return 'Created system service offering'; - }, - complete: function(args) { - return 'Sysmte service offering has been created'; - } - }, - - createForm: { - title: 'New system service offering', - desc: 'Please fill in the following data to add a new service offering.', - fields: { - name: { label: 'Name', editable: true }, - displayText: { label: 'Display Text' }, - storageType: { - label: 'Storage Type', - select: [ - { id: 'shared', description: 'Shared' }, - { id: 'local', description: 'Local' } - ] - }, - cpuCores: { label: '# of CPU cores' }, - cpuSpeed: { label: 'CPU Speed (in MHz)'}, - memory: { label: 'Memory (in MB)' }, - tags: { label: 'Tags' }, - offerHA: { label: 'Offer HA', isBoolean: true }, - isPublic: { label: 'Public', isBoolean: true } - } - }, - - notification: { - poll: testData.notifications.testPoll - } - } - }, - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: testData.data.systemServiceOfferings - }); - }); - } - } - }, - - diskOfferings: { - type: 'select', - title: 'Disk', - listView: { - label: 'Disk Offerings', - fields: { - displaytext: { label: 'Name' }, - disksize: { label: 'Disk Size' }, - domain: { label: 'Domain'} - }, - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: testData.data.diskOfferings - }); - }); - }, - - reorder: { - moveTop: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveBottom: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveUp: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDown: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDrag: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - } - }, - - actions: { - add: { - label: 'Add disk offering', - - messages: { - confirm: function(args) { - return 'Are you sure you want to add a disk offering?'; - }, - success: function(args) { - return 'Your new disk offering is being created.'; - }, - notification: function(args) { - return 'Creating new disk offering'; - }, - complete: function(args) { - return 'Disk offering has been created successfully!'; - } - }, - - createForm: { - title: 'Add disk offering', - fields: { - name: { - label: 'Name', - validation: { required: true } - }, - description: { - label: 'Description', - validation: { required: true } - }, - isCustomized: { - label: 'Custom disk size', - isBoolean: true, - isReverse: true, - isChecked: true - }, - disksize: { - label: 'Disk size (in GB)', - dependsOn: 'isCustomized', - validation: { required: true, number: true }, - isHidden: true - }, - tags: { - label: 'Storage tags' - }, - isDomainSpecific: { - label: 'Domain specific', - isBoolean: true - }, - domainId: { - label: 'Domain', - dependsOn: 'isDomainSpecific', - select: function(args) { - setTimeout(function() { - args.response.success({ - descriptionField: 'name', - data: testData.data.domains - }); - }); - }, - isHidden: true - } - } - }, - - action: function(args) { - args.response.success(); - } - } - } - } - }, - networkOfferings: { - type: 'select', - title: 'Network', - listView: { - label: 'Network Offerings', - fields: { - name: { label: 'Name', editable: true }, - networkrate: { label: 'Network Rate' }, - traffictype: { label: 'Traffic Type'} - }, - - reorder: { - moveTop: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveBottom: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveUp: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDown: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - }, - moveDrag: { - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - } - } - }, - - actions: { - add: { - label: 'Add network offering', - - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 200); - }, - - createForm: { - title: 'Add network offering', - desc: 'Please specify the network offering', - fields: { - name: { label: 'Name', validation: { required: true } }, - - displayText: { label: 'Display Text', validation: { required: true } }, - - maxConnections: { label: 'Max Connections' }, - - networkRate: { label: 'Network Rate' }, - - trafficType: { - label: 'Traffic Type', validation: { required: true }, - select: function(args) { - args.response.success({ - data: [ - { id: 'GUEST', description: 'Guest' } - ] - }); - } - }, - - guestType: { - label: 'Guest Type', - select: function(args) { - args.response.success({ - data: [ - { id: 'Isolated', description: 'Isolated' }, - { id: 'Shared', description: 'Shared' } - ] - }); - } - }, - - availability: { - label: 'Availability', - select: function(args) { - args.response.success({ - data: [ - { id: 'Required', description: 'Required' }, - { id: 'Optional', description: 'Optional' }, - { id: 'Unavailable', description: 'Unavailable' } - ] - }); - } - }, - - serviceOfferingId: { - label: 'Service Offering', - select: function(args) { - args.response.success({ - data: $.map(testData.data.serviceOfferings, function(elem) { - return { - id: elem.id, - description: elem.name - }; - }) - }); - } - }, - - specifyVlan: { label: 'Specify VLAN', isBoolean: true }, - - vlanId: { label: 'VLAN ID', isHidden: true, dependsOn: 'specifyVlan'}, - - supportedServices: { - label: 'Supported Services', - - dynamic: function(args) { - setTimeout(function() { - var fields = {}; - var services = ['Vpn', 'Dhcp', 'Gateway', 'Firewall', 'Lb', 'UserData', 'SourceNat', 'StaticNat', 'PortForwarding', 'SecurityGroup']; - - $(services).each(function() { - var id = { - isEnabled: this + '.' + 'isEnabled', - capabilities: this + '.' + 'capabilities', - provider: this + '.' + 'provider' - }; - - fields[id.isEnabled] = { label: this, isBoolean: true }; - fields[id.provider] = { - label: this + ' Provider', - isHidden: true, - dependsOn: id.isEnabled, - select: function(args) { - args.response.success({ - data: [ - { id: 'NetScaler', description: 'NetScaler'}, - { id: 'SRX', description: 'SRX' } - ] - }); - } - }; - }); - - args.response.success({ - fields: fields - }); - }, 50); - } - }, - - tags: { label: 'Tags' } - } - }, - - notification: { - poll: testData.notifications.testPoll - }, - messages: { - notification: function(args) { - return 'Added network offering'; - } - } - } - }, - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: testData.data.networkOfferings - }); - }); - } - } - } - } - }; -})(cloudStack, testData, jQuery); diff --git a/ui/scripts-test/dashboard.js b/ui/scripts-test/dashboard.js deleted file mode 100644 index 2fe0278280e..00000000000 --- a/ui/scripts-test/dashboard.js +++ /dev/null @@ -1,105 +0,0 @@ -(function(cloudStack, testData) { - // Admin dashboard - cloudStack.sections.dashboard = { - title: 'Dashboard', - show: cloudStack.uiCustom.dashboard, - - adminCheck: function(args) { - return args.context.users[0].role == 'admin'; - }, - - user: { - dataProvider: function(args) { - args.response.success({ - data: { - runningInstances: 10, - stoppedInstances: 2, - totalInstances: 12, - accountID: '12', - accountName: 'brian', - userName: 'brian', - accountType: 'user', - accountDomainID: 12 - } - }); - } - }, - - admin: { - dataProvider: function(args) { - args.response.success({ - data: { - publicIPAllocated: 50, - publicIPTotal: 100, - publicIPPercentage: 50, - privateIPAllocated: 50, - privateIPTotal: 100, - privateIPPercentage: (100 / 50) * 10, - memoryAllocated: 256, - memoryTotal: 1024, - memoryPercentage: (1024 / 256) * 10, - cpuAllocated: 500, - cpuTotal: 1200, - cpuPercentage: (1200 / 500) * 10, - zoneCapacities: [ - { - type: 'Public IP', - zoneName: 'zone', - percent: 50, - total: 4, - used: 2 - }, - { - type: 'Reserved System IP', - zoneName: 'zone', - percent: 50, - total: 10, - used: 40 - }, - { - type: 'Storage Used', - zoneName: 'zone', - percent: 10, - total: '50 GB', - used: '15 GB' - }, - { - type: 'Secondary Storage', - zoneName: 'zone', - percent: 10, - total: '50 GB', - used: '15 GB' - }, - { - type: 'Domain Router', - zoneName: 'zone', - percent: 25, - total: 30, - used: 100 - }, - { - type: 'Host', - zoneName: 'zone', - percent: 15, - total: '15.5 gHZ', - used: '100 gHZ' - } - ], - alerts: $.map(testData.data.alerts, function(alert) { - return { - name: 'System Alert', - description: alert.description - }; - }), - hostAlerts: $.map(testData.data.alerts, function(alert) { - return { - name: 'Host Alert', - description: alert.description - }; - }) - } - }); - } - } - }; -})(cloudStack, testData); diff --git a/ui/scripts-test/domains.js b/ui/scripts-test/domains.js deleted file mode 100644 index 722efc57b83..00000000000 --- a/ui/scripts-test/domains.js +++ /dev/null @@ -1,156 +0,0 @@ -(function(cloudStack) { - cloudStack.sections.domains = { - title: 'Domains', - id: 'domains', - - // Domain tree - treeView: { - // Details - detailView: { - name: 'Domain details', - viewAll: { - label: 'Accounts', - path: 'accounts.accounts' - }, - - // Detail actions - actions: { - // Destroy - destroy: { - label: 'Remove domain', - messages: { - confirm: function(args) { - return 'Are you sure you want to destroy this domain?'; - }, - notification: function(args) { - return 'Removed domain: ' + args.name; - } - }, - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 200); - }, - notification: { - poll: testData.notifications.testPoll - } - }, - - // Edit domain - edit: { - label: 'Edit domain details', - messages: { - notification: function(args) { - return 'Edited domain: ' + args.name; - } - }, - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 200); - } - }, - - // Add domain - create: { - label: 'Add domain', - - action: function(args) { - args.response.success(); - }, - - messages: { - notification: function(args) { - return 'Created domain'; - } - }, - - createForm: { - title: 'Add subdomain', - desc: 'Please specify the domain you want to create.', - fields: { - name: { - label: 'Name', - validation: { required: true } - }, - parent: { - label: 'Parent Domain', - validation: { required: true } - } - } - } - } - }, - tabs: { - details: { - title: 'Details', - fields: [ - { - name: { label: 'Name', isEditable: true } - }, - { - accounts: { label: 'Accounts' }, - instances: { label: 'Instances' }, - volumes: { label: 'Volumes' } - } - ], - dataProvider: function(args) { - args.response.success({ - data: { - name: 'Domain name', - accounts: 12, - volumes: 23 - } - }); - } - }, - adminAccounts: { - title: 'Admin Accounts', - multiple: true, - fields: [ - { - name: { label: 'Name' }, - vmtotal: { label: 'VMs' }, - iptotal: { label: 'IPs' }, - receivedbytes: { label: 'Bytes received' }, - sentbytes: { label: 'Bytes sent' }, - state: { label: 'State' } - } - ], - dataProvider: function(args) { - args.response.success({ - data: $.grep(testData.data.accounts, function(item, index) { - return item.domain === 'ROOT' && index <= 5; - }) - }); - } - }, - resourceLimits: { - title: 'Resource Limits', - fields: { - vmlimit: { label: 'Instance Limit' }, - iplimit: { label: 'Public IP Limit' }, - volumelimit: { label: 'Volume Limit' }, - snapshotlimit: { label: 'Snapshot Limit' }, - templatelimit: { label: 'Template Limit' } - }, - dataProvider: function(args) { - args.response.success({ - data: testData.data.accounts[4] - }); - } - } - } - }, - labelField: 'name', - dataProvider: function(args) { - args.response.success({ - data: [ - { id: 'domainA', name: 'Domain A' }, - { id: 'domainB', name: 'Domain B' } - ] - }); - } - } - }; -})(cloudStack); diff --git a/ui/scripts-test/events.js b/ui/scripts-test/events.js deleted file mode 100644 index 20e2b9417ad..00000000000 --- a/ui/scripts-test/events.js +++ /dev/null @@ -1,64 +0,0 @@ -(function(cloudStack) { - cloudStack.sections.events = { - title: 'Events', - id: 'events', - sectionSelect: { - preFilter: function(args) { - var user = args.context.users[0]; - - if (user.role == 'admin') - return args.context.sections; - - return ['events']; - }, - label: 'Select view' - }, - sections: { - events: { - type: 'select', - title: 'Events', - listView: { - id: 'events', - label: 'Events', - fields: { - type: { label: 'Type' }, - description: { label: 'Description' }, - username: { label: 'Initiated By' }, - created: { label: 'Date' } - }, - dataProvider: testData.dataProvider.listView('events') - } - }, - alerts: { - type: 'select', - title: 'Alerts', - listView: { - id: 'alerts', - label: 'Alerts', - fields: { - type: { label: 'Type' }, - description: { label: 'Description' }, - sent: { label: 'Date' } - }, - dataProvider: testData.dataProvider.listView('alerts'), - detailView: { - name: 'Alert details', - tabs: { - details: { - title: 'Details', - fields: [ - { - type: { label: 'Type' }, - description: { label: 'Description' }, - created: { label: 'Sent' } - } - ], - dataProvider: testData.dataProvider.detailView('alerts') - } - } - } - } - } - } - }; -})(cloudStack); diff --git a/ui/scripts-test/globalSettings.js b/ui/scripts-test/globalSettings.js deleted file mode 100644 index b6d0c52ec14..00000000000 --- a/ui/scripts-test/globalSettings.js +++ /dev/null @@ -1,26 +0,0 @@ -(function(cloudStack) { - cloudStack.sections['global-settings'] = { - title: 'Global Settings', - id: 'global-settings', - listView: { - label: 'Global Settings', - actions: { - edit: { - label: 'Change value', - action: function(args) { - args.response.success(); - }, - notification: { - poll: testData.notifications.testPoll - } - } - }, - fields: { - name: { label: 'Name', id: true }, - description: { label: 'Description' }, - value: { label: 'Value', editable: true } - }, - dataProvider: testData.dataProvider.listView('globalSettings') - } - }; -})(cloudStack); diff --git a/ui/scripts-test/installWizard.js b/ui/scripts-test/installWizard.js deleted file mode 100644 index 7a2b6a13e1f..00000000000 --- a/ui/scripts-test/installWizard.js +++ /dev/null @@ -1,287 +0,0 @@ -(function($, cloudStack, testData) { - cloudStack.installWizard = { - // Check if install wizard should be invoked - check: function(args) { - args.response.success({ - doInstall: args.context.users[0].username == 'newuser' - }); - }, - - changeUser: function(args) { - setTimeout(function() { - args.response.success({ - data: { - newUser: { - username: args.data.username - } - } - }); - }, 500); - }, - - // Copy text - copy: { - // Tooltips - 'tooltip.addZone.name': function(args) { - args.response.success({ - text: 'A name for the zone.' - }); - }, - - 'tooltip.addZone.dns1': function(args) { - args.response.success({ - text: 'These are DNS servers for use by guest VMs in the zone. These DNS servers will be accessed via the public network you will add later. The public IP addresses for the zone must have a route to the DNS server named here.' - }); - }, - - 'tooltip.addZone.dns2': function(args) { - args.response.success({ - text: 'These are DNS servers for use by guest VMs in the zone. These DNS servers will be accessed via the public network you will add later. The public IP addresses for the zone must have a route to the DNS server named here.' - }); - }, - - 'tooltip.addZone.internaldns1': function(args) { - args.response.success({ - text: 'These are DNS servers for use by system VMs in the zone. These DNS servers will be accessed via the private network interface of the System VMs. The private IP address you provide for the pods must have a route to the DNS server named here.' - }); - }, - - 'tooltip.addZone.internaldns2': function(args) { - args.response.success({ - text: 'These are DNS servers for use by system VMs in the zone. These DNS servers will be accessed via the private network interface of the System VMs. The private IP address you provide for the pods must have a route to the DNS server named here.' - }); - }, - - 'tooltip.addGuestNetwork.name': function(args) { - args.response.success({ - text: 'A name for your network' - }); - }, - - 'tooltip.addGuestNetwork.description': function(args) { - args.response.success({ - text: 'A description for your network' - }); - }, - - 'tooltip.addGuestNetwork.guestGateway': function(args) { - args.response.success({ - text: 'The gateway that the guests should use' - }); - }, - - 'tooltip.addGuestNetwork.guestNetmask': function(args) { - args.response.success({ - text: 'The netmask in use on the subnet that the guests should use' - }); - }, - - 'tooltip.addGuestNetwork.guestStartIp': function(args) { - args.response.success({ - text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.' - }); - }, - - 'tooltip.addGuestNetwork.guestEndIp': function(args) { - args.response.success({ - text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.' - }); - }, - - 'tooltip.addPod.name': function(args) { - args.response.success({ - text: 'A name for the pod' - }); - }, - - 'tooltip.addPod.gateway': function(args) { - args.response.success({ - text: 'The gateway for the hosts in that pod.' - }); - }, - - 'tooltip.addPod.netmask': function(args) { - args.response.success({ - text: 'The netmask in use on the subnet the guests will use.' - }); - }, - - 'tooltip.addPod.startip': function(args) { - args.response.success({ - text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.' - }); - }, - - 'tooltip.addPod.endip': function(args) { - args.response.success({ - text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.' - }); - }, - - 'tooltip.addCluster.name': function(args) { - args.response.success({ - text: 'A name for the cluster. This can be text of your choosing and is not used by CloudStack.' - }); - }, - - 'tooltip.addHost.hostname': function(args) { - args.response.success({ - text: 'The DNS name or IP address of the host.' - }); - }, - - 'tooltip.addHost.username': function(args) { - args.response.success({ - text: 'Usually root.' - }); - }, - - 'tooltip.addHost.password': function(args) { - args.response.success({ - text: 'This is the password for the user named above (from your XenServer install).' - }); - }, - - 'tooltip.addPrimaryStorage.name': function(args) { - args.response.success({ - text: 'The name for the storage device.' - }); - }, - - 'tooltip.addPrimaryStorage.server': function(args) { - args.response.success({ - text: '(for NFS, iSCSI, or PreSetup) The IP address or DNS name of the storage device.' - }); - }, - - 'tooltip.addPrimaryStorage.path': function(args) { - args.response.success({ - text: '(for NFS) In NFS this is the exported path from the server. Path (for SharedMountPoint). With KVM this is the path on each host that is where this primary storage is mounted. For example, "/mnt/primary".' - }); - }, - - 'tooltip.addSecondaryStorage.nfsServer': function(args) { - args.response.success({ - text: 'The IP address of the NFS server hosting the secondary storage' - }); - }, - - 'tooltip.addSecondaryStorage.path': function(args) { - args.response.success({ - text: 'The exported path, located on the server you specified above' - }); - }, - - // Intro text - whatIsCloudStack: function(args) { - args.response.success({ - text: 'CloudStack™ is a software platform that pools computing resources to build public, private, and hybrid Infrastructure as a Service (IaaS) clouds. CloudStack™ manages the network, storage, and compute nodes that make up a cloud infrastructure. Use CloudStack™ to deploy, manage, and configure cloud computing environments.

Extending beyond individual virtual machine images running on commodity hardware, CloudStack™ provides a turnkey cloud infrastructure software stack for delivering virtual datacenters as a service - delivering all of the essential components to build, deploy, and manage multi-tier and multi-tenant cloud applications. Both open-source and Premium versions are available, with the open-source version offering nearly identical features. ' - }); - }, - - whatIsAZone: function(args) { - args.response.success({ - text: 'A zone is the largest organizational unit within a CloudStack™ deployment. A zone typically corresponds to a single datacenter, although it is permissible to have multiple zones in a datacenter. The benefit of organizing infrastructure into zones is to provide physical isolation and redundancy. For example, each zone can have its own power supply and network uplink, and the zones can be widely separated geographically (though this is not required).' - }); - }, - - whatIsAPod: function(args) { - args.response.success({ - text: 'A pod often represents a single rack. Hosts in the same pod are in the same subnet.

A pod is the second-largest organizational unit within a CloudStack™ deployment. Pods are contained within zones. Each zone can contain one or more pods; in the Basic Installation, you will have just one pod in your zone' - }); - }, - - whatIsACluster: function(args) { - args.response.success({ - text: 'A cluster provides a way to group hosts. The hosts in a cluster all have identical hardware, run the same hypervisor, are on the same subnet, and access the same shared storage. Virtual machine instances (VMs) can be live-migrated from one host to another within the same cluster, without interrupting service to the user. A cluster is the third-largest organizational unit within a CloudStack™ deployment. Clusters are contained within pods, and pods are contained within zones.

CloudStack™ allows multiple clusters in a cloud deployment, but for a Basic Installation, we only need one cluster. ' - }); - }, - - whatIsAHost: function(args) { - args.response.success({ - text: 'A host is a single computer. Hosts provide the computing resources that run the guest virtual machines. Each host has hypervisor software installed on it to manage the guest VMs (except for bare metal hosts, which are a special case discussed in the Advanced Installation Guide). For example, a Linux KVM-enabled server, a Citrix XenServer server, and an ESXi server are hosts. In a Basic Installation, we use a single host running XenServer.

The host is the smallest organizational unit within a CloudStack™ deployment. Hosts are contained within clusters, clusters are contained within pods, and pods are contained within zones. ' - }); - }, - - whatIsPrimaryStorage: function(args) { - args.response.success({ - text: 'A CloudStack™ cloud infrastructure makes use of two types of storage: primary storage and secondary storage. Both of these can be iSCSI or NFS servers, or localdisk.

Primary storage is associated with a cluster, and it stores the disk volumes of each guest VM for all the VMs running on hosts in that cluster. The primary storage server is typically located close to the hosts. ' - }); - }, - - whatIsSecondaryStorage: function(args) { - args.response.success({ - text: 'Secondary storage is associated with a zone, and it stores the following:' - }); - } - }, - - action: function(args) { - var complete = args.response.success; - var error = args.response.error; - var message = args.response.message; - var startFn = args.startFn; - - var createZone = function(args) { - message('Creating zone'); - setTimeout(function() { - createPod(); - }, 500); - }; - - var createPod = function(args) { - message('Creating pod'); - setTimeout(function() { - createIPRange(); - }, 500); - }; - - var createIPRange = function(args) { - message('Creating network'); - setTimeout(function() { - createCluster(); - }, 500); - }; - - var createCluster = function(args) { - message('Creating cluster'); - setTimeout(function() { - createHost(); - //error('addCluster', 'Could not create cluster.', createPod); - }, 500); - }; - - var createHost = function(args) { - message('Creating host'); - setTimeout(function() { - createPrimaryStorage(); - }, 500); - }; - - var createPrimaryStorage = function(args) { - message('Creating primary storage'); - setTimeout(function() { - createSecondaryStorage(); - }, 500); - }; - - var createSecondaryStorage = function(args) { - message('Creating secondary storage'); - setTimeout(function() { - pollSystemVMs(); - }, 500); - }; - - var pollSystemVMs = function() { - message('Creating system VMs (this may take a while)'); - setTimeout(complete, 5000); - }; - - if (startFn) { - startFn(); - } else { - createZone(); - } - } - }; -}(jQuery, cloudStack, testData)); diff --git a/ui/scripts-test/instances.js b/ui/scripts-test/instances.js deleted file mode 100644 index d6d0529c91e..00000000000 --- a/ui/scripts-test/instances.js +++ /dev/null @@ -1,497 +0,0 @@ -(function($, cloudStack) { - cloudStack.sections.instances = { - title: 'Instances', - id: 'instances', - listView: { - section: 'instances', - filters: { - mine: { label: 'My instances' }, - all: { label: 'All instances' }, - running: { label: 'Running instances' }, - destroyed: { label: 'Destroyed instances' } - }, - fields: { - name: { label: 'Name', editable: true }, - account: { label: 'Account' }, - zonename: { label: 'Zone' }, - state: { - label: 'Status', - indicator: { - 'Running': 'on', - 'Stopped': 'off', - 'Destroyed': 'off' - } - } - }, - - // List view actions - actions: { - // Add instance wizard - add: { - label: 'Add instance', - - action: { - custom: cloudStack.instanceWizard({ - steps: [ - // Step 1: Setup - function(args) { - args.response.success({ - data: { - zones: testData.data.zones - } - }); - }, - - // Step 2: Select template - function(args) { - args.response.success({ - hypervisor: { - idField: 'id', - nameField: 'displayname' - }, - data: { - templates: { - featuredtemplates: $.grep(testData.data.isos, function(elem) { - return elem.isfeatured === true; - }), - communitytemplates: [], - mytemplates: $.grep(testData.data.isos, function(elem) { - return elem.isfeatured === true; - }), - isos: $.grep(testData.data.isos, function(elem) { - return elem.isfeatured === false; - }) - }, - hypervisors: [ - { id: 123, displayname: 'KVM' }, - { id: 124, displayname: 'Xen' }, - { id: 125, displayname: 'VMWare' } - ] - } - }); - }, - - // Step 3: Service offering - function(args) { - args.response.success({ - data: { - serviceOfferings: testData.data.serviceOfferings - } - }); - }, - - // Step 4: Data disk offering - function(args) { - args.response.success({ - required: true, - customFlag: 'iscustomized', // Field determines if custom slider is shown - data: { - diskOfferings: testData.data.diskOfferings - } - }); - }, - - // Step 5: Network - function(args) { - args.response.success({ - type: 'select-network', - data: { - myNetworks: $.grep(testData.data.networks, function(elem) { - return elem.isdefault === true; - }), - sharedNetworks: $.grep(testData.data.networks, function(elem) { - return elem.isdefault === false; - }), - securityGroups: testData.data.securityGroups, - networkOfferings: testData.data.networkOfferings - } - }); - }, - - // Step 6: Review - function(args) { - args.response.success({}); - } - ], - action: function(args) { - args.response.success({ - _custom: { jobID: 12345 } - }); - } - }) - }, - - messages: { - confirm: function(args) { - return 'Are you sure you want to add ' + args.name + '?'; - }, - notification: function(args) { - return 'Creating new VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.customPoll( - testData.data.instances[1] - ) - } - }, - - edit: { - label: 'Edit instance name', - action: function(args) { - if ((args.data.name) == '') { - args.response.error({ message: 'Instance name cannot be blank.' }); - } else { - args.response.success(); - } - } - }, - - restart: { - label: 'Restart instance', - action: function(args) { - setTimeout(function() { - args.response.success({ - data: { - state: 'Restarting' - } - }); - }, 1000); - }, - messages: { - confirm: function(args) { - return 'Are you sure you want to restart ' + args.name + '?'; - }, - notification: function(args) { - return 'Rebooting VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.customPoll({ - state: 'Running' - }) - } - }, - stop: { - label: 'Stop instance', - action: function(args) { - setTimeout(function() { - args.response.success({ - data: { state: 'Stopping' } - }); - }, 500); - }, - messages: { - confirm: function(args) { - return 'Are you sure you want to shutdown ' + args.name + '?'; - }, - notification: function(args) { - return 'Rebooting VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.customPoll({ - state: 'Stopped' - }) - } - }, - start: { - label: 'Start instance', - action: function(args) { - setTimeout(function() { - args.response.success({ - data: { state: 'Starting' } - }); - }, 500); - }, - messages: { - confirm: function(args) { - return 'Are you sure you want to start ' + args.name + '?'; - }, - notification: function(args) { - return 'Starting VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.customPoll({ - state: 'Running' - }) - } - }, - destroy: { - label: 'Destroy instance', - messages: { - confirm: function(args) { - return 'Are you sure you want to destroy ' + args.name + '?'; - }, - notification: function(args) { - return 'Destroyed VM: ' + args.name; - } - }, - action: function(args) { - setTimeout(function() { - args.response.success({ data: { state: 'Destroying' }}); - }, 200); - }, - notification: { - poll: testData.notifications.customPoll({ - state: 'Destroyed' - }) - } - } - }, - dataProvider: testData.dataProvider.listView('instances'), - detailView: { - name: 'Instance details', - viewAll: { path: 'storage.volumes', label: 'Volumes' }, - - // Detail view actions - actions: { - edit: { - label: 'Edit VM details', action: function(args) { - setTimeout(function() { - args.response.success(); - }, 500); - }, - notification: { - poll: testData.notifications.testPoll - } - }, - viewConsole: { - label: 'View VM console', - action: { - externalLink: { - url: function(args) { - return 'http://localhost:8080/client/console?cmd=access&vm=' + - args.context.instances[0].id; - }, - title: function(args) { - return args.context.instances[0].displayname + ' console'; - }, - width: 800, - height: 600 - } - } - }, - stop: { - label: 'Stop VM', - messages: { - confirm: function(args) { - return 'Are you sure you want to stop ' + args.name + '?'; - }, - notification: function(args) { - return 'Stopping VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.customPoll({ - state: 'Stopped' - }) - }, - action: function(args) { - setTimeout(function() { - args.response.success({ - _custom: { jobID: args.data.id } - }); - }, 1000); - } - }, - start: { - label: 'Start VM', - messages: { - confirm: function(args) { - return 'Are you sure you want to start ' + args.name + '?'; - }, - notification: function(args) { - return 'Starting VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.customPoll({ - state: 'Running' - }) - }, - action: function(args) { - setTimeout(function() { - args.response.success({ - _custom: { jobID: args.data.id } - }); - }, 1000); - } - }, - restart: { - label: 'Restart VM', - messages: { - confirm: function(args) { - return 'Are you sure you want to restart ' + args.name + '?'; - }, - notification: function(args) { - return 'Rebooting VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.testPoll - }, - action: function(args) { - setTimeout(function() { - args.response.success({ - _custom: { jobID: args.data.id } - }); - }, 1000); - } - }, - destroy: { - label: 'Destroy VM', - messages: { - confirm: function(args) { - return 'Are you sure you want to destroy ' + args.name + '?'; - }, - notification: function(args) { - return 'Destroying VM: ' + args.name; - } - }, - notification: { - poll: testData.notifications.customPoll({ - state: 'Destroyed' - }) - }, - action: function(args) { - setTimeout(function() { - args.response.success(); - }, 1000); - } - }, - migrate: { - notification: { - desc: 'Migrated VM', - poll: testData.notifications.testPoll - }, - label: 'Migrate VM', action: function(args) { - args.response.success(); - } - }, - attachISO: { - label: 'Attach ISO', action: function(args) { - args.response.success(); - } - }, - resetPassword: { - label: 'Reset password', - preAction: function(args) { - cloudStack.dialog.notice({ - message: 'You cannot reset your password.' - }); - - return false; - }, - action: function(args) { - args.response.success({}); - }, - messages: { - confirm: function(args) { - return 'Do you really want to reset your password?'; - }, - notification: function(args) { - return 'Resetting VM password'; - }, - complete: function(args) { - return 'VM password reset. New password is: ' + args.password; - } - }, - notification: { - poll: testData.notifications.customPoll({ - password: '1284018jaj#' - }) - } - }, - changeService: { - label: 'Change Service', action: function(args) { - args.response.success(); - } - } - }, - tabs: { - // Details tab - details: { - title: 'Details', - fields: [ - { - name: { - label: 'Name', isEditable: true - } - }, - { - id: { label: 'ID', isEditable: false }, - zonename: { label: 'Zone', isEditable: false }, - templateid: { - label: 'Template type', - isEditable: true, - select: function(args) { - var items = []; - - $(testData.data.templates).each(function() { - items.push({ id: this.id, description: this.name }); - }); - setTimeout(function() { - args.response.success({ data: items }); - }, 500); - } - }, - serviceofferingname: { label: 'Service offering', isEditable: false }, - group: { label: 'Group', isEditable: true } - } - ], - dataProvider: testData.dataProvider.detailView('instances') - }, - - /** - * NICs tab - */ - nics: { - title: 'NICs', - isMultiple: true, - preFilter: function(args) { - return ['type']; - }, - fields: [ - { - name: { label: 'Name', header: true }, - ipaddress: { label: 'IP Address' }, - gateway: { label: 'Default gateway' }, - netmask: { label: 'Netmask' }, - type: { label: 'Type' } - } - ], - dataProvider: function(args) { - setTimeout(function() { - var instance = $.grep(testData.data.instances, function(elem) { - return elem.id == args.id; - }); - args.response.success({ - data: $.map(instance[0].nic, function(item, index) { - item.name = 'NIC ' + (index + 1); - return item; - }) - }); - }, 500); - } - }, - - /** - * Statistics tab - */ - stats: { - title: 'Statistics', - fields: { - cpuspeed: { label: 'Total CPU' }, - cpuused: { label: 'CPU Utilized' }, - networkkbsread: { label: 'Network Read' }, - networkkbswrite: { label: 'Network Write' } - }, - dataProvider: testData.dataProvider.detailView('instances') - } - } - } - } - }; -})(jQuery, cloudStack); diff --git a/ui/scripts-test/network.js b/ui/scripts-test/network.js deleted file mode 100644 index 32cfca82e5b..00000000000 --- a/ui/scripts-test/network.js +++ /dev/null @@ -1,1050 +0,0 @@ -(function(cloudStack, testData, $) { - cloudStack.sections.network = { - title: 'Network', - id: 'network', - sectionSelect: { - label: 'Select view' - }, - sections: { - networks: { - type: 'select', - title: 'Networks', - listView: { - filters: { - all: { label: 'All' }, - mine: { label: 'My network' } - }, - fields: { - displaytext: { label: 'Name' }, - traffictype: { label: 'Traffic Type' }, - gateway: { label: 'Gateway' }, - vlan: { label: 'VLAN' } - }, - dataProvider: testData.dataProvider.listView('networks'), - - detailView: { - name: 'Network details', - viewAll: { path: 'network.ipAddresses', label: 'IP Addresses' }, - tabs: { - details: { - title: 'Details', - fields: [ - { - displaytext: { label: 'Name' } - }, - { - name: { label: 'Short name' }, - traffictype: { label: 'Traffic Type' }, - gateway: { label: 'Gateway' }, - vlan: { label: 'VLAN' } - }, - { - startip: { label: 'Start IP' }, - endip: { label: 'End IP' } - } - ], - dataProvider: testData.dataProvider.detailView('networks') - } - } - } - } - }, - ipAddresses: { - type: 'select', - title: 'IP Addresses', - listView: { - id: 'ipAddresses', - label: 'IPs', - filters: { - allocated: { label: 'Allocated ' }, - mine: { label: 'My network' } - }, - fields: { - ipaddress: { - label: 'IP', - converter: function(text, item) { - if (item.issourcenat) { - return text + ' [Source NAT]'; - } - - return text; - } - }, - zonename: { label: 'Zone' }, - vlanname: { label: 'VLAN' }, - networkid: { label: 'Network Type' }, - state: { label: 'State', indicator: { 'Allocated': 'on' } } - }, - - actions: { - add: { - label: 'Acquire new IP', - - action: function(args) { - args.response.success(); - }, - - messages: { - confirm: function(args) { - return 'Are you sure you want to add this new IP?'; - }, - notification: function(args) { - return 'Allocated IP'; - } - }, - - createForm: { - title: 'Acquire new IP', - desc: 'Please select a zone from which you want to acquire your new IP from.', - fields: { - zonename: { - label: 'Zone', - select: function(args) { - setTimeout(function() { - args.response.success({ - data: [ - { id: 'San Jose', description: 'San Jose' }, - { id: 'Chicago', description: 'Chicago' } - ] - }); - }, 10); - } - } - } - }, - - notification: { - poll: testData.notifications.customPoll(testData.data.network[0]) - } - }, - enableStaticNAT: { - label: 'Enable static NAT', - action: { - noAdd: true, - custom: cloudStack.uiCustom.enableStaticNAT({ - listView: cloudStack.sections.instances, - action: function(args) { - args.response.success(); - } - }) - }, - messages: { - notification: function(args) { - return 'Enabled Static NAT'; - } - }, - notification: { - poll: testData.notifications.customPoll({ isstaticnat: true }) - } - }, - disableStaticNAT: { - label: 'Disable static NAT', - action: function(args) { - args.response.success(); - }, - messages: { - confirm: function(args) { - return 'Are you sure you want to disable static NAT?'; - }, - notification: function(args) { - return 'Disabled Static NAT'; - } - }, - notification: { - poll: testData.notifications.customPoll({ isstaticnat: false }) - } - } - }, - dataProvider: testData.dataProvider.listView('network'), - - // Detail view - detailView: { - name: 'IP address detail', - // Example tab filter - tabFilter: function(args) { - var disabledTabs = []; - var ipAddress = args.context.ipAddresses[0]; - - if (!ipAddress.issourcenat || - (ipAddress.issourcenat && !ipAddress.vpnenabled)) { - disabledTabs.push('vpn'); - } - - return disabledTabs; - }, - actions: { - enableStaticNAT: { - label: 'Enable static NAT', - action: { - noAdd: true, - custom: cloudStack.uiCustom.enableStaticNAT({ - listView: cloudStack.sections.instances, - action: function(args) { - args.response.success(); - } - }) - }, - messages: { - notification: function(args) { - return 'Enabled Static NAT'; - } - }, - notification: { - poll: testData.notifications.customPoll({ isstaticnat: true }) - } - }, - disableStaticNAT: { - label: 'Disable static NAT', - action: function(args) { - args.response.success(); - }, - messages: { - confirm: function(args) { - return 'Are you sure you want to disable static NAT?'; - }, - notification: function(args) { - return 'Disabled Static NAT'; - } - }, - notification: { - poll: testData.notifications.customPoll({ isstaticnat: false }) - } - }, - enableVPN: { - label: 'Enable VPN', - action: function(args) { - args.response.success(); - }, - messages: { - confirm: function(args) { - return 'Please confirm that you want VPN enabled for this IP address.'; - }, - notification: function(args) { - return 'Enabled VPN'; - }, - complete: function(args) { - return 'VPN is now enabled for IP ' + args.publicip + '.' - + '
Your IPsec pre-shared key is:
' + args.presharedkey; - } - }, - notification: { - poll: testData.notifications.customPoll({ - publicip: '10.2.2.1', - presharedkey: '23fudh881ssx88199488PP!#Dwdw', - vpnenabled: true - }) - } - }, - disableVPN: { - label: 'Disable VPN', - action: function(args) { - args.response.success(); - }, - messages: { - confirm: function(args) { - return 'Are you sure you want to disable VPN?'; - }, - notification: function(args) { - return 'Disabled VPN'; - } - }, - notification: { - poll: testData.notifications.customPoll({ vpnenabled: false }) - } - } - }, - tabs: { - details: { - title: 'Details', - fields: [ - { - ipaddress: { label: 'IP' } - }, - { - state: { label: 'State' }, - zonename: { label: 'Zone' }, - vlanname: { label: 'VLAN' }, - issourcenat: { label: 'Source NAT' } - } - ], - dataProvider: testData.dataProvider.detailView('network') - }, - - ipRules: { - title: 'Configuration', - custom: cloudStack.ipRules({ - preFilter: function(args) { - if (args.context.ipAddresses[0].isstaticnat) { - return args.items; // All items filtered means static NAT - } - - return []; - }, - - // Firewall rules - firewall: { - noSelect: true, - fields: { - 'cidrlist': { edit: true, label: 'Source CIDR' }, - 'protocol': { - label: 'Protocol', - select: function(args) { - args.$select.change(function() { - var $inputs = args.$form.find('input'); - var $icmpFields = $inputs.filter(function() { - var name = $(this).attr('name'); - - return $.inArray(name, [ - 'icmptype', - 'icmpcode' - ]) > -1; - }); - var $otherFields = $inputs.filter(function() { - var name = $(this).attr('name'); - - return name != 'icmptype' && name != 'icmpcode' && name != 'cidrlist'; - }); - - if ($(this).val() == 'icmp') { - $icmpFields.attr('disabled', false); - $otherFields.attr('disabled', 'disabled'); - } else { - $otherFields.attr('disabled', false); - $icmpFields.attr('disabled', 'disabled'); - } - }); - - args.response.success({ - data: [ - { name: 'tcp', description: 'TCP' }, - { name: 'udp', description: 'UDP' }, - { name: 'icmp', description: 'ICMP' } - ] - }); - } - }, - 'startport': { edit: true, label: 'Start Port' }, - 'endport': { edit: true, label: 'End Port' }, - 'icmptype': { edit: true, label: 'ICMP Type', isDisabled: true }, - 'icmpcode': { edit: true, label: 'ICMP Code', isDisabled: true }, - 'add-rule': { - label: 'Add', - addButton: true - } - }, - add: { - label: 'Add', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Add firewall rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - }, - actions: { - destroy: { - label: 'Remove Rule', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Remove firewall rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - } - }, - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: [ - { - "id": 11, - "protocol": "icmp", - "ipaddressid": 4, - "ipaddress": "10.223.71.23", - "state": "Active", - "cidrlist": "0.0.0.0/0", - "icmptype": 2, - "icmpcode": 22 - }, - { - "id": 10, - "protocol": "udp", - "startport": "500", - "endport": "10000", - "ipaddressid": 4, - "ipaddress": "10.223.71.23", - "state": "Active", - "cidrlist": "0.0.0.0/24" - }, - { - "id": 9, - "protocol": "tcp", - "startport": "20", - "endport": "200", - "ipaddressid": 4, - "ipaddress": "10.223.71.23", - "state": "Active", - "cidrlist": "0.0.0.0/24" - } - ] - }); - }, 100); - } - }, - - staticNATDataProvider: function(args) { - args.response.success({ - data: testData.data.networks[0] - }); - }, - - vmDataProvider: function(args) { - args.response.success({ - data: testData.data.instances[1] - }); - }, - - vmDetails: cloudStack.sections.instances.listView.detailView, - - staticNAT: { - noSelect: true, - fields: { - 'protocol': { - label: 'Protocol', - select: function(args) { - args.response.success({ - data: [ - { name: 'tcp', description: 'TCP' }, - { name: 'udp', description: 'UDP' } - ] - }); - } - }, - 'startport': { edit: true, label: 'Start Port' }, - 'endport': { edit: true, label: 'End Port' }, - 'add-rule': { - label: 'Add', - addButton: true - } - }, - add: { - label: 'Add', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Add static NAT rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - }, - actions: { - destroy: { - label: 'Remove Rule', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Remove static NAT rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - } - }, - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: [ - { - "id": 10, - "protocol": "udp", - "startport": "500", - "endport": "10000", - "ipaddressid": 4, - "ipaddress": "10.223.71.23", - "state": "Active", - "cidrlist": "0.0.0.0/24" - }, - { - "id": 9, - "protocol": "tcp", - "startport": "20", - "endport": "200", - "ipaddressid": 4, - "ipaddress": "10.223.71.23", - "state": "Active", - "cidrlist": "0.0.0.0/24" - } - ] - }); - }, 100); - } - }, - - // Load balancing rules - loadBalancing: { - listView: cloudStack.sections.instances, - multipleAdd: true, - fields: { - 'name': { edit: true, label: 'Name' }, - 'publicport': { edit: true, label: 'Public Port' }, - 'privateport': { edit: true, label: 'Private Port' }, - 'algorithm': { - label: 'Algorithm', - select: function(args) { - args.response.success({ - data: [ - { name: 'roundrobin', description: 'Round-robin' }, - { name: 'leastconn', description: 'Least connections' }, - { name: 'source', description: 'Source' } - ] - }); - } - }, - 'sticky': { - label: 'Sticky Policy', - custom: { - buttonLabel: 'Configure', - action: function(args) { - var success = args.response.success; - var fields = { - method: { - label: 'Stickiness method', - select: function(args) { - var $select = args.$select; - var $form = $select.closest('form'); - - args.response.success({ - data: [ - { - id: 'none', - description: 'None' - }, - { - id: 'lb', - description: 'LB-based' - }, - { - id: 'cookie', - description: 'Cookie-based' - }, - { - id: 'source', - description: 'Source-based' - } - ] - }, 500); - - $select.change(function() { - var value = $select.val(); - var showFields = []; - - switch (value) { - case 'none': - showFields = []; - break; - case 'lb': - showFields = ['name', 'mode', 'nocache', 'indirect', 'postonly', 'domain']; - break; - case 'cookie': - showFields = ['name', 'length', 'holdtime', 'request-learn', 'prefix', 'mode']; - break; - case 'source': - showFields = ['tablesize', 'expire']; - break; - } - - $select.closest('.form-item').siblings('.form-item').each(function() { - var $field = $(this); - var id = $field.attr('rel'); - - if ($.inArray(id, showFields) > -1) { - $field.css('display', 'inline-block'); - } else { - $field.hide(); - } - }); - - $select.closest(':ui-dialog').dialog('option', 'position', 'center'); - }); - } - }, - name: { label: 'Name', validation: { required: true }, isHidden: true }, - mode: { label: 'Mode', isHidden: true }, - length: { label: 'Length', validation: { required: true }, isHidden: true }, - holdtime: { label: 'Hold Time', validation: { required: true }, isHidden: true }, - tablesize: { label: 'Table size', isHidden: true }, - expire: { label: 'Expire', isHidden: true }, - requestlearn: { label: 'Request-Learn', isBoolean: true, isHidden: true }, - prefix: { label: 'Prefix', isBoolean: true, isHidden: true }, - nocache: { label: 'No cache', isBoolean: true, isHidden: true }, - indirect: { label: 'Indirect', isBoolean: true, isHidden: true }, - postonly: { label: 'Is post-only', isBoolean: true, isHidden: true }, - domain: { label: 'Domain', isBoolean: true, isHidden: true } - }; - - if (args.data) { - var populatedFields = $.map(fields, function(field, id) { - return id; - }); - - $(populatedFields).each(function() { - var id = this; - var field = fields[id]; - var dataItem = args.data[id]; - - if (field.isBoolean) { - field.isChecked = dataItem ? true : false; - } else { - field.defaultValue = dataItem; - } - }); - } - - cloudStack.dialog.createForm({ - form: { - title: 'Configure Sticky Policy', - desc: 'Please complete the following fields', - fields: fields - }, - after: function(args) { - var data = cloudStack.serializeForm(args.$form); - success({ - data: $.extend(data, { - _buttonLabel: data.method.toUpperCase() - }) - }); - } - }); - } - } - }, - 'add-vm': { - label: 'Add VMs', - addButton: true - } - }, - add: { - label: 'Add VMs', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Add load balancing rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - }, - actions: { - destroy: { - label: 'Remove load balancing rule', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Remove load balancing rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - } - }, - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: [ - { - "id": 13, - "name": "HTTP", - "publicipid": 4, - "publicip": "10.223.71.23", - "publicport": "80", - "privateport": "80", - "algorithm": "roundrobin", - "cidrlist": "", - "account": "admin", - "domainid": 1, - "domain": "ROOT", - "state": "Active", - "zoneid": 1, - _itemData: [ - testData.data.instances[0], - testData.data.instances[1], - testData.data.instances[2], - testData.data.instances[3] - ], - sticky: { - _buttonLabel: 'lb'.toUpperCase(), - method: 'lb', - name: 'StickyTest', - mode: '123', - nocache: true, - indirect: false, - postonly: true, - domain: false - } - } - ] - }); - }, 100); - } - }, - - // Port forwarding rules - portForwarding: { - listView: cloudStack.sections.instances, - fields: { - 'private-ports': { - edit: true, - label: 'Private Ports', - range: ['privateport', 'privateendport'] - }, - 'public-ports': { - edit: true, - label: 'Public Ports', - range: ['publicport', 'publicendport'] - }, - 'protocol': { - label: 'Protocol', - select: function(args) { - args.response.success({ - data: [ - { name: 'tcp', description: 'TCP' }, - { name: 'udp', description: 'UDP' } - ] - }); - } - }, - 'add-vm': { - label: 'Add VM', - addButton: true - } - }, - add: { - label: 'Add VM', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Add port forwarding rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - }, - actions: { - destroy: { - label: 'Remove port forwarding rule', - action: function(args) { - setTimeout(function() { - args.response.success({ - notification: { - label: 'Remove port forwarding rule', - poll: testData.notifications.testPoll - } - }); - }, 500); - } - } - }, - dataProvider: function(args) { - setTimeout(function() { - args.response.success({ - data: [ - { - "id": 12, - "privateport": "22", - "privateendport": "22", - "protocol": "tcp", - "publicport": "22", - "publicendport": "22", - "virtualmachineid": 10, - "virtualmachinename": "i-2-10-TEST", - "virtualmachinedisplayname": "i-2-10-TEST", - "ipaddressid": 4, - "ipaddress": "10.223.71.23", - "state": "Active", - "cidrlist": "", - _itemData: [ - testData.data.instances[5] - ] - } - ] - }); - }, 100); - } - } - }) - }, - vpn: { - title: 'VPN', - custom: function(args) { - var ipAddress = args.context.networks[0].ipaddress; - var psk = '081XufGFmEDBAEfsfdXTNpramSZ'; - - return $('
').append( - $('