 
     $scope.ponyExpressHost = $cookies.ponyExpressHost or undefined
     $scope.ponyExpressVersion = 'v1'
+
+    $scope.allNodes = []
+    $scope.allPackages = []
     $scope.nodes = []
     $scope.packages = []
     $scope.node = {}

          n.id = id
          $scope.package[id] = n
        , fetchError('packages')

    $scope.ensureNode = (id)->
      $scope.fetchNode(id) if not $scope.node[id]?

      Restangular.all('nodes').getList().
        then (ns) ->
          console.log 'fetch nodes'
          $scope.allNodes = ns
          $scope.updateNodeSelection()
        , fetchError('nodes')

    $scope.fetchPackages = ()->
      Restangular.all('packages').getList().
        then (ns) ->
          console.log 'fetch packages'
          $scope.allPackages = ns
          $scope.updatePackageSelection()
          for p in ns
            for v in p.versions
              if not $scope.package[v.id]?
