mirror of
https://gitlab.com/JKANetwork/powerfulcomputermanager.git
synced 2026-03-11 04:42:04 +01:00
New fixes
This commit is contained in:
@@ -12,7 +12,7 @@ from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||||
|
||||
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
|
||||
|
||||
BUILD=1
|
||||
BUILD=2
|
||||
APIC_VER=2
|
||||
|
||||
# Load config to comunicate with API or use default
|
||||
@@ -183,7 +183,12 @@ def pAdminGroup(): #Admin see one group
|
||||
return render_template('/login.tmpl', title="Login")
|
||||
|
||||
groupid=request.args.get('ID_G')
|
||||
if groupid is not None and groupid.isnumeric():
|
||||
groupname=request.args.get('GroupName')
|
||||
|
||||
if groupid is None and groupname is not None:
|
||||
groupid = returnvalueapi('/get/groups?GroupName='+str(groupid),"ID_G")
|
||||
|
||||
if groupid is not None and str(groupid).isnumeric():
|
||||
groupname=returnvalueapi('/get/groups?GroupID='+str(groupid),"Name")
|
||||
computers = returnTable("/get/computers",['ID_C','Name'])
|
||||
datagroup = (returnTable("/get/computersgrp?GroupID="+groupid,['ID_C','Name'])) #lista[0]¿
|
||||
@@ -223,6 +228,15 @@ def pAdminGroupAddcook(): #Add cook form enter
|
||||
return redirect('/admin/group?ID_G='+groupid)
|
||||
|
||||
|
||||
@app.route("/admin/group/addgroup",methods=['GET'])
|
||||
def pAdminGroupAddgroup(): #Add cook form enter
|
||||
groupname=request.args.get('groupnameadd')
|
||||
if groupname != None and groupname != "":
|
||||
r = returnvalueapi("/add/group?GroupName="+groupname,field="RESULT")
|
||||
if r == "OK":
|
||||
return redirect('/admin/group?GroupName='+groupname)
|
||||
|
||||
|
||||
@app.route("/admin/group/addcomputer",methods=['GET'])
|
||||
def pAdminGroupAddcomputer(): #Add computer form enter
|
||||
computertoadd=request.args.get('computeridadd')
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
{# -*- coding: utf-8 -*- #}
|
||||
{% extends 'baseadmin.tmpl' %}
|
||||
{% block content %}
|
||||
|
||||
<!-- Modal Add New Group -->
|
||||
<div class="modal fade" id="modalCreateGroup" tabindex="-1" role="dialog" aria-labelledby="modalCreateGroupLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="get" action="/admin/group/addgroup">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="modalCreateGroupLabel">Create new Group</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<p>Add group<br>
|
||||
<label for="groupname" class="col-form-label">Group name:</label>
|
||||
<input type="text" class="form-control" name="groupnameadd" id="groupnameadd"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-primary">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Groups</h2>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm">
|
||||
@@ -13,6 +38,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="4"><a class="btn btn-outline-success btn-sm" data-toggle="modal" data-target="#modalCreateGroup">Create group</a></td>
|
||||
</tr>
|
||||
{% for item in tablegroups %} {#['ID_G','Name','Computers[ID_C,Name]','Cooks[CookName]']#}
|
||||
<tr>
|
||||
<td>{{item.0}}</td>
|
||||
|
||||
Reference in New Issue
Block a user