Browse Source

remove html preview mode

master
dave 1 year ago
parent
commit
581f0ca353
2 changed files with 4 additions and 6 deletions
  1. +3
    -5
      nodepupper/daemon.py
  2. +1
    -1
      templates/node.html

+ 3
- 5
nodepupper/daemon.py View File

@@ -121,16 +121,14 @@ class AppWeb(object):
# raise cherrypy.HTTPRedirect('feed', 302)

@cherrypy.expose
def puppet(self, fqdn, preview=False):
def puppet(self, fqdn):
with self.nodes.db.transaction() as c:
node = c.root.nodes[fqdn]
doc = {"environment": "production",
"classes": {cls.name: yaml.load(conf) or {} for cls, conf in recurse_classes(node).items()},
"parameters": recurse_params(node)}
if preview:
yield "<plaintext>"
yield "---\n"
yield yamldump(doc)
cherrypy.response.headers["Content-type"] = "text/plain"
return "---\n" + yamldump(doc)

@cherrypy.expose
def login(self):


+ 1
- 1
templates/node.html View File

@@ -10,7 +10,7 @@
</form>-->
<a href="/node_edit?node={{ node.fqdn }}"><button class="secondary-button pure-button">Edit</button></a>
<a href="/node/{{ node.fqdn }}/attach"><button class="secondary-button pure-button">Attach class</button></a>
<a href="/puppet?preview=true&fqdn={{ node.fqdn }}"><button class="secondary-button pure-button">Render</button></a>
<a href="/puppet?fqdn={{ node.fqdn }}"><button class="secondary-button pure-button">Render</button></a>
{% endblock %}

{% block body %}


Loading…
Cancel
Save