Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. //script used to generate data.json
  8. (function() {
  9. function buildData(count) {
  10. count = count || 1000;
  11. var products = ['Ladder', 'Spanner', 'Chair', 'Hammer'],
  12. states = ['CA', 'NY', 'UK', 'AZ', 'TX'],
  13. cities = ['San Francisco', 'Palo Alto', 'London', 'Austin'],
  14. people = ['Tommy Maintz', 'Abe Elias', 'Ed Spencer', 'Jamie Avins'],
  15. records = [],
  16. i;
  17. for (i = 0; i < count; i++) {
  18. records.push({
  19. id : i + 1,
  20. product : products[Math.floor(Math.random() * products.length)],
  21. city : cities[Math.floor(Math.random() * cities.length)],
  22. state : states[Math.floor(Math.random() * states.length)],
  23. quantity: Math.floor(Math.random() * 10000),
  24. value : Math.floor(Math.random() * 50),
  25. month : Math.ceil(Math.random() * 12),
  26. quarter : Math.ceil(Math.random() * 4),
  27. year : 2010 - Math.floor(Math.random() * 2),
  28. person : people[Math.floor(Math.random() * people.length)]
  29. });
  30. }
  31. return records;
  32. };
  33. function buildPeople(count) {
  34. count = count || 800;
  35. var colors = ['Brown', 'Blue', 'Green'],
  36. decades = ['1960s', '1970s', '1980s', '1990s'],
  37. hands = ['Left', 'Right'],
  38. genders = ['Male', 'Female'],
  39. records = [],
  40. i;
  41. for (i = 0; i < count; i++) {
  42. var iq = Math.round(Math.random() * 100);
  43. if (iq < 25 && Math.random() > 0.5) {
  44. iq += Math.random() * 30;
  45. } else if (iq > 75 && Math.random() < 0.9) {
  46. iq -= Math.random() * 20;
  47. }
  48. records.push({
  49. eyeColor : colors[Math.floor(Math.random() * colors.length)],
  50. gender : genders[Math.floor(Math.random() * genders.length)],
  51. handedness : hands[Math.floor(Math.random() * hands.length)],
  52. birthDecade: decades[Math.floor(Math.random() * decades.length)],
  53. height : 5 + parseFloat((Math.random() * 2).toFixed(1)),
  54. iq : 50 + Math.round(iq)
  55. });
  56. }
  57. return Ext.encode({rows: records});
  58. };
  59. });