From b12dc4e2d6ae8dfd80f2fa429116f3b63b2546c8 Mon Sep 17 00:00:00 2001 From: Ehco1996 Date: Sun, 10 Dec 2023 11:15:38 +0800 Subject: [PATCH] feat: Add ehco_reload_interval field to ProxyNode model --- .../0019_proxynode_ehco_reload_interval.py | 17 +++++++++++++++++ apps/proxy/models.py | 2 ++ apps/sspanel/models.py | 1 - 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 apps/proxy/migrations/0019_proxynode_ehco_reload_interval.py diff --git a/apps/proxy/migrations/0019_proxynode_ehco_reload_interval.py b/apps/proxy/migrations/0019_proxynode_ehco_reload_interval.py new file mode 100644 index 0000000000..62ca7c08ce --- /dev/null +++ b/apps/proxy/migrations/0019_proxynode_ehco_reload_interval.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.6 on 2023-12-10 03:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("proxy", "0018_alter_relaynode_web_token"), + ] + + operations = [ + migrations.AddField( + model_name="proxynode", + name="ehco_reload_interval", + field=models.IntegerField(default=0, max_length=64, verbose_name="配置重载间隔"), + ), + ] diff --git a/apps/proxy/models.py b/apps/proxy/models.py index e1d6e66f72..ebdd21754f 100644 --- a/apps/proxy/models.py +++ b/apps/proxy/models.py @@ -215,6 +215,7 @@ class ProxyNode(BaseNodeModel, SequenceMixin): ehco_log_level = models.CharField( "隧道日志等级", max_length=64, default="info", choices=EHCO_LOG_LEVELS ) + ehco_reload_interval = models.IntegerField("配置重载间隔", max_length=64, default=0) upload_bandwidth_bytes = models.BigIntegerField("上传带宽", default=0) current_used_upload_bandwidth_bytes = models.BigIntegerField("当前使用的上传带宽", default=0) @@ -360,6 +361,7 @@ def get_ehco_server_config(self): "web_port": self.ehco_web_port, "web_token": self.ehco_web_token, "log_level": self.ehco_log_level, + "reload_interval": self.ehco_reload_interval, "relay_configs": [ { "listen": f"{self.ehco_listen_host}:{self.ehco_listen_port}", diff --git a/apps/sspanel/models.py b/apps/sspanel/models.py index 2feda113b2..57a0d129ab 100644 --- a/apps/sspanel/models.py +++ b/apps/sspanel/models.py @@ -17,7 +17,6 @@ from django.db import models, transaction from django.utils import functional, timezone from redis.exceptions import LockError -from slugify import slugify from apps import constants as c from apps.ext import cache, encoder, lock, pay