Skip to content

Commit

Permalink
feat: add dynamic lab_name to wiki
Browse files Browse the repository at this point in the history
fixes: #537

* additionally, set irc notifications to false as a default.

Change-Id: Ic799667c9a35bd82e6c2dc05fbd982f8071a5224
  • Loading branch information
athiruma authored and sadsfae committed Dec 7, 2024
1 parent f061c4c commit 593644d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,7 @@ Additionally, you can pass `--year` instead for a report for every month in that

## Customizing Environment Web Details
### Changing the Default Lab Name
Until [this RFE](https://github.com/redhat-performance/quads/issues/537) is completed you'll need to change your lab name, or what you want to call your QUADS-managed environment in two separate `quads-web` files:

* Edit the [inventory.html](https://github.com/redhat-performance/quads/blob/latest/src/quads/web/templates/wiki/inventory.html#L5)
* Edit the [navbar.html](https://github.com/redhat-performance/quads/blob/latest/src/quads/web/templates/navbar.html#L2)
You can change the default QUADS environment name by modifying the `lab_name` variable in the [quads.yml](https://github.com/redhat-performance/quads/blob/latest/conf/quads.yml#L11)

Restart `quads-web` to take effect.

Expand Down
5 changes: 3 additions & 2 deletions conf/quads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
spare_pool_name: cloud01
spare_pool_description: "Spare Pool"
spare_pool_owner: quads

# Define the name of the QUADS environment
lab_name: "Lab"
# display name for QUADS email notifications
mail_display_name: "QUADS Scheduler"
# set header for User-Agent:
Expand Down Expand Up @@ -35,7 +36,7 @@ email_host: 172.16.0.1

# * Note* you'll need Supybot with the notify plugin
# these setting use netcat to send messages to Supybot
irc_notify: true
irc_notify: false
ircbot_ipaddr: 192.168.0.100
ircbot_port: 5050
ircbot_channel: #yourchannel
Expand Down
6 changes: 6 additions & 0 deletions src/quads/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def initiate_navbar(flask_app):
navbar.init_app(flask_app)


def set_global_variables(flask_app):
lab_name = Config.get("lab_name")
flask_app.add_template_global(lab_name, name="lab_name")


def create_app() -> Flask:
flask_app = Flask(__name__)
flask_app.url_map.strict_slashes = False
Expand All @@ -50,5 +55,6 @@ def create_app() -> Flask:
flask_app.register_blueprint(instack_bp, url_prefix="/instack")
flask_app.register_blueprint(wiki_bp)
initiate_navbar(flask_app)
set_global_variables(flask_app)

return flask_app
2 changes: 1 addition & 1 deletion src/quads/web/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{% block navbar %}
<div class="shadow-sm mb-5 bg-white rounded">
<div class="container">
<p class="fs-5 mt-2">RDU2 Scale Lab <small style="font-size: 14px">Dynamic
<p class="fs-5 mt-2">{{ lab_name }} <small style="font-size: 14px">Dynamic
Inventory</small></p>
{{ nav.navbar.render(renderer="BootStrapRender5") }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/quads/web/templates/wiki/inventory.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block title %}Inventory{% endblock %}

{% block page_content %}
<h2><b>RDU ScaleLab Dashboard</b></h2>
<h2><b>{{ lab_name }} Dashboard</b></h2>
<div class="container-fluid">
<div class="row">
<div class="col-md-9 col-sm-12 col-10">
Expand Down

0 comments on commit 593644d

Please sign in to comment.