mirror of https://github.com/Aidaho12/haproxy-wi
				
				
				
			
							parent
							
								
									403272cf47
								
							
						
					
					
						commit
						aa1702d243
					
				| 
						 | 
				
			
			@ -78,9 +78,8 @@ def show_roxy_log(
 | 
			
		|||
 | 
			
		||||
	log_file = checkAjaxInput(log_file) if log_file is not None else log_file
 | 
			
		||||
 | 
			
		||||
	if '..' in log_file: return 'error: nice try'
 | 
			
		||||
 | 
			
		||||
	if service in ('nginx', 'haproxy', 'apache', 'keepalived'):
 | 
			
		||||
		if '..' in log_file: return 'error: nice try'
 | 
			
		||||
		syslog_server_enable = sql.get_setting('syslog_server_enable')
 | 
			
		||||
		if syslog_server_enable is None or syslog_server_enable == 0:
 | 
			
		||||
			if service == 'nginx':
 | 
			
		||||
| 
						 | 
				
			
			@ -114,6 +113,7 @@ def show_roxy_log(
 | 
			
		|||
		else:
 | 
			
		||||
			return server_mod.ssh_command(syslog_server, commands, show_log='1', grep=grep, timeout=10)
 | 
			
		||||
	elif service == 'apache_internal':
 | 
			
		||||
		if '..' in serv: return 'error: nice try'
 | 
			
		||||
		apache_log_path = sql.get_setting('apache_log_path')
 | 
			
		||||
 | 
			
		||||
		if serv == 'roxy-wi.access.log':
 | 
			
		||||
| 
						 | 
				
			
			@ -127,6 +127,7 @@ def show_roxy_log(
 | 
			
		|||
 | 
			
		||||
		return show_log(output, grep=grep)
 | 
			
		||||
	elif service == 'internal':
 | 
			
		||||
		if '..' in serv: return 'error: nice try'
 | 
			
		||||
		log_path = get_config_var.get_config_var('main', 'log_path')
 | 
			
		||||
		logs_files = roxywi_common.get_files(log_path, "log")
 | 
			
		||||
		user_group = roxywi_common.get_user_group()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
{% import 'languages/'+lang|default('en')+'.html' as lang %}
 | 
			
		||||
{% import 'languages/'+lang|default('en')+'.html' as lang1 %}
 | 
			
		||||
{% from 'include/input_macros.html' import copy_to_clipboard %}
 | 
			
		||||
{% if style == 'new' %}
 | 
			
		||||
    {% if for_delver == '1' %}
 | 
			
		||||
| 
						 | 
				
			
			@ -56,18 +56,18 @@
 | 
			
		|||
                        <label for="new_select_all" id="new_label_select_all"></label>
 | 
			
		||||
                        <input type="checkbox" id="new_select_all">
 | 
			
		||||
                    </th>
 | 
			
		||||
                    <th>{{lang.words.user|title()}}</th>
 | 
			
		||||
                    <th>{{lang1.words.user|title()}}</th>
 | 
			
		||||
                    <th class="padding10 first-collumn" style="width: 30%">
 | 
			
		||||
                        {{lang.words.local|title()}} {{lang.words.path}}
 | 
			
		||||
                        {{lang1.words.local|title()}} {{lang1.words.path}}
 | 
			
		||||
                    </th>
 | 
			
		||||
                    <th class="padding10 first-collumn" style="width: 10%">
 | 
			
		||||
                        {{lang.words.remote|title()}} {{lang.words.path}}
 | 
			
		||||
                        {{lang1.words.remote|title()}} {{lang1.words.path}}
 | 
			
		||||
                    </th>
 | 
			
		||||
                    <th class="padding10 first-collumn" style="width: 35%">
 | 
			
		||||
                        {{lang.words.diff|title()}}
 | 
			
		||||
                        {{lang1.words.diff|title()}}
 | 
			
		||||
                    </th>
 | 
			
		||||
                    <th style="width: 10%">
 | 
			
		||||
                        {{lang.words.created|title()}}
 | 
			
		||||
                        {{lang1.words.created|title()}}
 | 
			
		||||
                    </th>
 | 
			
		||||
                    <th></th>
 | 
			
		||||
                </tr>
 | 
			
		||||
| 
						 | 
				
			
			@ -93,9 +93,9 @@
 | 
			
		|||
                    <td>{{ copy_to_clipboard(id=c.remote_path, value=c.remote_path) }}</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        {% if c.diff == '' %}
 | 
			
		||||
                            {{lang.words.no|title()}} {{lang.words.diff3}}
 | 
			
		||||
                            {{lang1.words.no|title()}} {{lang1.words.diff3}}
 | 
			
		||||
                            {% else %}
 | 
			
		||||
                            <a id="link_show_diff_{{c.id}}" onclick="show_diff('{{c.id}}')" title="Show a difference between this config and previous one" class="link">{{lang.words.show|title()}} {{lang.words.diff2}}</a>
 | 
			
		||||
                            <a id="link_show_diff_{{c.id}}" onclick="show_diff('{{c.id}}')" title="Show a difference between this config and previous one" class="link">{{lang1.words.show|title()}} {{lang1.words.diff2}}</a>
 | 
			
		||||
                            <div id="show_diff_{{c.id}}" style="display: none;">
 | 
			
		||||
                                {% set stdout = c.diff.split('\n') %}
 | 
			
		||||
                                {% include 'ajax/compare.html' %}
 | 
			
		||||
| 
						 | 
				
			
			@ -105,8 +105,8 @@
 | 
			
		|||
                    <td>{{c.date}}</td>
 | 
			
		||||
                    <td style="padding-top: 10px;">
 | 
			
		||||
                        <a href="/app/versions.py?service={{service}}&serv={{serv}}&open=open&configver={{c.local_path.split('/')[-1]}}"
 | 
			
		||||
                           class="ui-button ui-widget ui-corner-all" title="{{lang.phrases.view_and_upload}}" style="margin-top: -6px;">
 | 
			
		||||
                            {{lang.words.view|title()}}/{{lang.words.upload|title()}}
 | 
			
		||||
                           class="ui-button ui-widget ui-corner-all" title="{{lang1.phrases.view_and_upload}}" style="margin-top: -6px;">
 | 
			
		||||
                            {{lang1.words.view|title()}}/{{lang1.words.upload|title()}}
 | 
			
		||||
                        </a>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
| 
						 | 
				
			
			@ -118,7 +118,7 @@
 | 
			
		|||
            <input type="hidden" value="del" name="del">
 | 
			
		||||
            <input type="hidden" value="{{style}}" name="style">
 | 
			
		||||
            <p>
 | 
			
		||||
                <button type="submit" value="" name="" class="btn btn-default">{{lang.words.delete|title()}}</button>
 | 
			
		||||
                <button type="submit" value="" name="" class="btn btn-default">{{lang1.words.delete|title()}}</button>
 | 
			
		||||
            </p>
 | 
			
		||||
        </form>
 | 
			
		||||
    {% else %}
 | 
			
		||||
| 
						 | 
				
			
			@ -138,7 +138,7 @@
 | 
			
		|||
            <input type="hidden" value="{{serv}}" name="serv">
 | 
			
		||||
            <input type="hidden" value="open" name="open">
 | 
			
		||||
            <input type="hidden" value="{{service}}" name="service" id="service">
 | 
			
		||||
            <a class="ui-button ui-widget ui-corner-all" id="show" title="{{lang.words.enter|title()}}" onclick="showUploadConfig()">{{lang.words.select2|title()}}</a>
 | 
			
		||||
            <a class="ui-button ui-widget ui-corner-all" id="show" title="{{lang1.words.enter|title()}}" onclick="showUploadConfig()">{{lang1.words.select2|title()}}</a>
 | 
			
		||||
        </p>
 | 
			
		||||
        <script>
 | 
			
		||||
            $( "select" ).selectmenu();
 | 
			
		||||
| 
						 | 
				
			
			@ -157,14 +157,14 @@
 | 
			
		|||
            <label for="{{file}}"> {{file.split('-', maxsplit=1)[1]}} </label><input type="checkbox" value="{{file}}" name="{{file}}" id="{{file}}">
 | 
			
		||||
            <a href="/app/versions.py?service={{service}}&serv={{serv}}&open=open&configver={{file}}"
 | 
			
		||||
               class="ui-button ui-widget ui-corner-all" title="View and upload this version of the config" style="margin-top: -6px;">
 | 
			
		||||
                {{lang.words.view|title()}}/{{lang.words.upload|title()}}
 | 
			
		||||
                {{lang1.words.view|title()}}/{{lang1.words.upload|title()}}
 | 
			
		||||
            </a><br />
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
            <input type="hidden" value="{{serv}}" name="serv">
 | 
			
		||||
            <input type="hidden" value="open" name="open">
 | 
			
		||||
            <input type="hidden" value="del" name="del">
 | 
			
		||||
            <p>
 | 
			
		||||
                <button type="submit" value="" name="" class="btn btn-default">{{lang.words.delete|title()}}</button>
 | 
			
		||||
                <button type="submit" value="" name="" class="btn btn-default">{{lang1.words.delete|title()}}</button>
 | 
			
		||||
            </p>
 | 
			
		||||
        </form>
 | 
			
		||||
        </center>
 | 
			
		||||
| 
						 | 
				
			
			@ -184,7 +184,7 @@
 | 
			
		|||
            </select>
 | 
			
		||||
            <input type="hidden" value="{{serv}}" name="serv">
 | 
			
		||||
            <input type="hidden" value="open" name="open">
 | 
			
		||||
            <a class="ui-button ui-widget ui-corner-all" id="show" title="Enter" onclick="showUploadConfig()">{{lang.words.select2|title()}}</a>
 | 
			
		||||
            <a class="ui-button ui-widget ui-corner-all" id="show" title="Enter" onclick="showUploadConfig()">{{lang1.words.select2|title()}}</a>
 | 
			
		||||
        </p>
 | 
			
		||||
        <script>
 | 
			
		||||
            $( "select" ).selectmenu();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@
 | 
			
		|||
	<tbody>
 | 
			
		||||
	{% endif %}
 | 
			
		||||
	{% for user in users %}
 | 
			
		||||
	{% if user.role == 'superAdmin' and page == "servers.py" %}
 | 
			
		||||
	{% if user.role == '1' and page == "servers.py" %}
 | 
			
		||||
	{% set disable_superAdmin = "disabled" %}
 | 
			
		||||
	{% endif %}
 | 
			
		||||
		<tr id="user-{{user.user_id}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newuser{% endif %}">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue