Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched to resque because of process-based (not thread-based) parall…
…el processing better fits OWL.
- Loading branch information
Paweł Paprota
committed
Sep 30, 2013
1 parent
85198f8
commit 2733387
Showing
22 changed files
with
242 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
jQuery -> | ||
$("a[rel~=popover], .has-popover").popover() | ||
$("a[rel~=tooltip], .has-tooltip").tooltip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
=require twitter-bootstrap-static/bootstrap | ||
Use Font Awesome icons (default) | ||
To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites" | ||
=require twitter-bootstrap-static/fontawesome | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,30 @@ | ||
class AdminController < ActionController::Base | ||
protect_from_forgery | ||
|
||
def spawn_workers | ||
#post_params[] | ||
#TilerWorker.perform_async(params[:changeset_id]) | ||
sql = 'SELECT DISTINCT changeset_id AS id FROM nodes LIMIT 100' | ||
def index | ||
@person = {} | ||
end | ||
|
||
for row in ActiveRecord::Base.connection.execute(sql) do | ||
TilerWorker.perform_async(row['id'].to_i) | ||
def go | ||
params[:ids].each_line do |line| | ||
TilerWorker.perform_async(line.to_i) | ||
end | ||
render nothing: true | ||
end | ||
|
||
redirect_to '/admin' | ||
def go_latest | ||
sql = "SELECT DISTINCT changeset_id FROM ways w WHERE NOT EXISTS | ||
(SELECT 1 FROM changeset_tiles WHERE changeset_id = w.changeset_id) | ||
ORDER BY changeset_id DESC | ||
LIMIT #{params[:limit]}" | ||
go_from_sql(sql) | ||
render nothing: true | ||
end | ||
|
||
def go_from_sql(sql) | ||
for row in ActiveRecord::Base.connection.execute(sql) do | ||
#TilerWorker.perform_async(row['changeset_id'].to_i) | ||
Resque.enqueue(TilerWorker, row['changeset_id'].to_i) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="page-header"><h1>OWL</h1></div> | ||
<%= form_tag("/admin/go", method: "post", :remote => true, :class => 'form-horizontal') do %> | ||
<div class="control-group"> | ||
<%= label_tag(:ids, "changeset ids", :class => 'control-label') %> | ||
<div class="controls"> | ||
<%= text_area_tag :ids %> | ||
</div> | ||
</div> | ||
<div class="form-actions"> | ||
<%= submit_tag("Go", :class => 'btn btn-primary') %> | ||
</div> | ||
<% end %> | ||
<%= form_tag("/admin/go_latest", method: "get", :remote => true, :class => 'form-horizontal') do %> | ||
<div class="control-group"> | ||
<%= label_tag(:limit, "limit", :class => 'control-label') %> | ||
<div class="controls"> | ||
<%= text_field_tag :limit, 100 %> | ||
</div> | ||
</div> | ||
<div class="form-actions"> | ||
<%= submit_tag("Go", :class => 'btn btn-primary') %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="page-header"><h1>asdasd</h1></div> | ||
<%= form_tag("go", method: "post", :remote => true, :class => 'form-horizontal') do %> | ||
<div class="control-group"> | ||
<%= label_tag(:ids, "changeset ids", :class => 'control-label') %> | ||
<div class="controls"> | ||
<%= text_area_tag :ids %> | ||
</div> | ||
</div> | ||
<div class="form-actions"> | ||
<%= submit_tag("Go", :class => 'btn btn-primary') %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title><%= content_for?(:title) ? yield(:title) : "Owl" %></title> | ||
<%= csrf_meta_tags %> | ||
|
||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements --> | ||
<!--[if lt IE 9]> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script> | ||
<![endif]--> | ||
|
||
<%= stylesheet_link_tag "application", :media => "all" %> | ||
|
||
<!-- For third-generation iPad with high-resolution Retina display: --> | ||
<!-- Size should be 144 x 144 pixels --> | ||
<%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %> | ||
|
||
<!-- For iPhone with high-resolution Retina display: --> | ||
<!-- Size should be 114 x 114 pixels --> | ||
<%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %> | ||
|
||
<!-- For first- and second-generation iPad: --> | ||
<!-- Size should be 72 x 72 pixels --> | ||
<%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %> | ||
|
||
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: --> | ||
<!-- Size should be 57 x 57 pixels --> | ||
<%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %> | ||
|
||
<!-- For all other devices --> | ||
<!-- Size should be 32 x 32 pixels --> | ||
<%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %> | ||
<%= javascript_include_tag "application" %> | ||
</head> | ||
<body> | ||
|
||
<div class="navbar navbar-fluid-top"> | ||
<div class="navbar-inner"> | ||
<div class="container-fluid"> | ||
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse"> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</a> | ||
<a class="brand" href="#">OWL</a> | ||
<div class="container-fluid nav-collapse"> | ||
<ul class="nav"> | ||
<!--<li><%= link_to "Link1", "/path1" %></li> | ||
<li><%= link_to "Link2", "/path2" %></li> | ||
<li><%= link_to "Link3", "/path3" %></li>--> | ||
</ul> | ||
</div><!--/.nav-collapse --> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container-fluid"> | ||
<div class="row-fluid"> | ||
<div class="span3"> | ||
<div class="well sidebar-nav"> | ||
<ul class="nav nav-list"> | ||
<li class="nav-header">Process changesets</li> | ||
<!--<li><%= link_to "by ids", "/admin/process" %></li> | ||
<li><%= link_to "latest", "/admin/go_latest" %></li>--> | ||
</ul> | ||
</div><!--/.well --> | ||
</div><!--/span--> | ||
<div class="span9"> | ||
<%= bootstrap_flash %> | ||
<%= yield %> | ||
</div> | ||
</div><!--/row--> | ||
|
||
<footer> | ||
<p>© Company 2013</p> | ||
</footer> | ||
|
||
</div> <!-- /container --> | ||
|
||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Sample localization file for English. Add more files in this directory for other locales. | ||
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. | ||
|
||
en: | ||
helpers: | ||
actions: "Actions" | ||
links: | ||
back: "Back" | ||
cancel: "Cancel" | ||
confirm: "Are you sure?" | ||
destroy: "Delete" | ||
new: "New" | ||
edit: "Edit" | ||
titles: | ||
edit: "Edit %{model}" | ||
save: "Save %{model}" | ||
new: "New %{model}" | ||
delete: "Delete %{model}" |
Oops, something went wrong.