Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0


## [Unreleased]
### Added
- [GUI] Add help_text to forms' attributes


## [2.34.4] - 2025-12-17
Expand Down
5 changes: 3 additions & 2 deletions vulture_os/applications/backend/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from django.forms import CheckboxInput, ModelForm, NumberInput, Select, TextInput, Textarea, HiddenInput

# Django project imports
from gui.forms.form_utils import NoValidationField
from gui.forms.form_utils import NoValidationField, bootstrap_tooltips
from applications.backend.models import (Backend, Server, MODE_CHOICES, BALANCING_CHOICES, HEALTH_CHECK_TCP_EXPECT_CHOICES,
HEALTH_CHECK_EXPECT_CHOICES, HEALTH_CHECK_METHOD_CHOICES, HEALTH_CHECK_VERSION_CHOICES)
from system.pki.models import TLSProfile
Expand All @@ -38,7 +38,6 @@

# Logger configuration imports
import logging

logging.config.dictConfig(settings.LOG_SETTINGS)
logger = logging.getLogger('gui')

Expand Down Expand Up @@ -141,6 +140,7 @@
def __init__(self, *args, **kwargs):
""" Initialize form and special attributes """
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)
# Remove the blank input generated by django
for field_name in ['mode', 'balancing_mode', 'tcp_health_check_expect_match']:
self.fields[field_name].empty_label = None
Expand Down Expand Up @@ -179,7 +179,7 @@
def clean(self, *args, **kwargs):
cleaned_data = super().clean()

is_tcp_hc_enable = cleaned_data.get('enable_tcp_health_check')

Check failure on line 182 in vulture_os/applications/backend/form.py

View workflow job for this annotation

GitHub Actions / check

Ruff (F841)

vulture_os/applications/backend/form.py:182:9: F841 Local variable `is_tcp_hc_enable` is assigned to but never used
if cleaned_data.get('enable_tcp_keep_alive') and not cleaned_data.get('tcp_keep_alive_timeout'):
self.add_error('tcp_keep_alive_timeout', "Timeout field is required")

Expand Down Expand Up @@ -223,6 +223,7 @@
kwargs['auto_id'] = False
mode = kwargs.pop('mode', '')
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)
# Remove the blank input generated by django
self.fields['tls_profile'].empty_label = "Plain text"
self.fields['tls_profile'].required = False
Expand Down
1 change: 1 addition & 0 deletions vulture_os/applications/logfwd/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)

Check failure on line 79 in vulture_os/applications/logfwd/form.py

View workflow job for this annotation

GitHub Actions / check

Ruff (F821)

vulture_os/applications/logfwd/form.py:79:16: F821 Undefined name `bootstrap_tooltips`
for field_name in ['high_watermark', 'low_watermark', 'max_file_size', 'max_disk_space', 'spool_directory']:
self.fields[field_name].required = False

Expand Down
2 changes: 2 additions & 0 deletions vulture_os/applications/parser/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

# Django project imports
from applications.parser.models import Parser
from gui.forms.form_utils import bootstrap_tooltips

# Required exceptions imports

Expand Down Expand Up @@ -56,6 +57,7 @@ class Meta:
def __init__(self, *args, **kwargs):
""" Initialize form and special attributes """
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)
# Convert list field from model to text input comma separated
self.initial['tags'] = ','.join(self.initial.get('tags', []) or self.fields['tags'].initial)

Expand Down
4 changes: 2 additions & 2 deletions vulture_os/applications/reputation_ctx/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from django.forms import CheckboxInput, ModelForm, Select, TextInput, Textarea

# Django project imports
from gui.forms.form_utils import NoValidationField
from gui.forms.form_utils import NoValidationField, bootstrap_tooltips
from applications.reputation_ctx.models import (DBTYPE_CHOICES, HTTP_METHOD_CHOICES, HTTP_AUTH_TYPE_CHOICES,
ReputationContext)

Expand All @@ -37,7 +37,6 @@

# Logger configuration imports
import logging

logging.config.dictConfig(settings.LOG_SETTINGS)
logger = logging.getLogger('gui')

Expand Down Expand Up @@ -67,6 +66,7 @@ class Meta:
def __init__(self, *args, **kwargs):
""" Initialize form and special attributes """
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)
for field_name in ['auth_type', 'verify_cert', 'post_data', 'user', 'password', 'tags']:
self.fields[field_name].required = False
# Set readonly if internal reputation context
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/backend_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,13 @@ <h4><i class="icon fa fa-ban"></i> {% translate "Form errors" %} </h4>

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834',
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* All events to refresh (re-apply) after a table is modified */
Expand All @@ -496,7 +499,13 @@ <h4><i class="icon fa fa-ban"></i> {% translate "Form errors" %} </h4>
});

/* Re-initialize select2 objects */
$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Re-initialize Tag-Editor events */
/* Try to destroy old tag-editor elements */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,23 @@ <h4><i class="icon fa fa-ban"></i> Form errors </h4>

$(function() {

$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834'
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

$('#id_data_stream_mode').on('change', function(event) {
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/logfwd_LogOMFWD.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,23 @@ <h4><i class="icon fa fa-ban"></i> Form errors </h4>

$(function() {

$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834'
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

$('#id_enable_retry').on('change', function(e){
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/logfwd_LogOMFile.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,23 @@ <h1 class="panel-title"><i class="fa fa-sitemap">&nbsp;</i>{% translate "Local F

$(function() {

$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834'
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Show fields depending on chosen mode */
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/logfwd_LogOMHIREDIS.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,23 @@ <h4><i class="icon fa fa-ban"></i> Form errors </h4>

$(function() {

$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834'
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Show fields depending on chosen mode */
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/logfwd_LogOMKAFKA.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,23 @@ <h4><i class="icon fa fa-ban"></i> Form errors </h4>

$(function() {

$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834'
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

$("#id_confParam").tagsinput();
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/logfwd_LogOMMongoDB.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,23 @@ <h1 class="panel-title"><i class="fa fa-sitemap">&nbsp;</i>{% translate "MongoDB

$(function() {

$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834'
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Show fields depending on chosen mode */
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/logfwd_LogOMRELP.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,23 @@ <h4><i class="icon fa fa-ban"></i> Form errors </h4>

$(function() {

$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834'
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Show or hide registration fields depending on enable_registration */
Expand Down
13 changes: 11 additions & 2 deletions vulture_os/applications/templates/apps/parser_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ <h4><i class="icon fa fa-ban"></i> {% translate "Form errors" %} </h4>

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834',
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});


Expand Down Expand Up @@ -182,7 +185,13 @@ <h4><i class="icon fa fa-ban"></i> {% translate "Form errors" %} </h4>
$(this).parent().parent().remove();
});
/* Re-initialize select2 objects */
$('.select2').select2();
let selects = Array.prototype.slice.call(document.querySelectorAll('.select2'));
selects.forEach(function(html) {
$(html).select2();
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});

/* Re-initialize Tag-Editor events */
/* Try to destroy old tag-editor elements */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,13 @@ <h4 class="modal-title">{% translate "Download result" %}</h4>

/* Switchery mandatory code */
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
elems.forEach(function(html) {
var switchery = new Switchery(html, {
'color': '#FA9834',
});
if (html.attributes['data-original-title']) {
$(html.nextElementSibling).tooltip({title: html.attributes['data-original-title'].value, placement: "bottom"});
}
});


Expand Down
2 changes: 2 additions & 0 deletions vulture_os/authentication/auth_access_control/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

from authentication.auth_access_control.models import AuthAccessControl
from authentication.auth_access_control.models import OPERATOR_CHOICES
from gui.forms.form_utils import bootstrap_tooltips
from django.conf import settings
from django import forms
import logging
Expand All @@ -45,6 +46,7 @@ class Meta:

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)
self.fields['rules'].required = False

def clean(self):
Expand Down
2 changes: 2 additions & 0 deletions vulture_os/authentication/kerberos/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

# Django project imports
from authentication.kerberos.models import KerberosRepository
from gui.forms.form_utils import bootstrap_tooltips
from toolkit.auth.kerberos_client import test_keytab

# Extern modules imports
Expand Down Expand Up @@ -59,6 +60,7 @@ class Meta:

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)

def clean_keytab(self):
""" Test keytab """
Expand Down
2 changes: 2 additions & 0 deletions vulture_os/authentication/ldap/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# Django project imports
from authentication.ldap.models import (LDAPRepository, LDAPCustomAttributeMapping,
LDAP_ENC_SCHEMES_CHOICES, LDAP_PROTO_CHOICES, LDAP_SCOPES_CHOICES)
from gui.forms.form_utils import bootstrap_tooltips

# Extern modules imports
from re import match as re_match
Expand Down Expand Up @@ -82,6 +83,7 @@

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self = bootstrap_tooltips(self)
# Remove the blank input generated by django
for field_name in ['protocol', 'encryption_scheme', 'user_scope', 'group_scope']:
self.fields[field_name].empty_label = None
Expand Down Expand Up @@ -171,7 +173,7 @@
if user_objectclasses:
try:
user_objectclasses = set(json_loads(user_objectclasses.replace("'", '"')))
except:

Check failure on line 176 in vulture_os/authentication/ldap/form.py

View workflow job for this annotation

GitHub Actions / check

Ruff (E722)

vulture_os/authentication/ldap/form.py:176:13: E722 Do not use bare `except`
logger.debug(f"LDAPRepositoryForm::clean_user_objectclasses: '{user_objectclasses}' "
"doesn't look like a valid json, spliting values instead")
user_objectclasses = set([i.strip() for i in user_objectclasses.split(',')])
Expand All @@ -189,7 +191,7 @@
if group_objectclasses:
try:
group_objectclasses = set(json_loads(group_objectclasses.replace("'", '"')))
except:

Check failure on line 194 in vulture_os/authentication/ldap/form.py

View workflow job for this annotation

GitHub Actions / check

Ruff (E722)

vulture_os/authentication/ldap/form.py:194:13: E722 Do not use bare `except`
logger.debug(f"LDAPRepositoryForm::clean_group_objectclasses: '{group_objectclasses}' "
"doesn't look like a valid json, spliting values instead")
group_objectclasses = set([i.strip() for i in group_objectclasses.split(',')])
Expand Down
Loading