28 lines
940 B
Python
28 lines
940 B
Python
from django import forms
|
|
from .models import RemoteHost, BatchScript, CommandTask
|
|
|
|
class RemoteHostForm(forms.ModelForm):
|
|
class Meta:
|
|
model = RemoteHost
|
|
fields = ['name','hostname','port','username','auth_method','key_path','strict_host_key_checking','notes']
|
|
widgets = {
|
|
'notes': forms.Textarea(attrs={'rows':3}),
|
|
}
|
|
|
|
class BatchScriptForm(forms.ModelForm):
|
|
class Meta:
|
|
model = BatchScript
|
|
fields = ['name','description','script']
|
|
widgets = {
|
|
'script': forms.Textarea(attrs={'rows':14, 'spellcheck':'false'}),
|
|
}
|
|
|
|
class CommandTaskForm(forms.ModelForm):
|
|
class Meta:
|
|
model = CommandTask
|
|
fields = ['name','label','command','description']
|
|
widgets = {
|
|
'command': forms.Textarea(attrs={'rows':6,'spellcheck':'false','class':'font-mono'}),
|
|
'description': forms.Textarea(attrs={'rows':2}),
|
|
}
|