Skip to content

Commit

Permalink
add navbar customization
Browse files Browse the repository at this point in the history
  • Loading branch information
jjackzhn committed Sep 25, 2024
1 parent bcd2fcf commit 14b248b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@
# @param enable_xdmod_export
# Whether to set up xdmod_export for ACCESS metrics
#
# @param navbar_items
# Hash of custom items to add to the navbar
# If left undefined, use the default navbar
#
# @example
# include profile_ondemand
class profile_ondemand (
String $nodejs_version,
String $ruby_version,
Hash $crons,
Boolean $enable_xdmod_export = false,
Hash $navbar_items = undef,
) {
include apache::mod::rewrite
include apache::mod::env
Expand Down Expand Up @@ -66,6 +71,14 @@
cron { $k: * => $v }
}

if $navbar_items {
file { '/etc/ood/config/ondemand.d/custom_navbar.yml':
ensure => 'file',
mode => '0644',
content => template('profile_ondemand/custom_navbar.yml.epp'),
}
}

letsencrypt::certonly { $facts['networking']['fqdn']:
plugin => 'standalone',
require => [
Expand Down
23 changes: 23 additions & 0 deletions templates/custom-navbar.yml.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
nav_bar:

# These are the default configurations that would appear without this configuration.
# Since we're redefining the navigation bar, you have to add them back.
- apps
- files
- jobs
- clusters
- interactive apps
- my interactive sessions

<% $profile_ondemand::navbar_items.each |$menu,$contents| { -%>
- title: <%= $menu %>
links:
<% $contents.each |$item| { -%>
- title: <%= $item[title] %>
icon: <%= $item[icon] %>
url: <%= $item[url] %>
new_tab: true
<% } -%>
<% } -%>

0 comments on commit 14b248b

Please sign in to comment.