 UpdateStackModal = require './update_stack_modal'
 AppsCollection = require '../collections/application'
 
+
 module.exports = class ConfigApplicationsView extends BaseView
     id: 'config-applications-view'
     template: require 'templates/config_applications'

        @stackApps.fetch reset: true
        @displayDevices()
        @stackApplications = new StackApplication

    openUpdatePopover: (slug) ->
        @applicationList.openUpdatePopover slug

    displayStackVersion: =>
        for app in @stackApps.models

                @displayMemory data.freeMem, data.totalMem
                @displayDiskSpace diskUsed, diskTotal


    displayMemory: (amount, total) ->
        @memoryFree.find('.amount').html Math.floor((total - amount) / 1000)
        @memoryFree.find('.total').html Math.floor(total / 1000)


    displayDiskSpace: (amount, total) ->
        @diskSpace.find('.amount').html amount
        @diskSpace.find('.total').html total


    onAppStateChanged: ->
        setTimeout @fetch, 10000


    popoverManagement: (action) ->
        @popover.hide() if @popover?
