Merge pull request #50 from rickcarlino/master

Starting axial movement feature
pull/51/head^2
Rick Carlino 2014-05-30 06:57:39 -07:00
commit e612df8132
8 changed files with 41 additions and 13 deletions

View File

@ -8,7 +8,8 @@
//= require angular/angular-route
//= require ng-rails-csrf
//= require farmbot_app/farmbot
//= require_tree ./farmbot_app
//= require_tree ./farmbot_app/services
//= require_tree ./farmbot_app/controllers
//bootstrap the alert box plugin

View File

@ -1,8 +1,9 @@
# The overview controller provides an indepth view of a device as well as fine-
# grained controll options.
app = angular.module('FarmBot')
controller = ($scope, Restangular) ->
app.controller "OverviewController", ['$scope', 'Restangular', controller]
angular.module('FarmBot').controller "OverviewController", [
'$scope'
'Restangular'
($scope, Restangular) ->
$scope.device = {}
]

View File

@ -1 +0,0 @@
angular.module('FarmBot').provider('device', ->)

View File

@ -0,0 +1,12 @@
Device = (Restangular) ->
class Device
constructor: () ->
@all = @fetchAll
fetchAll: ->
Restangular.all("devices").getList().$object
angular.module('FarmBot').service 'Device',[
'Restangular'
Device
]

View File

@ -0,0 +1,16 @@
#Example:
# cnxn = new Skynet(device.uuid, device.token, device.message)
Skynet = () ->
class Skynet
constructor: (uuid, token, callback) ->
config =
uuid: uuid
token: token
type: "farmbot"
protocol: "websocket"
send: (message) ->
angular.module('FarmBot').service 'Skynet',[
Skynet
]

View File

@ -4,8 +4,8 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
def after_sign_in_path_for()
# We can add a 'resource' parameter to this method if we end up adding more
def after_sign_in_path_for(resource)
# 'resource' parameter for if we end up adding more
# devise resources (eg: admin users, etc.)
dashboard_path
end

View File

@ -2,7 +2,7 @@
%h1 Manage FarmBot Device Overview
%h3 Eventually, this will be the home of device control and metrics. Stay tuned!
.row
.large-6.columns
.large-12.columns
.panel
.container.clearfix
.large-4.columns Gantry (X)
@ -41,5 +41,4 @@
%li
%a.button.small{href: "#"} Calibrate
%li
%a.button.small.alert{href: "#"} Shutdown
.large-6.columns
%a.button.small.alert{href: "#"} Shutdown

View File

@ -27,5 +27,5 @@ describe Api::DevicesController do
get :index
expect(response.status).to eq(401)
end
end
end