static.js.views.over-view.js Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of gobblin-admin Show documentation
                Show all versions of gobblin-admin Show documentation
Gobblin Ingestion Framework
                
             The newest version!
        
        /* global Backbone, _, jQuery */
var app = app || {}
;(function ($) {
  app.OverView = Backbone.View.extend({
    el: '#main-content',
    headerTemplate: _.template($('#header-template').html()),
    contentTemplate: _.template($('#list-all-template').html()),
    events: {
      'click #query-btn': '_fetchData'
    },
    initialize: function () {
      this.collection = app.jobExecutions
      this.headerEl = this.$el.find('#header-container')
      this.contentEl = this.$el.find('#content-container')
      this.render()
    },
    render: function () {
      var self = this
      self.headerEl.html(self.headerTemplate({
        header: {
          title: 'Gobblin Jobs'
        }
      }))
      self.contentEl.html(self.contentTemplate({}))
      self.table = new app.TableView({
        el: '#list-all-table-container',
        collection: self.collection,
        columnSchema: 'listJobs',
        includeJobToggle: true
      })
      self._fetchData()
    },
    _fetchData: function () {
      var self = this
      var opts = {
        limit: self.table.getLimit(),
        includeTaskExecutions: false,
        includeJobMetrics: false,
        includeTaskMetrics: false,
        jobProperties: 'job.description,job.runonce,job.schedule',
        taskProperties: ''
      }
      var id = $('#list-jobs-toggle .active input').val()
      self.collection.fetchCurrent('LIST_TYPE', id, opts).done(function () {
        self.table.renderData()
      })
    }
  })
})(jQuery)
    © 2015 - 2025 Weber Informatics LLC | Privacy Policy