Sha256: d95e133ad22360ff3de6091247fae61a66ffb460944ed347085dc92c2b743bb4

Contents?: true

Size: 1.42 KB

Versions: 36

Compression:

Stored size: 1.42 KB

Contents

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

    // Public variables
    self.data = undefined;
    self.viewControllerApplicationSelected = undefined;
    self.viewControllerInstanceSelected = undefined;

    self.getApplicationData = function(name) {
        var appData = self.data.applications.filter(function(d) {
            return d.name == name;
        });

        if(appData.length == 0) {
            return undefined;
        }

        return appData[0];
    };

    self.getInstanceData = function(appName, instanceName) {
        var appData = self.getApplicationData(appName);

        if(appData == undefined)
            return undefined;

        var instanceData = appData.instances.filter(function(instance) {
            return instance.name == instanceName;
        });

        if(instanceData.length == 0) {
            return undefined;
        }

        return instanceData[0];
    };

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

    self.fetchData = function(url) {
        d3.json(url, function(error, data) {
            if (error)
                return console.warn(error);

            self.data = data;

            notificationCenter.dispatch(Notifications.data.APPLICATION_DATA_CHANGE);
        });
    };

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

    return self;
};

var applicationModel = ApplicationsModel();

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
nutella_framework-0.6.4 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.3 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.2 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.1 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.0 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.5.1 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.5.0 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.32 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.31 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.30 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.29 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.28 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.27 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.26 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.25 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.4.24 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js