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: Implement slider for choosing a container memory limit

This implements the memory row as described by the mockup here:

https://github.com/cockpit-project/cockpit-design/blob/f1d6e8c560d6230bad24e4ac11c8916dc75d9e52/docker/docker-run-hires.png

The only difference is that the total memory is not shown, as the
container is not actually being allocated a portion of the memory. This
is about setting a limit.

Fixes #295
Closes #353
web: Implement CPU priority slider

This is done on a logarithmic scale. Defaults to 'default' priority.

Fixes #296
Closes #353