mysql changes

This commit is contained in:
Hassan Hashmi
2023-12-18 12:45:28 +05:00
parent c56566d15c
commit 6aaa183135
13 changed files with 686 additions and 90 deletions

View File

@@ -0,0 +1,70 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Mysql Manager - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container" ng-controller="OptimizeMysql">
<div id="page-title">
<h2>{% trans "Optimize MySQL" %} <img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}"></h2>
</div>
<div class="panel">
<div class="panel-body">
<button style="margin-bottom: 2%; display: inline" ng-click="generateRecommendations()" type="button"
class="btn btn-success"><i
class="mdi mdi-dns mr-1"></i>
<span>Generate Recommendations</span>
</button>
<button style="margin-bottom: 2%; display: inline" ng-click="applyMySQLChanges()" type="button"
class="btn btn-danger"><i
class="mdi mdi-dns mr-1"></i>
<span>Apply Changes</span>
</button>
<button style="margin-bottom: 2%; display: inline" ng-click="restartMySQL()" type="button"
class="btn btn-info"><i
class="mdi mdi-dns mr-1"></i>
<span>Restart MySQL</span>
</button>
<div class="right" style="float: right; display: inline">
<strong> Detected Ram: <b id="detectedRam">{{ ramInGB }}</b></strong>
</div>
<form>
<div class="row">
<div class="col-md-6">
<div class="form-group mb-3">
<label for="billing-town-city">Current contents of my.cnf</label>
<textarea placeholder="{{ conf }}" rows="25"
class="form-control">{{ conf }}</textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group mb-3">
<label for="billing-town-city">Suggested Content</label>
<textarea placeholder="Click Generate Recommendations to generate recommentations."
ng-model="suggestedContent" rows="25"
class="form-control"></textarea>
</div>
</div>
</div> <!-- end row -->
</form>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,129 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Mysql Manager - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container" ng-controller="Mysqlmanager">
<div id="page-title">
<h2>{% trans "MySQL Manager" %} <img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}"></h2>
</div>
<div class="example-box-wrapper">
<div class="panel panel-body">
<div class="row">
<h3 style="display: inline-block;" class="content-box-header">MySQL status</h3>
<a style="display: inline-block;" href="{% url 'OptimizeMySQL' %}" class="btn btn-primary">
<i class="glyph-icon icon-database"></i> Optimize MySQL
</a>
</div>
<div class="content-box-header">
<div class="row">
<div class="col-md-4">
<!-- project card -->
<div class="panel">
<div class="panel-body">
<!-- project title-->
<h4 style="display: inline" class="mt-0">
<strong>MySQL Uptime</strong>
</h4>
<img style="float: right; display: inline; height: 46px"
src="{% static 'databases/hourglass.png' %}">
<h4 class="mt-5"><b>{$ uptime $}</b></h4>
<!-- project detail-->
</div> <!-- end card-body-->
</div> <!-- end card-->
</div>
<div class="col-md-4">
<!-- project card -->
<div class="panel">
<div class="panel-body">
<!-- project title-->
<h4 style="display: inline" class="mt-0">
<strong>Connections</strong>
</h4>
<img style="float: right; display: inline; height: 46px"
src="{% static 'databases/link.png' %}">
<h4 class="mt-5"><b>{$ connections $}</b></h4>
<!-- project detail-->
</div> <!-- end card-body-->
</div> <!-- end card-->
</div>
<div class="col-md-4">
<!-- project card -->
<div class="panel">
<div class="panel-body">
<!-- project title-->
<h4 style="display: inline" class="mt-0">
<strong>Slow Queries</strong>
</h4>
<img style="float: right; display: inline; height: 46px"
src="{% static 'databases/snail.png' %}">
<h4 class="mt-5"><b>{$ Slow_queries $}</b></h4>
<!-- project detail-->
</div> <!-- end card-body-->
</div> <!-- end card-->
</div>
</div>
</div>
</div>
</div>
<div class="example-box-wrapper">
<div class="panel panel-body">
<h3 class="content-box-header"> MySQL Processes</h3>
<div class="content-box-header">
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>User</th>
<th>Database</th>
<th>Command</th>
<th>Time</th>
<th>State</th>
<th>Info</th>
<th>Progress</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="process in processes">
<td ng-bind="process.id"></td>
<td ng-bind="process.user"></td>
<td ng-bind="process.database"></td>
<td ng-bind="process.command"></td>
<td ng-bind="process.time"></td>
<td ng-bind="process.state"></td>
<td ng-bind="process.info"></td>
<td ng-bind="process.progress"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}