Changelog: https://roxy-wi.org/changelog#7.0.0
pull/364/head
Aidaho 2023-09-20 16:43:15 +03:00
parent 3edd512c91
commit d75ad2b893
5 changed files with 31 additions and 42 deletions

View File

@ -369,11 +369,6 @@ def keepalived_master_install(master: str, eth: str, eth_slave: str, vrrp_ip: st
haproxy, nginx, '0', firewall haproxy, nginx, '0', firewall
) )
try:
os.remove(f'{full_path}/{script}')
except Exception:
pass
if not api: if not api:
return show_success_installation(service) return show_success_installation(service)
@ -454,9 +449,7 @@ def keepalived_masteradd(master, eth, slave_eth, vrrp_ip, router_id, return_to_m
except Exception as e: except Exception as e:
raise Exception(e) raise Exception(e)
os.remove(f'{full_path}/{script}') return show_success_installation('master VRRP address')
return show_success_installation('slave VRRP address')
def keepalived_slaveadd(slave, eth, slave_eth, vrrp_ip, router_id, kp): def keepalived_slaveadd(slave, eth, slave_eth, vrrp_ip, router_id, kp):

View File

@ -375,9 +375,9 @@ def add_haproxy():
return config_add return config_add
else: else:
try: try:
return add_mod.save_to_haproxy_config(config_add, server_ip) return add_mod.save_to_haproxy_config(config_add, server_ip, name)
except Exception as e: except Exception as e:
return str(e) return f'error: Cannot add to config: {e}'
@bp.post('/haproxy/userlist') @bp.post('/haproxy/userlist')
@ -464,9 +464,9 @@ def add_peers():
return config_add, 200 return config_add, 200
else: else:
try: try:
return add_mod.save_to_haproxy_config(config_add, server_ip) return add_mod.save_to_haproxy_config(config_add, server_ip, name)
except Exception as e: except Exception as e:
return (str(e)), 200 return f'error: Cannot add to config: {e}'
@bp.route('/option/get/<group>') @bp.route('/option/get/<group>')

View File

@ -53,24 +53,19 @@
</tr> </tr>
</table> </table>
<div id="ajax"></div> <div id="ajax"></div>
<script>
{% if serv == 'roxy-wi.error.log' or serv == 'roxy-wi.access.log' %} {% if serv == 'roxy-wi.error.log' or serv == 'roxy-wi.access.log' %}
<script> showApacheLog('{{serv}}');
showApacheLog('{{serv}}');
</script>
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
{{lang.phrases.read_about_files}} <a href="https://roxy-wi.org/description/logs" title="{{lang.words.servers|title()}} {{lang.words.desc}}" target="_blank" class="link">{{lang.words.here}}</a>
</div>
{% else %} {% else %}
<script> viewLogs()
viewLogs()
if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) {
$( "#viewlogs" ).selectmenu({
width: 150
});
}
</script>
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
{{lang.phrases.read_about_files}} <a href="https://roxy-wi.org/description/logs" title="{{lang.words.servers|title()}} {{lang.words.desc}}" target="_blank" class="link">{{lang.words.here}}</a>
</div>
{% endif %} {% endif %}
if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) {
$("#viewlogs").selectmenu({
width: 150
});
}
</script>
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
{{lang.phrases.read_about_files}} <a href="https://roxy-wi.org/description/logs" title="{{lang.words.servers|title()}} {{lang.words.desc}}" target="_blank" class="link">{{lang.words.here}}</a>
</div>
{% endblock %} {% endblock %}

View File

@ -649,17 +649,18 @@ function findGetParameter(parameterName) {
return result; return result;
} }
function viewLogs() { function viewLogs() {
if($('#viewlogs').val() == 'roxy-wi.error.log' || $('#viewlogs').val() == 'roxy-wi.access.log' || $('#viewlogs').val() == 'fail2ban.log') { var viewlogs = $('#viewlogs').val();
showApacheLog($('#viewlogs').val()); if (viewlogs == '------' || viewlogs === null) { return false; }
if(viewlogs == 'roxy-wi.error.log' || viewlogs == 'roxy-wi.access.log' || viewlogs == 'fail2ban.log') {
showApacheLog(viewlogs);
} else { } else {
var rows = $('#rows').val() var rows = $('#rows').val();
var grep = $('#grep').val() var grep = $('#grep').val();
var exgrep = $('#exgrep').val() var exgrep = $('#exgrep').val();
var hour = $('#time_range_out_hour').val() var hour = $('#time_range_out_hour').val();
var minut = $('#time_range_out_minut').val() var minute = $('#time_range_out_minut').val();
var hour1 = $('#time_range_out_hour1').val() var hour1 = $('#time_range_out_hour1').val();
var minut1 = $('#time_range_out_minut1').val() var minute1 = $('#time_range_out_minut1').val();
var viewlogs = $('#viewlogs').val()
var type = findGetParameter('type') var type = findGetParameter('type')
if (viewlogs == null){ if (viewlogs == null){
viewlogs = findGetParameter('viewlogs') viewlogs = findGetParameter('viewlogs')
@ -674,9 +675,9 @@ function viewLogs() {
grep: grep, grep: grep,
exgrep: exgrep, exgrep: exgrep,
hour: hour, hour: hour,
minut: minut, minute: minute,
hour1: hour1, hour1: hour1,
minut1: minut1, minute1: minute1,
token: $('#token').val(), token: $('#token').val(),
}, },
type: "POST", type: "POST",

View File

@ -1927,7 +1927,7 @@ function updateServer(id) {
protected_serv = '1'; protected_serv = '1';
} }
var servergroup = $('#servergroup-' + id + ' option:selected').val(); var servergroup = $('#servergroup-' + id + ' option:selected').val();
if (cur_url[0].indexOf('servers') != '-1') { if (cur_url[0].indexOf('servers#') != '-1') {
servergroup = $('#new-server-group-add').val(); servergroup = $('#new-server-group-add').val();
} }
$.ajax({ $.ajax({