ace.blade.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. <style>
  2. .content-header {
  3. display: none;
  4. }
  5. .left-panel {
  6. background-color: #fff; /* 左侧面板的背景色 */
  7. height: 100vh; /* 高度占满 */
  8. }
  9. .main-panel {
  10. background-color: #e9ecef; /* 右侧面板的背景色 */
  11. height: 95.8vh; /* 高度占满 */
  12. }
  13. .main-panel-header {
  14. background-color: #1e1e1e;
  15. padding: 5px;
  16. }
  17. .main-card-body {
  18. max-height: 75vh; /* 设置最大高度 */
  19. overflow-y: auto; /* 启用垂直滚动条 */
  20. overflow-x: hidden; /* 隐藏水平滚动条 */
  21. border-radius: 1px; /* 圆角 */
  22. }
  23. .main-card-body ul li {
  24. white-space: nowrap;
  25. padding: 0px;
  26. }
  27. #editor {
  28. background-color: #1e1e1e;
  29. }
  30. .modal-body {
  31. background-color: #e9ecef;
  32. }
  33. .submenu {
  34. list-style: none;
  35. padding-left: 3px;
  36. }
  37. .list-group-flush .float-right {
  38. padding-right: 5px;
  39. }
  40. .list-group-flush .icon-x {
  41. color:#cdcdcd;font-size: 10px
  42. }
  43. .submenu .list-group-item {
  44. padding: 10px 0px 10px 20px;
  45. }
  46. .submenu .list-group-item:hover {
  47. background-color: rgba(221, 251, 239, 0.56);
  48. }
  49. .submenu .list-group-item.active {
  50. background-color: rgba(221, 251, 239, 0.56);
  51. border-color:#fff;
  52. color: #414750;
  53. }
  54. .custom-blue-bold {
  55. color: #1e1e1e; /* Bootstrap 的 primary 颜色 */
  56. font-weight: bold;
  57. }
  58. .modal-xxl {
  59. max-width: 75%; /* 或其他所需的宽度 */
  60. }
  61. .field_dist_id {
  62. max-height: 30px;
  63. white-space: nowrap; /* 防止文字换行 */
  64. overflow: hidden; /* 隐藏超出部分 */
  65. text-overflow: ellipsis; /* 显示省略号 */
  66. }
  67. .field_dist_id .form-control {
  68. height: 17px; /* 设置高度为 17px */
  69. overflow: hidden; /* 隐藏超出部分 */
  70. display: flex; /* 使用 flexbox 布局 */
  71. align-items: center; /* 垂直居中对齐 */
  72. }
  73. .field_dist_id .option {
  74. white-space: nowrap; /* 防止文字换行 */
  75. overflow: hidden; /* 隐藏超出部分 */
  76. text-overflow: ellipsis; /* 显示省略号 */
  77. display: flex; /* 使用 flexbox 布局 */
  78. align-items: center; /* 垂直居中对齐 */
  79. }
  80. .field_dist_id .pull-right {
  81. margin-left: auto; /* 将删除按钮推到右侧 */
  82. }
  83. #addFileModal .modal-body {
  84. display: flex;
  85. align-items: center;
  86. height: 100px; /* 可根据需要调整高度 */
  87. background-color: #ffffff;
  88. }
  89. #addFileModal .modal-body div {
  90. display: flex;
  91. align-items: center;
  92. }
  93. #addFileModal .modal-body .text-right {
  94. padding-left: 5px;
  95. padding-right: 5px;
  96. }
  97. #addFileModal .modal-sm {
  98. max-width:320px;
  99. }
  100. #addFileModal .modal-dialog {
  101. position: absolute;
  102. top: 45%;
  103. left: 50%;
  104. transform: translate(-40%, -50%);
  105. }
  106. #addFileButton {
  107. margin-right: 5px;
  108. }
  109. .btn-warning.disabled, .btn-warning:disabled {
  110. color: #ffffff;
  111. }
  112. .modal-body {
  113. background-color: #ffffff;
  114. }
  115. .selected-row {
  116. background-color: rgba(221, 251, 239, 0.56);
  117. }
  118. #templateLogTable {
  119. max-height: 550px; /* 最大高度 */
  120. overflow-y: auto; /* 垂直方向滚动 */
  121. display: block; /* 表格需要设置为块级元素以支持滚动 */
  122. }
  123. #templateLogTableBody {
  124. display: block; /* 表格需要设置为块级元素以支持滚动 */
  125. width: 100%;
  126. }
  127. #templateLogTableBody tr {
  128. display: block; /* 表格需要设置为块级元素以支持滚动 */
  129. width: 100%;
  130. }
  131. #templateLogTableBody tr td{
  132. display: block; /* 表格需要设置为块级元素以支持滚动 */
  133. width: 90%;
  134. }
  135. </style>
  136. </style>
  137. <div class="container-fluid" style="padding: 0px;">
  138. <div class="row">
  139. <div class="col-2 left-panel"> <!-- 左侧20% -->
  140. {!!$leftForm!!}
  141. <!-- 代码树 start-->
  142. <div class="main-card-body"></div>
  143. <!-- 代码树 end-->
  144. </div>
  145. <div class="col-10 main-panel" style="padding-right: 0px;"> <!-- 右侧80% -->
  146. <div class="main-panel-header">
  147. <button type="button" class="btn btn-info btn-sm" id="save-btn" disabled>Save</button>
  148. <button type="button" class="btn btn-warning btn-sm" data-toggle="modal" id="variable-btn" data-target="#iframeModal" disabled>Variable</button>
  149. <button type="button" class="btn btn-success btn-sm" id="publish-btn" disabled>Publish</button>
  150. <button type="button" class="btn btn-info btn-sm float-right" id="history-btn" disabled>History</button>
  151. </div>
  152. <div class="main-panel-content" id="editor" style="width: 100%; height: 100%;"></div>
  153. <input type="hidden" name="template_id" id="template_id" />
  154. </div>
  155. </div>
  156. </div>
  157. <!-- 变量管理弹窗 -->
  158. <div class="modal fade" id="iframeModal" tabindex="-1" aria-labelledby="iframeModalLabel" aria-hidden="true">
  159. <div class="modal-dialog modal-dialog-centered modal-xxl">
  160. <div class="modal-content">
  161. <div class="modal-header">
  162. <h5 class="modal-title" id="iframeModalLabel">Variable Management</h5>
  163. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  164. <span aria-hidden="true">&times;</span>
  165. </button>
  166. </div>
  167. <div class="modal-body">
  168. <iframe src="/prime-control/dist-template-var" width="100%" height="750px" frameborder="0" style="max-width: 100%;overflow: hidden"></iframe>
  169. </div>
  170. <div class="modal-footer">
  171. <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <!-- Modal -->
  177. <!-- Modal -->
  178. <div class="modal fade" id="addFileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  179. <div class="modal-dialog modal-sm" role="document">
  180. <div class="modal-content">
  181. <div class="modal-header">
  182. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  183. </div>
  184. <div class="modal-body">
  185. <div class="row">
  186. <div class="col-xs-2 text-right">
  187. File Name:
  188. </div>
  189. <div class="col-xs-8">
  190. <input type="hidden" class="form-control" id="file_path_name" name="file_path_name">
  191. <input type="text" class="form-control" id="file_name_input" name="file_name_input">
  192. </div>
  193. <div class="col-xs-2">
  194. <button type="button" class="btn btn-success" id="addFileButton">OK</button>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <!-- Bootstrap Modal -->
  202. <div class="modal fade" id="templateLogModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  203. <div class="modal-dialog modal-xl" role="document" >
  204. <div class="modal-content">
  205. <div class="modal-header">
  206. <h5 class="modal-title" id="exampleModalLabel">Template Logs</h5>
  207. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  208. <span aria-hidden="true">&times;</span>
  209. </button>
  210. </div>
  211. <div class="modal-body" style="height: 600px;">
  212. <div class="row" style="height: 100%;">
  213. <!-- 左侧显示 Previous Content -->
  214. <div class="col-md-8">
  215. <h5>Content</h5>
  216. <textarea id="contentDetails" style="height: 550px; overflow-y: auto; border: 1px solid #ededed; padding: 10px;width: 100%;"></textarea>
  217. </div>
  218. <!-- 右侧显示 Version 和 Created At 列表 -->
  219. <div class="col-md-4">
  220. <h5>Version</h5>
  221. <table class="table table-condensed table-hover" id="templateLogTable">
  222. <tbody id="templateLogTableBody">
  223. <!-- 动态生成的列表 -->
  224. </tbody>
  225. </table>
  226. </div>
  227. </div>
  228. </div>
  229. <div class="modal-footer">
  230. <input type="hidden" id="templateLogId" name="templateLogId"/>
  231. <input type="hidden" id="templateVersion" name="templateVersion"/>
  232. <button type="button" class="btn btn-success" id="restoreTemplateLog">Restore Version</button>
  233. <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <script src="/vendor/ace/ace.js" type="text/javascript"></script>
  239. <script>
  240. //https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js
  241. // 创建 Ace 编辑器实例
  242. var editor = ace.edit("editor");
  243. // 设置语言
  244. editor.getSession().setMode("ace/mode/html");
  245. // 设置主题
  246. editor.setTheme("ace/theme/monokai");
  247. editor.setAutoScrollEditorIntoView(true);
  248. // 其他配置
  249. editor.setOptions({
  250. showPrintMargin: true // 不显示打印边距
  251. });
  252. $(document).ready(function() {
  253. var loadingIndex = '';
  254. var fileId = '';
  255. var changeButtonDisabled = function (status) {
  256. $('#save-btn').prop('disabled', status);
  257. $('#variable-btn').prop('disabled', status);
  258. $('#publish-btn').prop('disabled', status);
  259. $('#history-btn').prop('disabled', status);
  260. }
  261. var changeIframeUrl = function() {
  262. appearance_id = $('select[name="appearance_id"]').val();
  263. dist_id = $('select[name="dist_id"]').val();
  264. var iframeUrl = '/prime-control/dist-template-var?templateCode=' + fileId + '&appearanceId=' + appearance_id+'&distId=' + dist_id;
  265. $('#iframeModal iframe').attr('src', iframeUrl);
  266. }
  267. //点击代码树后中间的Ace编辑器,内容展示
  268. var actionclick = function() {
  269. $('.file-action').click(function() {
  270. //去掉上一个文件的加粗
  271. $('.active').removeClass('active');
  272. //加粗
  273. var $li = $(this).closest('li');
  274. $li.addClass('active');
  275. //去掉保存与变量管理按钮的disabled
  276. changeButtonDisabled(false);
  277. //加载编辑代码
  278. loadingIndex = layer.load(1, {
  279. shade: [0.5, '#000'] // 设置遮罩层
  280. });
  281. var appearance_id = $('select[name="appearance_id"]').val();
  282. var dist_id = $('select[name="dist_id"]').val();
  283. fileId = $(this).attr('file_id');
  284. //得到文件名
  285. fileName = $(this).html();
  286. if (fileName.endsWith('.css')) {
  287. editor.getSession().setMode("ace/mode/css");
  288. } else if (fileName.endsWith('.js')) {
  289. editor.getSession().setMode("ace/mode/javascript");
  290. }else {
  291. editor.getSession().setMode("ace/mode/html");
  292. }
  293. //改变iframe的url
  294. changeIframeUrl();
  295. //编辑代码
  296. $.ajax({
  297. url: '/prime-control/dist-template/ace',
  298. type: 'POST',
  299. data: {
  300. act:'content',
  301. appearance_id: appearance_id,
  302. dist_id: dist_id,
  303. id: fileId
  304. },
  305. success: function(response) {
  306. $("#template_id").val(fileId);
  307. editor.setValue(response);
  308. layer.close(loadingIndex);
  309. }
  310. });
  311. });
  312. }
  313. // 加载代码树
  314. var postData = function () {
  315. var appearance_id = $('select[name="appearance_id"]').val();
  316. var dist_id = $('select[name="dist_id"]').val();
  317. //改变iframe的url
  318. changeIframeUrl();
  319. $.ajax({
  320. url: '/prime-control/dist-template/ace',
  321. type: 'POST',
  322. data: {
  323. act:'tree',
  324. appearance_id: appearance_id,
  325. dist_id: dist_id
  326. },
  327. success: function(response) {
  328. layer.close(loadingIndex);
  329. $('.main-card-body').html(response);
  330. actionclick();
  331. delFileButtonClick();
  332. }
  333. });
  334. }
  335. //左边外观选择与分销商选择联动
  336. $('select[name="appearance_id"]').change(function() {
  337. //console.log('-------2-----')
  338. if ($(this).val() == '') {
  339. changeButtonDisabled(true);
  340. }
  341. loadingIndex = layer.load(1, {
  342. shade: [0.5, '#000'] // 设置遮罩层
  343. });
  344. //请空编辑器内容
  345. editor.setValue('');
  346. //请空代码树
  347. $('.main-card-body').html('');
  348. //显示代码树
  349. postData();
  350. });
  351. //分销商选择
  352. $('select[name="dist_id"]').change(function() {
  353. //console.log('-------0-----')
  354. loadingIndex = layer.load(1, {
  355. shade: [0.5, '#000'] // 设置遮罩层
  356. });
  357. //请空编辑器内容
  358. editor.setValue('');
  359. //请空代码树
  360. $('.main-card-body').html('');
  361. dist_id = $(this).val();
  362. //在分销商名字前加上分销商id
  363. setTimeout(function() {
  364. $("div[name='dist_id'] .option").prepend(dist_id+" - ");
  365. }, 100); // 延迟2000毫秒(即2秒)
  366. //改变appearance_id
  367. $.ajax({
  368. url: '/prime-control/dist-template/ace',
  369. type: 'POST',
  370. data: {
  371. act:'get_appearance_id',
  372. dist_id: dist_id,
  373. },
  374. success: function(response) {
  375. //console.log('-------1-----')
  376. // 更改选中的值
  377. var $select = $('select[name="appearance_id"]');
  378. $select.select2('val', response);
  379. //显示代码树
  380. // postData();
  381. }
  382. });
  383. });
  384. // 模版编辑保存
  385. $("#save-btn").click(function() {
  386. var appearance_id = $('select[name="appearance_id"]').val();
  387. var dist_id = $('select[name="dist_id"]').val();
  388. // console.log(dist_id);
  389. var template_id = $("#template_id").val();
  390. var content = editor.getValue();
  391. if (template_id == '') {
  392. Dcat.error('操作失败:请先选择模板');
  393. return false;
  394. }
  395. if (appearance_id == '') {
  396. Dcat.error('操作失败:请先选择主题');
  397. return false;
  398. }
  399. loadingIndex = layer.load(1, {
  400. shade: [0.5, '#000'] // 设置遮罩层
  401. });
  402. $.ajax({
  403. url: '/prime-control/dist-template/ace',
  404. type: 'POST',
  405. data: {
  406. act:'content_save',
  407. template_code: template_id,
  408. appearance_id: appearance_id,
  409. dist_id: dist_id,
  410. content: content
  411. },
  412. success: function(response) {
  413. layer.close(loadingIndex);
  414. if (response == '1') {
  415. Dcat.success('保存成功');
  416. }else{
  417. Dcat.error('保存失败');
  418. }
  419. }
  420. });
  421. })
  422. // 模版发布
  423. $("#publish-btn").click(function() {
  424. var appearance_id = $('select[name="appearance_id"]').val();
  425. var dist_id = $('select[name="dist_id"]').val();
  426. if (appearance_id == '') {
  427. Dcat.error('操作失败:请先选择主题');
  428. return false;
  429. }
  430. loadingIndex = layer.load(1, {
  431. shade: [0.5, '#000'] // 设置遮罩层
  432. });
  433. $.ajax({
  434. url: '/prime-control/dist-template/ace',
  435. type: 'POST',
  436. data: {
  437. act:'publish',
  438. appearance_id: appearance_id,
  439. dist_id: dist_id
  440. },
  441. success: function(response) {
  442. layer.close(loadingIndex);
  443. Dcat.success('保存成功');
  444. }
  445. });
  446. })
  447. //文件新增
  448. $('#addFileModal').on('show.bs.modal', function (event) {
  449. // 获取触发模态框的元素
  450. var button = $(event.relatedTarget);
  451. // 获取 file_path_name 的值
  452. var filePathName = button.attr('file_path_name');
  453. $('#file_path_name').val(filePathName);
  454. });
  455. var ajaxAddDelFile = function (appearance_id,dist_id,fileId,filePathName,fileInputName,type) {
  456. $.ajax({
  457. url: '/prime-control/dist-template/ace',
  458. type: 'POST',
  459. data: {
  460. act:'add_del_tree',
  461. type: type,
  462. appearance_id: appearance_id,
  463. dist_id: dist_id,
  464. file_path_name: filePathName,
  465. file_name_input: fileInputName,
  466. file_id: fileId
  467. },
  468. success: function(response) {
  469. layer.close(loadingIndex);
  470. $("#file_name_input").val('')
  471. if (response.status == '1') {
  472. Dcat.success('保存成功');
  473. //刷新代码树
  474. postData();
  475. }else{
  476. Dcat.error(response.msg);
  477. }
  478. }
  479. });
  480. }
  481. //代码树新增
  482. $("#addFileButton").click(function () {
  483. var filePathName = $('#file_path_name').val();
  484. var fileInputName = $('#file_name_input').val();
  485. var appearanceId = $('select[name="appearance_id"]').val();
  486. var distId = $('select[name="dist_id"]').val();
  487. if (fileInputName == '') {
  488. Dcat.error('文件名不能为空');
  489. return false;
  490. }
  491. loadingIndex = layer.load(1, {
  492. shade: [0.5, '#000'] // 设置遮罩层
  493. });
  494. $('#addFileModal').modal('hide');
  495. ajaxAddDelFile(appearanceId,distId,0,filePathName,fileInputName,'add');
  496. });
  497. //代码树删除
  498. function delFileButtonClick() {
  499. $(".delFileButton").click(function () {
  500. var filePathName = "";
  501. var fileInputName = "";
  502. var appearanceId = $('select[name="appearance_id"]').val();
  503. var distId = $('select[name="dist_id"]').val();
  504. var fileId = $(this).attr('file_id');
  505. var fileName = $(this).attr('file_name');
  506. msg = '确定要删除'+fileName+'吗?';
  507. Dcat.confirm('确认删除',msg , function () {
  508. loadingIndex = layer.load(1, {
  509. shade: [0.5, '#000'] // 设置遮罩层
  510. });
  511. ajaxAddDelFile(appearanceId,distId,fileId,filePathName,fileInputName,'del');
  512. });
  513. });
  514. }
  515. //历史记录弹窗
  516. $("#history-btn").click(function () {
  517. loadingIndex = layer.load(1, {
  518. shade: [0.5, '#000'] // 设置遮罩层
  519. });
  520. var appearanceId = $('select[name="appearance_id"]').val();
  521. var distId = $('select[name="dist_id"]').val();
  522. if (fileId == '') {
  523. Dcat.error('操作失败:请先选择模板');
  524. return false;
  525. }
  526. //移除历史记录内容
  527. $('#contentDetails').html('');
  528. $("#templateLogId").val('');
  529. $("#templateVersion").val('');
  530. $.ajax({
  531. url: '/prime-control/dist-template/ace',
  532. method: 'POST',
  533. data: {
  534. act: 'fetch_template_logs',
  535. file_id: fileId,
  536. dist_id: distId,
  537. appearance_id: appearanceId,
  538. },
  539. success: function(data) {
  540. const tableBody = $('#templateLogTableBody');
  541. tableBody.empty();
  542. data.forEach(log => {
  543. const row = `<tr log_id="${log.id}">
  544. <td>Version:${log.version} <br /> ${log.created_at}</td>
  545. </tr>`;
  546. tableBody.append(row);
  547. });
  548. layer.close(loadingIndex);
  549. // Show modal
  550. $('#templateLogModal').modal('show');
  551. },
  552. error: function(error) {
  553. layer.close(loadingIndex);
  554. alert('Error fetching data!');
  555. }
  556. });
  557. });
  558. //显示历史记录内容
  559. $(document).on('click', '#templateLogTableBody tr', function() {
  560. loadingIndex = layer.load(1, {
  561. shade: [0.5, '#000'] // 设置遮罩层
  562. });
  563. // 移除其他行的选中样式
  564. $('#templateLogTableBody tr').removeClass('selected-row');
  565. // 当前点击行添加选中样式
  566. $(this).addClass('selected-row');
  567. //
  568. var logId = $(this).attr('log_id');
  569. var appearanceId = $('select[name="appearance_id"]').val();
  570. var distId = $('select[name="dist_id"]').val();
  571. $.ajax({
  572. url: '/prime-control/dist-template/ace',
  573. method: 'POST',
  574. data: {
  575. act: 'fetch_template_log_content',
  576. log_id: logId,
  577. dist_id: distId,
  578. appearance_id: appearanceId,
  579. },
  580. success: function(data) {
  581. layer.close(loadingIndex);
  582. $('#contentDetails').html(data.previous_content);
  583. $("#templateLogId").val(data.id);
  584. $("#templateVersion").val(data.version);
  585. },
  586. error: function(error) {
  587. layer.close(loadingIndex);
  588. alert('Error fetching data!');
  589. }
  590. });
  591. });
  592. $("#restoreTemplateLog").click(function () {
  593. var logId = $("#templateLogId").val();
  594. var templateVersion = $("#templateVersion").val();
  595. if (logId == '' || templateVersion == '') {
  596. Dcat.error('Please select the history record first.');
  597. return false;
  598. }
  599. //确认框
  600. msg = 'Are you sure to restore to version: '+templateVersion+'?';
  601. Dcat.confirm('Confirm Recovery',msg , function () {
  602. loadingIndex = layer.load(1, {
  603. shade: [0.5, '#000'] // 设置遮罩层
  604. });
  605. //ajax
  606. $.ajax({
  607. url: '/prime-control/dist-template/ace',
  608. method: 'POST',
  609. data: {
  610. act:'restore_template_log',
  611. log_id: logId,
  612. },
  613. success: function(data) {
  614. layer.close(loadingIndex);
  615. if (data.status == '1') {
  616. Dcat.success('Recovery Successful');
  617. //关闭弹窗
  618. $('#templateLogModal').modal('hide');
  619. //请空编辑器内容
  620. editor.setValue('');
  621. //刷新代码树
  622. postData();
  623. }else{
  624. Dcat.error(data.msg);
  625. }
  626. },
  627. error: function(error) {
  628. layer.close(loadingIndex);
  629. alert('Error fetching data!');
  630. }
  631. });
  632. });
  633. });
  634. });
  635. </script>