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.7.3 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.7.2 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.7.1 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.7.0 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.21 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.20 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.19 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.18 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.17 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.16 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.15 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.13 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.12 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.11 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.10 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.9 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.8 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.7 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.6 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js
nutella_framework-0.6.5 framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js