Skip to content

Commit

Permalink
Updated docs and added asciinema script
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeares committed Nov 9, 2021
1 parent 349228e commit 2d75163
Show file tree
Hide file tree
Showing 16 changed files with 1,076 additions and 206 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.snakeviz/
*.prof
*.db
scratch/
/portable/
/test_root/
/tests/data/
Expand Down
1,023 changes: 1,023 additions & 0 deletions docs/mkdocs/assets/casts/demo.cast

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/mkdocs/assets/screenshots/dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/mkdocs/assets/screenshots/login-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/mkdocs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ hide:

Below is a list of common questions and issues you may encounter. If you have suggestions, please join the [FAQ Suggestions discussion on the GitHub repository](https://github.com/bmeares/Meerschaum/discussions/46)!

??? faq "How do I upgrade to the latest version?"
You can install the latest version of Meerschaum with `pip install --upgrade meerschaum` or the command `mrsm upgrade mrsm`, which installs the latest version from PyPI and pulls the latest Docker images.

??? faq "`mrsm` doesn't work!"
You can invoke `mrsm` directly with `python -m meerschaum`. Check that your `PATH` includes scripts installed by `pip`, such as `~/.local/bin`.

Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs/get-started/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ title: Get Started
nav:
- Setup: index.md
- Building a Pipe: bootstrap.md
- Web Interface: start-api.md
- Web Console: start-api.md
- ...
44 changes: 14 additions & 30 deletions docs/mkdocs/get-started/start-api.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,41 @@
# Meerschaum Web Server
# Meerschaum Web Console

You can use Meerschaum from its web interface. From within a `mrsm` shell, type to commands below to see how:

## Web Interface

1. Register a new user (`myuser`) on your instance.

```bash
register user myuser
```

2. Start the API server.
1. Start the Web API server.

```bash
start api
```

3. In a web browser, visit the IP address of your server followed by `:8000`, e.g. [http://localhost:8000](http://localhost:8000). Enter the username and password you just created, then click Login.

??? tip "Change the port number"
To change the port of the API server, add the flag `--port` or `-p`:

```bash
start api --port 8001
```

2. Visit port 8000 in a web browser (e.g. [http://localhost:8000](http://localhost:8000)) and create an account or login to your instance.

??? tip "Register from the command-line"

You can create users on your instance with the `register user` command.
```bash
register user myuser
```

<img src="/assets/screenshots/login-page.png"/>

4. On the left side of the dashboard are the available Meerschaum commands, just like in the `mrsm` shell.
3. On the left side of the dashboard are the available commands, like in the `mrsm` shell.

<img src="/assets/screenshots/dash.png"/>

!!! tip "Adding custom commands"
You can add your own actions with [Meerschaum plugins](/reference/plugins/writing-plugins/#action-plugins).

## Web API

1. Visit the address of the server mentioned above, and add `/docs`, e.g. [http://localhost:8000/docs](http://localhost:8000/docs):

<img src="/assets/screenshots/api-docs.png"/>

2. Click the green Authorize button on the top left, and enter the credentials you made earlier:

<img src="/assets/screenshots/api-login.png"/>

3. Scroll to the section for the endpoint `/pipes/{connector_keys}/{metric_key}/{location_key}/data` and enter the keys `plugin:noaa`, `weather`, and `ATL` for the pipe you [previouosly bootstrapped](/get-started/bootstrap/). You may also enter beginning and end datetimes if you like.

<img src="/assets/screenshots/api-data-params.png"/>

4. Click the blue Execute button and scroll down to see the JSON response.

<img src="/assets/screenshots/api-data-response.png"/>
<img src="/assets/screenshots/dash-statistics.png"/>

Also like the `mrsm` shell, the web console lets you control pipes from several instances (note the instances drop-down on the top right).

# Conclusion

Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ h1 {
</div>
<div class="grid-child">
<br>
<asciinema-player src="/assets/casts/jobs.cast" autoplay="true" loop="true" size="small" preload="true"></asciinema-player>
<asciinema-player src="/assets/casts/demo.cast" autoplay="true" loop="true" size="small" preload="true"></asciinema-player>
<!-- <div style="text-align: center">
<iframe width="480" height="270" src="https://www.youtube.com/embed/wncA_vaIois" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div> -->
Expand Down
16 changes: 13 additions & 3 deletions docs/mkdocs/news/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,23 @@ This changelog was not introduced until v0.2.12, so many of the critical release
## 0.4.x Releases
This is the current release cycle, so future features will be updated below.

### v0.4.10
### v0.4.11 — v0.4.15
- **Change the number of columns when printing items.**
Depending on the lengths of items and size of the terminal, the number of columns is reduced until most items are not truncated.
- **Allow shell jobs with the `-f` flag.**
In addition to `--allow-shell-job`, the `--force` flag permits non-Meerschaum commands to be run. If these flags are absent, a more informative error message is printed.
- **Redesigned the bottom toolbar.**
The bottom toolbar now uses a black background with white text. Although this technically still prints ANSI when the global ANSI configuration is false, it still does toggle color.
- **More bugfixes.**
A warning when installing plugins has been addressed, and other virtual environment and portable bugs have been fixed.

### v0.4.8 — v0.4.10
- **Added the bottom toolbar to the interactive shell.**
The includes the current instance, repo, and connection status.
- **Fixed parsing issue with the Docker build.**
There is a strange edge case where multiple levels of JSON-encoding needed to be escaped, and this scenario has been accounted for.
- **Enforce `MRSM_CONFIG` and `MRSM_PATCH` in the Web Console actions.**
The Docker version of the API uses environment variables to manage instances, so this information is passed along to children threads.
- **Added the bottom toolbar to the interactive shell.**
The includes the current instance, repo, and connection status.
- **Delayed imports when changing instances.**
This postpones trying to connect to an instance until as late as possible.

Expand Down
25 changes: 0 additions & 25 deletions scratch/daemoniker.py

This file was deleted.

81 changes: 0 additions & 81 deletions scratch/dashing_test.py

This file was deleted.

18 changes: 0 additions & 18 deletions scratch/flame.py

This file was deleted.

17 changes: 0 additions & 17 deletions scratch/pyro_client.py

This file was deleted.

30 changes: 0 additions & 30 deletions scratch/pyro_server.py

This file was deleted.

20 changes: 20 additions & 0 deletions scripts/asciinema.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. "$DIR"/config.sh

if [ -n "$1" ]; then
name="$1"
else
echo "Enter name for recording:"
read name
if [ -z "$name" ]; then
echo "Invalid name."
exit 1
fi
fi

file_path="$PARENT/docs/mkdocs/assets/casts/$name.cast"
cd ~/
python -m asciinema rec "$file_path" --overwrite

0 comments on commit 2d75163

Please sign in to comment.