This shows you the differences between two versions of the page.
userspace:json-rpc_angularjs [2015/05/01 14:03] justcoding |
userspace:json-rpc_angularjs [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Yet another method of reading the JSON-RPC interface. | ||
- | The example below reads the result of the latest softwareAudit and displays it as a table. Information about installed sw products are merged in. | ||
- | |||
- | All needed files (.html, .js, .css) should be hosted below / | ||
- | |||
- | The location would then read https:// | ||
- | |||
- | ====== Minor Obstacles ====== | ||
- | configed will currently answer /rpc? requests with Encoding " | ||
- | |||
- | Most requests require a logon, some even special rights. The script user should be member of a new group // | ||
- | < | ||
- | getProducts_.* : | ||
- | productOnClient_get.* : | ||
- | auditSoftwareOnClient_get.* : | ||
- | product_get.* : | ||
- | </ | ||
- | |||
- | ====== The Code ====== | ||
- | < | ||
- | / | ||
- | ├ index.html | ||
- | ├ swinv.js | ||
- | └ swinv.css | ||
- | </ | ||
- | |||
- | ===== index.html ===== | ||
- | Where all other is loaded from.. | ||
- | <code html> | ||
- | < | ||
- | <html ng-app=" | ||
- | < | ||
- | <link rel=" | ||
- | <script type=" | ||
- | <!-- script type=" | ||
- | <script type=" | ||
- | <script type=" | ||
- | </ | ||
- | |||
- | <body ng-controller=" | ||
- | |||
- | <div class=" | ||
- | |||
- | <input id=" | ||
- | <button ng-click=" | ||
- | |||
- | |||
- | <table border > | ||
- | < | ||
- | |||
- | <tr ng-repeat=" | ||
- | < | ||
- | <td> {{swp.version}}</ | ||
- | < | ||
- | <td class={{sw.csswarn(swp.name)}}>< | ||
- | </tr> | ||
- | </ | ||
- | |||
- | < | ||
- | <div ng-show=" | ||
- | <table border> | ||
- | < | ||
- | <tr ng-repeat=" | ||
- | < | ||
- | </tr> | ||
- | </ | ||
- | </ | ||
- | |||
- | < | ||
- | <table ng-show=" | ||
- | < | ||
- | <tr ng-repeat=" | ||
- | | ||
- | < | ||
- | < | ||
- | < | ||
- | </tr> | ||
- | </ | ||
- | |||
- | </ | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | |||
- | swinv.js | ||
- | The AngularJS mimic.. | ||
- | <code js> | ||
- | |||
- | </ |