<commit_before>/*global define*/
/* jshint -W106, -W069*/
define(['jquery', 'underscore', 'backbone', 'templates', 'humanize', 'helpers/animation', 'marionette'], function($, _, Backbone, JST, humanize, animation) {
    'use strict';

    return Backbone.Marionette.ItemView.extend({
        className: 'gauge card span6 status',
        template: JST['app/scripts/templates/status.ejs'],
        statusTemplate: JST['app/scripts/templates/status-icon.ejs'],
        title: 'status',
        timer: null,
        ui: {
            cardTitle: '.card-title',
            subText: '.subtext',
            monstatus: '.mon-status',
            pgstate: '.pg-status',
            monstate: '.mon-status',
            osdstate: '.osd-status',
            okosd: '.ok-osd',
            warnosd: '.warn-osd',
            failosd: '.fail-osd',
            okpool: '.ok-pool',
            warnpool: '.warn-pool',
            failpool: '.fail-pool',
            okmds: '.ok-mds',
            warnmds: '.warn-mds',
            failmds: '.fail-mds',
            okpg: '.ok-pg',
            warnpg: '.warn-pg',
            failpg: '.fail-pg',
            okmon: '.ok-mon',
            warnmon: '.warn-mon',
            failmon: '.fail-mon',
            spinner: '.icon-spinner'
        },
        modelEvents: {
            'change': 'updateView'
        },
        serializeData: function() {
            return {
                title: this.title,
                relTime: humanize.relativeTime(Date.now() / 1000)
            };
        },
        initialize: function(options) {
            this.disappearAnimation = animation.single('fadeOutUpAnim');
            this.reappearAnimation = animation.single('fadeInDownAnim');
            _.bindAll(this, 'updateView', 'set', 'updateTimer', 'disappear', 'disappearAnimation', 'reappearAnimation', 'reappear', 'makeStatusTemplate');

            // The are defaults for Gauge.js and can be overidden from the contructor
            this.App = Backbone.Marionette.getOption(this, 'App');
            if (this.App) {
                this.listenTo(this.App.vent, 'status:update', this.set);
                this.listenTo(this.App.vent, 'gauges:disappear', this.disappear);
                this.listenTo(this.App.vent, 'gauges:reappear', this.reappear);
                this.listenTo(this.App.vent, 'gauges:expand', this.expand);
                this.listenTo(this.App.vent, 'gauges:collapse', this.collapse);
            }
            if (options && options.App !== undefined) {
                this.App = options.App;
            }
            if (this.App && !this.App.Config['offline']) {
                /* Placeholder */
            }

            var PGStatesTemplate = this.makeStateTemplate('PGs'),
                OSDStatesTemplate = this.makeStateTemplate('OSDs'),
                MONStatesTemplate = this.makeStateTemplate('MONs'),
                pgwarn = this.makeStateInfoView(this.makeStatusTemplate('PG Warn Status', 'icon-question-sign warn'), PGStatesTemplate, '.warn'),
                pgcrit = this.makeStateInfoView(this.makeStatusTemplate('PG Critical Status', 'icon-question-sign fail'), PGStatesTemplate, '.fail'),
                osdwarn = this.makeStateInfoView(this.makeStatusTemplate('OSD Warn Status', 'icon-question-sign warn'), OSDStatesTemplate, '.warn'),
                osdcrit = this.makeStateInfoView(this.makeStatusTemplate('OSD Critical Status', 'icon-question-sign fail'), OSDStatesTemplate, '.fail'),
                monwarn = this.makeStateInfoView(this.makeStatusTemplate('MON Warn Status', 'icon-question-sign warn'), MONStatesTemplate, '.warn'),
                moncrit = this.makeStateInfoView(this.makeStatusTemplate('MON Critical Status', 'icon-question-sign fail'), MONStatesTemplate, '.fail');

            var self = this;
            this.listenToOnce(this, 'render', function() {
                self.listenTo(self.App.vent, 'status:request', function() {
                    self.ui.spinner.css('visibility', 'visible');
                });
                self.listenTo(self.App.vent, 'status:sync status:error', function() {
                    self.ui.spinner.css('visibility', 'hidden');
                });
                if (self.timer === null) {
                    self.updateTimer();
                }
                // wait until self.ui is initialized
                var ui = self.ui;
                self.addPGStateInfo = self.makeStateView(ui.pgstate, pgwarn, pgcrit);
                self.addOSDStateInfo = self.makeStateView(ui.osdstate, osdwarn, osdcrit);
                self.addMONStateInfo = self.makeStateView(ui.monstate, monwarn, moncrit);
            });
        },
        set: function(model) {
            this.model.set(model.attributes);<commit_msg>Make icon larger easier to click (dm)<commit_after>/*global define*/
/* jshint -W106, -W069*/
define(['jquery', 'underscore', 'backbone', 'templates', 'humanize', 'helpers/animation', 'marionette'], function($, _, Backbone, JST, humanize, animation) {
    'use strict';

    return Backbone.Marionette.ItemView.extend({
        className: 'gauge card span6 status',
        template: JST['app/scripts/templates/status.ejs'],
        statusTemplate: JST['app/scripts/templates/status-icon.ejs'],
        title: 'status',
        timer: null,
        ui: {
            cardTitle: '.card-title',
            subText: '.subtext',
            monstatus: '.mon-status',
            pgstate: '.pg-status',
            monstate: '.mon-status',
            osdstate: '.osd-status',
            okosd: '.ok-osd',
            warnosd: '.warn-osd',
            failosd: '.fail-osd',
            okpool: '.ok-pool',
            warnpool: '.warn-pool',
            failpool: '.fail-pool',
            okmds: '.ok-mds',
            warnmds: '.warn-mds',
            failmds: '.fail-mds',
            okpg: '.ok-pg',
            warnpg: '.warn-pg',
            failpg: '.fail-pg',
            okmon: '.ok-mon',
            warnmon: '.warn-mon',
            failmon: '.fail-mon',
            spinner: '.icon-spinner'
        },
        modelEvents: {
            'change': 'updateView'
        },
        serializeData: function() {
            return {
                title: this.title,
                relTime: humanize.relativeTime(Date.now() / 1000)
            };
        },
        initialize: function(options) {
            this.disappearAnimation = animation.single('fadeOutUpAnim');
            this.reappearAnimation = animation.single('fadeInDownAnim');
            _.bindAll(this, 'updateView', 'set', 'updateTimer', 'disappear', 'disappearAnimation', 'reappearAnimation', 'reappear', 'makeStatusTemplate');

            // The are defaults for Gauge.js and can be overidden from the contructor
            this.App = Backbone.Marionette.getOption(this, 'App');
            if (this.App) {
                this.listenTo(this.App.vent, 'status:update', this.set);
                this.listenTo(this.App.vent, 'gauges:disappear', this.disappear);
                this.listenTo(this.App.vent, 'gauges:reappear', this.reappear);
                this.listenTo(this.App.vent, 'gauges:expand', this.expand);
                this.listenTo(this.App.vent, 'gauges:collapse', this.collapse);
            }
            if (options && options.App !== undefined) {
                this.App = options.App;
            }
            if (this.App && !this.App.Config['offline']) {
                /* Placeholder */
            }

            var PGStatesTemplate = this.makeStateTemplate('PGs'),
                OSDStatesTemplate = this.makeStateTemplate('OSDs'),
                MONStatesTemplate = this.makeStateTemplate('MONs'),
                pgwarn = this.makeStateInfoView(this.makeStatusTemplate('PG Warn Status', 'icon-question-sign icon-large warn'), PGStatesTemplate, '.warn'),
                pgcrit = this.makeStateInfoView(this.makeStatusTemplate('PG Critical Status', 'icon-question-sign icon-large fail'), PGStatesTemplate, '.fail'),
                osdwarn = this.makeStateInfoView(this.makeStatusTemplate('OSD Warn Status', 'icon-question-sign icon-large warn'), OSDStatesTemplate, '.warn'),
                osdcrit = this.makeStateInfoView(this.makeStatusTemplate('OSD Critical Status', 'icon-question-sign icon-large fail'), OSDStatesTemplate, '.fail'),
                monwarn = this.makeStateInfoView(this.makeStatusTemplate('MON Warn Status', 'icon-question-sign icon-large warn'), MONStatesTemplate, '.warn'),
                moncrit = this.makeStateInfoView(this.makeStatusTemplate('MON Critical Status', 'icon-question-sign icon-large fail'), MONStatesTemplate, '.fail');

            var self = this;
            this.listenToOnce(this, 'render', function() {
                self.listenTo(self.App.vent, 'status:request', function() {
                    self.ui.spinner.css('visibility', 'visible');
                });
                self.listenTo(self.App.vent, 'status:sync status:error', function() {
                    self.ui.spinner.css('visibility', 'hidden');
                });
                if (self.timer === null) {
                    self.updateTimer();
                }
                // wait until self.ui is initialized
                var ui = self.ui;
                self.addPGStateInfo = self.makeStateView(ui.pgstate, pgwarn, pgcrit);
                self.addOSDStateInfo = self.makeStateView(ui.osdstate, osdwarn, osdcrit);
                self.addMONStateInfo = self.makeStateView(ui.monstate, monwarn, moncrit);
            });
        },
        set: function(model) {
            this.model.set(model.attributes);
{'fraction_non_alphanumeric': 0.14068994181213632, 'fraction_numerical': 0.00228595178719867, 'mean_word_length': 2.0012472715933893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2482111', 'n_tokens_mistral': 2769, 'n_tokens_neox': 2661, 'n_words': 503}