rhoconnect 3.1.2 → 3.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (248) hide show
  1. data/CHANGELOG.md +14 -2
  2. data/CREDITS +151 -10
  3. data/Gemfile +16 -5
  4. data/Gemfile.lock +58 -23
  5. data/Rakefile +70 -50
  6. data/bench/bench_runner.rb +2 -2
  7. data/bench/benchapp/Gemfile +6 -0
  8. data/bench/benchapp/Gemfile.lock +5 -0
  9. data/bench/benchapp/config.ru +2 -0
  10. data/bench/lib/bench/cli.rb +2 -0
  11. data/bench/lib/bench/distr_runner.rb +3 -2
  12. data/bench/lib/bench/runner.rb +1 -1
  13. data/bench/lib/bench.rb +10 -1
  14. data/bench/run_bench.sh +1 -1
  15. data/bench/scripts/test_query_script.rb +2 -1
  16. data/bench/spec/bench_spec_helper.rb +1 -0
  17. data/bin/rhoconnect +9 -27
  18. data/bin/rhoconnect-benchmark +10 -1
  19. data/commands/commands/dtach_commands/dtach_about.rb +6 -0
  20. data/commands/commands/dtach_commands/dtach_install.rb +30 -0
  21. data/commands/commands/redis_commands/redis_about.rb +6 -0
  22. data/commands/commands/redis_commands/redis_attach.rb +6 -0
  23. data/commands/commands/redis_commands/redis_download.rb +33 -0
  24. data/commands/commands/redis_commands/redis_install.rb +26 -0
  25. data/commands/commands/redis_commands/redis_make.rb +9 -0
  26. data/commands/commands/redis_commands/redis_restart.rb +7 -0
  27. data/commands/commands/redis_commands/redis_runner.rb +67 -0
  28. data/commands/commands/redis_commands/redis_start.rb +6 -0
  29. data/commands/commands/redis_commands/redis_startbg.rb +6 -0
  30. data/commands/commands/redis_commands/redis_stop.rb +6 -0
  31. data/commands/commands/rhoconnect/attach.rb +7 -0
  32. data/commands/commands/rhoconnect/clean_start.rb +9 -0
  33. data/commands/commands/rhoconnect/config.rb +15 -0
  34. data/commands/commands/rhoconnect/console.rb +15 -0
  35. data/commands/commands/rhoconnect/console_helper.rb +3 -0
  36. data/commands/commands/rhoconnect/create_user.rb +18 -0
  37. data/commands/commands/rhoconnect/delete_device.rb +9 -0
  38. data/commands/commands/rhoconnect/delete_user.rb +8 -0
  39. data/commands/commands/rhoconnect/flushdb.rb +14 -0
  40. data/commands/commands/rhoconnect/get_token.rb +25 -0
  41. data/commands/commands/rhoconnect/reset.rb +16 -0
  42. data/commands/commands/rhoconnect/reset_refresh.rb +11 -0
  43. data/commands/commands/rhoconnect/restart.rb +7 -0
  44. data/commands/commands/rhoconnect/secret.rb +11 -0
  45. data/commands/commands/rhoconnect/set_admin_password.rb +26 -0
  46. data/commands/commands/rhoconnect/spec.rb +15 -0
  47. data/commands/commands/rhoconnect/start.rb +18 -0
  48. data/commands/commands/rhoconnect/startbg.rb +34 -0
  49. data/commands/commands/rhoconnect/startdebug.rb +35 -0
  50. data/commands/commands/rhoconnect/stop.rb +11 -0
  51. data/commands/commands/rhoconnect/war.rb +32 -0
  52. data/commands/commands/rhoconnect/web.rb +7 -0
  53. data/commands/execute.rb +35 -0
  54. data/commands/generators/app.rb +6 -0
  55. data/commands/generators/source.rb +6 -0
  56. data/commands/utilities/dtach_installed.rb +10 -0
  57. data/doc/benchmarks-running.txt +5 -0
  58. data/doc/command-line.txt +216 -27
  59. data/doc/heroku-addon.txt +1 -1
  60. data/doc/preparing-production.txt +20 -1
  61. data/doc/public/cli.txt +191 -0
  62. data/doc/push-backend-setup.txt +148 -0
  63. data/doc/push-client-setup.txt +61 -0
  64. data/doc/push-server-setup.txt +91 -0
  65. data/doc/push.txt +8 -137
  66. data/doc/rest-api.txt +96 -0
  67. data/doc/settings.txt +1 -1
  68. data/doc/supported-platforms.txt +2 -1
  69. data/doc/tutorial.txt +6 -4
  70. data/examples/simple/Gemfile +39 -0
  71. data/examples/simple/Rakefile +7 -12
  72. data/examples/simple/config.ru +16 -31
  73. data/examples/simple/settings/settings.yml +5 -4
  74. data/examples/simple/sources/product.rb +51 -0
  75. data/generators/templates/application/Gemfile +7 -0
  76. data/generators/templates/application/Rakefile +5 -18
  77. data/generators/templates/application/config.ru +11 -19
  78. data/install.sh +24 -49
  79. data/installer/unix-like/create_texts.rb +71 -123
  80. data/installer/unix-like/post_install.sh +3 -0
  81. data/installer/unix-like/post_uninstall.sh +2 -0
  82. data/installer/unix-like/pre_install.sh +5 -3
  83. data/installer/unix-like/pre_uninstall.sh +14 -6
  84. data/installer/unix-like/rho_connect_install_checkers.rb +1 -1
  85. data/installer/unix-like/rho_connect_install_constants.rb +6 -10
  86. data/installer/unix-like/rho_connect_install_debian.rb +2 -2
  87. data/installer/unix-like/rho_connect_install_dnd.rb +2 -5
  88. data/installer/unix-like/rho_connect_install_installers.rb +15 -23
  89. data/installer/unix-like/rho_connect_install_yum.rb +2 -2
  90. data/installer/utils/constants.rb +4 -4
  91. data/installer/utils/create_sha1.rb +1 -1
  92. data/installer/utils/nix_install_test.rb +32 -31
  93. data/installer/utils/nix_installation.rake +1 -1
  94. data/installer/utils/package_upload/repos.rake +34 -30
  95. data/installer/utils/package_upload/s3_upload.rb +3 -3
  96. data/lib/rhoconnect/api/source/fast_delete.rb +10 -0
  97. data/lib/rhoconnect/api/source/fast_insert.rb +10 -0
  98. data/lib/rhoconnect/api/source/fast_update.rb +10 -0
  99. data/lib/rhoconnect/api/source/get_source_params.rb +1 -1
  100. data/lib/rhoconnect/api/source/list_sources.rb +2 -2
  101. data/lib/rhoconnect/api/source/save_adapter.rb +1 -1
  102. data/lib/rhoconnect/api/source/update_source_params.rb +6 -0
  103. data/lib/rhoconnect/async.rb +82 -0
  104. data/lib/rhoconnect/bulk_data/bulk_data.rb +5 -1
  105. data/lib/rhoconnect/client_sync.rb +18 -3
  106. data/lib/rhoconnect/console/rhoconnect_api.rb +2 -2
  107. data/lib/rhoconnect/console/server.rb +5 -32
  108. data/lib/rhoconnect/console.rb +2 -2
  109. data/lib/rhoconnect/graph_helper.rb +225 -0
  110. data/lib/rhoconnect/jobs/bulk_data_job.rb +24 -2
  111. data/lib/rhoconnect/server.rb +31 -11
  112. data/lib/rhoconnect/source.rb +10 -5
  113. data/lib/rhoconnect/source_sync.rb +32 -2
  114. data/lib/rhoconnect/tasks.rb +19 -108
  115. data/lib/rhoconnect/test_methods.rb +20 -0
  116. data/lib/rhoconnect/utilities.rb +118 -0
  117. data/lib/rhoconnect/version.rb +1 -1
  118. data/lib/rhoconnect/web-console/controllers/admins.js +245 -0
  119. data/lib/rhoconnect/web-console/models/adapter.js +53 -0
  120. data/lib/rhoconnect/web-console/models/client.js +105 -0
  121. data/lib/rhoconnect/web-console/models/doc.js +113 -0
  122. data/lib/rhoconnect/web-console/models/session.js +40 -0
  123. data/lib/rhoconnect/web-console/models/source.js +115 -0
  124. data/lib/rhoconnect/web-console/models/stats.js +84 -0
  125. data/lib/rhoconnect/web-console/models/user.js +111 -0
  126. data/lib/rhoconnect/web-console/public/backbone.js +1432 -0
  127. data/lib/rhoconnect/web-console/public/bootstrap.css +3990 -0
  128. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/excanvas.min.js +0 -0
  129. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.barRenderer.min.js +0 -0
  130. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasAxisLabelRenderer.js +0 -0
  131. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasAxisTickRenderer.js +0 -0
  132. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasTextRenderer.js +0 -0
  133. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.categoryAxisRenderer.min.js +0 -0
  134. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.cursor.js +0 -0
  135. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.dateAxisRenderer.js +0 -0
  136. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.dateAxisRenderer.min.js +0 -0
  137. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.pointLabels.min.js +0 -0
  138. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery-1.4.2.min.js +0 -0
  139. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery.jqplot.min.css +0 -0
  140. data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery.jqplot.min.js +0 -0
  141. data/lib/rhoconnect/web-console/public/jquery-1.7.1.min.js +154 -0
  142. data/lib/rhoconnect/web-console/public/rhoconnect-web.js +15 -0
  143. data/lib/rhoconnect/web-console/public/underscore.js +999 -0
  144. data/lib/rhoconnect/web-console/server.rb +55 -0
  145. data/lib/rhoconnect/web-console/templates/index.erb +90 -0
  146. data/lib/rhoconnect/web-console/templates/jqplot.erb +60 -0
  147. data/lib/rhoconnect/web-console/views/api_token.js +16 -0
  148. data/lib/rhoconnect/web-console/views/doc.js +63 -0
  149. data/lib/rhoconnect/web-console/views/edit_user.js +43 -0
  150. data/lib/rhoconnect/web-console/views/home.js +56 -0
  151. data/lib/rhoconnect/web-console/views/index.js +63 -0
  152. data/lib/rhoconnect/web-console/views/new_ping.js +58 -0
  153. data/lib/rhoconnect/web-console/views/new_user.js +29 -0
  154. data/lib/rhoconnect/web-console/views/server_doc.js +103 -0
  155. data/lib/rhoconnect/web-console/views/set_adapter.js +38 -0
  156. data/lib/rhoconnect/web-console/views/settings.js +53 -0
  157. data/lib/rhoconnect/web-console/views/show_device.js +56 -0
  158. data/lib/rhoconnect/web-console/views/show_user.js +38 -0
  159. data/lib/rhoconnect/web-console/views/source_docs.js +30 -0
  160. data/lib/rhoconnect/web-console/views/stats.js +69 -0
  161. data/lib/rhoconnect/web-console/views/users.js +20 -0
  162. data/lib/rhoconnect.rb +2 -1
  163. data/rhoconnect.gemspec +3 -1
  164. data/spec/api/application/rhoconnect_api_spec.rb +3 -5
  165. data/spec/api/source/fast_delete_spec.rb +27 -0
  166. data/spec/api/source/fast_insert_spec.rb +28 -0
  167. data/spec/api/source/fast_update_spec.rb +51 -0
  168. data/spec/api/source/get_source_params_spec.rb +1 -0
  169. data/spec/api/source/update_source_params_spec.rb +24 -0
  170. data/spec/async_spec.rb +19 -0
  171. data/spec/client_sync_spec.rb +19 -2
  172. data/spec/javascripts/PlayerSpec.js +58 -0
  173. data/spec/javascripts/admins_routes_spec.js +117 -0
  174. data/spec/javascripts/admins_spec.js +27 -0
  175. data/spec/javascripts/doc_view_spec.js +37 -0
  176. data/spec/javascripts/edit_user_view_spec.js +44 -0
  177. data/spec/javascripts/helpers/SpecHelper.js +9 -0
  178. data/spec/javascripts/helpers/jasmine-jquery.js +305 -0
  179. data/spec/javascripts/helpers/jasmine-sinon.js +43 -0
  180. data/spec/javascripts/helpers/sinon-1.3.2.js +3551 -0
  181. data/spec/javascripts/home_view_spec.js +39 -0
  182. data/spec/javascripts/index_view_spec.js +42 -0
  183. data/spec/javascripts/new_ping_view_spec.js +48 -0
  184. data/spec/javascripts/new_user_view_spec.js +42 -0
  185. data/spec/javascripts/server_doc_view_spec.js +39 -0
  186. data/spec/javascripts/set_adapter_view_spec.js +32 -0
  187. data/spec/javascripts/show_device_view_spec.js +41 -0
  188. data/spec/javascripts/show_user_view_spec.js +46 -0
  189. data/spec/javascripts/source_docs_view_spec.js +36 -0
  190. data/spec/javascripts/support/jasmine.yml +79 -0
  191. data/spec/javascripts/support/jasmine_config.rb +23 -0
  192. data/spec/javascripts/support/jasmine_runner.rb +32 -0
  193. data/spec/javascripts/users_view_spec.js +35 -0
  194. data/spec/jobs/bulk_data_job_spec.rb +10 -2
  195. data/spec/perf/bulk_data_perf_spec.rb +1 -0
  196. data/spec/server/server_spec.rb +3 -1
  197. data/spec/source_sync_spec.rb +14 -1
  198. data/spec/spec_helper.rb +51 -0
  199. data/spec/store_spec.rb +6 -0
  200. data/spec/test_methods_spec.rb +11 -0
  201. data/tasks/redis.rake +3 -1
  202. metadata +172 -64
  203. data/doc/contributing.txt +0 -60
  204. data/lib/rhoconnect/console/app/helpers/auth_helper.rb +0 -22
  205. data/lib/rhoconnect/console/app/helpers/extensions.rb +0 -19
  206. data/lib/rhoconnect/console/app/helpers/helpers.rb +0 -57
  207. data/lib/rhoconnect/console/app/public/ThickBox.css +0 -649
  208. data/lib/rhoconnect/console/app/public/home.css +0 -431
  209. data/lib/rhoconnect/console/app/public/images/foot_logo_rhoconnect.png +0 -0
  210. data/lib/rhoconnect/console/app/public/images/header_halo.jpg +0 -0
  211. data/lib/rhoconnect/console/app/public/images/land_separator.gif +0 -0
  212. data/lib/rhoconnect/console/app/public/images/landing_header.jpg +0 -0
  213. data/lib/rhoconnect/console/app/public/images/logo_rhoconnect.png +0 -0
  214. data/lib/rhoconnect/console/app/public/images/tabs_separator.png +0 -0
  215. data/lib/rhoconnect/console/app/public/main.css +0 -7
  216. data/lib/rhoconnect/console/app/public/reset.css +0 -76
  217. data/lib/rhoconnect/console/app/public/style.css +0 -2201
  218. data/lib/rhoconnect/console/app/public/text.txt +0 -0
  219. data/lib/rhoconnect/console/app/routes/adapter.rb +0 -28
  220. data/lib/rhoconnect/console/app/routes/auth.rb +0 -29
  221. data/lib/rhoconnect/console/app/routes/client.rb +0 -31
  222. data/lib/rhoconnect/console/app/routes/docs.rb +0 -145
  223. data/lib/rhoconnect/console/app/routes/heroku.rb +0 -19
  224. data/lib/rhoconnect/console/app/routes/home.rb +0 -63
  225. data/lib/rhoconnect/console/app/routes/timing.rb +0 -242
  226. data/lib/rhoconnect/console/app/routes/user.rb +0 -122
  227. data/lib/rhoconnect/console/app/views/adapter.erb +0 -16
  228. data/lib/rhoconnect/console/app/views/client.erb +0 -30
  229. data/lib/rhoconnect/console/app/views/content.erb +0 -14
  230. data/lib/rhoconnect/console/app/views/doc.erb +0 -8
  231. data/lib/rhoconnect/console/app/views/docdata.erb +0 -28
  232. data/lib/rhoconnect/console/app/views/docs.erb +0 -30
  233. data/lib/rhoconnect/console/app/views/edituser.erb +0 -13
  234. data/lib/rhoconnect/console/app/views/headermenu.erb +0 -40
  235. data/lib/rhoconnect/console/app/views/home.erb +0 -24
  236. data/lib/rhoconnect/console/app/views/index.erb +0 -58
  237. data/lib/rhoconnect/console/app/views/jqplot.erb +0 -52
  238. data/lib/rhoconnect/console/app/views/layout.erb +0 -153
  239. data/lib/rhoconnect/console/app/views/login.erb +0 -26
  240. data/lib/rhoconnect/console/app/views/newuser.erb +0 -17
  241. data/lib/rhoconnect/console/app/views/ping.erb +0 -40
  242. data/lib/rhoconnect/console/app/views/result.erb +0 -11
  243. data/lib/rhoconnect/console/app/views/rightboxlinks.erb +0 -15
  244. data/lib/rhoconnect/console/app/views/select_doc.erb +0 -17
  245. data/lib/rhoconnect/console/app/views/upload_doc.erb +0 -23
  246. data/lib/rhoconnect/console/app/views/user.erb +0 -29
  247. data/lib/rhoconnect/console/app/views/users.erb +0 -19
  248. data/lib/rhoconnect/server/views/index.erb +0 -13
@@ -1,16 +0,0 @@
1
- <h1>Set Backend App URL</h1>
2
- <%=show_errors%>
3
- <form action="<%=url_path('/adapter/create')%>" method='POST'>
4
- <table>
5
- <tr>
6
- <td>backend app url:&nbsp;</td>
7
- <td><input style='padding-left:5px;width:300px' name='adapter_url' value='<%=@adapter%>'/></td>
8
- </tr>
9
- <tr>
10
- <td>syncserver url:&nbsp;</td>
11
- <td><%=@domain%></td>
12
- </table>
13
- <br/>
14
- <input type='submit' value='Add'/>
15
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%=url_path('users')%>','main_box')">Back</a>
16
- </form>
@@ -1,30 +0,0 @@
1
- <h1>Device: <%=params[:device_id]%></h1>
2
- <%=show_errors%>
3
- <a href="javascript:void(0);" onclick="loadXMLDoc('<%=url_path("user?user_id=#{CGI.escape(params[:user_id])}")%>','main_box');" class='nav_button'>Back</a>
4
- <a href='<%=url_path("device/delete?user_id=#{CGI.escape(params[:user_id])}&device_id=#{CGI.escape(params[:device_id])}")%>' class='nav_button'>
5
- Delete device
6
- </a>
7
-
8
- <h2>Device attributes</h2>
9
- <div class='panel'>
10
- <table>
11
- <%@attributes.each do |attrib|%>
12
- <%if attrib['name'] != 'rho__id' and attrib['value'] and attrib['value'].size > 0%>
13
- <tr>
14
- <td><%=attrib['name']%>:</td>
15
- <td><%=attrib['value']%></td>
16
- </tr>
17
- <%end%>
18
- <%end%>
19
- </table>
20
- </div>
21
-
22
- <h2>Device documents for source:</h2>
23
-
24
- [
25
- <%@sources.each_index do |i|%>
26
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%=url_path("docs?source_id=#{@sources[i]}&device_id=#{CGI.escape(params[:device_id])}&user_id=#{CGI.escape(params[:user_id])}")%>','main_box');">
27
- <%=i==0?'':','%>"<%=@sources[i]%>"
28
- </a>
29
- <%end%>
30
- ]
@@ -1,14 +0,0 @@
1
- <h1><%=@pagetitle%></h1>
2
-
3
-
4
-
5
- <div id="left" >
6
- <div class="boxes" id="main_box">
7
- </div>
8
- </div>
9
-
10
- <%= erb(:rightboxlinks, :layout => false, :locals => @locals)%>
11
-
12
- <script type="text/javascript">
13
- setTimeout ("loadXMLDoc('<%= @initialcontent %>','main_box');",1);
14
- </script>
@@ -1,8 +0,0 @@
1
- <h1>Document [<%= params[:dbkey]%>]</h1>
2
- <%=show_errors%>
3
- <div class='panel'>
4
- <a href='<%= @back_href%>' class='nav_button'>Back</a>
5
- </div>
6
- <%= erb(:upload_doc, :layout => false) %>
7
- <%= erb(:docdata, :layout => false) %>
8
- <br/>
@@ -1,28 +0,0 @@
1
- <h2>Data</h2>
2
- <div class='panel'>
3
- <%if @data.size > 0%>
4
- <div class='panel'>
5
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%=url_path("doc/clear?#{@back_params}&dbkey=#{CGI.escape(params[:dbkey])}")%>','main_box');" class='nav_button'>Clear document</a>
6
- </div>
7
- <%if @is_string%>
8
- <p>[<%=@data%>]</p>
9
- <%else%>
10
- <table>
11
- <%@data.each do |obj_id,obj|%>
12
- <tr>
13
- <td colspan=3>[<%=obj_id%>]</td>
14
- </tr>
15
- <%obj.each do |attrib,value|%>
16
- <tr>
17
- <td></td>
18
- <td><%=attrib%>:</td>
19
- <td><%=value%></td>
20
- </tr>
21
- <%end%>
22
- <%end%>
23
- </table>
24
- <%end%>
25
- <%else%>
26
- <p>Document is empty</p>
27
- <%end%>
28
- </div>
@@ -1,30 +0,0 @@
1
- <h1><%=params[:source_id]%></h1>
2
- <%=show_errors%>
3
- <div class='panel'>
4
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%= @back_href%>','main_box');" class='nav_button'>Back</a>
5
- </div>
6
- <h2>Source attributes</h2>
7
- <div class='panel'>
8
- <table>
9
- <%@src_params.each do |attrib|%>
10
- <%if attrib['name'] != 'rho__id' and attrib['value'] and attrib['value'].size > 0%>
11
- <tr>
12
- <td><%=attrib['name']%>:</td>
13
- <td><%=attrib['value']%></td>
14
- </tr>
15
- <%end%>
16
- <%end%>
17
- </table>
18
- </div>
19
- <h2>Documents for <%=@docs_name%></h2>
20
- <div class='panel'>
21
- <table>
22
- <%@docs.each do |name,dbkey|%>
23
- <tr>
24
- <td>:<%=name%></td>
25
- <td><a href='javascript:void(0);' onclick="loadXMLDoc('<%=url_path("doc?dbkey=#{CGI.escape(dbkey)}&#{@doc_params}")%>','main_box');" class='nav_button'><%=dbkey%></a></td>
26
- </tr>
27
- <%end%>
28
- </table>
29
- </div>
30
- <br/>
@@ -1,13 +0,0 @@
1
- <h1>Edit admin</h1>
2
- <%=show_errors%>
3
- <form action="<%=url_path('/user/update')%>" method='POST'>
4
- <table>
5
- <tr>
6
- <td>Password:</td>
7
- <td><input type="password" name='password'/></td>
8
- </tr>
9
- </table>
10
- <br/>
11
- <input type='submit' value='Add'/>
12
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%=url_path('homepage')%>','main_box')">Back</a>
13
- </form>
@@ -1,40 +0,0 @@
1
- <ul>
2
- <% currentpage = "Console" if currentpage.nil? %>
3
-
4
- <% if currentpage == "Resque" %>
5
- <li id="current"><a href="<%= resque_path %>" class="current">Resque</a></li>
6
- <% else %>
7
- <li ><a href="<%= resque_path %>" >Resque</a></li>
8
- <% end %>
9
- <% if currentpage == "Console" %>
10
- <li id="current"><a href="<%=url_path("")%>" class="current">Console</a></li>
11
- <% else %>
12
- <li ><a href="<%=url_path("")%>" >Console</a></li>
13
- <% end %>
14
- <% if currentpage == "Statistics" %>
15
- <li id="current"><a href="<%=url_path("timing")%>" class="current">Statistics</a></li>
16
- <% else %>
17
- <li ><a href="<%=url_path("timing")%>" class="">Statistics</a></li>
18
- <% end %>
19
- <!--
20
- <% if currentpage == "Storage" %>
21
- <li id="current"><a href="/pricing" class="current">Storage</a></li>
22
- <% else %>
23
- <li ><a href="/pricing" class="">Storage</a></li>
24
- <% end %>
25
-
26
- <% if currentpage == "Counts" %>
27
- <li id="current"><a href="/pricing" class="current">Counts</a></li>
28
- <% else %>
29
- <li ><a href="/pricing" class="">Counts</a></li>
30
- <% end %>
31
- -->
32
- <li class="separator">
33
- <img src="<%=url_path("images/tabs_separator.png")%>" />
34
- </li>
35
- <% if session[:token] != nil %>
36
- <li><a href="<%=url_path("logout")%>" class="logout">Logout</a></li>
37
- <% else %>
38
- <li><a href="<%=url_path("")%>" class="login">Login</a></li>
39
- <% end %>
40
- </ul>
@@ -1,24 +0,0 @@
1
- <%if is_errors? or @sources.nil? %>
2
- <%= show_errors%>
3
- <%end%>
4
- <%unless @license.nil? %>
5
- <%="Licensed to #{@license['licensee']} on #{@license['issued']}, available #{@license['available']} of #{@license['seats']} devices"%>
6
- <%end%>
7
-
8
- <div class='panel'>
9
- <a href="<%=url_path('reset')%>" class='nav_button' onclick="return confirm('Are you sure? Resetting will remove all data. It will also return an error code to all existing devices when they connect!')">Reset</a>
10
- <div style=<%=RhoconnectConsole::Server::HEROKU_NAV ? "display:none" : "display:inline"%>>&nbsp;|&nbsp;
11
- <a href="javascript:void(0);" onclick="loadXMLDoc('<%=url_path('user/edit')%>','main_box');" class='nav_button'>Change Admin Password</a>
12
- </div>
13
- </div>
14
-
15
- <h2>App partition sources</h2>
16
- <div class='panel'>
17
- <%unless @sources.nil? %>
18
- [
19
- <%@sources.each_index do |i|%>
20
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%=url_path("docs?source_id=#{@sources[i]}&user_id=*")%>','main_box');"><%=i==0?'':','%>"<%=@sources[i]%>"</a>
21
- <%end%>
22
- ]
23
- <%end%>
24
- </div>
@@ -1,58 +0,0 @@
1
- <%if not login_required %>
2
- <h1>RhoConnect Console</h1>
3
- <%if is_errors? or @sources.nil? %>
4
- <%= show_errors%>
5
- <%end%>
6
- <%unless @license.nil? %>
7
- <%="Licensed to #{@license['licensee']} on #{@license['issued']}, available #{@license['available']} of #{@license['seats']} devices"%>
8
- <%end%>
9
- <div class='panel'>
10
- <a href="<%=url_path('logout')%>" class='nav_button'>Logout</a>
11
- </div>
12
- <div class='panel'>
13
- <a href="<%=url_path('reset')%>" class='nav_button' onclick="return confirm('Are you sure? Resetting will remove all data. It will also return an error code to all existing devices when they connect!')">Reset</a>
14
- <a href="<%=url_path('doc/select')%>" class='nav_button'>Show server document</a>
15
- </div>
16
- <div class='panel'>
17
- <a href="<%=url_path('users')%>" class='nav_button'>Application users</a>
18
- </div>
19
- <h2>App partition sources</h2>
20
- <div class='panel'>
21
- <%unless @sources.nil? %>
22
- [
23
- <%@sources.each_index do |i|%>
24
- <a href="<%=url_path("docs?source_id=#{@sources[i]}&user_id=*")%>"><%=i==0?'':','%>"<%=@sources[i]%>"</a>
25
- <%end%>
26
- ]
27
- <%end%>
28
- </div>
29
- <% else %>
30
- <h1>Login</h1>
31
- <%=show_errors%>
32
- <form action="<%=url_path('login')%>" method='POST'>
33
- <table>
34
- <tr>
35
- <td>Connect to Rhoconnect:</td>
36
- <td>
37
- <input type="radio" name="connect" value="direct"
38
- <%= 'checked' if session[:connect] == 'direct' or session[:connect].nil?%>> Directly</input><br>
39
- <input type="radio" name="connect" value="remote" <%= 'checked' if session[:connect] == 'remote'%>> Using REST API</input><br>
40
- </td>
41
- </tr>
42
- <tr>
43
- <td>REST Server address:</td>
44
- <td><input name='server' value='<%=session[:server_url] || 'http://localhost:9292'%>' size=64/></td>
45
- </tr>
46
- <tr>
47
- <td>Login:</td>
48
- <td><input name='login' value='<%=session[:login] || 'rhoadmin'%>'/></td>
49
- </tr>
50
- <tr>
51
- <td>Password:</td>
52
- <td><input name='password' type='password' value=''/></td>
53
- </tr>
54
- </table>
55
- <br/>
56
- <input type='submit' value='Submit'/>
57
- </form>
58
- <% end %>
@@ -1,52 +0,0 @@
1
- <%
2
- s = nil
3
- if @displayname.nil?
4
- s = @sources[0]
5
- else
6
- @sources.each { |source| s = source if source['name'] == @displayname }
7
- end
8
- %>
9
- <% if s.nil? or s['data'].length < 1 %>
10
- <center>No data for <b><%= s.nil? ? "" : s['name'] %></b></center><br/><br/>
11
- <% else %>
12
- <div id="chartdiv" style="height:295px;width:670px; display:none;"></div>
13
- <%end%>
14
- <%
15
- def fix_json(instring)
16
- outstring = instring.gsub(/"/,"'")
17
- outstring = outstring.gsub(/('.*?enderer'):'(.*?)'/,'\1:\2')
18
- outstring
19
- end
20
-
21
- %>
22
-
23
- <% if @displayname.nil? %>
24
- <script type="text/javascript">
25
- document.getElementById('chartdiv').style.display = '';plot = $.jqplot('chartdiv',<%=@sources[0]['data'].to_json.gsub(/"/,"'")%>,<%=fix_json(@sources[0]['options'].to_json)%>); plot.redraw();
26
- </script>
27
- <%end%>
28
-
29
- <br/>
30
-
31
-
32
-
33
- <% if @sources.length > 1%>
34
-
35
- <% @sources.each do |source| %>
36
- <% if @displayname == source['name'] %>
37
- <script type="text/javascript">
38
- document.getElementById('chartdiv').style.display = '';plot = $.jqplot('chartdiv',<%=source['data'].to_json.gsub(/"/,"'")%>,<%=fix_json(source['options'].to_json)%>); plot.redraw();
39
- </script>
40
-
41
- <% end %>
42
-
43
- <a style="margin-right:5px" href="javascript:void(0);"
44
- onclick="loadXMLDoc('<%= url_path(@uri + '?display='+ source['name'])%>','main_box');">
45
- <%= source['name'] %>
46
- </a>
47
- <% end%>
48
-
49
-
50
- <% end %>
51
-
52
- <br/><div style="margin-top:3px;">Select and drag to zoom. Double click to reset.</div>
@@ -1,153 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>RhoConnect Console</title>
7
- <!--<link rel="stylesheet" href="<%=url_path('main.css')%>" type="text/css" media="screen" /> -->
8
- <link rel="stylesheet" href="<%=url_path('reset.css')%>" type="text/css" media="screen" />
9
- <link rel="stylesheet" href="<%=url_path('home.css')%>" type="text/css" media="screen" />
10
- <link rel="stylesheet" href="<%=url_path('style.css')%>" type="text/css" media="screen" />
11
- <link rel="stylesheet" href="<%=url_path('ThickBox.css')%>" type="text/css" media="screen" />
12
-
13
- <!--[if IE]><script language="javascript" type="text/javascript" src="<%=url_path('jqplot/excanvas.js')%>"></script><![endif]-->
14
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jquery-1.4.2.min.js')%>"></script>
15
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jquery.jqplot.min.js')%>"></script>
16
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.categoryAxisRenderer.min.js')%>"></script>
17
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.dateAxisRenderer.js')%>"></script>
18
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.canvasTextRenderer.js')%>"></script>
19
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.canvasAxisLabelRenderer.js')%>"></script>
20
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.canvasAxisTickRenderer.js')%>"></script>
21
- <script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.cursor.js')%>"></script>
22
- <!--<script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.barRenderer.min.js')%>"></script>-->
23
- <!--<script language="javascript" type="text/javascript" src="<%=url_path('jqplot/jqplot.pointLabels.min.js')%>"></script>-->
24
-
25
- <link rel="stylesheet" type="text/css" href="<%=url_path('jqplot/jquery.jqplot.min.css')%>" />
26
-
27
- <script type="text/javascript">
28
- $.jqplot.config.enablePlugins = true;
29
-
30
-
31
- function loadXMLDoc(url,id)
32
- {
33
- if(url.indexOf('?') != -1) {
34
- url = url + "&xhr=true";
35
- } else {
36
- url = url + "?xhr=true";
37
- }
38
- if (window.XMLHttpRequest)
39
- {// code for IE7+, Firefox, Chrome, Opera, Safari
40
- xmlhttp=new XMLHttpRequest();
41
-
42
- xmlhttp.open("GET",url,false);
43
- xmlhttp.send(null);
44
- if (xmlhttp.responseText != null)
45
- {
46
- element = document.getElementById(id);
47
- if (element != null)
48
- {
49
- element.innerHTML=xmlhttp.responseText;
50
- parseScript(xmlhttp.responseText);
51
- }
52
- }
53
- }
54
- }
55
-
56
- function switch_tab(elem)
57
- {
58
- if(document.getElementById('link1') != null)document.getElementById('link1').className = "no_class";
59
- if(document.getElementById('link2') != null)document.getElementById('link2').className = "no_class";
60
- if(document.getElementById('link3') != null)document.getElementById('link3').className = "no_class";
61
- if(document.getElementById('link4') != null)document.getElementById('link4').className = "no_class";
62
- if(document.getElementById('link5') != null)document.getElementById('link5').className = "no_class";
63
- if(document.getElementById('link6') != null)document.getElementById('link6').className = "no_class";
64
- if(document.getElementById('link7') != null)document.getElementById('link7').className = "no_class";
65
- document.getElementById(elem).className = "selected";
66
- }
67
-
68
- function parseScript(_source) {
69
- var source = _source;
70
- var scripts = new Array();
71
-
72
- // Strip out tags
73
- while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
74
- var s = source.indexOf("<script");
75
- var s_e = source.indexOf(">", s);
76
- var e = source.indexOf("</script", s);
77
- var e_e = source.indexOf(">", e);
78
-
79
- // Add to scripts array
80
- scripts.push(source.substring(s_e+1, e));
81
- // Strip from source
82
- source = source.substring(0, s) + source.substring(e_e+1);
83
- }
84
-
85
- // Loop through every script collected and eval it
86
- for(var i=0; i<scripts.length; i++) {
87
- try {
88
- eval(scripts[i]);
89
- }
90
- catch(ex) {
91
- // do what you want here when a script fails
92
- }
93
- }
94
-
95
- // Return the cleaned source
96
- return source;
97
- }
98
-
99
- </script>
100
- </head>
101
- <body>
102
- <div class="container">
103
- <%= RhoconnectConsole::Server::HEROKU_NAV if RhoconnectConsole::Server::HEROKU_NAV%>
104
- <div class="wrapper">
105
- <div class="header">
106
- <div class="logos">
107
- <% unless RhoconnectConsole::Server::HEROKU_NAV %>
108
- <a href="" class="logo_rhoconnect">RhoHub</a>
109
- <% end %>
110
- </div>
111
- <div id="menu">
112
- <%= erb(:headermenu,:layout => false, :locals => {:currentpage => @currentpage}) unless RhoconnectConsole::Server::HEROKU_NAV %>
113
- </div>
114
- <div class="header_landing">
115
- <div class="col_1">
116
- <%= yield%>
117
- </div><!--END col_1 -->
118
- <div class="land_separator"></div>
119
- </div><!--END header_landing -->
120
- <div style="float:left">
121
-
122
- <br/>
123
- </div>
124
- </div><!--END header -->
125
- </div><!--END wrapper -->
126
- </div><!-- END container -->
127
- <div id="footer">
128
- <div class="footer_content">
129
- <div id="foot_lefts" class="foot_left">
130
- <% unless RhoconnectConsole::Server::HEROKU_NAV %>
131
- <img src="<%=url_path("images/foot_logo_rhoconnect.png")%>"></a>
132
- <% end %>
133
- <p>© <a href="http://www.rhomobile.com/">Rhomobile</a> All rights reserved.</p>
134
- </div>
135
- <div class="foot_right">
136
- <ul class="ul_footer">
137
- <%unless login_required %>
138
- <% license = {}
139
- handle_api_error("Can't get license information") do
140
- license = RhoconnectApi::get_license_info(session[:server],session[:token])
141
- end
142
- %>
143
- <%="<li>Licensed to #{license['licensee']}</li><li>|</li><li> #{license['available']}/#{license['seats']} devices available</li>"%>
144
- <%end%>
145
- <li>|</li>
146
- <li>RhoConnect v<%=Rhoconnect::VERSION%></li>
147
- </ul>
148
- </div>
149
- <br class="clear">
150
- </div>
151
- </div>
152
- </body>
153
- </html>
@@ -1,26 +0,0 @@
1
- <form action="<%=url_path('login')%>" method='POST'>
2
- <table>
3
- <tr>
4
- <td>Connect to Rhoconnect:</td>
5
- <td>
6
- <input type="radio" name="connect" value="direct"
7
- <%= 'checked' if session[:connect] == 'direct' or session[:connect].nil?%>> Directly</input><br>
8
- <input type="radio" name="connect" value="remote" <%= 'checked' if session[:connect] == 'remote'%>> Using REST API</input><br>
9
- </td>
10
- </tr>
11
- <tr>
12
- <td>REST Server address:</td>
13
- <td><input name='server' value='<%=session[:server_url] || 'http://localhost:9292'%>' size=64/></td>
14
- </tr>
15
- <tr>
16
- <td>Login:</td>
17
- <td><input name='login' value='<%=session[:login] || 'rhoadmin'%>'/></td>
18
- </tr>
19
- <tr>
20
- <td>Password:</td>
21
- <td><input name='password' type='password' value=''/></td>
22
- </tr>
23
- </table>
24
- <br/>
25
- <input type='submit' value='Submit'/>
26
- </form>
@@ -1,17 +0,0 @@
1
- <h1>New user</h1>
2
- <%=show_errors%>
3
- <form action="<%=url_path('/user/create')%>" method='POST'>
4
- <table>
5
- <tr>
6
- <td>Login:</td>
7
- <td><input name='login'/></td>
8
- </tr>
9
- <tr>
10
- <td>Password:</td>
11
- <td><input type="password" name='password'/></td>
12
- </tr>
13
- </table>
14
- <br/>
15
- <input type='submit' value='Add'/>
16
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%=url_path('users')%>','main_box')">Back</a>
17
- </form>
@@ -1,40 +0,0 @@
1
- <%users = params[:user_id].split(',')%>
2
- <%if users.size == 1%>
3
- <h1>Ping <%=users[0]%></h1>
4
- <%else%>
5
- <h1>Ping Users</h1>
6
- <%end%>
7
- <%=show_errors%>
8
- <form method="POST" action="<%=url_path('user/ping')%>">
9
- <table>
10
- <%if users.size == 1%>
11
- <input type="hidden" name="user_id" value="<%=params[:user_id]%>">
12
- <%else%>
13
- <tr>
14
- <td>Users:</td>
15
- <td><input type="text" name="user_id" value="<%=params[:user_id]%>" size=64/></td>
16
- </tr>
17
- <%end%>
18
- <tr>
19
- <td>Message:</td>
20
- <td><input type="text" name="message" value="push message" size=64/></td>
21
- </tr>
22
- <tr>
23
- <td>Sources:</td>
24
- <td><input type="text" name="sources" value="<%=@sources.join(',')%>" size=64/></td>
25
- </tr>
26
- <tr>
27
- <td>Badge:</td>
28
- <td><input type="text" name="badge" value="1" /></td>
29
- </tr>
30
- <tr>
31
- <td>Sound:</td>
32
- <td><input type="text" name="sound" value="welcome.mp3" /></td>
33
- </tr>
34
- <tr>
35
- <td>Vibrate:</td>
36
- <td><input type="text" name="vibrate" value="2" />(seconds)</td>
37
- </tr>
38
- </table>
39
- <input type="submit" value="Ping!"/>
40
- </form>
@@ -1,11 +0,0 @@
1
- <h1><%=@result_name%></h1>
2
- <div class='panel'>
3
- <%if is_errors?%>
4
- <%=show_errors%>
5
- <%else%>
6
- <p><%=@status%></p>
7
- <%end%>
8
- </div>
9
- <div class='panel'>
10
- <a href='javascript:void(0);' onclick="loadXMLDoc('<%= @back_href%>','main_box');" class='nav_button'>Back</a>
11
- </div>
@@ -1,15 +0,0 @@
1
- <!-- div, links[]{ :url, :title, :selected }> -->
2
-
3
- <div id="right-box_links">
4
- <ul class="right-box_links">
5
- <% i=1 %>
6
- <% links.each do |link| %>
7
- <li><a id="link<%=i%>"
8
- <%= 'class="selected"' if link[:selected] %>
9
- onclick="javascript:loadXMLDoc('<%=link[:url]%>','<%= div %>');switch_tab(this.id); this.blur();"
10
- href="javascript:void(0);"><%=link[:title]%></a>
11
- </li>
12
- <% i = i + 1 %>
13
- <% end %>
14
- </ul>
15
- </div>
@@ -1,17 +0,0 @@
1
- <h1>Document <%= @dbkey%></h1>
2
- <%=show_errors%>
3
-
4
- <form action=<%= url_path('doc/select')%> method='GET'>
5
- <table>
6
- <tr>
7
- <td>Doc DB key: </db>
8
- <td><input name='dbkey' value='<%= @dbkey%>' size=64/></td>
9
- </tr>
10
- </table>
11
- <input type='submit' value='Submit'>
12
- </form>
13
- <%if params[:dbkey]%>
14
- <%= erb(:upload_doc, :layout => false) %>
15
- <%end%>
16
- <%= erb(:docdata, :layout => false) %>
17
-
@@ -1,23 +0,0 @@
1
- <h2>Upload document</h2>
2
- <div class='panel'>
3
- <form action='<%=url_path("doc/upload?#{@back_params}")%>' method='post' enctype="multipart/form-data">
4
- <input type='hidden' name='doc' value='<%= "#{CGI.escape(params[:dbkey])}"%>'/>
5
- <table>
6
- <%if @is_string%>
7
- <tr>
8
- <td>Token string:</td>
9
- <td><input type='text' name='string' value=''/></td>
10
- </tr>
11
- <%else%>
12
- <tr>
13
- <td>Data (hash of hashes in json):</td>
14
- <td><input type='file' name='file' value=''/></td>
15
- </tr>
16
- <%end%>
17
- <tr>
18
- <td></td>
19
- <td><input type='submit' value='Submit'/></td>
20
- </tr>
21
- </table>
22
- </form>
23
- </div>