feat: 添加组件类型 razor 并替换 XRDP_ENABLED

This commit is contained in:
Jiangjie.Bai
2022-06-06 18:04:11 +08:00
committed by 老广
parent dade0cadda
commit 2366f02d10
8 changed files with 49 additions and 8 deletions

View File

@@ -21,7 +21,7 @@ def migrate_endpoints(apps, schema_editor):
}
Endpoint.objects.create(**default_data)
if not settings.XRDP_ENABLED:
if not settings.TERMINAL_RAZOR_ENABLED:
return
# migrate xrdp
xrdp_addr = settings.TERMINAL_RDP_ADDR
@@ -41,7 +41,7 @@ def migrate_endpoints(apps, schema_editor):
else:
rdp_port = 3389
xrdp_data = {
'name': 'XRDP',
'name': 'Razor',
'host': host,
'https_port': 0,
'http_port': 0,
@@ -56,7 +56,7 @@ def migrate_endpoints(apps, schema_editor):
EndpointRule = apps.get_model("terminal", "EndpointRule")
xrdp_rule_data = {
'name': 'XRDP',
'name': 'Razor',
'ip_group': ['*'],
'priority': 20,
'endpoint': xrdp_endpoint,

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.1.14 on 2022-06-06 09:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('terminal', '0049_endpoint_redis_port'),
]
operations = [
migrations.AlterField(
model_name='terminal',
name='type',
field=models.CharField(choices=[('koko', 'KoKo'), ('guacamole', 'Guacamole'), ('omnidb', 'OmniDB'), ('xrdp', 'Xrdp'), ('lion', 'Lion'), ('core', 'Core'), ('celery', 'Celery'), ('magnus', 'Magnus'), ('razor', 'Razor')], default='koko', max_length=64, verbose_name='type'),
),
]