{"id":21357820,"url":"https://github.com/rcbops/expert-happiness","last_synced_at":"2025-03-16T06:15:25.978Z","repository":{"id":142014175,"uuid":"61575339","full_name":"rcbops/expert-happiness","owner":"rcbops","description":"A jquery plugin like thing that will allow you to embed context aware documentation into OpenStack Horizon","archived":false,"fork":false,"pushed_at":"2016-09-02T06:12:44.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T18:30:47.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcbops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-20T19:43:36.000Z","updated_at":"2018-07-31T16:00:34.000Z","dependencies_parsed_at":"2023-07-07T07:32:07.814Z","dependency_job_id":null,"html_url":"https://github.com/rcbops/expert-happiness","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcbops%2Fexpert-happiness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcbops%2Fexpert-happiness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcbops%2Fexpert-happiness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcbops%2Fexpert-happiness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcbops","download_url":"https://codeload.github.com/rcbops/expert-happiness/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830956,"owners_count":20354856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T05:12:31.875Z","updated_at":"2025-03-16T06:15:25.973Z","avatar_url":"https://github.com/rcbops.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expert-happiness\n\nexpert-happiness is a jquery powered file for OpenStack Horizon that will allow you to place a help window on your\nviews allowing for context aware documentation for your cloud.\n\n## Screen Shots\n![shot1](http://i.imgur.com/qPxJAHm.png)\n\n![shot2](http://i.imgur.com/wSukr0T.png)\n\n\n## How It Works\nexpert-happiness works by using an ajax call to a remote web server to fetch in index.json file that you create. This\njson file must contain a Catalog object. The Catalog object must contain a list of key value pairs. One key must be\n`regex` and its value should be a valid regular expression. The next key must be `doc` and it should point to a document\non the Web Server that should be served should your current location in Horizon match the value in `regex`. For example\nlets say your current location in Horizon is: `http://site.com/admin/instances` and you have your doc server running at:\n`http://site.com:8000/`\n\nIn your `http://site.com:8000/index.json` you have the following entries:\n\n```json\n{\"Catalog\": [\n    {\n        \"regex\": \"/admin/instances.*\",\n        \"doc\": \"/admin/instances.html\"\n    },\n    {\n        \"regex\": \"/project/instances.*\",\n        \"doc\": \"/admin/instances.html\"\n    },\n    {\n        \"regex\": \".*\",\n        \"doc\": \"/default.html\"\n    }\n  ]\n}\n```\nWhen you land on `http://site.com/admin/instances` the index.json is pulled first. Next it looks at your regular\nexpressions and finds one that matches. In this case the file: `http://site.com:8000/admin/instances.html` will be\nloaded into the help info container. Regular expressions are matched in top down order. In this example above if you were\nto visit: `http://site.com/admin/volumes` you would be served `http://site.com:8000/default.html` because it is a catch all\nwhere anything would match. If you do not want a default page do not make a catch all regular expression.\n\n## Documentation Server Setup\n\nTo setup expert-happiness you will need a web server to serve your documentation from. While possible it is not advised\nto use the same server used to host Horizon to host your help docs. You will also need to be able to set the\n`Access-Control-Allow-Origin` header on your content which will allow the content to be served using ajax. If you are\nusing Apache HTTPD the easiest way to set that header is using [mod_headers](http://httpd.apache.org/docs/current/mod/mod_headers.html).\nAny Web Server can be used including lighttpd, nginx, httpd, or even IIS.\n\n\n## expert-happiness Configuration\n\nVery little is needed in this area. By default expert-happiness is only 1 file named double-cheeseburger.js It currently\nonly requires 1 variable be set in the file and that is:\n\n```javascript\nvar info_site = \"CHANGEME\";\n```\nThe value should be a full url. For example if you have the domain `site.com` and plan to run your documentation server\nat `http://docs.site.com` then your variable should be:\n\n```javascript\nvar info_site = \"http://docs.site.com\";\n```\n\nThe value can also be an IP, but it still needs to be in URL format: `var info_site = \"http://10.12.1.2\";` Further configuration\ncan take place to adjust colors as well. To make adjustments to those values see the `helpInfoContainer()` function where\nthose variables are defined.\n\n\n## Installing Into Horizon\n\nHere you have several options. I will discuss the 2 options I use. First will be use on DevStack, and second will be using\nOpenStack-Ansible (aka [osa](https://github.com/openstack/openstack-ansible)). Before you follow all the install instructions\nbe sure to configure the `var info_site` variable mentioned above. Failure to configure that variable will result in a\nnon functional help info box because it will never be able to pull docs.\n\n\n### DevStack\n\nTo install using DevStack do the following as the stack user:\n\n    cd ~/\n    git clone https://github.com/michaelrice/expert-happiness\n    cd /opt/stack/horizon/openstack_dashboard/static/dashboard\n    mkdir js\n    cd js\n    cp ~/expret-happiness/js/*.js .\n    cd /opt/stack/horizon\n    python manage.py collectstatic --noinput\n    python manage.py compress\n    sudo service apache2 restart\n\nThis should give you a functional DevStack. This method will work on Liberty and newer, and possibly even on older\n\n### OSA\n\nTo install using OSA you will need at least Mitaka because in previous versions there was no way to add custom files. If\nyou need to install this on Liberty or older it will be a manual process which is beyond the scope of this help doc.\n\n    cd /opt\n    git clone https://github.com/michaelrice/expert-happiness\n\nNext edit your `user_variables.yml` file and add the following:\n\n    horizon_custom_uploads:\n      cheeseburger:\n        src: /opt/expert-happiness/js\n        dest: .\n\nFinally save the file and re-run the os_horizon playbook\n\n    cd /opt/openstack-ansible/playbooks\n    openstack-ansible os-horizon-install.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcbops%2Fexpert-happiness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcbops%2Fexpert-happiness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcbops%2Fexpert-happiness/lists"}