Skip to content
Snippets Groups Projects
Commit 3b25517c authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '5997-no-autocomplete' into 'master'

5997 no autocomplete

See merge request !45
parents 40957bb9 084abe7c
No related branches found
No related tags found
1 merge request!455997 no autocomplete
Pipeline #1470 passed
......@@ -269,7 +269,7 @@ class formgen {
$this->_checkReqiredKeys($elementData, array("name"));
$sFormElement.=' <input type="'.$elementData["type"].'" id="' . $sId . '" class="form-control col-sm-10" ';
$aAllowedHtmlAttributes["text"] = explode(",", "");
$sFormElement.=$this->_addHtmlAtrributes(explode(",", "$sDefaultAttributes,name,autofocus,list,disabled,onkeyup,onkeydown,onchange,pattern,placeholder,required,size,value"), $elementData);
$sFormElement.=$this->_addHtmlAtrributes(explode(",", "$sDefaultAttributes,name,autocomplete,autofocus,list,disabled,onkeyup,onkeydown,onchange,pattern,placeholder,required,size,value"), $elementData);
// $sFormElement.=$this->_addHtmlAtrributes(array("name", "value", "size", "placeholder", "required"), $elementData);
// IE: Return abfangen lassen
// $sFormElement.=' onkeypress="return checkKey(event);"';
......
......@@ -6,6 +6,22 @@
* Debug logging during a client request.
* So you can measure any action find bottlenecks in your code.
*
<<<<<<< public_html/deployment/classes/logger.class.php
* Source: https://github.com/axelhahn/ahlogger
*
* USAGE:
* (1) Trigger a message with add() to add a marker
* (2) The render() method lists all items in a table with time since start
* and the delta to the last message.
*
* @author www.axel-hahn.de
*/
class logger {
protected $aMessages = [];
protected $bShowDebug = false;
protected $_iMemStart = false;
=======
* Licence: GNU GPL 3.0
* Source: https://github.com/axelhahn/ahlogger
* Docs: https://www.axel-hahn.de/docs/ahlogger/
......@@ -53,6 +69,7 @@ class logger {
// ----------------------------------------------------------------------
// CONSTRUCTOR
// ----------------------------------------------------------------------
>>>>>>> public_html/deployment/classes/logger.class.php
/**
* constuctor
......@@ -67,10 +84,13 @@ class logger {
return true;
}
<<<<<<< public_html/deployment/classes/logger.class.php
=======
// ----------------------------------------------------------------------
// PUBLIC METHODS
// ----------------------------------------------------------------------
>>>>>>> public_html/deployment/classes/logger.class.php
/**
* add a logging message
* @param type $sMessage
......@@ -115,6 +135,8 @@ class logger {
}
}
<<<<<<< public_html/deployment/classes/logger.class.php
=======
/**
* helper function: prepare array of added massages before output
* - detect warnings and errors
......@@ -125,6 +147,7 @@ class logger {
*
* @return array
*/
>>>>>>> public_html/deployment/classes/logger.class.php
protected function _prepareRendering(){
$iMem=memory_get_usage();
$this->add('<hr>');
......@@ -165,6 +188,18 @@ class logger {
if ($iDelta > $iMaxtime) {
$iMaxtime = $iDelta;
$sMaxRowId = $sTrId;
<<<<<<< public_html/deployment/classes/logger.class.php
}
$iMaxmem=max($aLogentry["memory"], $iMaxmem);
if (($iDelta > 1) || $aLogentry["level"] == "warning") {
$aReturn['warnings'].='<a href="#' . $sTrId . '" title="' . sprintf("%01.4f", $iDelta) . ' s">' . $iCounter . '</a>&nbsp;';
}
if ($aLogentry["level"] == "error") {
$aReturn['errors'].='<a href="#' . $sTrId . '" title="' . sprintf("%01.4f", $iDelta) . ' s">' . $iCounter . '</a>&nbsp;';
}
=======
}
$iMaxmem=max($aLogentry["memory"], $iMaxmem);
......@@ -175,11 +210,96 @@ class logger {
if ($aLogentry["level"] == "error") {
$aReturn['errors'].='<a href="#' . $sTrId . '" title="' . sprintf("%01.4f", $iDelta) . ' s">' . $iCounter . '</a>&nbsp;';
}
>>>>>>> public_html/deployment/classes/logger.class.php
$aReturn['entries'][]=[
'time'=>$aLogentry["time"],
'level'=>$aLogentry["level"],
'message'=>$aLogentry["message"],
'memory'=>sprintf("%01.2f", $aLogentry["memory"]/1024/1024), // MB
<<<<<<< public_html/deployment/classes/logger.class.php
'trid'=>$sTrId,
'trclass'=>$aLogentry["level"],
'counter'=>$iCounter,
'timer'=>sprintf("%01.3f", $aLogentry["time"] - $sStarttime),
'delta'=>sprintf("%01.0f", $iDelta*1000),
];
$iLasttime = $aLogentry["time"];
}
$aReturn['level']=($bHasWarning
? ($bHasError ? 'error' : 'warning')
: ''
);
$aReturn['maxrowid']=$sMaxRowId;
$aReturn['maxtime']=sprintf("%01.3f", $iMaxtime);
$aReturn['maxmem']=sprintf("%01.2f", $iMaxmem/1024/1024);
$aReturn['totaltime']=sprintf("%01.3f", $aLogentry['time']-$aReturn['entries'][0]['time']);
return $aReturn;
}
/**
* get html code for a progressbar with divs
* @param {int|float} $iVal value between 0..max value
* @param {int|float} $iMax max value
* @return {string}
*/
protected function _getBar($iVal, $iMax){
$iWidth=$iVal/$iMax*100;
return '<div class="bar"><div class="progress" style="width: '.$iWidth.'%;">&nbsp;</div></div>';
}
/**
* render output of all logging messages
*/
public function render() {
if (!$this->bShowDebug){
return false;
}
$aData=$this->_prepareRendering();
/*
Array
(
[totaltime] => 0.006
[errors] =>
[warnings] => 3
[maxrowid] => debugTableRow3
[maxtime] => 0.005
[result] => Array
(
)
[entries] => Array
mit Elementen
Array
(
[time] => 1663959608.2566
[level] => info
[message] => Logger was initialized.
[memory] => 538056
[trid] => debugTableRow1
[trclass] => info
[trstyle] =>
[counter] => 1
[timer] => 0.000
[delta] => 0.000
)
*/
$sOut='';
// echo '<pre>'; print_r($aData); die();
foreach ($aData['entries'] as $aLogentry){
$sOut.='<tr class="'.$this->sCssPrefix.'-level-' . $aLogentry["level"] . ''.($aLogentry["trid"]==$aData["maxrowid"] ? ' '.$this->sCssPrefix.'-maxrow' : '').'" '
.'id="' . $aLogentry["trid"] . '">' .
'<td>' . $aLogentry["counter"] . '</td>' .
'<td>' . $aLogentry["level"] . '</td>' .
'<td>' . $aLogentry["timer"] . '</td>' .
'<td>' . $this->_getBar($aLogentry["delta"], $aData["maxtime"]*1000). $aLogentry["delta"] .' ms</td>' .
'<td>' . $this->_getBar($aLogentry["memory"], $aData["maxmem"]) . $aLogentry["memory"] .' MB'. '</td>' .
'<td>' . $aLogentry["message"] . '</td>' .
'</tr>';
}
=======
'trid'=>$sTrId,
'trclass'=>$aLogentry["level"],
......@@ -262,6 +382,7 @@ class logger {
'<td>' . $aLogentry["message"] . '</td>' .
'</tr>';
}
>>>>>>> public_html/deployment/classes/logger.class.php
if ($sOut){
$sOut = '
<style>
......
......@@ -3716,6 +3716,7 @@ class project extends base {
'validate' => 'isastring',
'size' => 100,
'placeholder' => '',
'autocomplete' => 'off',
),
'input' . $i++ => $aSelectSlack,
......
......@@ -266,7 +266,8 @@ class rollout_base implements iRolloutplugin{
// 'required' => 'required',
'validate' => 'isastring',
// 'size' => 25,
'placeholder' => $sMyPlaceholder
'placeholder' => $sMyPlaceholder,
'autocomplete' => 'off',
);
break;
case "select":
......@@ -300,7 +301,8 @@ class rollout_base implements iRolloutplugin{
// 'required' => 'required',
'validate' => 'isastring',
// 'size' => 25,
'placeholder' => $sMyPlaceholder
'placeholder' => $sMyPlaceholder,
'autocomplete' => 'off',
);
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment