X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2FHACKING.rst;fp=src%2Fceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2FHACKING.rst;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=b1cae5f0d54da7db69ecaebea97bdcb789423d21;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/pybind/mgr/dashboard/HACKING.rst b/src/ceph/src/pybind/mgr/dashboard/HACKING.rst deleted file mode 100644 index b1cae5f..0000000 --- a/src/ceph/src/pybind/mgr/dashboard/HACKING.rst +++ /dev/null @@ -1,95 +0,0 @@ - -HACKING -======= - -See the top-level docs in the ceph repository for general information about how to submit code. This -file is about the specifics of how this module fits together. - -This module uses deliberately simple/explicit structure so that it is accessbile -to people who are not specialists in webapps. Very little javascript knowledge -is needed. The absence of a javascript toolchain (node, bower, grunt, etc) is -considered a feature rather than a bug. All of the CSS and Javascript in -the git repository is used as-is without any compilation/minification. - -On the server (i.e. python-side) --------------------------------- - -In the serve() method, there's a cherrypy request handler object with methods that correspond to URLs. -See the cherrypy documentatino for how that stuff works. - -There is a mixture of endpoints that return JSON (for live updates of pages) and endpoints that return -HTML (for initial loads of pages). The HTML files are rendered from jinja2 templates (the .html files -in the source tree). - -The initial render of the HTML template includes some json-ized inline data, so that the page can -be rendered immediately without having to make another request to the server to load the data -after loading the markup. - -The pattern is that for some resource 'foo' we would generally have three methods, along the lines of: - -:: - - def _foo(self): - return {...the data of interest...} - - @cherrypy.expose - def foo(self): - data = self._foo() - *render a foo.html template with data inline* - - @cherrypy.expose - @cherrypy.tools.json_out() - def foo_data(self): - return self._foo() - -In the browser (Javascript and markup) --------------------------------------- - -The javascript code uses the rivets.js (http://rivetsjs.com/) library to render the data from -the server into HTML templates, and to enable subsequent updates without reloading the whole -page. - -The use of rivets.js looks something like this: - -:: - -