bridge: Hold ref during cockpit_channel_ready()

If a callback from cockpit_channel_ready() closes and unrefs the
channel, then we need to keep a reference so we can cleanly
finish and return from the function.

Closes #1410
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Add default arg to cockpit_channel_get_bool_option()

So that we can tell the difference between unset and FALSE.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Rename the old dbus code out of the way

So we can implement new stuff with the usual 'cockpit.dbus' and
CockpitDBusJson names.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
 * Keep using dbus-json1 for realm operations
doc: Document and design new dbus-json3 protocol payload

There will be additions later, but this is the meat of the
protocol.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Implement a new dbus-json3 protocol payload

This protocol is much simpler than the others. There will be some
additions to it in the future, but at it's core it's about relaying
messages and signals.

We don't have innate object manager support in the bridge, the
javascript code will respond to events and update an object model
there.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
base: Implement a javascript client for new dbus-json3

This implements a simple javascript client for dbus-json3. It has
no proxy support at this time, but that will be added later.

Fixes #1352
Fixes #1355

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
doc: Add documentation for cockpit.dbus and related

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Add explicit 'type' support for dbus-json3

You can specify the 'type' of a call, and then no Introspect() will
be needed when calling the method. In addition, the 'type' will be
returned in the reply.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Add support for flags in dbus messages

The only thing we do now is report the endianness of the message
as a flag. But in the future this is where things like the new
PERMIT_INTERACTIVE_AUTHORIZATION flag will go.

Fixes #1358
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Implement support for monitoring properties

 * Watch support for monitoring DBus properties.
 * Introspection meta data suppport.
 * Proxies, and caching of data in javascript.
 * Ordering guarantees for method calls vs. interfaces appearing,
   including signals, error returns, etc..

Closes #1356
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
shell: Simplify HTML

Mostly, move the top navbar out of #content.
shell: Basic, ugly, host switcher.

The HTML is all wrong.
shell: Hide navigation when showing the dashboard.
shell: Position the sidebar explicitly and correctly.

Also, specify the height of images in the navbar explicitly so that it
doesn't change size asynchronously when they load.
shell: Clean up layout recalculation a bit.

Now we resize iframes when updating the navigation elements, since it
always needs to happen at the same time anyway and in the right order.

Additionally, the layout is recalculated after every change of the navbar.
shell: Style the sidebar nicely.

From Andreas Nilsson.
shell: Highlight selected host in the switcher.
shell: Show avatars in host switcher.