Exemplo n.º 1
0
  component.name_model = function(formElement)
  {
    // Validating
    formElement.classList.add('was-validated');

    // If valid...
    if (formElement.checkValidity() === true)
    {
      // Clearing form validation
      formElement.classList.remove('was-validated');
      // Creating new model
      client.put_model(
      {
        mid: component.model._id(),
        name: component.model.name(),
        description: component.model.description(),
        marking: component.model.marking(),
        success: function()
        {
          client.post_model_finish({
            mid: component.model._id(),
            success: function() {
              component.go_to_model();
            }
          });
        },
        error: dialog.ajax_error("Error updating model."),
      });
    }
  };
Exemplo n.º 2
0
 component.close_model = function(model)
 {
   client.put_model(
   {
     mid: model._id(),
     state: "closed",
     success : function()
     {
       window.location.reload(true);
       console.log("set new location in slycat-navbar line 210. This is what causes the reload on first model load.");
     }
   });
 }
Exemplo n.º 3
0
component.name_model = function() {

    // turn off finish button
    $('.vs-finish-button').toggleClass("disabled", true);

    client.put_model(
    {
    mid: component.model._id(),
    name: component.model.name(),
    description: component.model.description(),
    marking: component.model.marking(),
    success: function()
    {
        client.post_model_finish({
        mid: component.model._id(),
        success: function() {

                // do we need to launch a remote job?
                if (launch_remote_job) {

                    start_remote_job();

                } else {

                    // mark as already uploaded and go to model
                    client.put_model_parameter({
                        mid: component.model._id(),
                        aid: "vs-loading-parms",
                        value: ["Uploaded"],
                        success: function () {

                            // go to model
                            component.go_to_model();

                        },
                        error: function () {
                            dialog.ajax_error("Error uploading model status.")("","","");
                            $('.vs-finish-button').toggleClass("disabled", false);
                        }
                    });
                }
            }
        });
    },
    error: dialog.ajax_error("Error updating model."),
    });
};
Exemplo n.º 4
0
  component.name_model = function(formElement)
  {
    // Validating
    formElement.classList.add('was-validated');

    // If valid...
    if (formElement.checkValidity() === true)
    {
      // Clearing form validation
      formElement.classList.remove('was-validated');
      // Creating new model
      client.put_model(
      {
        mid: component.model._id(),
        name: component.model.name(),
        description: component.model.description(),
        marking: component.model.marking(),
        success: function()
        {
          client.put_model_parameter({
            mid: component.model._id(),
            aid: "cluster-linkage",
            value: component.cluster_linkage(),
            input: true,
            success: function() {
              if (component.matrix_type() === "compute")
                component.go_to_model();
              else {
                client.post_model_finish({
                  mid: component.model._id(),
                  success: function() {
                    component.go_to_model();
                  }
                });
              }
            }
          });
        },
        error: dialog.ajax_error("Error updating model."),
      });
    }
  };