Commit a71054dc authored by Giovanni Panozzo's avatar Giovanni Panozzo

Add stats for current active secret plugin

parent 054435e6
......@@ -103,6 +103,9 @@
* "DATE_PYTHON_SIMPLE": ""
* "DATE_SPICE": ""
* }
* "ACTIVESECRETPLUGIN": {
* "plugin_name": "kwallet"
* }
*
* }
* @endcode
......@@ -138,6 +141,7 @@
#include "remmina_sysinfo.h"
#include "remmina_utils.h"
#include "remmina/remmina_trace_calls.h"
#include "remmina_plugin_manager.h"
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/gdkwayland.h>
......@@ -742,6 +746,36 @@ JsonNode *remmina_stats_get_profiles()
return r;
}
/**
* Add a json member ACTIVESECRETPLUGIN which shows the current secret plugin in use by remmina.
*
* @return a Json Node structure containg the secret plugin in use
*
*/
JsonNode *remmina_stats_get_secret_plugin()
{
TRACE_CALL(__func__);
JsonBuilder *b;
JsonNode *r;
RemminaSecretPlugin *secret_plugin;
secret_plugin = remmina_plugin_manager_get_secret_plugin();
b = json_builder_new();
json_builder_begin_object(b);
if (secret_plugin && secret_plugin->is_service_available) {
json_builder_set_member_name(b, "plugin_name");
json_builder_add_string_value(b, secret_plugin->name);
}
json_builder_end_object(b);
r = json_builder_get_root(b);
g_object_unref(b);
return r;
}
/**
* Get all statistics in json format to send periodically to the PHP server.
* The caller should free the returned buffer with g_free()
......@@ -801,6 +835,10 @@ JsonNode *remmina_stats_get_all()
json_builder_set_member_name(b, "PROFILES");
json_builder_add_value(b, n);
n = remmina_stats_get_secret_plugin();
json_builder_set_member_name(b, "ACTIVESECRETPLUGIN");
json_builder_add_value(b, n);
json_builder_end_object(b);
n = json_builder_get_root(b);
g_object_unref(b);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment