fixed styles

This commit is contained in:
daniel 2023-03-06 17:51:49 +01:00
parent 5ba9e0e9aa
commit 70d2223a46
6 changed files with 155 additions and 117 deletions

View File

@ -55,17 +55,19 @@ function get_wiz_class($str)
default: default:
// Main, show header. // Main, show header.
ui_print_page_header( ui_print_standard_header(
__('Discovery'), __('Discovery'),
'', '',
false, false,
'', '',
true, true,
'', [],
false, [
'', [
GENERIC_SIZE_TEXT, 'link' => '',
'' 'label' => __('Discovery'),
],
]
); );
return null; return null;
} }

View File

@ -454,22 +454,6 @@ if (empty($create) === false || empty($view) === false) {
$data[0] = html_print_textarea('form_description', 4, 50, $form_description, '', true, 'w100p'); $data[0] = html_print_textarea('form_description', 4, 50, $form_description, '', true, 'w100p');
$table->colspan['plugin_desc_inputs'][0] = 3; $table->colspan['plugin_desc_inputs'][0] = 3;
$table->data['plugin_desc_inputs'] = $data; $table->data['plugin_desc_inputs'] = $data;
/*
if (is_metaconsole() === true) {
$table->head[0] = __('General');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
html_print_table($table);
} else {
echo '<fieldset><legend>'.__('General').'</legend>';
html_print_table($table);
echo '</fieldset>';
}
html_print_table($table);
$table->data = [];
*/
// Command title. // Command title.
$commandTitleContent = []; $commandTitleContent = [];
@ -528,20 +512,6 @@ if (empty($create) === false || empty($view) === false) {
$data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true); $data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true);
$table->data['plugin_preview_inputs'] = $data; $table->data['plugin_preview_inputs'] = $data;
$table->colspan['plugin_preview_inputs'][0] = 2; $table->colspan['plugin_preview_inputs'][0] = 2;
/*
$table->width = '100%';
$table->class = 'databox filters';
if (is_metaconsole() === true) {
$table->head[0] = __('Command');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
html_print_table($table);
} else {
echo '<fieldset><legend>'.__('Command').'</legend>';
html_print_table($table);
echo '</fieldset>';
}
*/
// Parameters macros title. // Parameters macros title.
$macrosTitleContent = []; $macrosTitleContent = [];
@ -696,11 +666,27 @@ if (empty($create) === false || empty($view) === false) {
echo '<tr><td align="right">'; echo '<tr><td align="right">';
if ($create != '') { if ($create != '') {
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>"; $button = html_print_submit_button(
__('Create'),
'crtbutton',
false,
[ 'icon' => 'wand' ],
true
);
} else { } else {
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('Update')."'>"; $button = html_print_submit_button(
__('Update'),
'uptbutton',
false,
[ 'icon' => 'upd' ],
true
);
} }
html_print_action_buttons(
$button
);
echo '</form></table>'; echo '</form></table>';
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {

View File

@ -60,12 +60,23 @@ if (is_metaconsole() === true) {
return; return;
} }
} else { } else {
ui_print_page_header( ui_print_standard_header(
__('PLUGIN REGISTRATION'), __('PLUGIN REGISTRATION'),
'images/gm_servers.png', 'images/gm_servers.png',
false, false,
'', '',
true true,
[],
[
[
'link' => '',
'label' => __('Servers'),
],
[
'link' => '',
'label' => __('Register plugin'),
],
]
); );
$management_allowed = is_management_allowed(); $management_allowed = is_management_allowed();

View File

@ -603,14 +603,14 @@ class ConfigPEN extends HTML
], ],
]; ];
$this->tableId = 'keystore'; $tableId = 'keystore';
// Load datatables user interface. // Load datatables user interface.
$output .= ui_print_datatable( $output .= ui_print_datatable(
[ [
'id' => $this->tableId, 'id' => $tableId,
'return' => true, 'return' => true,
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $column_names, 'column_names' => $column_names,
'ajax_url' => $this->ajaxController, 'ajax_url' => $this->ajaxController,
@ -621,6 +621,7 @@ class ConfigPEN extends HTML
'direction' => 'asc', 'direction' => 'asc',
], ],
'search_button_class' => 'sub filter float-right', 'search_button_class' => 'sub filter float-right',
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
'form' => [ 'form' => [
'inputs' => [ 'inputs' => [
[ [
@ -643,15 +644,18 @@ class ConfigPEN extends HTML
$output .= '<div id="msg" class="invisible"></div>'; $output .= '<div id="msg" class="invisible"></div>';
$output .= '<div id="aux" class="invisible"></div>'; $output .= '<div id="aux" class="invisible"></div>';
// Create button. $output .= html_print_action_buttons(
$output .= parent::printInput( parent::printInput(
[ [
'type' => 'submit', 'type' => 'submit',
'name' => 'create', 'name' => 'create',
'label' => __('Register manufacturer'), 'label' => __('Register manufacturer'),
'attributes' => 'class="sub next"', 'attributes' => ['icon' => 'next'],
'return' => true, 'return' => true,
] ]
),
['type' => 'form_action'],
true
); );
ob_start(); ob_start();

View File

@ -398,7 +398,7 @@ class HTML
* *
* @return void * @return void
*/ */
public static function printGoBackButton($url=null) public static function printGoBackButton($url=null, $return=false)
{ {
if (isset($url) === false) { if (isset($url) === false) {
$url = ui_get_full_url( $url = ui_get_full_url(
@ -428,7 +428,11 @@ class HTML
], ],
]; ];
self::printForm($form); if ($return === true) {
return self::printForm($form, $return);
}
self::printForm($form, $return);
} }

View File

@ -836,7 +836,15 @@ class ModuleTemplates extends HTML
] ]
); );
ui_pagination($countModuleTemplates, $this->baseUrl, $this->offset); $tablePagination = ui_pagination(
$countModuleTemplates,
$this->baseUrl,
$this->offset,
0,
true,
'offset',
false
);
// Create the table with Module Block list. // Create the table with Module Block list.
$table = new StdClasS(); $table = new StdClasS();
$table->class = 'databox data '; $table->class = 'databox data ';
@ -874,13 +882,13 @@ class ModuleTemplates extends HTML
$table->cellclass[][3] = 'table_action_buttons'; $table->cellclass[][3] = 'table_action_buttons';
$data[3] = html_print_input_image( $data[3] = html_print_input_image(
'delete_profile', 'delete_profile',
'images/cross.png', 'images/delete.svg',
$row['id_np'], $row['id_np'],
'', 'width:40px',
true, true,
[ [
'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;', 'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
); );
$data[3] .= html_print_input_image( $data[3] .= html_print_input_image(
@ -891,23 +899,40 @@ class ModuleTemplates extends HTML
true, true,
[ [
'title' => 'Export tdaso CSV', 'title' => 'Export tdaso CSV',
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
); );
$data[3] = '<a href="'.$this->baseUrl.'&action=delete&id_np='.$row['id_np'].'" onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>'; $data[3] = '<a href="'.$this->baseUrl.'&action=delete&id_np='.$row['id_np'].'" onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
$data[3] .= '<a href="'.$this->baseUrl.'&action=export&id_np='.$row['id_np'].'" onclick="blockResubmit($(this))">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV'), 'class' => 'invert_filter']).'</a>'; $data[3] .= html_print_image(
'images/delete.svg',
true,
[
'title' => __('Delete'),
'class' => 'invert_filter main_menu_icon',
]
);
$data[3] .= '</a>';
$data[3] .= '<a href="'.$this->baseUrl.'&action=export&id_np='.$row['id_np'].'" onclick="blockResubmit($(this))">';
$data[3] .= html_print_image(
'images/csv.png',
true,
[
'title' => __('Export to CSV'),
'class' => 'invert_filter main_menu_icon',
]
);
$data[3] .= '</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
html_print_table($table); html_print_table($table);
$output = '<div class="float-right">';
$form = [ $form = [
'method' => 'POST', 'method' => 'POST',
'action' => $this->baseUrl, 'action' => $this->baseUrl,
'id' => 'main_management_form', 'id' => 'main_management_form',
'class' => 'flex_center',
]; ];
$inputs[] = [ $inputs[] = [
@ -934,22 +959,29 @@ class ModuleTemplates extends HTML
'label' => __('Delete selected'), 'label' => __('Delete selected'),
'name' => 'erase', 'name' => 'erase',
'type' => 'button', 'type' => 'button',
'attributes' => ['icon' => 'cancel'], 'attributes' => [
'icon' => 'delete',
'mode' => 'secondary',
],
'return' => true, 'return' => true,
], ],
]; ];
$output .= $this->printForm( html_print_action_buttons(
$this->printForm(
[
'form' => $form,
'inputs' => $inputs,
],
true
),
[ [
'form' => $form, 'type' => 'data_table',
'inputs' => $inputs, 'class' => 'fixed_action_buttons',
], 'right_content' => $tablePagination,
true ]
); );
$output .= '</div>';
echo $output;
} }
@ -1056,42 +1088,38 @@ class ModuleTemplates extends HTML
], ],
]; ];
$availableButtons = []; // Required for PEN field.
ui_require_jquery_file('tag-editor');
ui_require_css_file('jquery.tag-editor');
$availableButtons[] = [ $buttons = $this->printInput(
'arguments' => [ [
'name' => 'action_button', 'name' => 'action_button',
'label' => $formButtonLabel, 'label' => $formButtonLabel,
'type' => 'submit', 'type' => 'submit',
'attributes' => [ 'icon' => $formButtonClass ], 'attributes' => [
'icon' => $formButtonClass,
'form' => 'module_template_form',
],
'return' => true, 'return' => true,
], 'width' => 'initial',
]; ]
);
if ($createNewTemplate === false) { if ($createNewTemplate === false) {
$availableButtons[] = [ $buttons .= $this->printInput(
'arguments' => [ [
'name' => 'add_components_button', 'name' => 'add_components_button',
'label' => __('Add components'), 'label' => __('Add components'),
'type' => 'button', 'type' => 'button',
'attributes' => [ 'icon' => 'cog' ], 'attributes' => [ 'icon' => 'cog' ],
'script' => 'showAddComponent();', 'script' => 'showAddComponent();',
'return' => true, 'return' => true,
], 'width' => 'initial',
]; ]
);
} }
$inputs[] = [
'class' => 'action_button_list',
'direct' => false,
'wrapper' => 'div',
'block_content' => $availableButtons,
];
// Required for PEN field.
ui_require_jquery_file('tag-editor');
ui_require_css_file('jquery.tag-editor');
if ($createNewTemplate === false) { if ($createNewTemplate === false) {
// Get the data. // Get the data.
$sql = sprintf( $sql = sprintf(
@ -1142,13 +1170,13 @@ class ModuleTemplates extends HTML
$blockTitle .= '<div class="white_table_header_checkbox">'; $blockTitle .= '<div class="white_table_header_checkbox">';
$blockTitle .= html_print_input_image( $blockTitle .= html_print_input_image(
'del_block_'.$id_group.'_', 'del_block_'.$id_group.'_',
'images/cross.png', 'images/delete.svg',
1, 1,
false, 'width: 40px',
true, true,
[ [
'title' => __('Delete this block'), 'title' => __('Delete this block'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
'onclick' => 'if(confirm(\''.__('Do you want delete this block?').'\')){deleteModuleTemplate(\'block\',\''.$blockComponentList.'\')};return false;', 'onclick' => 'if(confirm(\''.__('Do you want delete this block?').'\')){deleteModuleTemplate(\'block\',\''.$blockComponentList.'\')};return false;',
] ]
); );
@ -1196,7 +1224,7 @@ class ModuleTemplates extends HTML
true, true,
[ [
'title' => __('Network module'), 'title' => __('Network module'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
); );
break; break;
@ -1207,7 +1235,7 @@ class ModuleTemplates extends HTML
true, true,
[ [
'title' => __('WMI module'), 'title' => __('WMI module'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
); );
break; break;
@ -1218,7 +1246,7 @@ class ModuleTemplates extends HTML
true, true,
[ [
'title' => __('Plug-in module'), 'title' => __('Plug-in module'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
); );
break; break;
@ -1239,13 +1267,13 @@ class ModuleTemplates extends HTML
$data[3] = mb_strimwidth(io_safe_output($module['description']), 0, 150, '...'); $data[3] = mb_strimwidth(io_safe_output($module['description']), 0, 150, '...');
$data[4] = html_print_input_image( $data[4] = html_print_input_image(
'del_module_'.$module['component_id'].'_', 'del_module_'.$module['component_id'].'_',
'images/cross.png', 'images/delete.svg',
1, 1,
'', 'width:40px;',
true, true,
[ [
'title' => __('Delete this module'), 'title' => __('Delete this module'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
'onclick' => 'if(confirm(\''.__('Do you want delete this module?').'\')){deleteModuleTemplate(\'module\','.$module['component_id'].')};return false;', 'onclick' => 'if(confirm(\''.__('Do you want delete this module?').'\')){deleteModuleTemplate(\'module\','.$module['component_id'].')};return false;',
] ]
); );
@ -1277,7 +1305,9 @@ class ModuleTemplates extends HTML
echo '<div class="invisible" id="msg"></div>'; echo '<div class="invisible" id="msg"></div>';
} }
$this->printGoBackButton($this->baseUrl); $buttons .= $this->printGoBackButton($this->baseUrl, true);
html_print_action_buttons($buttons);
} }
@ -1459,30 +1489,31 @@ class ModuleTemplates extends HTML
var listValidPens = $("#hidden-valid-pen").val(); var listValidPens = $("#hidden-valid-pen").val();
try { try {
listValidPens = listValidPens.split(','); if(listValidPens != undefined) {
listValidPens = listValidPens.split(',');
//Adding tagEditor for PEN management.
$("#text-pen").tagEditor({
beforeTagSave: function(field, editor, tags, tag, val) {
if (listValidPens.indexOf(val) == -1) {
return false;
}
},
autocomplete: {
source: <?php echo json_encode($this->penRefs); ?>
}
});
}
} catch (e) { } catch (e) {
console.error(e); console.error(e);
return; return;
} }
//Adding tagEditor for PEN management.
$("#text-pen").tagEditor({
beforeTagSave: function(field, editor, tags, tag, val) {
if (listValidPens.indexOf(val) == -1) {
return false;
}
},
autocomplete: {
source: <?php echo json_encode($this->penRefs); ?>
}
});
//Values for add. //Values for add.
$("#add-modules-components").change(function() { $("#add-modules-components").change(function() {
var valores = $("#add-modules-components") var valores = $("#add-modules-components")
.val() .val()
.join(","); .join(",");
//$("#hidden-add-modules-components-values").val(valores);
}); });
}); });