updates from Production
This commit is contained in:
parent
d67697acff
commit
1d7e9cd221
1
Gemfile
1
Gemfile
@ -37,6 +37,7 @@ gem 'tzinfo'
|
|||||||
gem 'tzinfo-data'
|
gem 'tzinfo-data'
|
||||||
gem 'turbolinks'
|
gem 'turbolinks'
|
||||||
gem 'geokit-rails'
|
gem 'geokit-rails'
|
||||||
|
gem 'clockwork'
|
||||||
|
|
||||||
# to use debugger
|
# to use debugger
|
||||||
# gem 'ruby-debug'
|
# gem 'ruby-debug'
|
||||||
|
@ -90,6 +90,9 @@ GEM
|
|||||||
net-ssh (>= 2.0.14)
|
net-ssh (>= 2.0.14)
|
||||||
net-ssh-gateway (>= 1.1.0)
|
net-ssh-gateway (>= 1.1.0)
|
||||||
chronic (0.10.2)
|
chronic (0.10.2)
|
||||||
|
clockwork (0.7.7)
|
||||||
|
activesupport
|
||||||
|
tzinfo
|
||||||
coffee-rails (4.0.1)
|
coffee-rails (4.0.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
@ -356,6 +359,7 @@ DEPENDENCIES
|
|||||||
autotest-rails
|
autotest-rails
|
||||||
capistrano (~> 2.15.4)
|
capistrano (~> 2.15.4)
|
||||||
chronic
|
chronic
|
||||||
|
clockwork
|
||||||
coffee-rails (~> 4.0)
|
coffee-rails (~> 4.0)
|
||||||
daemons
|
daemons
|
||||||
dalli
|
dalli
|
||||||
|
@ -40,6 +40,7 @@ class User < ActiveRecord::Base
|
|||||||
has_many :reacts, :dependent => :destroy
|
has_many :reacts, :dependent => :destroy
|
||||||
has_many :scheduled_thinghttps, :dependent => :destroy
|
has_many :scheduled_thinghttps, :dependent => :destroy
|
||||||
has_many :talkbacks, :dependent => :destroy
|
has_many :talkbacks, :dependent => :destroy
|
||||||
|
has_many :timecontrols, :dependent => :destroy
|
||||||
has_many :plugins, :dependent => :destroy
|
has_many :plugins, :dependent => :destroy
|
||||||
has_many :devices, :dependent => :destroy
|
has_many :devices, :dependent => :destroy
|
||||||
has_many :api_keys, :dependent => :destroy
|
has_many :api_keys, :dependent => :destroy
|
||||||
@ -56,6 +57,11 @@ class User < ActiveRecord::Base
|
|||||||
cattr_reader :per_page
|
cattr_reader :per_page
|
||||||
@@per_page = 50
|
@@per_page = 50
|
||||||
|
|
||||||
|
# true if the user has used the maximum number of available timecontrols
|
||||||
|
def max_timecontrols?
|
||||||
|
self.timecontrols.roots.count >= Timecontrol::MAX_PER_USER
|
||||||
|
end
|
||||||
|
|
||||||
# allow login by login name also
|
# allow login by login name also
|
||||||
def self.find_first_by_auth_conditions(warden_conditions)
|
def self.find_first_by_auth_conditions(warden_conditions)
|
||||||
conditions = warden_conditions.dup
|
conditions = warden_conditions.dup
|
||||||
|
@ -47,10 +47,10 @@
|
|||||||
|
|
||||||
<% if current_admin_user.present? %>
|
<% if current_admin_user.present? %>
|
||||||
<div class="apps">
|
<div class="apps">
|
||||||
<%= link_to scheduled_thinghttps_path do %>
|
<%= link_to timecontrols_path do %>
|
||||||
<%= image_tag 'scheduled_thinghttp.png', :size => '104x104' %>
|
<%= image_tag 'scheduled_thinghttp.png', :size => '104x104' %>
|
||||||
<br>
|
<br>
|
||||||
<%= t(:scheduled_thinghttp) %>
|
<%= t(:timecontrol) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -97,6 +97,7 @@ en:
|
|||||||
confirm_react_delete: "Are you sure you want to delete this React?"
|
confirm_react_delete: "Are you sure you want to delete this React?"
|
||||||
confirm_talkback_delete: "Are you sure you want to delete this TalkBack?"
|
confirm_talkback_delete: "Are you sure you want to delete this TalkBack?"
|
||||||
confirm_thinghttp_delete: "Are you sure you want to delete this ThingHTTP?"
|
confirm_thinghttp_delete: "Are you sure you want to delete this ThingHTTP?"
|
||||||
|
confirm_timecontrol_delete: "Are you sure you want to delete this TimeControl?"
|
||||||
confirm_tweetcontrol_delete: "Are you sure you want to delete this TweetControl?"
|
confirm_tweetcontrol_delete: "Are you sure you want to delete this TweetControl?"
|
||||||
confirm_twitter_delete: "Are you sure you want to unlink this Twitter account?"
|
confirm_twitter_delete: "Are you sure you want to unlink this Twitter account?"
|
||||||
contact_us: "Contact Us"
|
contact_us: "Contact Us"
|
||||||
@ -146,11 +147,13 @@ en:
|
|||||||
forgot: "Forgot your password?"
|
forgot: "Forgot your password?"
|
||||||
forum: "Forum"
|
forum: "Forum"
|
||||||
for_more_information: "More Information"
|
for_more_information: "More Information"
|
||||||
|
frequency: 'frequency'
|
||||||
generate_thingtweet_arduino_code: "Generate ThingTweet Arduino Code"
|
generate_thingtweet_arduino_code: "Generate ThingTweet Arduino Code"
|
||||||
get_started: "Get Started Now"
|
get_started: "Get Started Now"
|
||||||
height: "Height"
|
height: "Height"
|
||||||
home_motto: "Billions and Billions."
|
home_motto: "Billions and Billions."
|
||||||
home_tagline: "The open data platform for the Internet of Things."
|
home_tagline: "The open data platform for the Internet of Things."
|
||||||
|
hour: 'hour'
|
||||||
import: "Import"
|
import: "Import"
|
||||||
latitude: "Latitude"
|
latitude: "Latitude"
|
||||||
longitude: "Longitude"
|
longitude: "Longitude"
|
||||||
@ -159,10 +162,13 @@ en:
|
|||||||
message: 'message'
|
message: 'message'
|
||||||
message_field: "Message Field"
|
message_field: "Message Field"
|
||||||
metadata: 'metadata'
|
metadata: 'metadata'
|
||||||
|
minute: 'minute'
|
||||||
myaccount: "My Account"
|
myaccount: "My Account"
|
||||||
|
name: 'name'
|
||||||
new: "New"
|
new: "New"
|
||||||
note: "Note"
|
note: "Note"
|
||||||
note_save: "Save Note"
|
note_save: "Save Note"
|
||||||
|
one_time: 'one time'
|
||||||
password: "Password"
|
password: "Password"
|
||||||
password_change: "Change Password"
|
password_change: "Change Password"
|
||||||
password_confirmation: "Password Confirmation"
|
password_confirmation: "Password Confirmation"
|
||||||
@ -263,6 +269,7 @@ en:
|
|||||||
react_option_run_every_time: "Run action each time condition is met"
|
react_option_run_every_time: "Run action each time condition is met"
|
||||||
react_create_button: "Create React"
|
react_create_button: "Create React"
|
||||||
react_save_button: "Create React"
|
react_save_button: "Create React"
|
||||||
|
recurring: 'recurring'
|
||||||
remember_me: "Remember my User ID"
|
remember_me: "Remember my User ID"
|
||||||
results: "Results"
|
results: "Results"
|
||||||
save: "Save"
|
save: "Save"
|
||||||
@ -357,8 +364,19 @@ en:
|
|||||||
thingtweet: "ThingTweet"
|
thingtweet: "ThingTweet"
|
||||||
thingtweet_arduino_select_message: "Select Twitter account to use for this code"
|
thingtweet_arduino_select_message: "Select Twitter account to use for this code"
|
||||||
thingtweet_back: "Back to ThingTweet"
|
thingtweet_back: "Back to ThingTweet"
|
||||||
time_zone: "Time Zone"
|
timecontrol: "TimeControl"
|
||||||
|
timecontrols: "TimeControls"
|
||||||
|
timecontrol_date: 'date'
|
||||||
|
timecontrol_days: 'days'
|
||||||
|
timecontrol_delete: "Delete TimeControl"
|
||||||
|
timecontrol_delete_message: "Want to delete this TimeControl?"
|
||||||
|
timecontrol_error: "There were some problems creating your TimeControl:"
|
||||||
|
timecontrol_max_message: "You have reached the maximum number of TimeControls available per user. Please delete an existing TimeControl before adding a new one."
|
||||||
|
timecontrol_new: "New TimeControl"
|
||||||
|
timecontrol_run_at: 'run at'
|
||||||
|
timecontrol_time: 'time'
|
||||||
timescale: "Timescale"
|
timescale: "Timescale"
|
||||||
|
time_zone: "Time Zone"
|
||||||
title: "Title"
|
title: "Title"
|
||||||
tos: "Terms of Service"
|
tos: "Terms of Service"
|
||||||
tos_agree: "By signing up, you agree to the"
|
tos_agree: "By signing up, you agree to the"
|
||||||
@ -450,6 +468,7 @@ en:
|
|||||||
help_thinghttp_example: "This will send your HTTP GET request to Google Finance and parse the response for an element having an ID of ref_626307_c, which corresponds to the S&P 500 current price change for the day."
|
help_thinghttp_example: "This will send your HTTP GET request to Google Finance and parse the response for an element having an ID of ref_626307_c, which corresponds to the S&P 500 current price change for the day."
|
||||||
help_thinghttp_show: "You can now send your ThingHTTP request and view the response using the following URL:"
|
help_thinghttp_show: "You can now send your ThingHTTP request and view the response using the following URL:"
|
||||||
help_thingtweet: "ThingTweet acts as a proxy to Twitter so that your devices can update Twitter statuses without having to implement Open Authentication (OAuth)."
|
help_thingtweet: "ThingTweet acts as a proxy to Twitter so that your devices can update Twitter statuses without having to implement Open Authentication (OAuth)."
|
||||||
|
help_timecontrol_index: "Create a TimeControl to automatically execute ThingHTTP requests at predetermined times."
|
||||||
help_tweetcontrol: "Use TweetControl to listen to specific trigger words from Twitter, and then process a ThingHTTP request."
|
help_tweetcontrol: "Use TweetControl to listen to specific trigger words from Twitter, and then process a ThingHTTP request."
|
||||||
help_tweetcontrol_edit: "Select Anonymous TweetControl to allow anyone to trigger your TweetControl or fill in a specfic Twitter Account (don't include the '@' sign)."
|
help_tweetcontrol_edit: "Select Anonymous TweetControl to allow anyone to trigger your TweetControl or fill in a specfic Twitter Account (don't include the '@' sign)."
|
||||||
help_tweetcontrol_hashtag: "To trigger a TweetControl, you need to send a Twitter Status Update with at least the hashtag #thingspeak and the trigger word, for example:"
|
help_tweetcontrol_hashtag: "To trigger a TweetControl, you need to send a Twitter Status Update with at least the hashtag #thingspeak and the trigger word, for example:"
|
||||||
|
@ -17,9 +17,9 @@ Thingspeak::Application.routes.draw do
|
|||||||
# for api: login and get token
|
# for api: login and get token
|
||||||
match 'users/api_login', :to => 'users#api_login', :via => [:get, :post]
|
match 'users/api_login', :to => 'users#api_login', :via => [:get, :post]
|
||||||
|
|
||||||
# devise for authentication
|
# devise for authentication (but don't use devise if $skip_devise == true, necessary for clockworkd to run)
|
||||||
# override devise controllers and use custom sessions_controller and registrations_controller
|
# override devise controllers and use custom sessions_controller and registrations_controller
|
||||||
devise_for :users, :controllers => {:sessions => 'sessions', :registrations => 'registrations'}
|
devise_for :users, :controllers => {:sessions => 'sessions', :registrations => 'registrations'} if $skip_devise != true
|
||||||
|
|
||||||
resource :pages do
|
resource :pages do
|
||||||
collection do
|
collection do
|
||||||
@ -172,6 +172,7 @@ Thingspeak::Application.routes.draw do
|
|||||||
end
|
end
|
||||||
resources :tweetcontrol
|
resources :tweetcontrol
|
||||||
resources :reacts
|
resources :reacts
|
||||||
|
resources :timecontrols
|
||||||
resources :scheduled_thinghttps
|
resources :scheduled_thinghttps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
38
db/schema.rb
38
db/schema.rb
@ -11,13 +11,13 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20140804223739) do
|
ActiveRecord::Schema.define(version: 20140903095213) do
|
||||||
|
|
||||||
create_table "active_admin_comments", force: true do |t|
|
create_table "active_admin_comments", force: true do |t|
|
||||||
t.string "namespace"
|
t.string "namespace"
|
||||||
t.text "body"
|
t.text "body"
|
||||||
t.string "resource_id", limit: 50, null: false
|
t.string "resource_id", null: false
|
||||||
t.string "resource_type", limit: 50, null: false
|
t.string "resource_type", null: false
|
||||||
t.integer "author_id"
|
t.integer "author_id"
|
||||||
t.string "author_type"
|
t.string "author_type"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
@ -166,6 +166,15 @@ ActiveRecord::Schema.define(version: 20140804223739) do
|
|||||||
add_index "devices", ["mac_address"], name: "index_devices_on_mac_address", using: :btree
|
add_index "devices", ["mac_address"], name: "index_devices_on_mac_address", using: :btree
|
||||||
add_index "devices", ["user_id"], name: "index_devices_on_user_id", using: :btree
|
add_index "devices", ["user_id"], name: "index_devices_on_user_id", using: :btree
|
||||||
|
|
||||||
|
create_table "events", force: true do |t|
|
||||||
|
t.integer "timecontrol_id"
|
||||||
|
t.datetime "run_at"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "events", ["run_at"], name: "index_events_on_run_at", using: :btree
|
||||||
|
|
||||||
create_table "failedlogins", force: true do |t|
|
create_table "failedlogins", force: true do |t|
|
||||||
t.string "login"
|
t.string "login"
|
||||||
t.string "password"
|
t.string "password"
|
||||||
@ -329,6 +338,29 @@ ActiveRecord::Schema.define(version: 20140804223739) do
|
|||||||
add_index "thinghttps", ["api_key"], name: "index_thinghttps_on_api_key", using: :btree
|
add_index "thinghttps", ["api_key"], name: "index_thinghttps_on_api_key", using: :btree
|
||||||
add_index "thinghttps", ["user_id"], name: "index_thinghttps_on_user_id", using: :btree
|
add_index "thinghttps", ["user_id"], name: "index_thinghttps_on_user_id", using: :btree
|
||||||
|
|
||||||
|
create_table "timecontrols", force: true do |t|
|
||||||
|
t.integer "user_id"
|
||||||
|
t.integer "schedulable_id"
|
||||||
|
t.string "schedulable_type", limit: 50
|
||||||
|
t.string "frequency", limit: 20
|
||||||
|
t.integer "day", limit: 1
|
||||||
|
t.integer "hour", limit: 1
|
||||||
|
t.integer "minute", limit: 1
|
||||||
|
t.integer "parent_id"
|
||||||
|
t.datetime "last_event_at"
|
||||||
|
t.text "last_response"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
t.string "name"
|
||||||
|
t.datetime "run_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "timecontrols", ["frequency", "minute", "hour", "day"], name: "index_timecontrols_on_frequency_and_minute_and_hour_and_day", using: :btree
|
||||||
|
add_index "timecontrols", ["parent_id"], name: "index_timecontrols_on_parent_id", using: :btree
|
||||||
|
add_index "timecontrols", ["run_at"], name: "index_timecontrols_on_run_at", using: :btree
|
||||||
|
add_index "timecontrols", ["schedulable_id", "schedulable_type"], name: "index_timecontrols_on_schedulable_id_and_schedulable_type", using: :btree
|
||||||
|
add_index "timecontrols", ["user_id"], name: "index_timecontrols_on_user_id", using: :btree
|
||||||
|
|
||||||
create_table "tweetcontrols", force: true do |t|
|
create_table "tweetcontrols", force: true do |t|
|
||||||
t.string "screen_name"
|
t.string "screen_name"
|
||||||
t.string "trigger"
|
t.string "trigger"
|
||||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user