Skip to content

Commit

Permalink
clean up old stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Küng committed Jun 1, 2024
1 parent 04a1660 commit e8e0248
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 110 deletions.
1 change: 0 additions & 1 deletion app/munkiwebadmin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
MEDIA_ROOT = os.path.join(MUNKI_REPO_DIR, 'icons')
ICONS_URL = MEDIA_URL
CONVERT_TO_QWERTZ = os.getenv('CONVERT_TO_QWERTZ')
VAULT_USERNAME = os.getenv('VAULT_USERNAME', 'admin')
PROXY_ADDRESS = os.getenv('PROXY_ADDRESS', '')
DEFAULT_MANIFEST = os.getenv('DEFAULT_MANIFEST')
MUNKISCRIPTS_PATH = os.path.join(BASE_DIR, 'munkiscripts', 'build')
Expand Down
49 changes: 0 additions & 49 deletions app/reports/static/reports/js/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,55 +756,6 @@ function getHostname(serial, handleData) {
});
}

function loadPasswordAccess(serial) {
var machineURL = '/api/vault/reasons/'+serial;
passwordAccessTable = $('#passwordAccess').DataTable( {
ajax: {
url: machineURL,
dataSrc: ''
},
columns: [
{ data: 'fields.user.0' },
{ data: 'fields.reason' },
{ data: 'fields.date', type: 'date' },
],
"columnDefs": [
{
"render": function ( data, type, row ) {
return new Date(data)
},
"width": "100px",
"targets": 2
},
],
"bPaginate": false,
"bInfo": false,
"bFilter": false,
"aaSorting": [[2,"desc"]]
} );
}

function showPassword(reason) {
var machineURL = '/api/vault/show/'+current_pathname;
$.ajax({
method: 'POST',
url: machineURL,
data: { "reason" : reason},
success: function(data) {
var html = data + ' <button type="button" class="btn btn-default btn-xs" onclick="copyTextToClipboard(\'' + data + '\');"><i class="fa fa-clipboard" aria-hidden="true"></i></button>'
$("#password").html( html );
$("#reasonForm").addClass("d-none")
$("#showPassTable").removeClass("d-none")
passwordAccessTable.ajax.reload();
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR["responseJSON"]["detail"])
$("#errorModalDetailText").text(jqXHR["responseJSON"]["detail"]);
$("#errorModal").modal("show");
}
});
}

function loadInventory(serial) {
url = "/inventory/detail/" + serial
$.ajax({
Expand Down
52 changes: 1 addition & 51 deletions app/reports/templates/reports/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h4 class="d-none d-sm-block">
{% if machine.hostname %}
<div class="d-none d-sm-block">
<a type="button" class="btn btn-secondary" href="vnc://{{ machine.hostname.strip }}">ScreenSharing <i class="far fa-clone"></i></a>
<a type="button" class="btn btn-secondary" href="ssh://{{ vault_username }}@{{ machine.hostname.strip }}">SSH <i class="fas fa-terminal"></i></a>
<a type="button" class="btn btn-secondary" href="ssh://{{ machine.hostname.strip }}">SSH <i class="fas fa-terminal"></i></a>
</div>
{% endif %}
</div>
Expand All @@ -44,11 +44,6 @@ <h4 class="d-none d-sm-block">
<li class="nav-item" role="presentation">
<button class="nav-link" id="inverntorytab" data-bs-toggle="tab" data-bs-target="#inverntorytab-pane" type="button" role="tab" aria-controls="inverntorytab-pane" aria-selected="false">Inventory</button>
</li>
{% if perms.vault.view_passwordAccess %}
<li class="nav-item" role="presentation">
<button class="nav-link" id="admintab" data-bs-toggle="tab" data-bs-target="#admintab-pane" type="button" role="tab" aria-controls="admintab-pane" aria-selected="false">Password</button>
</li>
{% endif %}
</ul>
<div class="tab-content" id="detail_content" >
<div class="tab-pane show tabDetail active" id="softwaretab-pane" role="tabpanel" aria-labelledby="softwaretab" tabindex="0">
Expand Down Expand Up @@ -489,51 +484,6 @@ <h5 style="margin-top: 0px">{{ partition.partitionName }}</h5>
</div>
</div>
</div>
{% if perms.vault.view_passwordAccess %}
<div class="tab-pane show tabDetail" id="admintab-pane" role="tabpanel" aria-labelledby="admintab" tabindex="0">
<div class="panel-body">
<div class="row mb-3">
<div class='col-md-12' id="showPass">
<h4>Admin login</h4>
<form id="reasonForm">
<div class="input-group mb-2">
<span class="input-group-text">Reason</span>
<textarea class="form-control" aria-label="Reason"></textarea>
</div>
<button type="submit" class="btn btn-primary" id="showPassButton">Show</button>
</form>

<table id="showPassTable" class='table table-bordered d-none'>
<tbody>
<tr>
<td style='width: 90px;'><b>User</b></td>
<td>{{ vault_username }}</td>
</tr>
<tr>
<td style='width: 90px;'><b>Password</b></td>
<td id="password"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<div class="section_label"><h4>Admin access</h4></div>
<table id="passwordAccess" class="table table-striped table-bordered" width="100%">
<thead>
<tr>
<th>User</th>
<th>Reason</th>
<th>Date</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
<div class="modal-footer">
Expand Down
7 changes: 0 additions & 7 deletions app/reports/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
except AttributeError:
ICONS_URL = ""

try:
VAULT_USERNAME = settings.VAULT_USERNAME
except AttributeError:
VAULT_USERNAME = "admin"

proxies = {
"http": PROXY_ADDRESS,
"https": PROXY_ADDRESS
Expand Down Expand Up @@ -147,15 +142,13 @@ def index(request, computer_serial=None):
diskInfoDict = {}

context = {'machine': machine,
'vault_username': VAULT_USERNAME,
'report_plist': report_plist,
'disksList': disksList,
'time': time,
'defaultManifest': DEFAULT_MANIFEST,
}
else:
context = {'machine': machine,
'vault_username': VAULT_USERNAME,
'report_plist': report_plist,
'defaultManifest': DEFAULT_MANIFEST,
}
Expand Down
3 changes: 1 addition & 2 deletions devScripts/startDevServer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export LANGUAGE_CODE='en-us'
export ALLOWED_HOSTS='localhost 127.0.0.1 [::1]'
export DEFAULT_MANIFEST=''
export PROXY_ADDRESS=''
export VAULT_USERNAME='admin'
export DEBUG=1
export MUNKI_REPO_DIR='/Users/Shared/munki_repo'
export MAKECATALOGS_PATH='/usr/local/munki/makecatalogs'
Expand All @@ -20,7 +19,7 @@ fi

cd app

python manage.py makemigrations manifests pkgsinfo process reports vault inventory
python manage.py makemigrations manifests pkgsinfo process reports inventory
python manage.py migrate --noinput

# Start the development server
Expand Down

0 comments on commit e8e0248

Please sign in to comment.