Skip to content

Commit afe0ec5

Browse files
committed
add sorting/search to server list
1 parent ed40d13 commit afe0ec5

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

docs/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Add any Sphinx extension module names here, as strings. They can be
2323
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2424
# ones.
25-
extensions = ['myst_parser', "sphinx_copybutton"]
25+
extensions = ['myst_parser', "sphinx_copybutton", 'sphinxcontrib.jquery', 'sphinx_datatables']
2626

2727
# Add any paths that contain templates here, relative to this directory.
2828
templates_path = ["_templates"]
@@ -188,3 +188,6 @@
188188

189189
# Enable MyST heading anchors
190190
myst_heading_anchors = 2
191+
192+
# sphinx-datatables
193+
datatables_options = {"paging": False}

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ furo
22
sphinx
33
myst-parser
44
sphinx-copybutton
5+
sphinx-datatables

docs/salt-server-list.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
.. csv-table::
77
:header: "Name", "Purpose", "Contact", "Distro", "Datacener"
8+
:class: sphinx-datatable display compact
89

910

1011
"backup.sfo1.psf.io", "Automated backup of infrastructure", "Infrastructure staff", "Ubuntu-24.04", "sfo1"

salt/base/config/salt-server-list.rst.jinja

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
{% endfor %}
88

99
.. csv-table::
10-
:header: "Name", "Purpose", "Contact", "Distro", "Datacener", "Category"
10+
:header: "Name", "Purpose", "Contact", "Distro", "Datacenter", "Category"
11+
:class: sphinx-datatable display compact
1112

1213
{% for server in salt['minion.list']()['minions']|sort -%}
1314
{% set role = salt['match.filter_by'](role_mapping, minion_id=server) -%}
1415
{% set datacenter = salt['mine.get']("*", "psf_dc").get(server, "") -%}
1516
{% set distro = salt['mine.get']("*", "osfinger").get(server, "") -%}
1617
{% set roleconfig = salt["pillar.get"]("roles", {}).get(role, {}) %}
17-
"{{ server }}", "{{ roleconfig.get("purpose", "") }}", "{{ roleconfig.get("contact", "") }}", "{{ distro }}", "{{ datacenter }}","{{ roleconfig.get("category", "") }}"
18+
"{{ server }}", "{{ roleconfig.get("purpose", "") }}", "{{ roleconfig.get("contact", "") }}", "{{ distro }}", "{{ datacenter }}", "{{ roleconfig.get("category", "") }}"
1819
{%- endfor %}
1920

2021
..

0 commit comments

Comments
 (0)