Sha256: 90c90b34ff197e712b32474bc85c5e7144c5d304b08f4b293d6ac2e443a218ab

Contents?: true

Size: 1.66 KB

Versions: 1

Compression:

Stored size: 1.66 KB

Contents

.page-header
  .row
    .col-md-7
      %h1
        Backups
        %small
          <i class="ace-icon fa fa-angle-double-right"></i>
          manage backups

%h2 Commands

%ul.list-inline#commands
  %li=link_to 'Backup all', '#', :class=>'btn btn-primary btn-sm', :"data-name"=>'command', :"data-cmd"=>'perform', :"data-cmd-type"=>"full"
  %li=link_to 'Backup app files', '#', :class=>'btn btn-primary btn-sm', :"data-name"=>'command', :"data-cmd"=>'perform', :"data-cmd-type"=>"app_files"
  %li=link_to 'Backup user files', '#', :class=>'btn btn-primary btn-sm', :"data-name"=>'command', :"data-cmd"=>'perform', :"data-cmd-type"=>"user_files"
  %li=link_to 'Backup DB', '#', :class=>'btn btn-primary btn-sm', :"data-name"=>'command', :"data-cmd"=>'perform', :"data-cmd-type"=>"db"

#status_commands.bg-info.well

= render 'list'

:javascript
  // commands
  $( '#commands a[data-name="command"]' ).click(function() {
    //$('#status_commands').html("Handler for .click() called." );
    send_command($(this).data('cmd'), $(this).data('cmd-type'));
  });

  function send_command(cmd, t){
    $('#status_commands').html("Sending...");

    $.ajax({
      url: "/#{Optimacms.config.admin_namespace}/backups/" + cmd,
      data: {t: t},
      type: "GET",
      dataType: "json",
      contentType: "application/json",
      beforeSend: function(){
        // Handle the beforeSend event
      },
      success: function(res){
        $('#status_commands').html("Result: "+res.res+", output: "+res.output);
      },

      complete: function (res) {

      }

    });
  }


  // delete
  $("ul.list-backups").on( "ajax:success", "li a.link_delete", function() {
    $(this).closest('li').hide();
  });

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
optimacms_backups-0.0.14 app/views/optimacms_backups/admin/backups/index.html.haml