Merge branch 'devel' of h1dev:/srv/APKPM/
[APKPM.git] / public / CRM.html
index ff43941..e0e0585 100644 (file)
@@ -8,7 +8,7 @@
    
       this.fetch = function() {
         self.clear();
-       self.url = '/g/' + self.function + '/' + self.args + '?callback=JSON_CALLBACK';
+       self.url = '/g/' + self.function_name + '/' + self.args + '?callback=JSON_CALLBACK';
         $xhr('JSON', self.url, function(code, response) {
           self.code = code;
           self.response = response;
@@ -16,6 +16,7 @@
       };
    
       this.clear = function() {
+        self.url = null;
         self.code = null;
         self.response = null;
       };
     PingCntl.$inject = ['$xhr'];
   </script>
   <div ng:controller="PingCntl">
-    <input type="text" name="function" value="CRM_username"      size="20"/>
+    <input type="hidden" name="function_name" value="CRM_search"      size="20"/>
     <input type="text" name="args"     value="test" size="10"/>
     <button ng:click="fetch()">fetch</button>
     <button ng:click="clear()">clear</button>
     <b ng:show="url && ! code">loading {{url}}</b>
+    <b ng:show="response">{{response.length}} results</b>
     <table ng:show="response">
     <tr>
+       <th>USERNAME</th>
        <th>BROJ</th>
        <th>USLUGA</th>
        <th>IP_MANAGEMENT</th>
@@ -38,6 +41,7 @@
        <th>OPT82</th>
     </tr>
     <tr ng:repeat="u in response">
+       <td>{{u.USERNAME}}</td>
        <td>{{u.BROJ}}</td>
        <td>{{u.USLUGA}}</td>
        <td>{{u.IP_MANAGEMENT}}</td>
@@ -46,7 +50,8 @@
        <td>{{u.OPT82}}</td>
     </tr>
     </table>
-    <pre>
+    <input type=checkbox name=debug value=1>
+    <pre ng:show=debug>
 url={{url}}
 code={{code}}
 response={{response}}