parent
4902c1d3a3
commit
751057898e
|
@ -0,0 +1,14 @@
|
|||
If you would like to contribute to the development of OpenStack, you must
|
||||
follow the steps in this page:
|
||||
https://docs.openstack.org/infra/manual/developers.html
|
||||
|
||||
If you already have a good understanding of how the system works and your
|
||||
OpenStack accounts are set up, you can skip to the development workflow
|
||||
section of this documentation to learn how changes to OpenStack should be
|
||||
submitted for review via the Gerrit tool:
|
||||
https://docs.openstack.org/infra/manual/developers.html#development-workflow
|
||||
|
||||
Pull requests submitted through GitHub will be ignored.
|
||||
|
||||
Bugs should be filed on Launchpad, not GitHub:
|
||||
https://bugs.launchpad.net/iotronic_ui
|
|
@ -0,0 +1,4 @@
|
|||
iotronic_ui Style Commandments
|
||||
===============================================
|
||||
|
||||
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/
|
|
@ -0,0 +1,176 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
include AUTHORS
|
||||
include ChangeLog
|
||||
exclude .gitignore
|
||||
exclude .gitreview
|
||||
include setup.py
|
||||
|
||||
recursive-include iotronic_ui *.js *.html *.scss
|
||||
|
||||
global-exclude *.pyc
|
|
@ -0,0 +1,64 @@
|
|||
===============================
|
||||
IoTronic Panels
|
||||
===============================
|
||||
|
||||
Iotronic plugin for the OpenStack Dashboard
|
||||
|
||||
* Free software: Apache license
|
||||
* Source: http://git.openstack.org/cgit/openstack/iotronic_ui
|
||||
* Bugs: http://bugs.launchpad.net/None
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* TODO
|
||||
|
||||
Enabling in DevStack
|
||||
--------------------
|
||||
|
||||
Add this repo as an external repository into your ``local.conf`` file::
|
||||
|
||||
[[local|localrc]]
|
||||
enable_plugin iotronic_ui https://github.com/openstack/iotronic_ui
|
||||
|
||||
Manual Installation
|
||||
-------------------
|
||||
|
||||
Begin by cloning the Horizon and IoTronic Panels repositories::
|
||||
|
||||
git clone https://github.com/openstack/horizon
|
||||
git clone https://github.com/openstack/iotronic_ui
|
||||
|
||||
Create a virtual environment and install Horizon dependencies::
|
||||
|
||||
cd horizon
|
||||
python tools/install_venv.py
|
||||
|
||||
Set up your ``local_settings.py`` file::
|
||||
|
||||
cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
|
||||
|
||||
Open up the copied ``local_settings.py`` file in your preferred text
|
||||
editor. You will want to customize several settings:
|
||||
|
||||
- ``OPENSTACK_HOST`` should be configured with the hostname of your
|
||||
OpenStack server. Verify that the ``OPENSTACK_KEYSTONE_URL`` and
|
||||
``OPENSTACK_KEYSTONE_DEFAULT_ROLE`` settings are correct for your
|
||||
environment. (They should be correct unless you modified your
|
||||
OpenStack server to change them.)
|
||||
|
||||
Install IoTronic Panels with all dependencies in your virtual environment::
|
||||
|
||||
tools/with_venv.sh pip install -e ../iotronic_ui/
|
||||
|
||||
And enable it in Horizon::
|
||||
|
||||
ln -s ../iotronic_ui/iotronic_ui/enabled/_90_project_iot_panelgroup.py openstack_dashboard/local/enabled
|
||||
ln -s ../iotronic_ui/iotronic_ui/enabled/_91_project_iot_boardss_panel.py openstack_dashboard/local/enabled
|
||||
|
||||
To run horizon with the newly enabled IoTronic Panels plugin run::
|
||||
|
||||
./run_tests.sh --runserver 0.0.0.0:8080
|
||||
|
||||
to have the application start on port 8080 and the horizon dashboard will be
|
||||
available in your browser at http://localhost:8080/
|
|
@ -0,0 +1,5 @@
|
|||
[extractors]
|
||||
django = django_babel.extract:extract_django
|
||||
|
||||
[python: **.py]
|
||||
[django: **/templates/**.html]
|
|
@ -0,0 +1,14 @@
|
|||
[extractors]
|
||||
# We use a custom extractor to find translatable strings in AngularJS
|
||||
# templates. The extractor is included in horizon.utils for now.
|
||||
# See http://babel.pocoo.org/docs/messages/#referencing-extraction-methods for
|
||||
# details on how this works.
|
||||
angular = horizon.utils.babel_extract_angular:extract_angular
|
||||
|
||||
[javascript: **.js]
|
||||
|
||||
# We need to look into all static folders for HTML files.
|
||||
# The **/static ensures that we also search within
|
||||
# /openstack_dashboard/dashboards/XYZ/static which will ensure
|
||||
# that plugins are also translated.
|
||||
[angular: **/static/**.html]
|
|
@ -0,0 +1,152 @@
|
|||
# Makefile for Sphinx documentation
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/iotronic_ui.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/iotronic_ui.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/iotronic_ui"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/iotronic_ui"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
|
@ -0,0 +1,441 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# Horizon documentation build configuration file, created by
|
||||
# sphinx-quickstart on Thu Oct 27 11:38:59 2011.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import django
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
|
||||
|
||||
sys.path.insert(0, ROOT)
|
||||
|
||||
# This is required for ReadTheDocs.org, but isn't a bad idea anyway.
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
||||
'iotronic_ui.test.settings')
|
||||
|
||||
# Starting in Django 1.7, standalone scripts, such as a sphinx build
|
||||
# require that django.setup() be called first.
|
||||
# https://docs.djangoproject.com/en/1.8/releases/1.7/#standalone-scripts
|
||||
django.setup()
|
||||
|
||||
|
||||
def write_autodoc_index():
|
||||
|
||||
def find_autodoc_modules(module_name, sourcedir):
|
||||
"""returns a list of modules in the SOURCE directory."""
|
||||
modlist = []
|
||||
os.chdir(os.path.join(sourcedir, module_name))
|
||||
print("SEARCHING %s" % sourcedir)
|
||||
for root, dirs, files in os.walk("."):
|
||||
for filename in files:
|
||||
if filename == 'tests.py':
|
||||
continue
|
||||
if filename.endswith(".py"):
|
||||
# remove the pieces of the root
|
||||
elements = root.split(os.path.sep)
|
||||
# replace the leading "." with the module name
|
||||
elements[0] = module_name
|
||||
# and get the base module name
|
||||
base, extension = os.path.splitext(filename)
|
||||
if not (base == "__init__"):
|
||||
elements.append(base)
|
||||
result = ".".join(elements)
|
||||
# print result
|
||||
modlist.append(result)
|
||||
return modlist
|
||||
|
||||
RSTDIR = os.path.abspath(os.path.join(BASE_DIR, "contributor/api"))
|
||||
SRCS = [('iotronic_ui', ROOT), ]
|
||||
|
||||
EXCLUDED_MODULES = ()
|
||||
CURRENT_SOURCES = {}
|
||||
|
||||
if not(os.path.exists(RSTDIR)):
|
||||
os.mkdir(RSTDIR)
|
||||
CURRENT_SOURCES[RSTDIR] = ['autoindex.rst']
|
||||
|
||||
INDEXOUT = open(os.path.join(RSTDIR, "autoindex.rst"), "w")
|
||||
INDEXOUT.write("""
|
||||
=================
|
||||
Source Code Index
|
||||
=================
|
||||
|
||||
.. contents::
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
""")
|
||||
|
||||
for modulename, path in SRCS:
|
||||
sys.stdout.write("Generating source documentation for %s\n" %
|
||||
modulename)
|
||||
INDEXOUT.write("\n%s\n" % modulename.capitalize())
|
||||
INDEXOUT.write("%s\n" % ("=" * len(modulename),))
|
||||
INDEXOUT.write(".. toctree::\n")
|
||||
INDEXOUT.write(" :maxdepth: 1\n")
|
||||
INDEXOUT.write("\n")
|
||||
|
||||
MOD_DIR = os.path.join(RSTDIR, modulename)
|
||||
CURRENT_SOURCES[MOD_DIR] = []
|
||||
if not(os.path.exists(MOD_DIR)):
|
||||
os.mkdir(MOD_DIR)
|
||||
for module in find_autodoc_modules(modulename, path):
|
||||
if any([module.startswith(exclude) for exclude
|
||||
in EXCLUDED_MODULES]):
|
||||
print("Excluded module %s." % module)
|
||||
continue
|
||||
mod_path = os.path.join(path, *module.split("."))
|
||||
generated_file = os.path.join(MOD_DIR, "%s.rst" % module)
|
||||
|
||||
INDEXOUT.write(" %s/%s\n" % (modulename, module))
|
||||
|
||||
# Find the __init__.py module if this is a directory
|
||||
if os.path.isdir(mod_path):
|
||||
source_file = ".".join((os.path.join(mod_path, "__init__"),
|
||||
"py",))
|
||||
else:
|
||||
source_file = ".".join((os.path.join(mod_path), "py"))
|
||||
|
||||
CURRENT_SOURCES[MOD_DIR].append("%s.rst" % module)
|
||||
# Only generate a new file if the source has changed or we don't
|
||||
# have a doc file to begin with.
|
||||
if not os.access(generated_file, os.F_OK) or (
|
||||
os.stat(generated_file).st_mtime <
|
||||
os.stat(source_file).st_mtime):
|
||||
print("Module %s updated, generating new documentation."
|
||||
% module)
|
||||
FILEOUT = open(generated_file, "w")
|
||||
header = "The :mod:`%s` Module" % module
|
||||
FILEOUT.write("%s\n" % ("=" * len(header),))
|
||||
FILEOUT.write("%s\n" % header)
|
||||
FILEOUT.write("%s\n" % ("=" * len(header),))
|
||||
FILEOUT.write(".. automodule:: %s\n" % module)
|
||||
FILEOUT.write(" :members:\n")
|
||||
FILEOUT.write(" :undoc-members:\n")
|
||||
FILEOUT.write(" :show-inheritance:\n")
|
||||
FILEOUT.write(" :noindex:\n")
|
||||
FILEOUT.close()
|
||||
|
||||
INDEXOUT.close()
|
||||
|
||||
# Delete auto-generated .rst files for sources which no longer exist
|
||||
for directory, subdirs, files in list(os.walk(RSTDIR)):
|
||||
for old_file in files:
|
||||
if old_file not in CURRENT_SOURCES.get(directory, []):
|
||||
print("Removing outdated file for %s" % old_file)
|
||||
os.remove(os.path.join(directory, old_file))
|
||||
|
||||
|
||||
write_autodoc_index()
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings.
|
||||
# They can be extensions coming with Sphinx (named 'sphinx.ext.*')
|
||||
# or your custom ones.
|
||||
extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.viewcode',
|
||||
'openstackdocstheme',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
# templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'IoTronic Panels'
|
||||
copyright = u'2017, OpenStack Foundation'
|
||||
|
||||
# Release notes are version independent.
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = ''
|
||||
# The short X.Y version.
|
||||
version = ''
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
# language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
# today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
# today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['**/#*', '**~', '**/#*#']
|
||||
|
||||
# The reST default role (used for this markup: `text`)
|
||||
# to use for all documents.
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
# add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
# modindex_common_prefix = []
|
||||
|
||||
primary_domain = 'py'
|
||||
nitpicky = False
|
||||
|
||||
|
||||
# -- Options for HTML output --------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'openstackdocs'
|
||||
|
||||
# openstackdocstheme options
|
||||
repository_name = 'openstack/iotronic_ui'
|
||||
bug_project = 'None'
|
||||
bug_tag = ''
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
# html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
# html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
# html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
# html_static_path = ['_static']
|
||||
|
||||
# Must set this variable to include year, month, day, hours, and minutes.
|
||||
html_last_updated_fmt = '%Y-%m-%d %H:%M'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
# html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
# html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
# html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
# html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
# html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
# html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'iotronic_uidoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output -------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
# 'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass
|
||||
# [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'iotronic_ui.tex',
|
||||
u'IoTronic Panels Documentation',
|
||||
u'OpenStack Foundation', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
# latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
# latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
# latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
# latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
# latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output -------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', u'IoTronic Panels Documentation',
|
||||
'Documentation for the IoTronic Panels plugin to the Openstack\
|
||||
Dashboard (Horizon)',
|
||||
[u'OpenStack'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
# man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -----------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'IoTronic Panels',
|
||||
u'IoTronic Panels Documentation', u'OpenStack',
|
||||
'IoTronic Panels',
|
||||
'Iotronic plugin for the OpenStack Dashboard', 'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
# texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
# texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
# texinfo_show_urls = 'footnote'
|
||||
|
||||
|
||||
# -- Options for Epub output --------------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = u'IoTronic Panels'
|
||||
epub_author = u'OpenStack'
|
||||
epub_publisher = u'OpenStack'
|
||||
epub_copyright = u'2017, OpenStack'
|
||||
|
||||
# The language of the text. It defaults to the language option
|
||||
# or en if the language is not set.
|
||||
# epub_language = ''
|
||||
|
||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||
# epub_scheme = ''
|
||||
|
||||
# The unique identifier of the text. This can be an ISBN number
|
||||
# or the project homepage.
|
||||
# epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
# epub_uid = ''
|
||||
|
||||
# A tuple containing the cover image and cover page html template filenames.
|
||||
# epub_cover = ()
|
||||
|
||||
# HTML files that should be inserted before the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
# epub_pre_files = []
|
||||
|
||||
# HTML files shat should be inserted after the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
# epub_post_files = []
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
# epub_exclude_files = []
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
# epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
# epub_tocdup = True
|
|
@ -0,0 +1,10 @@
|
|||
=============
|
||||
Configuration
|
||||
=============
|
||||
|
||||
IoTronic Panels has no configuration option.
|
||||
|
||||
For more configurations, see
|
||||
`Deployment & Configuration
|
||||
<https://docs.openstack.org/horizon/latest/configuration/index.html>`__
|
||||
in the Horizon documentation.
|
|
@ -0,0 +1,9 @@
|
|||
=====================
|
||||
Source Code Reference
|
||||
=====================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
api/*
|
|
@ -0,0 +1,16 @@
|
|||
=================
|
||||
Contributor Guide
|
||||
=================
|
||||
|
||||
There is no topic specific to IoTronic Panels now.
|
||||
|
||||
See `Horizon Contributor Documentation
|
||||
<https://docs.openstack.org/horizon/latest/contributor/>`__
|
||||
for general topic on developing a dashboard on horizon.
|
||||
|
||||
----
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
api
|
|
@ -0,0 +1,33 @@
|
|||
===============================
|
||||
IoTronic Panels
|
||||
===============================
|
||||
|
||||
Iotronic plugin for the OpenStack Dashboard
|
||||
|
||||
* Free software: Apache license
|
||||
* Source: http://git.openstack.org/cgit/openstack/iotronic_ui
|
||||
* Bugs: http://bugs.launchpad.net/None
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* TODO
|
||||
|
||||
User Documentation
|
||||
------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
install/index
|
||||
configuration/index
|
||||
Release Notes <https://docs.openstack.org/releasenotes/iotronic_ui>
|
||||
|
||||
Contributor Guide
|
||||
-----------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
contributor/index
|
|
@ -0,0 +1,53 @@
|
|||
============
|
||||
Installation
|
||||
============
|
||||
|
||||
Enabling in DevStack
|
||||
--------------------
|
||||
|
||||
Add this repo as an external repository into your ``local.conf`` file::
|
||||
|
||||
[[local|localrc]]
|
||||
enable_plugin iotronic_ui https://github.com/openstack/iotronic_ui
|
||||
|
||||
Manual Installation
|
||||
-------------------
|
||||
|
||||
Begin by cloning the Horizon and IoTronic Panels repositories::
|
||||
|
||||
git clone https://github.com/openstack/horizon
|
||||
git clone https://github.com/openstack/iotronic_ui
|
||||
|
||||
Create a virtual environment and install Horizon dependencies::
|
||||
|
||||
cd horizon
|
||||
python tools/install_venv.py
|
||||
|
||||
Set up your ``local_settings.py`` file::
|
||||
|
||||
cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
|
||||
|
||||
Open up the copied ``local_settings.py`` file in your preferred text
|
||||
editor. You will want to customize several settings:
|
||||
|
||||
- ``OPENSTACK_HOST`` should be configured with the hostname of your
|
||||
OpenStack server. Verify that the ``OPENSTACK_KEYSTONE_URL`` and
|
||||
``OPENSTACK_KEYSTONE_DEFAULT_ROLE`` settings are correct for your
|
||||
environment. (They should be correct unless you modified your
|
||||
OpenStack server to change them.)
|
||||
|
||||
Install IoTronic Panels with all dependencies in your virtual environment::
|
||||
|
||||
tools/with_venv.sh pip install -e ../iotronic_ui/
|
||||
|
||||
And enable it in Horizon::
|
||||
|
||||
ln -s ../iotronic_ui/iotronic_ui/enabled/_90_project_iot_panelgroup.py openstack_dashboard/local/enabled
|
||||
ln -s ../iotronic_ui/iotronic_ui/enabled/_91_project_iot_boardss_panel.py openstack_dashboard/local/enabled
|
||||
|
||||
To run horizon with the newly enabled IoTronic Panels plugin run::
|
||||
|
||||
./run_tests.sh --runserver 0.0.0.0:8080
|
||||
|
||||
to have the application start on port 8080 and the horizon dashboard will be
|
||||
available in your browser at http://localhost:8080/
|
|
@ -0,0 +1,85 @@
|
|||
Metadata-Version: 1.1
|
||||
Name: iotronic-ui
|
||||
Version: 0.0.0
|
||||
Summary: Iotronic plugin for the OpenStack Dashboard
|
||||
Home-page: http://www.openstack.org/
|
||||
Author: OpenStack
|
||||
Author-email: openstack-dev@lists.openstack.org
|
||||
License: UNKNOWN
|
||||
Description: ===============================
|
||||
IoTronic Panels
|
||||
===============================
|
||||
|
||||
Iotronic plugin for the OpenStack Dashboard
|
||||
|
||||
* Free software: Apache license
|
||||
* Source: http://git.openstack.org/cgit/openstack/iotronic_ui
|
||||
* Bugs: http://bugs.launchpad.net/None
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* TODO
|
||||
|
||||
Enabling in DevStack
|
||||
--------------------
|
||||
|
||||
Add this repo as an external repository into your ``local.conf`` file::
|
||||
|
||||
[[local|localrc]]
|
||||
enable_plugin iotronic_ui https://github.com/openstack/iotronic_ui
|
||||
|
||||
Manual Installation
|
||||
-------------------
|
||||
|
||||
Begin by cloning the Horizon and IoTronic Panels repositories::
|
||||
|
||||
git clone https://github.com/openstack/horizon
|
||||
git clone https://github.com/openstack/iotronic_ui
|
||||
|
||||
Create a virtual environment and install Horizon dependencies::
|
||||
|
||||
cd horizon
|
||||
python tools/install_venv.py
|
||||
|
||||
Set up your ``local_settings.py`` file::
|
||||
|
||||
cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
|
||||
|
||||
Open up the copied ``local_settings.py`` file in your preferred text
|
||||
editor. You will want to customize several settings:
|
||||
|
||||
- ``OPENSTACK_HOST`` should be configured with the hostname of your
|
||||
OpenStack server. Verify that the ``OPENSTACK_KEYSTONE_URL`` and
|
||||
``OPENSTACK_KEYSTONE_DEFAULT_ROLE`` settings are correct for your
|
||||
environment. (They should be correct unless you modified your
|
||||
OpenStack server to change them.)
|
||||
|
||||
Install IoTronic Panels with all dependencies in your virtual environment::
|
||||
|
||||
tools/with_venv.sh pip install -e ../iotronic_ui/
|
||||
|
||||
And enable it in Horizon::
|
||||
|
||||
ln -s ../iotronic_ui/iotronic_ui/enabled/_90_project_iot_panelgroup.py openstack_dashboard/local/enabled
|
||||
ln -s ../iotronic_ui/iotronic_ui/enabled/_91_project_iot_boardss_panel.py openstack_dashboard/local/enabled
|
||||
|
||||
To run horizon with the newly enabled IoTronic Panels plugin run::
|
||||
|
||||
./run_tests.sh --runserver 0.0.0.0:8080
|
||||
|
||||
to have the application start on port 8080 and the horizon dashboard will be
|
||||
available in your browser at http://localhost:8080/
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Environment :: OpenStack
|
||||
Classifier: Intended Audience :: Information Technology
|
||||
Classifier: Intended Audience :: System Administrators
|
||||
Classifier: License :: OSI Approved :: Apache Software License
|
||||
Classifier: Operating System :: POSIX :: Linux
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 2
|
||||
Classifier: Programming Language :: Python :: 2.7
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.5
|
|
@ -0,0 +1,88 @@
|
|||
CONTRIBUTING.rst
|
||||
HACKING.rst
|
||||
LICENSE
|
||||
MANIFEST.in
|
||||
README.rst
|
||||
babel-django.cfg
|
||||
babel-djangojs.cfg
|
||||
manage.py
|
||||
package.json
|
||||
requirements.txt
|
||||
setup.cfg
|
||||
setup.py
|
||||
test-requirements.txt
|
||||
test-shim.js
|
||||
tox.ini
|
||||
doc/Makefile
|
||||
doc/source/conf.py
|
||||
doc/source/index.rst
|
||||
doc/source/configuration/index.rst
|
||||
doc/source/contributor/api.rst
|
||||
doc/source/contributor/index.rst
|
||||
doc/source/install/index.rst
|
||||
iotronic_ui/__init__.py
|
||||
iotronic_ui.egg-info/PKG-INFO
|
||||
iotronic_ui.egg-info/SOURCES.txt
|
||||
iotronic_ui.egg-info/dependency_links.txt
|
||||
iotronic_ui.egg-info/not-zip-safe
|
||||
iotronic_ui.egg-info/pbr.json
|
||||
iotronic_ui.egg-info/requires.txt
|
||||
iotronic_ui.egg-info/top_level.txt
|
||||
iotronic_ui/api/iotronic.py
|
||||
iotronic_ui/enabled/_6000_iot.py
|
||||
iotronic_ui/enabled/_6010_iot_boards_panel.py
|
||||
iotronic_ui/enabled/_6020_iot_plugins_panel.py
|
||||
iotronic_ui/iot/__init__.py
|
||||
iotronic_ui/iot/dashboard.py
|
||||
iotronic_ui/iot/boards/__init__.py
|
||||
iotronic_ui/iot/boards/forms.py
|
||||
iotronic_ui/iot/boards/panel.py
|
||||
iotronic_ui/iot/boards/tables.py
|
||||
iotronic_ui/iot/boards/tabs.py
|
||||
iotronic_ui/iot/boards/tests.py
|
||||
iotronic_ui/iot/boards/urls.py
|
||||
iotronic_ui/iot/boards/views.py
|
||||
iotronic_ui/iot/boards/templates/boards/_create.html
|
||||
iotronic_ui/iot/boards/templates/boards/_detail_overview.html
|
||||
iotronic_ui/iot/boards/templates/boards/_removeplugins.html
|
||||
iotronic_ui/iot/boards/templates/boards/_update.html
|
||||
iotronic_ui/iot/boards/templates/boards/create.html
|
||||
iotronic_ui/iot/boards/templates/boards/index.html
|
||||
iotronic_ui/iot/boards/templates/boards/removeplugins.html
|
||||
iotronic_ui/iot/boards/templates/boards/update.html
|
||||
iotronic_ui/iot/plugins/__init__.py
|
||||
iotronic_ui/iot/plugins/forms.py
|
||||
iotronic_ui/iot/plugins/panel.py
|
||||
iotronic_ui/iot/plugins/tables.py
|
||||
iotronic_ui/iot/plugins/tabs.py
|
||||
iotronic_ui/iot/plugins/tests.py
|
||||
iotronic_ui/iot/plugins/urls.py
|
||||
iotronic_ui/iot/plugins/views.py
|
||||
iotronic_ui/iot/plugins/templates/plugins/_call.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/_create.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/_detail_overview.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/_inject.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/_remove.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/_start.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/_stop.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/_update.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/call.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/create.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/index.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/inject.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/remove.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/start.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/stop.html
|
||||
iotronic_ui/iot/plugins/templates/plugins/update.html
|
||||
iotronic_ui/iot/static/iot/images/blue-circle.png
|
||||
iotronic_ui/iot/static/iot/images/green-circle.png
|
||||
iotronic_ui/iot/static/iot/images/marker-icon-green.png
|
||||
iotronic_ui/iot/static/iot/images/marker-icon-red.png
|
||||
iotronic_ui/iot/static/iot/images/marker-icon.png
|
||||
iotronic_ui/iot/static/iot/images/marker-shadow.png
|
||||
iotronic_ui/iot/static/iot/images/red-circle.png
|
||||
iotronic_ui/iot/static/iot/js/iot.js
|
||||
iotronic_ui/iot/static/iot/scss/iot.scss
|
||||
iotronic_ui/iot/templates/iot/base.html
|
||||
tools/tox_install.sh
|
||||
tools/tox_install.sh_ORIG
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
{"git_version": "4902c1d", "is_release": false}
|
|
@ -0,0 +1,6 @@
|
|||
pbr!=2.1.0,>=2.0.0
|
||||
Babel!=2.4.0,>=2.3.4
|
||||
Django<2.0,>=1.8
|
||||
django-babel>=0.5.1
|
||||
django-compressor>=2.0
|
||||
django-pyscss>=2.0.2
|
|
@ -0,0 +1 @@
|
|||
iotronic_ui
|
|
@ -0,0 +1 @@
|
|||
__version__ = '0.0.1'
|
|
@ -0,0 +1,148 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# from collections import OrderedDict
|
||||
# import threading
|
||||
|
||||
from iotronicclient import client as iotronic_client
|
||||
# from django.conf import settings
|
||||
# from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
# from horizon import exceptions
|
||||
from horizon.utils.memoized import memoized # noqa
|
||||
|
||||
from openstack_dashboard.api import base
|
||||
# from openstack_dashboard.api import keystone
|
||||
|
||||
|
||||
# TESTING
|
||||
import logging
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@memoized
|
||||
def iotronicclient(request):
|
||||
"""Initialization of Iotronic client."""
|
||||
|
||||
endpoint = base.url_for(request, 'iot')
|
||||
# insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||
# cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
|
||||
|
||||
return iotronic_client.Client('1', endpoint, token=request.user.token.id)
|
||||
|
||||
|
||||
# BOARD MANAGEMENT
|
||||
def board_list(request, status=None, detail=None, project=None):
|
||||
"""List boards."""
|
||||
boards = iotronicclient(request).board.list(status, detail, project)
|
||||
return boards
|
||||
|
||||
|
||||
def board_get(request, board_id, fields):
|
||||
"""Get board info."""
|
||||
board = iotronicclient(request).board.get(board_id, fields)
|
||||
return board
|
||||
|
||||
|
||||
def board_create(request, code, mobile, location, type, name):
|
||||
"""Create board."""
|
||||
params = {"code": code,
|
||||
"mobile": mobile,
|
||||
"location": location,
|
||||
"type": type,
|
||||
"name": name}
|
||||
board = iotronicclient(request).board.create(**params)
|
||||
return board
|
||||
|
||||
|
||||
def board_update(request, board_id, patch):
|
||||
"""Update board."""
|
||||
board = iotronicclient(request).board.update(board_id, patch)
|
||||
return board
|
||||
|
||||
|
||||
def board_delete(request, board_id):
|
||||
"""Delete board."""
|
||||
board = iotronicclient(request).board.delete(board_id)
|
||||
return board
|
||||
|
||||
|
||||
# PLUGIN MANAGEMENT (Cloud Side)
|
||||
def plugin_list(request, detail=None, project=None, with_public=False,
|
||||
all_plugins=False):
|
||||
"""List plugins."""
|
||||
plugin = iotronicclient(request).plugin()
|
||||
plugins = plugin.list(detail, project,
|
||||
with_public=with_public,
|
||||
all_plugins=all_plugins)
|
||||
return plugins
|
||||
|
||||
|
||||
def plugin_get(request, plugin_id, fields):
|
||||
"""Get plugin info."""
|
||||
plugin = iotronicclient(request).plugin.get(plugin_id, fields)
|
||||
return plugin
|
||||
|
||||
|
||||
def plugin_create(request, name, public, callable, code, parameters):
|
||||
"""Create plugin."""
|
||||
params = {"name": name,
|
||||
"public": public,
|
||||
"callable": callable,
|
||||
"code": code,
|
||||
"parameters": parameters}
|
||||
plugin = iotronicclient(request).plugin.create(**params)
|
||||
return plugin
|
||||
|
||||
|
||||
def plugin_update(request, plugin_id, patch):
|
||||
"""Update plugin."""
|
||||
plugin = iotronicclient(request).plugin.update(plugin_id, patch)
|
||||
return plugin
|
||||
|
||||
|
||||
def plugin_delete(request, plugin_id):
|
||||
"""Delete plugin."""
|
||||
plugin = iotronicclient(request).plugin.delete(plugin_id)
|
||||
return plugin
|
||||
|
||||
|
||||
# PLUGIN MANAGEMENT (Board Side)
|
||||
def plugin_inject(request, board_id, plugin_id, onboot):
|
||||
"""Inject plugin on board(s)."""
|
||||
plugin_injection = iotronicclient(request).plugin_injection()
|
||||
plugin = plugin_injection.plugin_inject(board_id, plugin_id, onboot)
|
||||
return plugin
|
||||
|
||||
|
||||
def plugin_action(request, board_id, plugin_id, action, params={}):
|
||||
"""Start/Stop/Call actions on board(s)."""
|
||||
plugin_injection = iotronicclient(request).plugin_injection()
|
||||
plugin = plugin_injection.plugin_action(board_id,
|
||||
plugin_id,
|
||||
action,
|
||||
params)
|
||||
return plugin
|
||||
|
||||
|
||||
def plugin_remove(request, board_id, plugin_id):
|
||||
"""Inject plugin on board(s)."""
|
||||
plugin_injection = iotronicclient(request).plugin_injection()
|
||||
plugin = plugin_injection.plugin_remove(board_id, plugin_id)
|
||||
return plugin
|
||||
|
||||
|
||||
def plugins_on_board(request, board_id):
|
||||
"""Plugins on board."""
|
||||
plugin_injection = iotronicclient(request).plugin_injection()
|
||||
plugins = plugin_injection.plugins_on_board(board_id)
|
||||
return plugins
|
|
@ -0,0 +1,29 @@
|
|||
# Copyright 2015, Rackspace, US, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# The slug of the dashboard to be added to HORIZON['dashboards']. Required.
|
||||
DASHBOARD = 'iot'
|
||||
|
||||
# A list of applications to be added to INSTALLED_APPS.
|
||||
ADD_INSTALLED_APPS = [
|
||||
'iotronic_ui.iot',
|
||||
]
|
||||
|
||||
"""
|
||||
ADD_ANGULAR_MODULES = [
|
||||
'horizon.dashboard.iot',
|
||||
]
|
||||
"""
|
||||
|
||||
AUTO_DISCOVER_STATIC_FILES = True
|
|
@ -0,0 +1,23 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# The slug of the panel to be added to HORIZON_CONFIG. Required.
|
||||
PANEL = 'boards'
|
||||
# The slug of the dashboard the PANEL associated with. Required.
|
||||
PANEL_DASHBOARD = 'iot'
|
||||
# The slug of the panel group the PANEL is associated with.
|
||||
PANEL_GROUP = 'iot'
|
||||
# If set, it will update the default panel of the PANEL_DASHBOARD.
|
||||
DEFAULT_PANEL = ''
|
||||
|
||||
# Python panel class of the PANEL to be added.
|
||||
ADD_PANEL = 'iotronic_ui.iot.boards.panel.Boards'
|
|
@ -0,0 +1,23 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# The slug of the panel to be added to HORIZON_CONFIG. Required.
|
||||
PANEL = 'plugins'
|
||||
# The slug of the dashboard the PANEL associated with. Required.
|
||||
PANEL_DASHBOARD = 'iot'
|
||||
# The slug of the panel group the PANEL is associated with.
|
||||
PANEL_GROUP = 'iot'
|
||||
# If set, it will update the default panel of the PANEL_DASHBOARD.
|
||||
DEFAULT_PANEL = ''
|
||||
|
||||
# Python panel class of the PANEL to be added.
|
||||
ADD_PANEL = 'iotronic_ui.iot.plugins.panel.Plugins'
|
|
@ -0,0 +1 @@
|
|||
__version__ = '0.0.1'
|
|
@ -0,0 +1,197 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
from horizon import messages
|
||||
|
||||
from openstack_dashboard.api import iotronic
|
||||
from openstack_dashboard import policy
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CreateBoardForm(forms.SelfHandlingForm):
|
||||
name = forms.CharField(label=_("Board Name"))
|
||||
code = forms.CharField(
|
||||
label=_("Registration Code"),
|
||||
help_text=_("Registration code")
|
||||
)
|
||||
|
||||
# MODIFY ---> options: yun, server
|
||||
type = forms.ChoiceField(
|
||||
label=_("Type"),
|
||||
choices=[('yun', _('YUN')), ('server', _('Server'))],
|
||||
widget=forms.Select(
|
||||
attrs={'class': 'switchable', 'data-slug': 'slug-type'},
|
||||
)
|
||||
)
|
||||
|
||||
"""
|
||||
mobile = forms.ChoiceField(
|
||||
label=_("Mobile"),
|
||||
choices =[('false', _('False')), ('true', _('True'))],
|
||||
widget=forms.Select(
|
||||
attrs={'class': 'switchable', 'data-slug': 'slug-mobile'},
|
||||
)
|
||||
)
|
||||
"""
|
||||
mobile = forms.BooleanField(label=_("Mobile"), required=False)
|
||||
|
||||
latitude = forms.FloatField(label=_("Latitude"))
|
||||
longitude = forms.FloatField(label=_("Longitude"))
|
||||
altitude = forms.FloatField(label=_("Altitude"))
|
||||
|
||||
def handle(self, request, data):
|
||||
try:
|
||||
|
||||
# Float
|
||||
# data["location"] = [{"latitude": data["latitude"],
|
||||
# "longitude": data["longitude"],
|
||||
# "altitude": data["altitude"]}]
|
||||
# String
|
||||
data["location"] = [{"latitude": str(data["latitude"]),
|
||||
"longitude": str(data["longitude"]),
|
||||
"altitude": str(data["altitude"])}]
|
||||
|
||||
board = iotronic.board_create(request, data["code"],
|
||||
data["mobile"], data["location"],
|
||||
data["type"], data["name"])
|
||||
messages.success(request, _("Board created successfully."))
|
||||
|
||||
return board
|
||||
except Exception:
|
||||
exceptions.handle(request, _('Unable to create board.'))
|
||||
|
||||
|
||||
class UpdateBoardForm(forms.SelfHandlingForm):
|
||||
uuid = forms.CharField(label=_("Board ID"), widget=forms.HiddenInput)
|
||||
name = forms.CharField(label=_("Board Name"))
|
||||
mobile = forms.BooleanField(label=_("Mobile"), required=False)
|
||||
|
||||
latitude = forms.FloatField(label=_("Latitude"))
|
||||
longitude = forms.FloatField(label=_("Longitude"))
|
||||
altitude = forms.FloatField(label=_("Altitude"))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
super(UpdateBoardForm, self).__init__(*args, **kwargs)
|
||||
|
||||
# LOG.debug("MELO INITIAL: %s", kwargs["initial"])
|
||||
|
||||
LOG.debug("MELO Manager: %s", policy.check((("iot", "iot_manager"),),
|
||||
self.request))
|
||||
LOG.debug("MELO Admin: %s", policy.check((("iot", "iot_admin"),),
|
||||
self.request))
|
||||
|
||||
# Admin
|
||||
if policy.check((("iot", "iot:update_boards"),), self.request):
|
||||
# LOG.debug("MELO ADMIN")
|
||||
pass
|
||||
|
||||
# Manager or Admin of the iot project
|
||||
elif (policy.check((("iot", "iot_manager"),), self.request) or
|
||||
policy.check((("iot", "iot_admin"),), self.request)):
|
||||
# LOG.debug("MELO NO-edit IOT ADMIN")
|
||||
pass
|
||||
|
||||
# Other users
|
||||
else:
|
||||
if self.request.user.id != kwargs["initial"]["owner"]:
|
||||
# LOG.debug("MELO IMMUTABLE FIELDS")
|
||||
self.fields["name"].widget.attrs = {'readonly': 'readonly'}
|
||||
self.fields["mobile"].widget.attrs = {'disabled': 'disabled'}
|
||||
|
||||
self.fields["latitude"].widget.attrs = {'readonly':
|
||||
'readonly'}
|
||||
self.fields["longitude"].widget.attrs = {'readonly':
|
||||
'readonly'}
|
||||
self.fields["altitude"].widget.attrs = {'readonly':
|
||||
'readonly'}
|
||||
|
||||
def handle(self, request, data):
|
||||
try:
|
||||