0

I want to GET and present the web service states inside HTML dashboard. What is the most friendly and easy way to do it by JavaScript?

For example - When some docker is stopped i want to present a red led icon and when the response take long i want to present a yellow led icon and if it's ok.. you guess right, I want to present a green led icon.

Please your pro assistance. Thanks.

1
  • Try this one: github.com/portainer/portainer This is an docker adminpanel running in your browser. Maybe you can copy some code and learn how to get the running containers. Commented Apr 24, 2017 at 8:48

1 Answer 1

0

You will have to use the API provided by docker, see Docker Engine API (v1.26)

GET /containers/json will give you back the details you want in json format.

function getContainers(callback) { $.ajax({ type: 'GET', url: '/containers/json?all=1', dataType: 'json', success: function(data) { if( callback ) callback(data); }, error: function(err) { // ... }, timeout: 30000 }); } 

Also:

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.