<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/aos.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/fa_all.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
    <link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}">
    <title>{{ title }}</title>
</head>

<body>
    <!-- Loading screen -->
    <div class="overlay text-center">
        <img class="img-responsive align-middle loading-img"
            src="{{ url_for('static', filename='images/graphenex_logo_white.png') }}" alt="" height="200" width="200">
    </div>
    <!-- Loading screen end-->
    <div class="container text-center mt-4 mb-4">
        <div class="row">
            <div class="col-md-4" data-aos="fade-up">
                <!-- Left side (logo, info etc.) -->
                <div class="box deep">
                    <div class="row">
                        <div class="col col-md-12">
                            <img class="img-responsive"
                                src="{{ url_for('static', filename='images/graphenex_logo_white.png') }}" alt="logo"
                                height="200" width="200">
                        </div>
                        <div class="col col-md-12">
                            <h2>grapheneX</h2>
                            <p class="text-muted consolas">~ Automated System Hardening Framework.<br>
                                + Created for Linux & Windows.<br>
                                ><a href=" https://github.com/grapheneX" target="_blank">
                                    https://github.com/grapheneX</a><br>
                                - Copyright (C) 2019</p>
                        </div>
                    </div>
                    <!-- System information -->
                    <div class="text-left">
                        <ul class="text-left" style="list-style-type: none;
                            padding: 0;
                            margin: 0;">
                            {% set general_info = sys_all_info['general'] %}
                            <li id="os"><b>OS: </b><span class="text-muted">{{ general_info.system}}</span></li>
                            <li id="proc"><b>Processor: </b><span class="text-muted">{{ general_info.processor }}</span>
                            </li>
                        </ul>
                        <!-- This button only visible mobile and it will open system block -->
                        <button class="btn btn-block d-lg-none opensystembtn" style="border-width: 0; margin-top: 1%;"
                            data-toggle="collapse" data-target="#systemdiv" aria-expanded="false"
                            aria-controls="systemdiv"><i class="fas fa-chevron-down" style="font-size: 24px"></i></button>
                        <div class="collapse" id="systemdiv">
                            <div class="mb-4 mt-3">
                                <h6>Disks <i class="fas fa-hdd"></i></h6>
                                <hr>
                                {% for disk in sys_all_info.get('disks') %}
                                <div class="mb-1">
                                    <h6 style="font-size: 12px">{{ disk.name }}</h6>
                                    <div class="progress">
                                        <div class="progress-bar" role="progressbar"
                                            style="width: {{ disk.data.percent }}%;"
                                            aria-valuenow="{{ disk.data.percent }}" aria-valuemin="0.0"
                                            aria-valuemax="100.0">{{ disk.data.percent }}%</div>
                                    </div>
                                </div>
                                {% endfor %}
                            </div>
                            <h6>Network <i class="fa fa-network-wired"></i></h6>
                            <hr>
                            <div class="table-responsive" style="max-height: 300px">
                                <table class="table table-striped table-dark table-borderless">
                                    <thead>
                                        <tr>
                                            <th scope="col">Mask <i class="fa fa-mask"></i></th>
                                            <th scope="col">Sent <i class="fa fa-arrow-up"></i></th>
                                            <th scope="col">Recv <i class="fa fa-arrow-down"></i></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {% for mask in sys_all_info.get('network')%}
                                        <tr id="{{ mask.slug }}">
                                            <th scope="row">{{ mask.name }}</th>
                                            <td id="{{ mask.slug + '_send' }}">{{ mask.sent }}</td>
                                            <td id="{{ mask.slug + '_recv' }}">{{ mask.recv }}</td>
                                        </tr>
                                        {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!-- End System information -->
                    <p class="mt-4 text-left text-muted" style="font-size: 12px"><strong
                            id="modulecount">{{ mod_count }}</strong>
                        modules found.</p>

                </div>
                <div class="col-md-auto">
                    <button class="btn btn-block mt-2" data-toggle="modal" data-target="#addModuleModal"
                        id="openModal"><i class="fas fa-plus"></i> Add
                        Module</button>
                </div>
                <!-- Left side end -->
            </div>
            <div class="col-md-8 mt-3 mt-sm-0" data-aos="fade-up">
                <!-- Content -->
                <!-- Search bar etc. -->
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-8 text-left align-middle mt-1">
                            <h5>Available Modules</h5>
                        </div>
                        <div class="col-4 text-right">
                            <div class="dropdown">
                                <button class="btn dropdown-toggle deep" type="button" id="current_namespace"
                                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <!-- Javascript render -->
                                </button>
                                <ul class="dropdown-menu" aria-labelledby="current_namespace" id="namespaces"></ul>
                            </div>
                        </div>
                    </div>
                    <!-- Search input -->
                    <div class="mt-3">
                        <form action="">
                            <input class="sr-bar" type="text" placeholder="Search Module" name="modulesearch"
                                style="background-color: #1E1E1E" id="module_search">
                            <button class="sr-btn" type="submit" id="btn_mod_search" disabled><i
                                    class="fa fa-search"></i></button>
                        </form>
                    </div>
                    <!-- End Search input -->
                </div>
                <!-- End Search bar etc. -->
                <!-- Modules -->
                <div id="modules" style="margin-top: 80px;"></div>
            </div>
        </div>

        <!-- Add module modal component -->
        <div class="modal fade" id="addModuleModal" tabindex="-1" role="dialog"
            aria-labelledby="addModuleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content addmd-modal">
                    <div class="modal-header">
                        <h5 class="modal-title" id="addModuleModalLongTitle">Add a new module</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true" style="color: white;">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body text-left">
                        <label for="amod_ns_list">Namespace</label>
                        <ul class="list-group" id="amod_ns_list">
                            <li class="list-group-item" id="ns_list_new">
                                <div class="d-flex justify-content-between">
                                    New Namespace
                                    <i class="fas fa-plus"></i>
                                </div>
                            </li>
                        </ul>
                        <div class="form-group">
                            <label for="amod_name">Module Name</label>
                            <input type="text" class="form-control" id="amod_name" placeholder="Name">
                        </div>
                        <div class="form-group">
                            <label for="amod_desc">Description</label>
                            <textarea class="form-control" id="amod_desc" spellcheck="false" rows="5"
                                placeholder="Description"></textarea>
                        </div>
                        <div class="form-group">
                            <label for="amod_cmd">Command</label>
                            <textarea class="form-control consolas" spellcheck="false" id="amod_cmd" rows="5"
                                placeholder="Hardening Command"></textarea>
                        </div>
                        <div class="form-group">
                            <div class="input-group">
                                <div class="input-group-prepend">
                                    <div class="input-group-text">
                                        <input type="checkbox" id="amod_su">
                                    </div>
                                </div>
                                <div class="form-control" id="amod_su_label"><span style="color:#D8D8D8;">
                                        Requires Superuser Privileges</span></div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-danger" data-dismiss="modal">Cancel <i
                                class="fas fa-times"></i></button>
                        <button type="button" class="btn btn-primary" onclick="saveModal()">Add <i
                                class="fas fa-check"></i></button>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade right" id="messageModal" tabindex="-1" role="dialog"
            aria-labelledby="messageModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-side modal-top-right" role="document">
                <div class="modal-content alert-primary p-1">
                </div>
            </div>
        </div>
        <!-- Javascript includes -->
        <script src="{{ url_for('static', filename='js/jquery-3.2.1.js') }}"></script>
        <script src="{{ url_for('static', filename='js/popper.min.js') }}"></script>
        <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
        <script src="{{ url_for('static', filename='js/aos.js') }}"></script>
        <script src="{{ url_for('static', filename='js/socket.io.min.js') }}"></script>
        <script src="{{ url_for('static', filename='js/listgroup.min.js') }}"></script>
        <script src="{{ url_for('static', filename='js/template.js') }}"></script>
        <script src="{{ url_for('static', filename='js/index.js') }}"></script>
        <script src="{{ url_for('static', filename='js/providers.js') }}"></script>
</body>

</html>