Sha256: eec83a4392d923e40bd0b48fcf81ae34ff7f5dac09a956792014abb60fcfdbe1

Contents?: true

Size: 1.93 KB

Versions: 36

Compression:

Stored size: 1.93 KB

Contents

var AlertsModel = function() {
    var self = {};

    // Protected variables
    self._application = undefined;
    self._instance = undefined;
    self._component = undefined;
    self._emails = undefined;

    // Getter and setter
    self.__defineGetter__("application", function() {
        return self._application;
    });
    self.__defineSetter__("application", function(application) {
        self._application = application;
        notificationCenter.dispatch(Notifications.alerts.ALERT_CHANGE);
    });

    self.__defineGetter__("instance", function() {
        return self._instance;
    });
    self.__defineSetter__("instance", function(instance) {
        self._instance = instance;
        notificationCenter.dispatch(Notifications.alerts.ALERT_CHANGE);
    });

    self.__defineGetter__("component", function() {
        return self._component;
    });
    self.__defineSetter__("component", function(component) {
        self._component = component;
        notificationCenter.dispatch(Notifications.alerts.ALERT_CHANGE);
    });

    self.__defineGetter__("emails", function() {
        return self._emails;
    });
    self.__defineSetter__("emails", function(emails) {
        self._emails = emails;
        notificationCenter.dispatch(Notifications.alerts.EMAILS_CHANGE);
    });

    // Destructor
    self.deinit = function() {
        // Place here the code for dealloc eventual objects
    };

    self.fetchData = function() {

        var request = {
            application: self.application
        };

        if(self.instance != undefined) {
            request.instance = self.instance;
        }

        if(self.component != undefined) {
            request.component = self.component;
        }

        nutella.net.request("monitoring/alert", request, function(data) {
            self.emails = data.emails;
        });
    };

    // Constructor
    self.init = function() {
    }();

    return self;
};

var alertsModel = AlertsModel();

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
nutella_framework-0.7.3 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.7.2 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.7.1 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.7.0 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.21 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.20 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.19 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.18 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.17 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.16 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.15 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.13 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.12 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.11 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.10 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.9 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.8 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.7 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.6 framework_components/monitoring-interface/js/model/alerts-model.js
nutella_framework-0.6.5 framework_components/monitoring-interface/js/model/alerts-model.js