Sha256: b2b82dbc62463af48d079dbb99ce81010ab59d656848d703f8c8d649ab49bd42

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 KB

Contents

<form id="script" class="clearfix script" method="post">
  <div class="form-group">
    <textarea name="script" class="form-control" placeholder="Your Script..." rows="8"></textarea>
  </div>
  <div class="pull-right">
    <select name="type" class="form-control">
      <option value="ruby">Ruby</option>
      <option value="ruby_debug">Ruby (Debug Mode)</option>
      <option value="bash">Bash</option>
    </select>
    <button type="submit" class="btn btn-primary">Submit</button>
  </div>
</form>

<div id="content"></div>

<script type="text/javascript">
  var $content = $("#content");

  $('#script').ajaxForm({
    beforeSend: function() {
      $content
        .html('<hr/>')
        .append('<span class="text-info">Loading...</span>')
    },
    error: function() {
      $content
        .html('<hr/>')
        .append('<span class="text-danger">Oops! Something went wrong, please try again later!</span>')
    },
    success: function(json) {
      try {
        var data = JSON.parse(json);
        $content
          .html('<hr/>')
          .append('<span class="text-info">' + data.server_hostname + '</span>')
          .append(ansi_up.ansi_to_html(data.content));
      } catch (error) {
        console.log(error)
      }
    }
  });
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tailog-0.4.7 app/views/script/index.erb
tailog-0.4.6 app/views/script/index.erb