This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
userspace:json-rpc_angularjs [2015/05/01 14:11] justcoding |
userspace:json-rpc_angularjs [2021/08/23 08:37] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Angular JSON-RPC ====== | ||
| Yet another method of reading the JSON-RPC interface. | 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. | 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 / | + | All needed files (.html, .js, .css) should be hosted below / |
| The location would then read https:// | The location would then read https:// | ||
| Line 11: | Line 12: | ||
| ====== Minor Obstacles ====== | ====== Minor Obstacles ====== | ||
| - | configed | + | opsiconfd |
| Most requests require a logon, some even special rights. The script user should be member of a new group // | Most requests require a logon, some even special rights. The script user should be member of a new group // | ||
| Line 21: | Line 22: | ||
| </ | </ | ||
| + | ====== Calling Parameter ====== | ||
| + | When called as / | ||
| + | the SoftwareAudit of the given clientId is displayed. OPSI client names may be entered in an input field at any time and are queried asynchronously. | ||
| + | |||
| + | The strange format of the query string as json has its reason: it is needed for the AndroidApp named [[https:// | ||
| + | |||
| + | What if the barcode appears right on the client' | ||
| ====== The Code ====== | ====== The Code ====== | ||
| < | < | ||
| Line 30: | Line 38: | ||
| </ | </ | ||
| - | ===== index.html ===== | + | ======= index.html |
| Where all other is loaded from.. | Where all other is loaded from.. | ||
| <code html> | <code html> | ||
| Line 88: | Line 96: | ||
| </ | </ | ||
| - | ==== swinv.js ==== | + | ======= swinv.js |
| The AngularJS mimic.. | The AngularJS mimic.. | ||
| <code JavaScript> | <code JavaScript> | ||
| Line 106: | Line 114: | ||
| this.auditParams.params.push([]); | this.auditParams.params.push([]); | ||
| this.auditParams.params.push({" | this.auditParams.params.push({" | ||
| - | |||
| - | opsiURL=baseurl+"?" | ||
| me=this; | me=this; | ||
| Line 278: | Line 284: | ||
| </ | </ | ||
| - | ===== swinv.css ===== | + | ======= swinv.css |
| some tweaking of the appearance - anything goes.. | some tweaking of the appearance - anything goes.. | ||