step1.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. var tableData = [
  2. {
  3. option: '操作系统',
  4. now: 'LINUX',
  5. suggest: 'WINNT/LINUX',
  6. affect: '功能影响',
  7. },
  8. {
  9. option: 'PHP版本',
  10. now: 'LINUX',
  11. suggest: '开启',
  12. affect: '功能影响',
  13. },
  14. {
  15. option: 'MySQL扩展',
  16. now: 0,
  17. suggest: '开启',
  18. affect: '功能影响',
  19. },
  20. {
  21. option: 'session',
  22. now: 1,
  23. suggest: '开启',
  24. affect: '功能影响',
  25. },
  26. {
  27. option: 'curl扩展',
  28. now: 1,
  29. suggest: '开启',
  30. affect: '功能影响',
  31. },
  32. {
  33. option: 'zlib扩展',
  34. now: 0,
  35. suggest: '开启',
  36. affect: '功能影响',
  37. },
  38. {
  39. option: 'mb_string扩展',
  40. now: 1,
  41. suggest: '开启',
  42. affect: '功能影响',
  43. },
  44. {
  45. option: '附件上传',
  46. now: '20M',
  47. suggest: '>2M、<20M',
  48. affect: '功能影响',
  49. },
  50. ];
  51. var catalogueTableData = [
  52. {catalogue: '/Uploads', need: '可写、读', status: 1},
  53. {catalogue: '/App/Runtime', need: '可写、读', status: 0},
  54. {catalogue: '/App/Conf', need: '可写、读', status: 0},
  55. ];
  56. //renderTable();
  57. //renderCatalogueTable();
  58. $('.prev').click(function () {
  59. window.location = 'index.html'
  60. });
  61. $('.next').click(function () {
  62. window.location = 'step2.html'
  63. });
  64. function renderTable() {
  65. var template = "" +
  66. "<tr>\n" +
  67. " <td>{option}</td>\n" +
  68. " <td>{now}</td>\n" +
  69. " <td>{suggest}</td>\n" +
  70. " <td>{affect}</td>\n" +
  71. "</tr>";
  72. tableData.forEach(function (item, index) {
  73. var str = template.replace('{option}', item.option);
  74. str = str.replace('{suggest}', item.suggest);
  75. str = str.replace('{affect}', item.affect);
  76. if (item.now === 0) {
  77. str = str.replace('{now}', '<img src="../icon/error.png" width="20">');
  78. } else if (item.now === 1) {
  79. str = str.replace('{now}', '<img src="../icon/success.png" width="20">');
  80. } else {
  81. str = str.replace('{now}', item.now);
  82. }
  83. $('.table_01 tbody').append(str);
  84. str = ''
  85. })
  86. }
  87. function renderCatalogueTable() {
  88. var template = "" +
  89. "<tr>\n" +
  90. " <td>{catalogue}</td>\n" +
  91. " <td>{need}</td>\n" +
  92. " <td>{status}</td>\n" +
  93. "</tr>";
  94. catalogueTableData.forEach(function (item, index) {
  95. var str = template.replace('{catalogue}', item.catalogue);
  96. str = str.replace('{need}', item.need);
  97. if (item.status === 0) {
  98. str = str.replace('{status}', '<img src="../icon/error.png" width="20">');
  99. } else if (item.status === 1) {
  100. str = str.replace('{status}', '<img src="../icon/success.png" width="20">');
  101. } else {
  102. str = str.replace('{status}', item.status);
  103. }
  104. $('.catalogue-table tbody').append(str);
  105. str = ''
  106. })
  107. }