1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Instance create with template is revisited. Add password, console, listener address options. add wait dialog. change to console password optional. nwfilter become option.

This commit is contained in:
catborise 2018-09-14 16:23:25 +03:00
parent f477dd6a11
commit b58277c621
4 changed files with 61 additions and 14 deletions

View file

@ -2,6 +2,7 @@ import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from create.models import Flavor
from webvirtcloud.settings import QEMU_CONSOLE_LISTEN_ADDRESSES
class FlavorAddForm(forms.Form):
@ -45,6 +46,9 @@ class NewVMForm(forms.Form):
meta_prealloc = forms.BooleanField(required=False)
virtio = forms.BooleanField(required=False)
mac = forms.CharField(required=False)
console_pass = forms.CharField(required=False,empty_value="", widget=forms.PasswordInput())
video = forms.CharField(error_messages={'required': _('Please select a graphic display')})
listener_addr = forms.ChoiceField(required=True, widget=forms.RadioSelect, choices=QEMU_CONSOLE_LISTEN_ADDRESSES)
def clean_name(self):
name = self.cleaned_data['name']
@ -54,3 +58,4 @@ class NewVMForm(forms.Form):
elif len(name) > 20:
raise forms.ValidationError(_('The name of the virtual machine must not exceed 20 characters'))
return name