mirror of https://github.com/Aidaho12/haproxy-wi
				
				
				
			
							parent
							
								
									3edd512c91
								
							
						
					
					
						commit
						d75ad2b893
					
				| 
						 | 
				
			
			@ -369,11 +369,6 @@ def keepalived_master_install(master: str, eth: str, eth_slave: str, vrrp_ip: st
 | 
			
		|||
			haproxy, nginx, '0', firewall
 | 
			
		||||
		)
 | 
			
		||||
 | 
			
		||||
	try:
 | 
			
		||||
		os.remove(f'{full_path}/{script}')
 | 
			
		||||
	except Exception:
 | 
			
		||||
		pass
 | 
			
		||||
 | 
			
		||||
	if not api:
 | 
			
		||||
		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:
 | 
			
		||||
		raise Exception(e)
 | 
			
		||||
 | 
			
		||||
	os.remove(f'{full_path}/{script}')
 | 
			
		||||
 | 
			
		||||
	return show_success_installation('slave VRRP address')
 | 
			
		||||
	return show_success_installation('master VRRP address')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def keepalived_slaveadd(slave, eth, slave_eth, vrrp_ip, router_id, kp):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -375,9 +375,9 @@ def add_haproxy():
 | 
			
		|||
        return config_add
 | 
			
		||||
    else:
 | 
			
		||||
        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:
 | 
			
		||||
            return str(e)
 | 
			
		||||
            return f'error: Cannot add to config: {e}'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.post('/haproxy/userlist')
 | 
			
		||||
| 
						 | 
				
			
			@ -464,9 +464,9 @@ def add_peers():
 | 
			
		|||
        return config_add, 200
 | 
			
		||||
    else:
 | 
			
		||||
        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:
 | 
			
		||||
            return (str(e)), 200
 | 
			
		||||
            return f'error: Cannot add to config: {e}'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/option/get/<group>')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,24 +53,19 @@
 | 
			
		|||
	</tr>
 | 
			
		||||
</table>
 | 
			
		||||
<div id="ajax"></div>
 | 
			
		||||
<script>
 | 
			
		||||
{% if serv == 'roxy-wi.error.log' or serv == 'roxy-wi.access.log' %}
 | 
			
		||||
	<script>
 | 
			
		||||
		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>
 | 
			
		||||
	showApacheLog('{{serv}}');
 | 
			
		||||
{% else %}
 | 
			
		||||
    <script>
 | 
			
		||||
		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>
 | 
			
		||||
	viewLogs()
 | 
			
		||||
{% 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 %}
 | 
			
		||||
| 
						 | 
				
			
			@ -649,17 +649,18 @@ function findGetParameter(parameterName) {
 | 
			
		|||
    return result;
 | 
			
		||||
}
 | 
			
		||||
function viewLogs() {
 | 
			
		||||
	if($('#viewlogs').val() == 'roxy-wi.error.log' || $('#viewlogs').val() == 'roxy-wi.access.log' || $('#viewlogs').val() == 'fail2ban.log') {
 | 
			
		||||
		showApacheLog($('#viewlogs').val());
 | 
			
		||||
	var viewlogs = $('#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 {
 | 
			
		||||
		var rows = $('#rows').val()
 | 
			
		||||
		var grep = $('#grep').val()
 | 
			
		||||
		var exgrep = $('#exgrep').val()
 | 
			
		||||
		var hour = $('#time_range_out_hour').val()
 | 
			
		||||
		var minut = $('#time_range_out_minut').val()
 | 
			
		||||
		var hour1 = $('#time_range_out_hour1').val()
 | 
			
		||||
		var minut1 = $('#time_range_out_minut1').val()
 | 
			
		||||
		var viewlogs = $('#viewlogs').val()
 | 
			
		||||
		var rows = $('#rows').val();
 | 
			
		||||
		var grep = $('#grep').val();
 | 
			
		||||
		var exgrep = $('#exgrep').val();
 | 
			
		||||
		var hour = $('#time_range_out_hour').val();
 | 
			
		||||
		var minute = $('#time_range_out_minut').val();
 | 
			
		||||
		var hour1 = $('#time_range_out_hour1').val();
 | 
			
		||||
		var minute1 = $('#time_range_out_minut1').val();
 | 
			
		||||
		var type = findGetParameter('type')
 | 
			
		||||
		if (viewlogs == null){
 | 
			
		||||
			viewlogs = findGetParameter('viewlogs')
 | 
			
		||||
| 
						 | 
				
			
			@ -674,9 +675,9 @@ function viewLogs() {
 | 
			
		|||
				grep: grep,
 | 
			
		||||
				exgrep: exgrep,
 | 
			
		||||
				hour: hour,
 | 
			
		||||
				minut: minut,
 | 
			
		||||
				minute: minute,
 | 
			
		||||
				hour1: hour1,
 | 
			
		||||
				minut1: minut1,
 | 
			
		||||
				minute1: minute1,
 | 
			
		||||
				token: $('#token').val(),
 | 
			
		||||
			},
 | 
			
		||||
			type: "POST",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1927,7 +1927,7 @@ function updateServer(id) {
 | 
			
		|||
		protected_serv = '1';
 | 
			
		||||
	}
 | 
			
		||||
	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();
 | 
			
		||||
	}
 | 
			
		||||
	$.ajax({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue