2020-12-06 20:42:49 +00:00
|
|
|
{% extends ../base.html %}
|
|
|
|
|
|
|
|
{% block meta %}
|
|
|
|
<!-- <meta http-equiv="refresh" content="60">-->
|
|
|
|
{% end %}
|
|
|
|
|
|
|
|
{% block title %}Crafty Controller - Panel Config{% end %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<div class="content-wrapper">
|
|
|
|
|
|
|
|
<!-- Page Title Header Starts-->
|
|
|
|
<div class="row page-title-header">
|
|
|
|
<div class="col-12">
|
|
|
|
<div class="page-header">
|
|
|
|
<h4 class="page-title">Panel Config</h4>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- Page Title Header Ends-->
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 grid-margin">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 col-lg-12 grid-margin stretch-card">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header header-sm d-flex justify-content-between align-items-center">
|
2021-09-28 21:02:15 +00:00
|
|
|
<h4 class="card-title"><i class="fas fa-users"></i> Users</h4>
|
2021-09-29 02:25:47 +00:00
|
|
|
<span class="too_small" title="{{ translate('dashboard', 'cannotSee', data['lang']) }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}", data-placement="top"></span>
|
2021-10-04 15:06:57 +00:00
|
|
|
|
2020-12-06 20:42:49 +00:00
|
|
|
<div><a class="nav-link" href="/panel/add_user"><i class="fas fa-plus-circle"></i> Add New User</a></div>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="table-responsive">
|
2021-08-21 23:41:25 +00:00
|
|
|
<table class="table table-hover">
|
2020-12-06 20:42:49 +00:00
|
|
|
<thead>
|
|
|
|
<tr class="rounded">
|
|
|
|
<th>User</th>
|
|
|
|
<th>Enabled</th>
|
|
|
|
<th>Allowed Servers</th>
|
2021-08-08 20:43:04 +00:00
|
|
|
<th>Assigned Roles</th>
|
2020-12-06 20:42:49 +00:00
|
|
|
<th>Edit</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for user in data['users'] %}
|
|
|
|
<tr>
|
2021-08-21 23:41:25 +00:00
|
|
|
<td><i class="fas fa-user"></i> {{ user.username }}</td>
|
2021-10-09 09:10:24 +00:00
|
|
|
<td>
|
2020-12-06 20:42:49 +00:00
|
|
|
{% if user.enabled %}
|
|
|
|
<span class="text-success">
|
|
|
|
<i class="fas fa-check-square"></i> Yes
|
|
|
|
</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="text-danger">
|
|
|
|
<i class="far fa-times-square"></i> No
|
|
|
|
</span>
|
|
|
|
|
|
|
|
{% end %}
|
|
|
|
</td>
|
2021-10-09 09:10:24 +00:00
|
|
|
<td id="server_list_{{user.user_id}}">
|
|
|
|
<ul id="{{user.user_id}}">
|
|
|
|
{% for item in data['auth-servers'][user.user_id] %}
|
|
|
|
<li>{{item}}</li>
|
|
|
|
{% end %}
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td id="role_list_{{user.user_id}}">
|
|
|
|
<ul>
|
2021-08-08 20:43:04 +00:00
|
|
|
{% for item in data['user-roles'][user.user_id] %}
|
2021-10-09 09:10:24 +00:00
|
|
|
<li data-toggle="tooltip" title="{{ item }}">{{item}}</li>
|
2021-08-08 20:43:04 +00:00
|
|
|
{% end %}
|
2021-10-09 09:10:24 +00:00
|
|
|
</ul>
|
|
|
|
</td>
|
2020-12-24 22:55:15 +00:00
|
|
|
<td><a href="/panel/edit_user?id={{user.user_id}}"><i class="fas fa-pencil-alt"></i></a></td>
|
2020-12-06 20:42:49 +00:00
|
|
|
</tr>
|
|
|
|
{% end %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-12-27 16:00:26 +00:00
|
|
|
</div>
|
2020-12-06 20:42:49 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-12-27 16:00:26 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 col-lg-12 grid-margin stretch-card">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header header-sm d-flex justify-content-between align-items-center">
|
2021-08-21 23:41:25 +00:00
|
|
|
<h4 class="card-title"><i class="fas fa-user-tag"></i> Roles</h4>
|
2021-09-29 02:25:47 +00:00
|
|
|
<span class="too_small2" title="{{ translate('dashboard', 'cannotSee', data['lang']) }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}", data-placement="top"></span>
|
2020-12-27 16:00:26 +00:00
|
|
|
<div><a class="nav-link" href="/panel/add_role"><i class="fas fa-plus-circle"></i> Add New Role</a></div>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="table-responsive">
|
2021-08-21 23:41:25 +00:00
|
|
|
<table class="table table-hover">
|
2020-12-27 16:00:26 +00:00
|
|
|
<thead>
|
|
|
|
<tr class="rounded">
|
|
|
|
<th>Role</th>
|
|
|
|
<th>Allowed Servers</th>
|
2021-08-09 21:11:45 +00:00
|
|
|
<th>Role Users</th>
|
2020-12-27 16:00:26 +00:00
|
|
|
<th>Edit</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for role in data['roles'] %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ role.role_name }}</td>
|
2021-10-09 09:10:24 +00:00
|
|
|
<td id="role_list_{{role.role_id}}">
|
|
|
|
<ul id="{{role.role_id}}">
|
|
|
|
{% for item in data['role-servers'][role.role_id] %}
|
|
|
|
<li>{{item}}</li>
|
|
|
|
{% end %}
|
|
|
|
</ul>
|
|
|
|
</td>
|
2021-08-09 21:11:45 +00:00
|
|
|
<td><ul>
|
|
|
|
{% for user in data['users'] %}
|
|
|
|
{% for ruser in data['user-roles'][user.user_id] %}
|
|
|
|
{% if ruser == role.role_name %}
|
|
|
|
<li>{{ user.username }}</li>
|
|
|
|
{% end %}
|
|
|
|
{% end %}
|
|
|
|
{% end %}
|
|
|
|
</ul>
|
|
|
|
</td>
|
2020-12-27 16:00:26 +00:00
|
|
|
<td><a href="/panel/edit_role?id={{role.role_id}}"><i class="fas fa-pencil-alt"></i></a></td>
|
|
|
|
</tr>
|
|
|
|
{% end %}
|
2020-12-06 20:42:49 +00:00
|
|
|
|
2020-12-27 16:00:26 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-12-06 20:42:49 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
2021-09-28 21:02:15 +00:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.popover-body{
|
|
|
|
color: white !important;;
|
|
|
|
}
|
|
|
|
</style>
|
2020-12-06 20:42:49 +00:00
|
|
|
<!-- content-wrapper ends -->
|
|
|
|
|
|
|
|
{% end %}
|
|
|
|
|
|
|
|
{% block js %}
|
|
|
|
<script>
|
2021-10-04 15:06:57 +00:00
|
|
|
$(document).ready(function(){
|
2021-09-28 21:02:15 +00:00
|
|
|
$('[data-toggle="popover"]').popover();
|
2021-09-29 00:15:29 +00:00
|
|
|
if($(window).width() < 1000){
|
2021-09-28 21:02:15 +00:00
|
|
|
$('.too_small').popover("show");
|
2021-09-29 00:15:29 +00:00
|
|
|
$('.too_small2').popover("show");
|
|
|
|
}
|
2021-10-04 15:06:57 +00:00
|
|
|
|
2021-09-28 21:02:15 +00:00
|
|
|
});
|
|
|
|
$(window).ready(function(){
|
|
|
|
$('body').click(function(){
|
|
|
|
$('.too_small').popover("hide");
|
2021-09-29 00:15:29 +00:00
|
|
|
$('.too_small2').popover("hide");
|
2021-09-28 21:02:15 +00:00
|
|
|
});
|
|
|
|
});
|
2021-09-29 00:15:29 +00:00
|
|
|
$(window).resize(function() {
|
|
|
|
// This will execute whenever the window is resized
|
|
|
|
if($(window).width() < 1000){
|
|
|
|
$('.too_small').popover("show");
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$('.too_small').popover("hide");
|
|
|
|
} // New width
|
|
|
|
if($(window).width() < 1000){
|
|
|
|
$('.too_small2').popover("show");
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$('.too_small2').popover("hide");
|
|
|
|
} // New width
|
|
|
|
});
|
2021-09-28 21:02:15 +00:00
|
|
|
</script>
|
|
|
|
<script>
|
2020-12-06 20:42:49 +00:00
|
|
|
|
|
|
|
$( document ).ready(function() {
|
|
|
|
console.log('ready for JS!')
|
|
|
|
|
|
|
|
});
|
2021-09-28 21:02:15 +00:00
|
|
|
|
|
|
|
$( ".show_button" ).click(function() {
|
|
|
|
console.log("showing key");
|
|
|
|
api_key = $(this).attr("data-id");
|
|
|
|
bootbox.alert({
|
|
|
|
backdrop: true,
|
|
|
|
title: '',
|
|
|
|
message: api_key,
|
|
|
|
});
|
|
|
|
});
|
2020-12-06 20:42:49 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{% end %}
|