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>
Enable/disable start/stop/restart buttons based on container state.

Fixes #294
Closes #330

Reviewed-by: Stef Walter <stefw@redhat.com>
web: As containers are starting/stopping on overview page show waiting

Show a throbber as containers on the overview page are starting
or stopping.

We cannot use /events or container state to track the waiting state,
as docker doesn't seem to give us anything useful here. So we do this
ourselves.

The small-spinner.gif looks *really* ugly, so we use an alternate
throbber here, at least for now.

Along with previous commits this, fixes #301, closes #317