mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-26 15:15:20 +00:00
Compare commits
4 commits
2ff0abf8c5
...
6c0cc3c274
Author | SHA1 | Date | |
---|---|---|---|
|
6c0cc3c274 | ||
|
bcf91ad7b7 | ||
|
2f24f77368 | ||
|
7e8c05fff9 |
5 changed files with 58 additions and 5 deletions
18
appsettings/migrations/0009_alter_appsettings_id.py
Normal file
18
appsettings/migrations/0009_alter_appsettings_id.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 4.2.5 on 2023-10-30 17:00
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('appsettings', '0008_auto_20220905_1459'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='appsettings',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
]
|
28
appsettings/migrations/0010_auto_20231030_1305.py
Normal file
28
appsettings/migrations/0010_auto_20231030_1305.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Generated by Django 4.2.5 on 2023-10-30 17:05
|
||||
|
||||
from django.db import migrations
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
def add_default_settings(apps, schema_editor):
|
||||
setting = apps.get_model("appsettings", "AppSettings")
|
||||
db_alias = schema_editor.connection.alias
|
||||
setting.objects.using(db_alias).bulk_create([
|
||||
setting(35, _("VM NIC Type"), "INSTANCE_NIC_DEFAULT_TYPE", "default", "default,e1000,e1000e,rt18139,virtio", _("Change instance default NIC type"))
|
||||
])
|
||||
|
||||
|
||||
def del_default_settings(apps, schema_editor):
|
||||
setting = apps.get_model("appsettings", "AppSettings")
|
||||
db_alias = schema_editor.connection.alias
|
||||
setting.objects.using(db_alias).filter(key="INSTANCE_NIC_DEFAULT_TYPE").delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('appsettings', '0009_alter_appsettings_id')
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_default_settings,del_default_settings)
|
||||
]
|
|
@ -200,7 +200,7 @@
|
|||
<div class="col-sm-7">
|
||||
<select class="form-select" name="net_model">
|
||||
{% for model in net_models_host %}
|
||||
<option value="{{ model }}" {% if model == 'default' %} selected {% endif %}>{{ model }}</option>
|
||||
<option value="{{ model }}" {% if model == default_nic_type %} selected {% endif %}>{{ model }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
@ -476,7 +476,7 @@
|
|||
<div class="col-sm-7">
|
||||
<select class="form-select" name="net_model">
|
||||
{% for model in net_models_host %}
|
||||
<option value="{{ model }}" {% if model == 'default' %} selected {% endif %}>{{ model }}</option>
|
||||
<option value="{{ model }}" {% if model == default_nic_type %} selected {% endif %}>{{ model }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
@ -728,7 +728,7 @@
|
|||
<div class="col-sm-7">
|
||||
<select class="form-select" name="net_model">
|
||||
{% for model in net_models_host %}
|
||||
<option value="{{ model }}" {% if model == 'default' %} selected {% endif %}>{{ model }}</option>
|
||||
<option value="{{ model }}" {% if model == default_nic_type %} selected {% endif %}>{{ model }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
@ -1692,6 +1692,7 @@ def create_instance(request, compute_id, arch, machine):
|
|||
networks = sorted(conn.get_networks())
|
||||
nwfilters = conn.get_nwfilters()
|
||||
net_models_host = conn.get_network_models()
|
||||
default_nic_type = app_settings.INSTANCE_NIC_DEFAULT_TYPE
|
||||
storages = sorted(conn.get_storages(only_actives=True))
|
||||
default_graphics = app_settings.QEMU_CONSOLE_DEFAULT_TYPE
|
||||
default_cdrom = app_settings.INSTANCE_CDROM_ADD
|
||||
|
|
|
@ -424,9 +424,15 @@ until [[ $setupfqdn == "yes" ]] || [[ $setupfqdn == "no" ]]; do
|
|||
|
||||
case $setupfqdn in
|
||||
[yY] | [yY][Ee][Ss] )
|
||||
echo -n " Q. What is the FQDN of your server? ($(hostname --fqdn)): "
|
||||
read -r fqdn
|
||||
fqdn=$(hostname --fqdn)
|
||||
echo -n " Q. What is the FQDN of your server? ($fqdn): "
|
||||
read -r fqdn_from_user
|
||||
setupfqdn="yes"
|
||||
|
||||
if [ ! -z $fqdn_from_user ]; then
|
||||
fqdn=$fqdn_from_user
|
||||
fi
|
||||
|
||||
echo " Setting to $fqdn"
|
||||
echo ""
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue