diff --git a/README.md b/README.md
index 98cf98a..2ef2e1a 100644
--- a/README.md
+++ b/README.md
@@ -29,10 +29,9 @@ inside of the gnome-shell panel (this could not be developed).
Things I plan to add at some point or another:
- * Buttons to operate on services à la nagstamon (recheck, connect via SSH, etc.)
+ * Buttons to operate on services à la nagstamon (connect via SSH, etc.)
* Filters to hide services (handled, scheduled downtime, host down, ...)
* Support for other free (as in free speech) monitoring servers
- * Choose which columns are shown in services result
Things I will be unlikely to add unless a patch is provided:
diff --git a/img/screenshot.png b/img/screenshot.png
index 95cd25a..814a24b 100644
Binary files a/img/screenshot.png and b/img/screenshot.png differ
diff --git a/prefs.js b/prefs.js
index cba36cc..0f34ae8 100644
--- a/prefs.js
+++ b/prefs.js
@@ -67,6 +67,7 @@ const prefs = [
{ type: Gtk.Entry, category: 'Settings', label: _('Password'), key: 'password' },
{ type: Gtk.Entry, category: 'Settings', label: _('Web URL'), key: 'url' },
{ type: Gtk.Entry, category: 'Settings', label: _('CGI / API URL'), key: 'urlcgi' },
+ { type: Gtk.Entry, category: 'Settings', label: _('Proxy URL'), key: 'proxy' },
{ type: Gtk.Switch, category: 'Settings', label: _('Check SSL certificate'), key: 'strict-ssl', align: Gtk.Align.START },
{ type: Gtk.ColorButton, category: 'Colors', label: _('OK background color'), key: 'ok-color', align: Gtk.Align.START },
{ type: Gtk.ColorButton, category: 'Colors', label: _('Warning background color'), key: 'warning-color', align: Gtk.Align.START },
diff --git a/schemas/org.gnome.shell.extensions.monito@drieu.org.gschema.xml b/schemas/org.gnome.shell.extensions.monito@drieu.org.gschema.xml
index 24ef178..caee328 100644
--- a/schemas/org.gnome.shell.extensions.monito@drieu.org.gschema.xml
+++ b/schemas/org.gnome.shell.extensions.monito@drieu.org.gschema.xml
@@ -89,6 +89,10 @@
''
+
+ ''
+
+
true
diff --git a/servers/genericserver.js b/servers/genericserver.js
index 46d9d1a..5071ec7 100644
--- a/servers/genericserver.js
+++ b/servers/genericserver.js
@@ -20,7 +20,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
-const { Soup } = imports.gi;
+const { Soup, Gio } = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Lang = imports.lang;
@@ -62,7 +62,8 @@ var GenericServer = class {
this.strict_ssl != this._settings.get_boolean ( "strict-ssl" ) ||
this.name != this._settings.get_string ( "name" ) ||
this.password != this._settings.get_string ( "password" ) ||
- this.urlcgi != this._settings.get_string ( "urlcgi" ) )
+ this.urlcgi != this._settings.get_string ( "urlcgi" ) ||
+ this.proxy != this._settings.get_string ( "proxy" ) )
{
this.type = this._settings.get_string ( "type" );
this.username = this._settings.get_string ( "username" );
@@ -70,6 +71,7 @@ var GenericServer = class {
this.name = this._settings.get_string ( "name" );
this.password = this._settings.get_string ( "password" );
this.urlcgi = this._settings.get_string ( "urlcgi" );
+ this.proxy = this._settings.get_string ( "proxy" );
this._httpSession = null;
this.monitoLog ( 'Refreshing URL parameters' );
}
@@ -85,8 +87,17 @@ var GenericServer = class {
prepareHttp ( )
{
if ( this._httpSession == null ) {
-// this.monitoLog ( 'Preparing new HTTP with strict SSL ' + this.strict_ssl );
- this._httpSession = new Soup.Session();
+ this.monitoLog ( 'Preparing new HTTP with strict SSL ' + this.strict_ssl );
+ this._httpSession = new Soup.SessionSync();
+ this._httpSession.timeout = 5;
+ if ( this.proxy )
+ {
+ this.monitoLog ( 'monito Proxy ' + this.proxy + ' for ' + this.name );
+ let proxy = new Gio.SimpleProxyResolver ( { default_proxy: this.proxy } );
+ //let proxy = new Gio.SimpleProxyResolver ( { default_proxy: 'socks://127.0.0.1:3128' } );
+ this._httpSession.proxy_resolver = proxy;
+ }
+// Soup.Session.prototype.add_feature.call(this._httpSession, new Soup.SimpleProxyResolver());
this._httpSession.ssl_strict = this.strict_ssl;
this._httpSession.user_agent = Me.metadata.uuid;
}
@@ -112,9 +123,15 @@ var GenericServer = class {
// this.monitoLog ( message.status_code );
// this.monitoLog ( message.response_body );
+<<<<<<< HEAD
message.response_headers.foreach ((name, val) => {
// this.monitoLog (name, val);
});
+=======
+// message.response_headers.foreach ((name, val) => {
+// this.monitoLog (name, val);
+// });
+>>>>>>> 0d8113e52b9d6e05fe8ad6a0c7dab045291ac987
// this.monitoLog ( message.response_body.data );
if ( message.status_code != Soup.Status.OK )