Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yesnault/playstatus1

Display Play Framework 1.x Status in a view (Plugin Jquery)
https://github.com/yesnault/playstatus1

Last synced: about 1 month ago
JSON representation

Display Play Framework 1.x Status in a view (Plugin Jquery)

Awesome Lists containing this project

README

        

Plugin JQuery
-------------

A simple JQuery Plugin to display HTML with a JSON Play Framework Status in input.
/!\ Play Framework 1.x (not 2.0)

Use
---

### The Controller (example : Application.java)
```
package controllers;

import play.CorePlugin;
import play.mvc.Controller;

public class Application extends Controller {

public static void index() {
render();
}

public static void json() {
String json = CorePlugin.computeApplicationStatus(true);
renderJSON(json);
}

}
```

### The view (example : index.phtml) :
```
#{extends 'main.html' /}
#{set title:'Play Application Status' /}

#{set 'moreScripts'}


$(document).ready(function() {
var listAction = #{jsAction @json() /}
$.getJSON(listAction(), function(data) {
$('#status').status2html(data);
});
});

#{/set}


```

### The HTML Output

```

Java :

    Version : 1.6.0_29

    Free memory : 57577200

    Max memory : 99024896

    Total memory: 65470464

Application :

    Path : /Users/yvonnickesnault/Projets/repositories/playStatus1

    Uptime : 1716873ms

    Started at : 1716873

Pool :

    Active count : 1

    Queue size : 0

    Scheduled task count : 935

    Pool size : 1

Monitors :

N°nameavghitsmaxmin

0Application.index(), ms.7.5477707006369431577011
[...]


```

### Licence
LGPL v3