commit
e612df8132
|
@ -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
|
||||
|
|
|
@ -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 = {}
|
||||
]
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
angular.module('FarmBot').provider('device', ->)
|
|
@ -0,0 +1,12 @@
|
|||
Device = (Restangular) ->
|
||||
class Device
|
||||
constructor: () ->
|
||||
@all = @fetchAll
|
||||
fetchAll: ->
|
||||
Restangular.all("devices").getList().$object
|
||||
|
||||
angular.module('FarmBot').service 'Device',[
|
||||
'Restangular'
|
||||
Device
|
||||
]
|
||||
|
|
@ -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
|
||||
]
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -27,5 +27,5 @@ describe Api::DevicesController do
|
|||
get :index
|
||||
expect(response.status).to eq(401)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue