Browse Source

support class detaching

mysql
dave 2 years ago
parent
commit
3980153489
3 changed files with 22 additions and 19 deletions
  1. +2
    -0
      nodepupper/daemon.py
  2. +14
    -17
      styles/less/main.less
  3. +6
    -2
      templates/node.html

+ 2
- 0
nodepupper/daemon.py View File

@@ -165,6 +165,8 @@ class NodesWeb(object):
c.root.nodes[node].classes[clsname] = NClassAttachment(c.root.classes[clsname], config)
elif op == "Add Parent" and parent:
c.root.nodes[node].parents.append(c.root.nodes[parent])
elif op == "detach" and clsname:
del c.root.nodes[node].classes[clsname]
else:
raise Exception("F")
raise cherrypy.HTTPRedirect("/node/{}".format(node), 302)


+ 14
- 17
styles/less/main.less View File

@@ -246,23 +246,6 @@ a {
}
}

.tags-picker {
padding: 0;
li {
display: inline-block;
padding-right: 25px;
}
input.submit-link {
padding: 0;
border: 0;
background: none;
color: @linkcolor;
&:hover {
text-decoration: underline;
}
}
}

ul.pager {
padding: 0;
li {
@@ -281,3 +264,17 @@ ul.pager {
font-weight: bold;
}
}

input.pure-button-inline {
padding: 0;
border: 0;
background: none;
color: @linkcolor;
&:hover {
text-decoration: underline;
}
}

form.pure-form-inline {
display: inline-block;
}

+ 6
- 2
templates/node.html View File

@@ -33,8 +33,12 @@
<h2>Classes</h2>
<div class="class-list">
{% for name, class in node.classes.items() %}
<div class="class">
{{ class.cls.name }}
<div class="class-name">
{{ class.cls.name }} -
<form action="/node/{{ node.fqdn }}/op" method="post" class="pure-form-inline">
<input type="hidden" name="clsname" value="{{ class.cls.name }}"/>
<input type="submit" name="op" class="pure-button-inline" value="detach"/>
</form>
</div>
<div class="class-conf">
<pre>{{ class.conf }}</pre>


Loading…
Cancel
Save