From bbeb74a2a5b7de81d400f0ba0d08ef59426c15fa Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Wed, 31 Mar 2021 19:14:01 +0200 Subject: [PATCH] add settings page #9 --- source/cfml/plugins/settings.cfm | 117 +++++++++++++++++++++++++++++++ source/cfml/plugins/toolbar.cfm | 2 +- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 source/cfml/plugins/settings.cfm diff --git a/source/cfml/plugins/settings.cfm b/source/cfml/plugins/settings.cfm new file mode 100644 index 0000000..23fc126 --- /dev/null +++ b/source/cfml/plugins/settings.cfm @@ -0,0 +1,117 @@ + + param name="arguments.req.maxrows" default="1000"; + local.timers = variables.Perf.getLogs(arguments.req, "timers"); + local.q = timers.q; + local._total_time = 0; + local._total_executions = 0; + setTitle( "Settings" ); + + param name="form.bUpdateDebug" default="false"; + + if (form.bUpdateDebug){ + + var attrColl = form.debugSetting; // struct of settings + attrColl.action = "updateDebug"; + attrColl.type = "#request.adminType#" + attrColl.password = "#session["password"&request.adminType]#" + attrColl.debugTemplate = ""; + attrColl.remoteClients = ""; + + admin attributeCollection="#attrColl#"; + + admin + action="updateDebugSetting" + type="#request.adminType#" + password="#session["password"&request.adminType]#" + maxLogs="#form.maxLogs#" + remoteClients=""; + + echo("Debug Settigns updated!
"); + } + + admin + action="getDebugSetting" + type="#request.adminType#" + password="#session["password"&request.adminType]#" + returnVariable="local.debugSetting"; + + admin + action="getDebug" + type="#request.adminType#" + password="#session["password"&request.adminType]#" + returnVariable="local.debug"; + +
+

+ This is the same as updating the debug settings in the Lucee Admin +

+ + +
+ + + + + + + + + + local.r = 0; + local.d = "debug"; + + + + + + + + + + structDelete( local.debug, "debug" ); + local.r++; + + + + + + + + + + + + + + + + + + + +
SettingStatus
Debugging Enabled + + +

#UCFirst(d)# + + +
Number of Debug Logs + +

+ + +
+
+
\ No newline at end of file diff --git a/source/cfml/plugins/toolbar.cfm b/source/cfml/plugins/toolbar.cfm index fe1ee94..61a0b7e 100644 --- a/source/cfml/plugins/toolbar.cfm +++ b/source/cfml/plugins/toolbar.cfm @@ -4,7 +4,7 @@ variables.template = arguments.req.template; variables.req = arguments.req; - local.reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces", "Memory", "Threads"]; + local.reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces", "Memory", "Threads", "Settings"]; if ( Len( arguments.req.template ) || Len( arguments.req.url ) ) ArrayPrepend(local.reports, "Analysis"); local.path_reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces"];