mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
Charts can now be enabled / deactivated by one click in Chartsadmin
This commit is contained in:
parent
d0af267fbb
commit
a54591535c
@ -62,6 +62,13 @@ if ( !isset($_SESSION['SESSION_ISREADONLY']) || $_SESSION['SESSION_ISREADONLY']
|
||||
$_GET['op'] == "add" ||
|
||||
$_GET['op'] == "delete"
|
||||
)
|
||||
||
|
||||
( isset($_GET['miniop']) &&
|
||||
(
|
||||
$_GET['miniop'] == "setenabled"
|
||||
)
|
||||
)
|
||||
|
||||
)
|
||||
)
|
||||
DieWithFriendlyErrorMsg( $content['LN_ADMIN_ERROR_READONLY'] );
|
||||
@ -77,6 +84,47 @@ else
|
||||
$content['READONLY_ISUSERONLY'] = "";
|
||||
// ---
|
||||
|
||||
if ( isset($_GET['miniop']) )
|
||||
{
|
||||
if ( isset($_GET['id']) && isset($_GET['newval']) )
|
||||
{
|
||||
if ( $_GET['miniop'] == "setenabled" )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['CHARTID'] = intval(DB_RemoveBadChars($_GET['id']));
|
||||
$iNewVal = intval(DB_RemoveBadChars($_GET['newval']));
|
||||
|
||||
// Perform SQL Query!
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_CHARTS .
|
||||
" WHERE ID = " . $content['CHARTID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$mychart = DB_GetSingleRow($result, true);
|
||||
if ( isset($mychart['DisplayName']) )
|
||||
{
|
||||
// Update enabled setting!
|
||||
$result = DB_Query("UPDATE " . DB_CHARTS . " SET
|
||||
chart_enabled = $iNewVal
|
||||
WHERE ID = " . $content['CHARTID']);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Reload Charts from DB
|
||||
LoadChartsFromDatabase();
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_CHARTS_ERROR_CHARTIDNOTFOUND'], $content['CHARTID'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_CHARTS_ERROR_SETTINGFLAG'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
@ -439,9 +487,17 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
|
||||
// --- Set enabled or disabled state
|
||||
if ( $myChart['chart_enabled'] == 1 )
|
||||
{
|
||||
$myChart['ChartEnabledImage'] = $content["MENU_SELECTION_ENABLED"];
|
||||
$myChart['set_enabled'] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$myChart['ChartEnabledImage'] = $content["MENU_SELECTION_DISABLED"];
|
||||
$myChart['set_enabled'] = 1;
|
||||
}
|
||||
|
||||
|
||||
// ---
|
||||
|
||||
// --- Set Chart default Filterstring
|
||||
|
@ -66,7 +66,7 @@ $LANG_EN = "en"; // Used for fallback
|
||||
$LANG = "en"; // Default language
|
||||
|
||||
// Default Template vars
|
||||
$content['BUILDNUMBER'] = "3.0.5";
|
||||
$content['BUILDNUMBER'] = "3.0.6";
|
||||
$content['UPDATEURL'] = "http://loganalyzer.adiscon.com/files/version.txt";
|
||||
$content['TITLE'] = "Adiscon LogAnalyzer :: Release " . $content['BUILDNUMBER']; // Default page title
|
||||
$content['BASEPATH'] = $gl_root_path;
|
||||
|
@ -315,6 +315,8 @@ $content['LN_CHARTS_ERROR_DELCHART'] = "Löschen des Chart mit der id '%1' f
|
||||
$content['LN_CHARTS_ERROR_HASBEENDEL'] = "Der Chart '%1' wurde erfolgreich gelöscht!";
|
||||
$content['LN_CHARTS_FILTERSTRING'] = "Custom Filter";
|
||||
$content['LN_CHARTS_FILTERSTRING_HELP'] = "Use the same syntax as in the search field. For example if you want to generate a chart for 'server1', use this filter: source:=server1";
|
||||
$content['LN_CHARTS_ERROR_CHARTIDNOTFOUND'] = "Error, ChartID with ID '%1' , was not found";
|
||||
$content['LN_CHARTS_ERROR_SETTINGFLAG'] = "Error setting flag, invalid ChartID or operation.";
|
||||
|
||||
// Fields Options
|
||||
$content['LN_FIELDS_CENTER'] = "Feld Options";
|
||||
|
@ -315,7 +315,6 @@ $content['LN_CHARTS_NAME'] = "Chart Name";
|
||||
$content['LN_CHARTS_ENABLED'] = "Chart enabled";
|
||||
$content['LN_CHARTS_ENABLEDONLY'] = "Enabled";
|
||||
$content['LN_CHARTS_ERROR_INVALIDORNOTFOUNDID'] = "The Chart-ID is invalid or could not be found.";
|
||||
$content['LN_CHARTS_ERROR_IDNOTFOUND'] = "The Chart-ID could not be found in the database.";
|
||||
$content['LN_CHARTS_WARNDELETESEARCH'] = "Are you sure that you want to delete the Chart '%1'? This cannot be undone!";
|
||||
$content['LN_CHARTS_ERROR_DELCHART'] = "Deleting of the Chart with id '%1' failed!";
|
||||
$content['LN_CHARTS_ERROR_HASBEENDEL'] = "The Chart '%1' has been successfully deleted!";
|
||||
@ -328,7 +327,8 @@ $content['LN_CHARTS_ASSIGNTO'] = "Assigned To";
|
||||
$content['LN_CHARTS_PREVIEW'] = "Preview Chart in a new Window";
|
||||
$content['LN_CHARTS_FILTERSTRING'] = "Custom Filter";
|
||||
$content['LN_CHARTS_FILTERSTRING_HELP'] = "Use the same syntax as in the search field. For example if you want to generate a chart for 'server1', use this filter: source:=server1";
|
||||
|
||||
$content['LN_CHARTS_ERROR_CHARTIDNOTFOUND'] = "Error, ChartID with ID '%1' , was not found";
|
||||
$content['LN_CHARTS_ERROR_SETTINGFLAG'] = "Error setting flag, invalid ChartID or operation.";
|
||||
|
||||
// Fields Options
|
||||
$content['LN_FIELDS_CENTER'] = "Fields Options";
|
||||
|
@ -326,6 +326,8 @@ $content['LN_CHARTS_ASSIGNTO'] = "Assigned To";
|
||||
$content['LN_CHARTS_PREVIEW'] = "Preview Chart in a new Window";
|
||||
$content['LN_CHARTS_FILTERSTRING'] = "Custom Filter";
|
||||
$content['LN_CHARTS_FILTERSTRING_HELP'] = "Use the same syntax as in the search field. For example if you want to generate a chart for 'server1', use this filter: source:=server1";
|
||||
$content['LN_CHARTS_ERROR_CHARTIDNOTFOUND'] = "Error, ChartID with ID '%1' , was not found";
|
||||
$content['LN_CHARTS_ERROR_SETTINGFLAG'] = "Error setting flag, invalid ChartID or operation.";
|
||||
|
||||
// Fields Options
|
||||
$content['LN_FIELDS_CENTER'] = "Fields Options";
|
||||
|
@ -315,6 +315,8 @@ $content['LN_CHARTS_ERROR_DELCHART'] = "Deleting of the Chart with id '%1' faile
|
||||
$content['LN_CHARTS_ERROR_HASBEENDEL'] = "The Chart '%1' has been successfully deleted!";
|
||||
$content['LN_CHARTS_FILTERSTRING'] = "Custom Filter";
|
||||
$content['LN_CHARTS_FILTERSTRING_HELP'] = "Use the same syntax as in the search field. For example if you want to generate a chart for 'server1', use this filter: source:=server1";
|
||||
$content['LN_CHARTS_ERROR_CHARTIDNOTFOUND'] = "Error, ChartID with ID '%1' , was not found";
|
||||
$content['LN_CHARTS_ERROR_SETTINGFLAG'] = "Error setting flag, invalid ChartID or operation.";
|
||||
|
||||
// Fields Options
|
||||
$content['LN_FIELDS_CENTER'] = "Fields Options";
|
||||
|
@ -42,7 +42,7 @@
|
||||
<b>{DisplayName}</b>
|
||||
<!-- ENDIF ActionsAllowed!="true" -->
|
||||
</td>
|
||||
<td align="center" class="{cssclass}"><img src="{ChartEnabledImage}" width="16" align="center"></td>
|
||||
<td align="center" class="{cssclass}"><a href="{BASEPATH}admin/charts.php?miniop=setenabled&id={ID}&newval={set_enabled}"><img src="{ChartEnabledImage}" width="16" align="center"></a></td>
|
||||
<td align="left" class="{cssclass}"><img src="{ChartTypeImage}" width="16" align="left"> <b>{ChartTypeText}</b></td>
|
||||
<td align="left" class="{cssclass}"><img src="{ChartAssignedToImage}" width="16" align="left"> <b>{ChartAssignedToText}</b></td>
|
||||
<td align="center" class="{cssclass}">
|
||||
|
Loading…
x
Reference in New Issue
Block a user