Fixes in layout

This commit is contained in:
absurdo 2023-01-30 20:59:31 +01:00
parent 4914a1f0e7
commit 3a665b3d81
4 changed files with 23 additions and 28 deletions

View file

@ -40,7 +40,12 @@ class Task(WebModel):
self.register(corefields.CharField('ssh_key_pub'))
self.register(corefields.CharField('ssh_key_priv'))
self.register(corefields.CharField('ssh_key_password'))
self.register(DictField('data', corefields.CharField('')))
data_field=corefields.CharField('')
data_field.escape=True
self.register(DictField('data', data_field))
self.register(corefields.IntegerField('num_servers'))
self.register(corefields.BooleanField('is_parent'))
self.register(ParentField('parent_id', size=11, required=False, field_name='name_task'))

View file

@ -17,7 +17,7 @@ if linux_distro=='arch':
if call("sudo pacman -S --noconfirm git", shell=True) > 0:
print('Error, cannot install git...')
exit(1)
elif linux_distro=='debian':
elif linux_distro=='debian' or linux_distro=='ubuntu':
if call('sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y git', shell=True) > 0:
print('Error, cannot install git...')

View file

@ -10,7 +10,7 @@ sleep 1
DISTRO=`( lsb_release -ds || cat /etc/*release || uname -om ) 2>/dev/null | head -n1`
if [[ $DISTRO =~ ^Debian ]]; then
if [[ $DISTRO =~ ^Debian ]] || [[ $DISTRO =~ ^Ubuntu ]]; then
sudo apt-get update
sudo apt-get -y install python3 python3-pip
@ -29,6 +29,12 @@ elif [[ $DISTRO =~ ^NAME=\"Rocky ]]; then
sudo dnf upgrade -y
elif [[ $DISTRO =~ ^Fedora ]]; then
sudo dnf upgrade -y
sudo dnf install -y python3 python3-pip
else
echo "Sorry, Linux distro not supported"

View file

@ -7,12 +7,12 @@
</select>
</p>
<%def name="show_tasks(task_folder, separator)">
<%
form_set=""
form_set=[]
%>
<%def name="show_tasks(task_folder, separator)">
<!--<ul class="superul">-->
% if task_folder in select_task:
@ -24,46 +24,30 @@ form_set=""
%if script[1][2]==1:
<option value="${script[1][1]}">
${script[1][0].split(',')[0].strip()}
<%form_set+='<input type="hidden" name="'+script[1][1]+'" id="'+script[1][1].replace('/', '_')+'_form" value="'+str(script[1][3])+'">\n'%>
<%
form_set.append('<input type="hidden" name="'+script[1][1]+'" id="'+script[1][1].replace('/', '_')+'_form" value="'+str(script[1][3])+'">')
%>
</option>
% endif
% endfor
% endif
<!--<li>
<a href="#" class="category_server">${value[0][0]}</a>
% if len(value)>=2:
<ul style="display:none;" class="sonul">
% for script in enumerate(value, 1):
%if script[1][2]==1:
<li>
${script[1][0].split(',')[0].strip()}<input type="radio" name="task" value="${script[1][1]}"/>
<i class="fa fa-question-circle tooltip" data-tooltip-content="#tooltip_task_${script[1][1]}_content" style="cursor:pointer;"></i> \
<div class="tooltip_templates" style="display:none;"><div id="tooltip_task_${script[1][1]}_content">ayuda</div></div>
</li>
% endif
% endfor
</ul>
% endif
</li>-->
</optgroup>
% if task in select_task:
${show_tasks(task, separator+'--')}
%endif
</optgroup>
% endfor
% endif
<!--</ul>-->
${form_set|n}
</%def>
<p>
<select name="task" id="task">
<option value="">Select a task...</option>
${show_tasks('tasks', '')}
</select>
${"\n".join(form_set)|n}
</p>
<input type="button" name="select_all" class="select_all" value="${lang('pastafari2', 'select_all_servers', 'Select all servers')}" />
<input type="button" name="deselect_all" class="deselect_all" value="${lang('pastafari2', 'deselect_all_servers', 'Deselect all servers')}" />