Issues with password reset. Fixes #10
parent
18b53d7d9e
commit
f86ca32c2f
|
@ -1,8 +1,9 @@
|
|||
[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app.png)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
|
||||
[![Build Status](https://travis-ci.org/FarmBot/farmbot-web-app.svg)](https://travis-ci.org/FarmBot/farmbot-web-app)
|
||||
[![Test Coverage](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/coverage.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)# Farmbot Web App
|
||||
[![Test Coverage](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/coverage.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
|
||||
# Farmbot Web App
|
||||
|
||||
This Repo is the Web based side of FarmBot. It allows users to control the device from their web browser. **ITS NOT STABLE. WE ARE IN PRE ALPHA.**
|
||||
This Repo is the Web based side of FarmBot. It allows users to control the device from their web browser. **We're getting closer to launch, but it this is an unstable pre-alpha repo.**
|
||||
|
||||
# Developer setup
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
# A button used to set integers
|
||||
directive =
|
||||
template: '<button class="xx-small button radius red">OFF</button>'
|
||||
template: '<button class="xx-small button radius red" ng-class="{red: !pinStatus, green: pinStatus}">
|
||||
{{ pinStatus }}
|
||||
</button>'
|
||||
restrict: 'E'
|
||||
scope:
|
||||
peripheral: '='
|
||||
scope: true
|
||||
link: (scope, el, attr) ->
|
||||
el.on 'click', ->
|
||||
pins =
|
||||
|
@ -13,8 +14,12 @@ directive =
|
|||
tool: 8
|
||||
# Just blink the LED if the programmer selects the wrong pin #
|
||||
scope.toggle(pins[attr.peripheral] || 13)
|
||||
controller: ['$scope', 'Devices', ($scope, Devices) ->
|
||||
$scope.toggle = (num) -> Devices.togglePin num
|
||||
controller: ['$scope', 'Devices', '$rootScope', ($scope, Devices, $rootScope) ->
|
||||
$scope.pinStatus = off
|
||||
$scope.toggle = (num) ->
|
||||
$rootScope.$apply ->
|
||||
$scope.pinStatus = !$scope.pinStatus
|
||||
Devices.togglePin num
|
||||
]
|
||||
|
||||
angular.module("FarmBot").directive 'togglebutton', [() -> directive]
|
||||
|
|
|
@ -3,7 +3,7 @@ class SingleCommandMessage
|
|||
constructor: (payload = {}) ->
|
||||
@time_stamp = new Date()
|
||||
@command = payload
|
||||
message_type: 'single_command'
|
||||
@message_type = 'single_command'
|
||||
|
||||
# Used for _CREATION_ of _OUTBOUND_ messages.
|
||||
class Command
|
||||
|
@ -14,7 +14,9 @@ class Command
|
|||
return Command.all[type](args)
|
||||
|
||||
@all:
|
||||
read_status: (args) -> new SingleCommandMessage(args)
|
||||
read_status: (args) ->
|
||||
time_stamp: new Date()
|
||||
message_type: 'read_status'
|
||||
|
||||
pin_write: (values) ->
|
||||
new SingleCommandMessage
|
||||
|
|
|
@ -34,4 +34,4 @@
|
|||
.large-6.small-6.columns
|
||||
%button.red.button-like STOP
|
||||
.large-6.small-6.columns
|
||||
%button.yellow.button-like RESTART
|
||||
%button.yellow.button-like{ng_click: 'refresh()'} RESTART
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# Load the Rails application.
|
||||
require File.expand_path('../application', __FILE__)
|
||||
|
||||
# Initialize the Rails application.
|
||||
FarmBot::Application.initialize!
|
||||
|
|
|
@ -79,4 +79,5 @@ FarmBot::Application.configure do
|
|||
config.log_formatter = ::Logger::Formatter.new
|
||||
|
||||
config.assets.js_compressor = Uglifier.new(mangle: false)
|
||||
config.action_mailer.default_url_options = { host: 'my.farmbot.cc' }
|
||||
end
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'Device Management' do
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
||||
it 'adds a device' do
|
||||
sign_in user
|
||||
visit 'dashboard#/devices'
|
||||
binding.pry
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue