mirror of https://github.com/jumpserver/jumpserver
perf: 修改 migrations
parent
83bd8b600e
commit
cd8adc6d3d
|
@ -32,8 +32,8 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
migrations.AddField(
|
||||
model_name='platform',
|
||||
name='protocols_default',
|
||||
field=models.JSONField(blank=True, default=list, max_length=128, verbose_name='Protocols default'),
|
||||
name='protocols_enabled',
|
||||
field=models.BooleanField(default=True, verbose_name='Protocols enabled'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='platform',
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
# Generated by Django 3.2.13 on 2022-08-19 07:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('assets', '0111_auto_20220819_1523'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='platform',
|
||||
name='protocols_default',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='platform',
|
||||
name='protocols_enabled',
|
||||
field=models.BooleanField(default=True, verbose_name='Protocols enabled'),
|
||||
),
|
||||
]
|
|
@ -12,6 +12,7 @@ import ipaddress
|
|||
import psutil
|
||||
import platform
|
||||
import os
|
||||
import socket
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
@ -365,3 +366,18 @@ def pretty_string(data: str, max_length=128, ellipsis_str='...'):
|
|||
|
||||
def group_by_count(it, count):
|
||||
return [it[i:i+count] for i in range(0, len(it), count)]
|
||||
|
||||
|
||||
def test_ip_connectivity(host, port, timeout=0.5):
|
||||
"""
|
||||
timeout: seconds
|
||||
"""
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.settimeout(timeout)
|
||||
result = sock.connect_ex((host, int(port)))
|
||||
sock.close()
|
||||
if result == 0:
|
||||
connectivity = True
|
||||
else:
|
||||
connectivity = False
|
||||
return connectivity
|
||||
|
|
|
@ -6,8 +6,7 @@ from .. import const
|
|||
from .base import INSTALLED_APPS, TEMPLATES
|
||||
|
||||
XPACK_DIR = os.path.join(const.BASE_DIR, 'xpack')
|
||||
XPACK_ENABLED = False
|
||||
# XPACK_ENABLED = os.path.isdir(XPACK_DIR)
|
||||
XPACK_ENABLED = os.path.isdir(XPACK_DIR)
|
||||
XPACK_TEMPLATES_DIR = []
|
||||
XPACK_CONTEXT_PROCESSOR = []
|
||||
|
||||
|
|
Loading…
Reference in New Issue