tap-server 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History +5 -0
- data/cmd/server.rb +36 -8
- data/lib/tap/controller/rest_routes.rb +77 -0
- data/lib/tap/controller/utils.rb +29 -0
- data/lib/tap/controller.rb +244 -145
- data/lib/tap/controllers/app.rb +97 -55
- data/lib/tap/controllers/data.rb +132 -0
- data/lib/tap/controllers/schema.rb +137 -223
- data/lib/tap/controllers/server.rb +70 -27
- data/lib/tap/server/data.rb +178 -0
- data/lib/tap/server/runner.rb +71 -0
- data/lib/tap/server/server_error.rb +35 -0
- data/lib/tap/server.rb +60 -275
- data/lib/tap/tasks/echo.rb +39 -6
- data/lib/tap/tasks/render.rb +65 -0
- data/public/stylesheets/tap.css +15 -2
- data/views/configurable/_config.erb +1 -0
- data/views/configurable/_configs.erb +28 -0
- data/views/configurable/_flag.erb +2 -0
- data/views/configurable/_list_select.erb +8 -0
- data/views/configurable/_select.erb +6 -0
- data/views/configurable/_switch.erb +2 -0
- data/views/layout.erb +1 -1
- data/views/object/obj.erb +1 -0
- data/views/tap/controllers/app/_action.erb +3 -0
- data/views/tap/controllers/app/build.erb +18 -0
- data/views/tap/controllers/app/enque.erb +13 -0
- data/views/tap/controllers/app/info.erb +20 -7
- data/views/tap/controllers/data/_controls.erb +21 -0
- data/views/tap/controllers/data/_index_entry.erb +1 -0
- data/views/tap/controllers/data/_upload.erb +8 -0
- data/views/tap/controllers/data/entry.erb +8 -0
- data/views/tap/controllers/data/index.erb +14 -0
- data/views/tap/controllers/schema/_build.erb +6 -0
- data/views/tap/controllers/schema/_index_entry.erb +6 -0
- data/views/tap/controllers/schema/entry.erb +135 -0
- data/views/tap/controllers/schema/join.erb +6 -4
- data/views/tap/controllers/schema/task.erb +6 -0
- data/views/tap/controllers/server/access.erb +4 -0
- data/views/tap/controllers/server/admin.erb +21 -0
- data/views/tap/controllers/server/help.erb +23 -0
- data/views/tap/controllers/server/index.erb +43 -3
- data/views/tap/task/input.erb +17 -0
- data/views/tap/tasks/load/input.erb +11 -0
- metadata +35 -17
- data/lib/tap/server_error.rb +0 -34
- data/lib/tap/support/persistence.rb +0 -71
- data/lib/tap/tasks/server.rb +0 -30
- data/views/tap/controllers/app/index.erb +0 -44
- data/views/tap/controllers/schema/config/default.erb +0 -4
- data/views/tap/controllers/schema/config/flag.erb +0 -3
- data/views/tap/controllers/schema/config/switch.erb +0 -6
- data/views/tap/controllers/schema/configurations.erb +0 -27
- data/views/tap/controllers/schema/node.erb +0 -47
- data/views/tap/controllers/schema/preview.erb +0 -3
- data/views/tap/controllers/schema/round.erb +0 -30
- data/views/tap/controllers/schema/schema.erb +0 -28
- data/views/tap/tasks/echo/result.html +0 -1
data/lib/tap/tasks/echo.rb
CHANGED
@@ -1,14 +1,47 @@
|
|
1
1
|
module Tap
|
2
2
|
module Tasks
|
3
3
|
|
4
|
-
# ::
|
4
|
+
# ::task
|
5
5
|
class Echo < Tap::Task
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
config :key, 'default' # a basic config
|
7
|
+
|
8
|
+
config :flag_false, false, &c.flag # a flag config (false)
|
9
|
+
config :flag_true, true, &c.flag # a flag config (true)
|
10
|
+
|
11
|
+
config :switch_false, false, &c.switch # a switch config (false)
|
12
|
+
config :switch_true, true, &c.switch # a switch config (true)
|
13
|
+
|
14
|
+
config :string, "string", &c.string # string
|
15
|
+
#config :sym, :sym, &c.symbol # sym
|
16
|
+
config :integer, 10, &c.integer # integer
|
17
|
+
config :numeric, 10, &c.numeric # numeric
|
18
|
+
config :float, 10, &c.float # float
|
19
|
+
|
20
|
+
config :string_or_nil, nil, &c.string_or_nil # string_or_nil (nil)
|
21
|
+
#config :sym_or_nil, nil, &c.symbol_or_nil # symbol_or_nil (nil)
|
22
|
+
config :integer_or_nil, nil, &c.integer_or_nil # integer_or_nil (nil)
|
23
|
+
config :number_or_nil, nil, &c.numeric_or_nil # number_or_nil (nil)
|
24
|
+
config :float_or_nil, nil, &c.float_or_nil # float_or_nil (nil)
|
25
|
+
|
26
|
+
#config :range, 1..10, &c.range # range
|
27
|
+
#config :array, [1,2,3], &c.array # array
|
28
|
+
#config :hash, {}, &c.hash # hash
|
29
|
+
#config :regexp, /abc/, &c.regexp # regexp
|
30
|
+
config :select, 3, &c.select(12,3, &c.integer) # list
|
31
|
+
config :list_select, [3], &c.list_select(1,4,12,3, &c.integer) # list select
|
32
|
+
|
33
|
+
#
|
34
|
+
#
|
35
|
+
# config :output, $stdout, &c.io # regexp
|
36
|
+
|
37
|
+
nest :nest do # nest desc
|
38
|
+
config :a, 'default' # a nested config (before)
|
39
|
+
nest :nest do # double-nest desc
|
40
|
+
config :key, 'default' # a double-nested config
|
41
|
+
end
|
42
|
+
config :z, 'default' # a nested config (after)
|
11
43
|
end
|
44
|
+
|
12
45
|
end
|
13
46
|
end
|
14
47
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'tap/tasks/dump'
|
2
|
+
require 'tap/env'
|
3
|
+
require 'erb'
|
4
|
+
|
5
|
+
module Tap
|
6
|
+
module Tasks
|
7
|
+
# :startdoc::task render an object
|
8
|
+
class Render < Tap::Tasks::Dump
|
9
|
+
|
10
|
+
config :dir, :views
|
11
|
+
config :path, 'obj.erb'
|
12
|
+
|
13
|
+
attr_accessor :env
|
14
|
+
|
15
|
+
def initialize(config={}, app=Tap::App.instance, env=Tap::Env.instance)
|
16
|
+
super(config, app)
|
17
|
+
@env = env
|
18
|
+
end
|
19
|
+
|
20
|
+
# Renders the specified template as ERB using the options. Options:
|
21
|
+
#
|
22
|
+
# locals:: a hash of local variables used in the template
|
23
|
+
#
|
24
|
+
# The filename used to identify errors in an erb template to a specific
|
25
|
+
def render(path, options={})
|
26
|
+
# render template
|
27
|
+
template = File.read(path)
|
28
|
+
|
29
|
+
# assign locals to the render binding
|
30
|
+
# this almost surely may be optimized...
|
31
|
+
locals = options[:locals]
|
32
|
+
binding = empty_binding
|
33
|
+
|
34
|
+
locals.each_pair do |key, value|
|
35
|
+
@assignment_value = value
|
36
|
+
eval("#{key} = remove_instance_variable(:@assignment_value)", binding)
|
37
|
+
end if locals
|
38
|
+
|
39
|
+
erb = ERB.new(template, nil, "<>")
|
40
|
+
erb.filename = path
|
41
|
+
erb.result(binding)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Dumps the object to io using obj.inspect
|
45
|
+
def dump(obj, io)
|
46
|
+
template_path = env.class_path(dir, obj, path) do |file|
|
47
|
+
File.file?(file)
|
48
|
+
end
|
49
|
+
|
50
|
+
unless template_path
|
51
|
+
raise "no template for: #{obj.class}"
|
52
|
+
end
|
53
|
+
|
54
|
+
io.puts render(template_path, :locals => {:obj => obj})
|
55
|
+
end
|
56
|
+
|
57
|
+
protected
|
58
|
+
|
59
|
+
# Generates an empty binding to self without any locals assigned.
|
60
|
+
def empty_binding # :nodoc:
|
61
|
+
binding
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/public/stylesheets/tap.css
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
/*
|
2
2
|
Tap Styles
|
3
3
|
*/
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
/* schema */
|
6
|
+
form.build, form.rename, form.duplicate, form.delete {
|
7
|
+
display: inline;
|
8
|
+
}
|
9
|
+
|
10
|
+
li.task, li.join, li.queue {
|
11
|
+
border-top: thin solid black;
|
12
|
+
padding: 0.5em;
|
13
|
+
}
|
14
|
+
|
15
|
+
pre.yaml {
|
16
|
+
padding: 1em;
|
17
|
+
background-color: 99FFCC;
|
18
|
+
overflow: hidden;
|
6
19
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
<input name="<%= name %>" type="text" value="<%= escape_html(value) %>" />
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<dl class="configs">
|
2
|
+
<% configurations.each_pair do |key, config| %>
|
3
|
+
<% next if config[:type] == :hidden %>
|
4
|
+
<% if config.is_nest? %>
|
5
|
+
<dt class="name"><%= key %></dt>
|
6
|
+
<dd class="nested-configs">
|
7
|
+
<%= module_render("_configs.erb", obj, :locals => {
|
8
|
+
:id => id,
|
9
|
+
:name => "#{name}[#{key}]",
|
10
|
+
:configurations => config.default(false).delegates,
|
11
|
+
:values => values[key.to_s]
|
12
|
+
}) %>
|
13
|
+
</dd>
|
14
|
+
<% else %>
|
15
|
+
<dt><%= key %></dt>
|
16
|
+
<dd class="config">
|
17
|
+
<%= render(
|
18
|
+
:file => module_path("_#{config[:type]}.erb", obj) || module_path("_config.erb", obj),
|
19
|
+
:locals => {
|
20
|
+
:id => "#{id}_config_#{key}",
|
21
|
+
:obj => obj,
|
22
|
+
:name => "#{name}[#{key}]",
|
23
|
+
:config => config,
|
24
|
+
:value => values[key.to_s]}) %>
|
25
|
+
</dd>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
</dl>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<input type="hidden" name="<%= name %>[][]" value="" />
|
2
|
+
<select name="<%= name %>[]" multiple="true">
|
3
|
+
<% value.collect! {|val| stringify(val) } %>
|
4
|
+
<% (config[:options] || []).each do |option| %>
|
5
|
+
<% option = stringify(option) %>
|
6
|
+
<option value="<%= escape_html(option) %>" <%= value.include?(option) ? "selected='true' " : ""%>><%= option %></option>
|
7
|
+
<% end %>
|
8
|
+
</select>
|
data/views/layout.erb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
<%= obj.inspect %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<form action="<%= uri :build %>" method="post">
|
2
|
+
<textarea rows="10" cols="40" name="schema">
|
3
|
+
tasks:
|
4
|
+
load:
|
5
|
+
id: load
|
6
|
+
dump:
|
7
|
+
id: dump
|
8
|
+
joins:
|
9
|
+
- - [load]
|
10
|
+
- [dump]
|
11
|
+
</textarea><br/>
|
12
|
+
<input type="checkbox" name="reset">reset</input>
|
13
|
+
<input type="checkbox" name="run">run</input>
|
14
|
+
<input type="submit" value="build" />
|
15
|
+
</form>
|
16
|
+
<ul>
|
17
|
+
<li><a href="<%= uri :info %>">Info</a></li>
|
18
|
+
</ul>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<form action="<%= uri :enque %>" method="post">
|
2
|
+
<textarea rows="10" cols="40" name="queue">
|
3
|
+
- - load
|
4
|
+
- - goodnight moon
|
5
|
+
- - load
|
6
|
+
- - hello world
|
7
|
+
</textarea><br/>
|
8
|
+
<input type="hidden" name="load" value="on" />
|
9
|
+
<input type="submit" value="enque" />
|
10
|
+
</form>
|
11
|
+
<ul>
|
12
|
+
<li><a href="<%= uri :info %>">Info</a></li>
|
13
|
+
</ul>
|
@@ -1,8 +1,21 @@
|
|
1
|
-
|
2
|
-
<%
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<span class="info" id="info-<%= id %>"><%= content %></span>
|
1
|
+
<div>
|
2
|
+
<% actions.each do |action| %>
|
3
|
+
<%= render "_action.erb", :locals => {:action => action } %>
|
4
|
+
<% end %>
|
5
|
+
<%= app.info %>
|
7
6
|
</div>
|
8
|
-
<
|
7
|
+
<ul>
|
8
|
+
<li><a href="<%= uri :schema %>">Build</a> (<a href="<%= uri :build %>">manual</a>)</li>
|
9
|
+
<li><a href="<%= uri :data %>">Enque</a> (<a href="<%= uri :enque %>">manual</a>)</li>
|
10
|
+
</ul>
|
11
|
+
|
12
|
+
<h3>Current Build:</h3>
|
13
|
+
<% if tasks.empty? %>
|
14
|
+
<span>(no workflow built)</span>
|
15
|
+
<% end %>
|
16
|
+
<dl>
|
17
|
+
<% tasks.each_pair do |key, task| %>
|
18
|
+
<dt><%= key %></dt>
|
19
|
+
<dd><%= task.class %></dd>
|
20
|
+
<% end %>
|
21
|
+
</dl>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<form id="rename_<%= id %>" class="rename" method="post" action="<%= uri(id) %>">
|
2
|
+
<input type="text" name="new_id" value="<%= id %>" />
|
3
|
+
<input type="hidden" name="_method" value="rename" />
|
4
|
+
<input type="submit" value="Rename" />
|
5
|
+
</form>
|
6
|
+
|
7
|
+
<form id="duplicate_<%= id %>" class="duplicate" method="post" action="<%= uri(id) %>">
|
8
|
+
<input type="hidden" name="_method" value="duplicate" />
|
9
|
+
<input type="submit" value="Duplicate" />
|
10
|
+
</form>
|
11
|
+
|
12
|
+
<form id="delete_<%= id %>" class="delete" method="post" action="<%= uri(id) %>">
|
13
|
+
<input class="action" type="hidden" name="_method" value="delete" />
|
14
|
+
<input type="submit" value="Delete" />
|
15
|
+
</form>
|
16
|
+
|
17
|
+
<ul>
|
18
|
+
<li><a href="<%= uri %>">index</a></li>
|
19
|
+
<li><a href="<%= uri(id, :as => :preview) %>">preview</a></li>
|
20
|
+
<li><a href="<%= uri(id, :as => :download) %>">download</a></li>
|
21
|
+
</ul>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= data.cache[type].include?(id) ? "*" : "" %><a href="<%= uri(id) %>"><%= id %></a>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<form class="upload" enctype="multipart/form-data" method="post" action="<%= uri %>">
|
2
|
+
<input type="hidden" name="_method" value="upload" />
|
3
|
+
<ul>
|
4
|
+
<li><input type="file" name="<%= type %>" /></li>
|
5
|
+
<li><input type="text" name="id" value="" /> Id (if other than file name)</li>
|
6
|
+
</ul>
|
7
|
+
<input type="submit" value="Upload" />
|
8
|
+
</form>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= render('_controls.erb', :locals => {:id => id}) %>
|
2
|
+
|
3
|
+
<form class="<%= type %>" method="post" action="<%= uri %>">
|
4
|
+
<input type="hidden" name="_method" value="<%= id == 'new' ? 'create' : 'update' %>" />
|
5
|
+
<input type="hidden" name="id" value="<%= id %>" />
|
6
|
+
<textarea name="<%= type %>"><%= content %></textarea>
|
7
|
+
<input type="submit" value="Save" />
|
8
|
+
</form>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<h1><%= type %></h1>
|
2
|
+
<%= render('_upload.erb') %>
|
3
|
+
<form id="select_<%= type %>" class="select" method="post" action="<%= uri %>">
|
4
|
+
<input type="hidden" name="_method" value="select" />
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% data.index(type).each do |id| %>
|
8
|
+
<li><input type="checkbox" name="id[]" value="<%= id %>" /> <%= render('_index_entry.erb', :locals => {:id => id})%></li>
|
9
|
+
<% end %>
|
10
|
+
<li><a href="<%= uri('new') %>">new</a></li>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<input type="submit" value="Select" />
|
14
|
+
</form>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<form id="build_<%= id %>" class="build" method="post" action="<%= uri("../build") %>">
|
2
|
+
<input type="hidden" name="_method" value="build" />
|
3
|
+
<input type="hidden" name="id" value="<%= id %>" />
|
4
|
+
<input type="hidden" name="reset" value="on" />
|
5
|
+
<input type="submit" value="Build" />
|
6
|
+
</form>
|
@@ -0,0 +1,135 @@
|
|
1
|
+
<%= render('_build.erb', :locals => {:id => id}) %>
|
2
|
+
<%= render('_controls.erb', :locals => {:id => id}) %>
|
3
|
+
|
4
|
+
<h2>Design:</h2>
|
5
|
+
<!-- add form -->
|
6
|
+
<% traverse = schema.traverse %>
|
7
|
+
<form id="add_<%= id %>" class="add" method="post" action="<%= uri(id) %>">
|
8
|
+
<input type="hidden" name="_method" value="add" />
|
9
|
+
|
10
|
+
<table>
|
11
|
+
<% traverse.each do |(key, inputs, outputs)| %>
|
12
|
+
<tr>
|
13
|
+
<td><input name="outputs[]" value="<%= key %>" type="checkbox" /></td>
|
14
|
+
<td><a href="#task_<%= key %>"><%= key %></a></td>
|
15
|
+
<td><input name="inputs[]" value="<%= key %>" type="checkbox" /></td>
|
16
|
+
<td>[<% inputs.each do |index| %><a href="#join_<%= index %>"><%= index %></a> <% end %>]</td>
|
17
|
+
<td>[<% outputs.each do |index| %><a href="#join_<%= index %>"><%= index %></a> <% end %>]</td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
</table>
|
21
|
+
|
22
|
+
<ul>
|
23
|
+
<% server.env.minimap.each do |(env_name, env)| %>
|
24
|
+
<% env.manifest(:task).minimap.each do |(name, const)| %>
|
25
|
+
<% key = "#{env_name}:#{name}" %>
|
26
|
+
<li><input name="tasks[]" value="<%= key %>" type="checkbox"><%= key %></input></li>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
</ul>
|
30
|
+
|
31
|
+
<ul>
|
32
|
+
<% traverse.each do |(key, inputs, outputs)| %>
|
33
|
+
<li><input name="queue[]" value="<%= key %>" type="checkbox"><%= key %></input></li>
|
34
|
+
<% end %>
|
35
|
+
</ul>
|
36
|
+
|
37
|
+
<input type="submit" value="Add" />
|
38
|
+
</form>
|
39
|
+
|
40
|
+
<!-- remove form -->
|
41
|
+
<form id="remove_<%= id %>" class="remove" method="post" action="<%= uri(id) %>">
|
42
|
+
<input type="hidden" name="_method" value="remove" />
|
43
|
+
|
44
|
+
<ul>
|
45
|
+
<% traverse.each do |(key, inputs, outputs)| %>
|
46
|
+
<li>
|
47
|
+
<input name="tasks[]" value="<%= key %>" type="checkbox" />
|
48
|
+
<a href="#task_<%= key %>"><%= key %></a>
|
49
|
+
</li>
|
50
|
+
<% end %>
|
51
|
+
</ul>
|
52
|
+
|
53
|
+
<ul>
|
54
|
+
<% schema.joins.each_index do |index| %>
|
55
|
+
<li>
|
56
|
+
<input name="joins[]" value="<%= index %>" type="checkbox" />
|
57
|
+
<a href="#join_<%= index %>"><%= index %></a>
|
58
|
+
</li>
|
59
|
+
<% end %>
|
60
|
+
</ul>
|
61
|
+
|
62
|
+
<ul>
|
63
|
+
<% schema.queue.each_index do |index| %>
|
64
|
+
<li>
|
65
|
+
<input name="queue[]" value="<%= index %>" type="checkbox" />
|
66
|
+
<a href="#queue_<%= index %>"><%= index %></a>
|
67
|
+
</li>
|
68
|
+
<% end %>
|
69
|
+
</ul>
|
70
|
+
|
71
|
+
<input type="submit" value="Remove" />
|
72
|
+
</form>
|
73
|
+
|
74
|
+
<!-- configure form -->
|
75
|
+
<form id="configure_<%= id %>" class="configure" method="post" action="<%= uri(id) %>">
|
76
|
+
<input type="hidden" name="_method" value="configure" />
|
77
|
+
|
78
|
+
<h2>Configure:</h2>
|
79
|
+
<ul class="tasks">
|
80
|
+
<% schema.tasks.each_pair do |key, task| %>
|
81
|
+
<% name = "schema[tasks][#{key}]" %>
|
82
|
+
<% task_class = task['class'] %>
|
83
|
+
<li id="task_<%= key %>" class="task">
|
84
|
+
<h3><a href="#add_<%= id %>"><%= key %></a></h3>
|
85
|
+
|
86
|
+
<input type="hidden" name="<%= name %>[id]" value="<%= task['id'] %>">
|
87
|
+
<%= module_render('task.erb', task_class, :locals => {
|
88
|
+
:id => "#{id}_task_#{key}",
|
89
|
+
:name => name,
|
90
|
+
:values => task['config'] || default_config(task_class),
|
91
|
+
:task => task }) %>
|
92
|
+
</li>
|
93
|
+
<% end %>
|
94
|
+
</ul>
|
95
|
+
|
96
|
+
<ul class="joins">
|
97
|
+
<% schema.joins.each_with_index do |(inputs, outputs, join), index| %>
|
98
|
+
<% name = "schema[joins][]" %>
|
99
|
+
<% join_class = join['class'] %>
|
100
|
+
<li id="join_<%= index %>" class="join">
|
101
|
+
<h3><a href="#add_<%= id %>"><%= index %></a></h3>
|
102
|
+
<% inputs.each do |input| %>
|
103
|
+
<input type="hidden" name="<%= name %>[0][]" value="<%= input %>">
|
104
|
+
<% end %>
|
105
|
+
<% outputs.each do |output| %>
|
106
|
+
<input type="hidden" name="<%= name %>[1][]" value="<%= output %>">
|
107
|
+
<% end %>
|
108
|
+
<input type="hidden" name="<%= name %>[2][id]" value="<%= join['id'] || 'join' %>">
|
109
|
+
<%= module_render('join.erb', join_class, :locals => {
|
110
|
+
:id => "#{id}_join_#{index}",
|
111
|
+
:name => "#{name}[2]",
|
112
|
+
:values => join['config'] || default_config(join_class),
|
113
|
+
:join => join }) %>
|
114
|
+
</li>
|
115
|
+
<% end %>
|
116
|
+
</ul>
|
117
|
+
|
118
|
+
<h2>Enque:</h2>
|
119
|
+
<ul class="queue">
|
120
|
+
<% schema.queue.each_with_index do |(key, args), index| %>
|
121
|
+
<% name = "schema[queue][]" %>
|
122
|
+
<% task = schema.tasks[key] %>
|
123
|
+
<li id="queue_<%= index %>" class="queue">
|
124
|
+
<h3><%= key %></h3>
|
125
|
+
<input type="hidden" name="<%= name %>[0]" value="<%= key %>">
|
126
|
+
<%= module_render('input.erb', task['class'], :locals => {
|
127
|
+
:id => id,
|
128
|
+
:name => "#{name}[1]",
|
129
|
+
:args => args || [],
|
130
|
+
:task => task }) %>
|
131
|
+
</li>
|
132
|
+
<% end %>
|
133
|
+
</ul>
|
134
|
+
<input type="submit" value="Save" />
|
135
|
+
</form>
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%= module_render("_configs.erb", obj, :locals => {
|
2
|
+
:id => id,
|
3
|
+
:name => "#{name}[config]",
|
4
|
+
:configurations => obj.configurations,
|
5
|
+
:values => values || {}
|
6
|
+
}) %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div>Ruby <%= RUBY_VERSION %> (<%= RUBY_PLATFORM %>)</div>
|
2
|
+
<div>Tap <%= Tap::VERSION %></div>
|
3
|
+
<div>
|
4
|
+
Server:
|
5
|
+
<% config = server.config.to_hash %>
|
6
|
+
<% config.delete(:env) %>
|
7
|
+
<pre class="yaml"><%= YAML.dump(config) %></pre>
|
8
|
+
</div>
|
9
|
+
<% if Object.const_defined?(:Gem) %>
|
10
|
+
<div>
|
11
|
+
Active Gems:
|
12
|
+
<ul>
|
13
|
+
<% Gem.loaded_specs.each_pair do |key, spec| %>
|
14
|
+
<li><%= spec.full_name %></li>
|
15
|
+
<% end %>
|
16
|
+
</ul>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<form action="<%= uri :shutdown, :secret => secret %>" method="post">
|
20
|
+
<input type="submit" value="shutdown" />
|
21
|
+
</form>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<h1 class="class"><%= obj %></h1>
|
2
|
+
<span class="summary"><%= obj.desc.subject %></span>
|
3
|
+
|
4
|
+
<h2>Documentation</h2>
|
5
|
+
<pre class="desc"><%= obj.desc.wrap %></pre>
|
6
|
+
|
7
|
+
<h2>Attributes</h2>
|
8
|
+
<table>
|
9
|
+
<tr class="source_file">
|
10
|
+
<td>Source File</td>
|
11
|
+
<td><%= obj.source_file %></td>
|
12
|
+
<tr>
|
13
|
+
<tr class="ancestors">
|
14
|
+
<td>Ancestors</td>
|
15
|
+
<td>
|
16
|
+
<ul>
|
17
|
+
<% obj.ancestors.each do |ancestor| %>
|
18
|
+
<li><%= ancestor %></li>
|
19
|
+
<% end %>
|
20
|
+
</ul>
|
21
|
+
</td>
|
22
|
+
<tr>
|
23
|
+
</table>
|
@@ -1,3 +1,43 @@
|
|
1
|
-
|
2
|
-
<a href="<%=
|
3
|
-
|
1
|
+
<div id="branding">
|
2
|
+
<h1><a href="<%= Tap::WEBSITE %>">Tap (<ins>T</ins>ask <ins>Ap</ins>plication) <%= Tap::VERSION %> </a></h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div id="content_main">
|
6
|
+
<dl id="envs" class="manifest">
|
7
|
+
<% env_keys = server.env.minihash(true) %>
|
8
|
+
<% server.env.each do |env| %>
|
9
|
+
<% root = env.root %>
|
10
|
+
<% env_key = env_keys[env] %>
|
11
|
+
<dt class="key"><%= env_key %> (<%= root.root %>)</dt>
|
12
|
+
<dd class="value">
|
13
|
+
<% controllers = env.manifest(:controller) %>
|
14
|
+
<% unless controllers.empty? %>
|
15
|
+
<dl id="controllers" class="manifest">
|
16
|
+
<dt class="key">controllers</dt>
|
17
|
+
<dd class="value">
|
18
|
+
<ol>
|
19
|
+
<% controllers.minimap.each do |(key, const)| %>
|
20
|
+
<li><a href="<%= escape(key) %>"><%= key %></a> (<a href="<%= help_uri('controller', key) %>"><%= const.require_path %></a>)</li>
|
21
|
+
<% end %>
|
22
|
+
</ol>
|
23
|
+
</dd>
|
24
|
+
</dl>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% tasks = env.manifest(:task) %>
|
28
|
+
<% unless tasks.empty? %>
|
29
|
+
<dl id="tasks" class="manifest">
|
30
|
+
<dt class="key">tasks</dt>
|
31
|
+
<dd class="value">
|
32
|
+
<ol>
|
33
|
+
<% tasks.minimap.each do |(key, const)| %>
|
34
|
+
<li><%= key %> (<a href="<%= help_uri('task', key) %>"><%= const.require_path %></a>)</li>
|
35
|
+
<% end %>
|
36
|
+
</ol>
|
37
|
+
</dd>
|
38
|
+
</dl>
|
39
|
+
<% end %>
|
40
|
+
</dd>
|
41
|
+
<% end %>
|
42
|
+
</dl>
|
43
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<ul>
|
2
|
+
<% obj.args.arguments.each do |argument| %>
|
3
|
+
<li class="input">
|
4
|
+
<input name="<%= name %>[]" value="<%= args.shift %>" />
|
5
|
+
<span><%= argument %></span>
|
6
|
+
<% if argument =~ /\.{3}\z/ %>
|
7
|
+
<% args << '' %>
|
8
|
+
<% args.each do |arg| %>
|
9
|
+
</li>
|
10
|
+
<li class="input">
|
11
|
+
<input name="<%= name %>[]" value="<%= arg %>" />
|
12
|
+
<span>...</span>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
17
|
+
</ul>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<ul>
|
2
|
+
<li class="input">
|
3
|
+
<% config = task['config'] %>
|
4
|
+
<% if config && config['file'] == 'true' %>
|
5
|
+
<input name="<%= name %>[]" value="<%= args[0] %>" />
|
6
|
+
<% else %>
|
7
|
+
<textarea name="<%= name %>[]"><%= args[0] %></textarea>
|
8
|
+
<% end %>
|
9
|
+
<span>Data</span>
|
10
|
+
</li>
|
11
|
+
</ul>
|