Upload files to "templates/admin"
This commit is contained in:
79
templates/admin/kittyrecMod.html
Normal file
79
templates/admin/kittyrecMod.html
Normal file
@@ -0,0 +1,79 @@
|
||||
{% extends 'admin/custom_base.html' %}
|
||||
{% block body %}
|
||||
<div class="container-fluid mt-3">
|
||||
<h4 class="mb-3">KittyRec Mod — DLL Management</h4>
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger alert-dismissible">{{ error }}<button type="button" class="close" data-dismiss="alert">×</button></div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible">{{ success }}<button type="button" class="close" data-dismiss="alert">×</button></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
{% for branch_id, branch_name in branchs.items() %}
|
||||
{% set current = dll_data.get(branch_id) %}
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-header d-flex justify-content-between align-items-center
|
||||
{% if branch_name == 'Prod' %}bg-success text-white
|
||||
{% elif branch_name == 'Dev' %}bg-primary text-white
|
||||
{% else %}bg-secondary text-white{% endif %}">
|
||||
<strong>{{ branch_name }}</strong>
|
||||
{% if current %}
|
||||
<span class="badge badge-light">Active</span>
|
||||
{% else %}
|
||||
<span class="badge badge-warning">No DLL</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if current %}
|
||||
<p class="mb-1"><small class="text-muted">File:</small><br>
|
||||
<span class="text-monospace small">{{ current.file }}</span></p>
|
||||
<p class="mb-0"><small class="text-muted">SHA-512:</small><br>
|
||||
<span class="text-monospace" style="font-size:0.65rem;word-break:break-all">{{ current.hash }}</span></p>
|
||||
{% else %}
|
||||
<p class="text-muted text-center py-3">No DLL uploaded for this branch.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if SCOPE_ADMIN in scopes %}
|
||||
<div class="card-footer">
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="branch_id" value="{{ branch_id }}">
|
||||
<input type="hidden" name="action_type" value="upload">
|
||||
<div class="input-group mb-2">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="dll-{{ loop.index }}" name="dll_file" accept=".dll">
|
||||
<label class="custom-file-label" for="dll-{{ loop.index }}">Choose .dll file</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-block
|
||||
{% if branch_name == 'Prod' %}btn-success
|
||||
{% elif branch_name == 'Dev' %}btn-primary
|
||||
{% else %}btn-secondary{% endif %}">
|
||||
Upload to {{ branch_name }}
|
||||
</button>
|
||||
</form>
|
||||
{% if current %}
|
||||
<form method="POST" class="mt-2" onsubmit="return confirm('Clear {{ branch_name }} DLL?')">
|
||||
<input type="hidden" name="branch_id" value="{{ branch_id }}">
|
||||
<input type="hidden" name="action_type" value="clear">
|
||||
<button type="submit" class="btn btn-outline-danger btn-block btn-sm">Clear {{ branch_name }}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.querySelectorAll('.custom-file-input').forEach(function(inp) {
|
||||
inp.addEventListener('change', function() {
|
||||
var name = this.files[0] ? this.files[0].name : 'Choose .dll file';
|
||||
this.nextElementSibling.textContent = name;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user