# Discourse Container Namen met GON - Voor Systeembeheerders en Ontwikkelaars

**URL:** <https://meta.discourse.org/t/discourse-container-names-with-gon-for-sys-admins-and-developers/170973>\
**Category:** Plugin\
**Created:** [23 november 2020 om 03:11 UTC](https://meta.discourse.org/t/discourse-container-names-with-gon-for-sys-admins-and-developers/170973 "2020-11-23T03:11:20Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)\
**Post date:** [23 november 2020 om 03:11 UTC](https://meta.discourse.org/t/discourse-container-names-with-gon-for-sys-admins-and-developers/170973/1 "2020-11-23T03:11:20Z")

</div>

### WHAT DOES THIS PLUGIN DO?

This simple Discourse Container Names with GON plugin consumes the `ENV["DATA_NAME"]` environmental, or user set environments, to display the container names on Discourse admin pages.

In addition, it displays the disk space available to the app as seen from inside the container:

 ![Screen Shot 2020-11-23 at 9.43.44 AM](https://global.discourse-cdn.com/meta/original/3X/0/4/049b8863ebd04230b9ed596a4eddb4ccee3816d8.jpeg)

### WHO IS THIS PLUGIN FOR?

This plugin is for Discourse system admins who run in a multi-container environment and would like to see which containers they are running on in the admin area. In addition, since we often see Discourse system admins having upgrade issues related to disk space; the disk space is also shown and updated when the admin pages are reloaded.

This plugin is also for developers who are interested in learning how to use the GON Ruby gem in their projects. This plugin uses GON and jQuery (in the theme) to display the information and does not use EmberJS.

### HOW DOES IT WORK?

In a nutshell, this plugin extends the AdminController and reads specific environmental variables and also executes some simple system code. This parsed information is stored in a [GON](https://github.com/gazay/gon) global object using the GON Ruby gem and displayed using only jQuery in the theme. The `gon` javascript object is injected into the Discourse view (`.erb`) layout using [pups](https://github.com/discourse/pups).

### HOW TO INSTALL GON ON DISCOURSE?

Below is how I installed the GON javascript object in Discourse.

> **[An Easy Way to Setup the gon gem in a Discourse Plugin](https://community.unix.com/t/an-easy-way-to-setup-the-gon-gem-in-a-discourse-plugin/380693)**
>
> If you need to send some data to your javascript files in Discourse and you don't want to do this the long way, winding way through views and parsing and other strange framework headaches, consider using the gon gem. Here, I will show you a...

### HOW TO INSTALL THIS PLUGIN?

Here is the repo for this plugin with basic install instructions:

[https://github.com/unixneo/discourse-container-names-with-gon](https://github.com/unixneo/discourse-container-names-with-gon)

In addition, here are my installation notes:

> **[Discourse Plugin: Discourse Container Names with GON](https://community.unix.com/t/discourse-plugin-discourse-container-names-with-gon/380701)**
>
> Discourse Plugin Summary Shows the names of Docker containers to Discourse system admins using GON gem on the Backups page. GITHUB: GitHub - unixneo/discourse-container-names-with-gon: This Discourse plugin uses either (A) two environmental...

### SUMMARY

This plugin provides useful information to Discourse system admins, especially folks who run in mult-container setup. It also provides disk space info at a glance. You can over-ride the names of the containers in the container YAML file, but it is not necessary. In addition, this plugin demonstrates an easy way to use the GON Ruby gem in a Discourse plugin so information can be displayed using Javascript, and in this case, jQuery.

### ENHANCEMENTS

All ideas for enhancements are appreciated. PRs welcome.

### SEE ALSO

[https://github.com/gazay/gon](https://github.com/gazay/gon)

[https://github.com/discourse/pups](https://github.com/discourse/pups)

---

_[View the full topic](https://meta.discourse.org/t/discourse-container-names-with-gon-for-sys-admins-and-developers/170973)._
