Skip to content

Commit

Permalink
Add help in the admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Nov 30, 2024
1 parent 47e51d8 commit 084bdc2
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tilecloud_chain/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
- **`name`** _(string)_: The name used in the admin interface.
- **`allowed_commands`** _(array)_: The allowed commands (main configuration). Default: `["generate-tiles", "generate-controller", "generate-cost"]`.
- **Items** _(string)_
- **`allowed_arguments`** _(array)_: The allowed arguments (main configuration). Default: `["--layer", "--get-hash", "--generate-legend-images", "--get-bbox", "--help", "--ignore-errors", "--bbox", "--zoom", "--test", "--near", "--time", "--measure-generation-time", "--no-geom", "--dimensions"]`.
- **`allowed_arguments`** _(array)_: The allowed arguments (main configuration). Default: `["--layer", "--get-hash", "--generate-legend-images", "--get-bbox", "--help", "--ignore-error", "--bbox", "--zoom", "--test", "--near", "--time", "--measure-generation-time", "--no-geom", "--dimensions"]`.
- **Items** _(string)_
- **`admin_footer`** _(string)_: The footer of the admin interface.
- **`admin_footer_classes`** _(string)_: The CSS classes used on the footer of the admin interface.
Expand Down
4 changes: 2 additions & 2 deletions tilecloud_chain/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"--generate-legend-images",
"--get-bbox",
"--help",
"--ignore-errors",
"--ignore-error",
"--bbox",
"--zoom",
"--test",
Expand Down Expand Up @@ -2527,7 +2527,7 @@ class Server(TypedDict, total=False):
- --generate-legend-images
- --get-bbox
- --help
- --ignore-errors
- --ignore-error
- --bbox
- --zoom
- --test
Expand Down
2 changes: 1 addition & 1 deletion tilecloud_chain/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@
"--generate-legend-images",
"--get-bbox",
"--help",
"--ignore-errors",
"--ignore-error",
"--bbox",
"--zoom",
"--test",
Expand Down
39 changes: 39 additions & 0 deletions tilecloud_chain/templates/admin_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,45 @@ <h2>Launch generation</h2>
<span id="result"></span>
%endif

<!---->
%if request.identity.is_auth:
<h3>Usage</h3>
<h4><code>generate-tiles</code></h4>
<p>Generate the tiles.</p>
<p>Arguments:</p>
<ul>
<li>
<code>--layer=NAME</code>: the layer name to generate, it not specified all the layers are generated.
</li>
<li>
<code>--get-hash=Z/X/Y</code>: get the hash configuration for the layer (requires
<code>--layer</code>).
</li>
<li>
<code>--get-bbox=Z/X/Y[:-N/+N]</code>: get the bbox of a tile, use the specified tile
<code>Z/X/Y</code>, or <code>Z/X/Y:+N/+N</code> for metatiles (requires <code>--layer</code>).
</li>
<li>
<code>--dimensions DIMENSION=VALUE [DIMENSION=VALUE ...]</code>: overwrite the dimensions values
specified in the config file.
</li>
<li>
<code>--zoom=ZOOM</code> restrict to specified zoom level, or a zooms range (2-5), or a zooms list
(2,4,5).
</li>
<li><code>--bbox MINX MINY MAXX MAXY</code>: restrict to specified bounding box.</li>
<li>
<code>--near X Y</code>: This option is a good replacement of <code>--bbox</code>, to used with
<code>--time</code> or <code>--test</code> and <code>--zoom</code>, implies <code>--no-geom</code>. It
automatically measure a bbox around the X Y position that corresponds to the metatiles.
</li>
<li><code>--test N</code>: test with generating N tiles.</li>
</ul>

<h4><code>generate-controller --generate-legend-images</code></h4>
<p>Generate the legend images.</p>
%endif

<h2>Test</h2>
<p>See the result in <a href="/${admin_path}/test">the test page</a>.</p>

Expand Down
Binary file modified tilecloud_chain/tests/index.expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tilecloud_chain/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_should_not_commit():
[
pytest.param("http://application:8080/admin/", "not-login", 250, 800, id="not-login"),
pytest.param("http://application:8080/admin/test", "test", 800, 800, id="test-not-login"),
pytest.param("http://app_test_user:8080/admin", "index", 500, 1000, id="index"),
pytest.param("http://app_test_user:8080/admin", "index", 1000, 1000, id="index"),
pytest.param("http://app_test_user:8080/admin/test", "test", 800, 800, id="test"),
],
)
Expand Down

0 comments on commit 084bdc2

Please sign in to comment.