Sha256: be683ac5e384fe243869a3dacc7087a48c4c0a1b762ee002721099e7ea434941

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

//TODO figure out how to refresh modal

/**
 * Created by tgregory on 3/10/17.
 */
function azure_rm_subnet_from_vnet() {
    var vnet = $('#azure_rm_vnet').val();
    var imageId = $('#host_compute_attributes_custom_data').val();
    var subnets = $('#azure_rm_subnet');
    if (typeof tfm == 'undefined') {  // earlier than 1.13
        foreman.tools.showSpinner();
    } else {
        tfm.tools.showSpinner();
    }
    $.ajax({
        data: { "image_id": imageId, "vnet": vnet },
        type: "get",
        url: "/azure_rm/subnets",
        complete: function() {
            reloadOnAjaxComplete('#azure_rm_subnet');
            if (typeof tfm == 'undefined') {  // earlier than 1.13
                foreman.tools.hideSpinner();
            } else {
                tfm.tools.hideSpinner();
            }
        },
        error: function(request, status, error) {
            console.log(status);
            console.log(request);
            console.log(error);
        },
        success: function(request_subnets) {
            subnets.empty();
            $.each(request_subnets, function() {
               subnets.append($("<option />").val(this.id).text(this.name));
            });
        }
    });
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_azure_rm-1.3.0 app/assets/javascripts/foreman_azure_rm/azure_rm_subnet_from_vnet.js
foreman_azure_rm-1.2.0 app/assets/javascripts/foreman_azure_rm/azure_rm_subnet_from_vnet.js
foreman_azure_rm-1.1.1 app/assets/javascripts/foreman_azure_rm/azure_rm_subnet_from_vnet.js
foreman_azure_rm-1.1.0 app/assets/javascripts/foreman_azure_rm/azure_rm_subnet_from_vnet.js