daemon: Add some basic tests for CGroupMonitor

Closes #318

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Display 'play' buttons next to images to run a container

These buttons don't do anything yet.

Got the column smaller by setting a fixed width on td.cell-buttons.
Not completetly happy with that, but perhaps there's not a better way.

Work on issue #301

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Run images from the docker overview page

Bring up the run dialog by pressing the play button.

We no longer need to refresh the image information, as we have relevant
information being updated by the docker DOM code.

Work on fix for issue #301

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Implement DockerClient.start() .stop() .restart()

Since we want to be able to call these from the overview page
in addition to the details page.

Part of issue #301

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Start and stop containers with buttons on the overview page

Part of fix for issue #301

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Add a div.slider control

This will be used for allocating memory and CPU limits.

See src/web/STYLE.html for an example, or src/web/controls.js
for a bit of documentation on how to use it.

Slider can be disabled with .disabled or disabled='true' as
well and the value accessed with .value or value='xxx'

Work towards fixing issue #295
Closes #322
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Rename test-channel.html to test-chan.html

The way automake testing works is that each test generates a log file
with the same filename as the extension and .log. So multiple tests
with different extensions but the same name will generate the same
log file, and only one will be run.

Renaming test-channel.html allows it to run again.

Closes #323
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
daemon: Make cgroupmonitor compatible with old monitors.

This way we can use it directly with cockpit-plot.js.

This has been done by changing the GetSamples method to return data
using the same layout as NewSample, and adding back the useless
@options argument.

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Updated test-cgroupmonitor for changes
Fix ignore by adding some more generated things.

Closes #334

Reviewed-by: Stef Walter <stefw@redhat.com>
daemon: Keep cgroup consumers until they have no data.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Allow specifying specific factors to format bytes

Add a new $cockpit.format_bytes(number, [factor]) function, which
also accepts suffixes as the optional factor, and returns suffixes
separately from the number.

See cockpit-util.js for documentation.

Fixes #319
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Use $cockpit.format_bytes() for Docker memory sizes

Fixes #319
Closes #325
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Don't show bar-row min-width if value is zero

When a bar-row goes to actual zero, make the blue part of the
bar hidden.
web: When memory usage is zero it's unknown => '?'

Display a question mark when memory usage is zero for a running
container, and hence unknown. The system probably doesn't support
displaying memory usage.

Closes #326
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Signed-off-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Remove bar graph flicker by not recreating them

Don't recreate entire rows and cells and contents in the containers
and images tables. Just update the contents if a row already exists
for the container.

This allows us to simply update value="x/y" for the bar row div
rather than replacing it and causing animations all over the place.

Also simpler.

Fixes #320
Closes #331
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Remove Container overview table 'Status' header

The column is filled with buttons, doesn't make sense and causes
the buttons to flow with a strange margin.

Closes #343
web: Hover over containers and images in overview page

Make them look clickable with the right pointer as well.

Upstream patternfly now has .table-hover as of their commit:
456368a5595774340f133e2d35da518a4d5ca59a

Fixes #289
Closes #344
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Add startsWith and endsWith polyfills from MDN.

And use them.  This unbreaks the broken-since-forever "service:"
prefix recognition in the search box.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Add walking resource graphs to container overview.

Closes #327

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Explicitly use empty string for CPU column when stopped.

Otherwise, it remains at "0%" when stopping a container, because
$(..).text(undefined) doesn't have any effect.

Closes #350

Reviewed-by: Stef Walter <stefw@redhat.com>