addon.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) {
  2. var Controller = {
  3. index: function () {
  4. // 初始化表格参数配置
  5. Table.api.init({
  6. extend: {
  7. index_url: Config.api_url ? Config.api_url + '/addon/index' : "addon/downloaded",
  8. add_url: '',
  9. edit_url: '',
  10. del_url: '',
  11. multi_url: ''
  12. }
  13. });
  14. var table = $("#table");
  15. // 弹窗自适应宽高
  16. var area = Fast.config.openArea != undefined ? Fast.config.openArea : [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
  17. table.on('load-success.bs.table', function (e, json) {
  18. if (json && typeof json.category != 'undefined' && $(".nav-category li").size() == 2) {
  19. $.each(json.category, function (i, j) {
  20. $("<li><a href='javascript:;' data-id='" + j.id + "'>" + j.name + "</a></li>").insertBefore($(".nav-category li:last"));
  21. });
  22. }
  23. });
  24. table.on('load-error.bs.table', function (e, status, res) {
  25. if (status == 404 && $(".btn-switch.active").data("type") != "local") {
  26. Layer.confirm(__('Store now available tips'), {
  27. title: __('Warmtips'),
  28. btn: [__('Switch to the local'), __('Try to reload')]
  29. }, function (index) {
  30. layer.close(index);
  31. $(".panel .nav-tabs").hide();
  32. $(".toolbar > *:not(:first)").hide();
  33. $(".btn-switch[data-type='local']").trigger("click");
  34. }, function (index) {
  35. layer.close(index);
  36. table.bootstrapTable('refresh');
  37. });
  38. return false;
  39. }
  40. });
  41. table.on('post-body.bs.table', function (e, settings, json, xhr) {
  42. var parenttable = table.closest('.bootstrap-table');
  43. var d = $(".fixed-table-toolbar", parenttable).find(".search input");
  44. d.off("keyup drop blur");
  45. d.on("keyup", function (e) {
  46. if (e.keyCode == 13) {
  47. var that = this;
  48. var options = table.bootstrapTable('getOptions');
  49. var queryParams = options.queryParams;
  50. options.pageNumber = 1;
  51. options.queryParams = function (params) {
  52. var params = queryParams(params);
  53. params.search = $(that).val();
  54. return params;
  55. };
  56. table.bootstrapTable('refresh', {});
  57. }
  58. });
  59. });
  60. Template.helper("Moment", Moment);
  61. Template.helper("addons", Config['addons']);
  62. $("#faupload-addon").data("params", function () {
  63. var userinfo = Controller.api.userinfo.get();
  64. return {
  65. uid: userinfo ? userinfo.id : '',
  66. token: userinfo ? userinfo.token : '',
  67. version: Config.faversion
  68. };
  69. });
  70. // 初始化表格
  71. table.bootstrapTable({
  72. url: $.fn.bootstrapTable.defaults.extend.index_url,
  73. queryParams: function (params) {
  74. var userinfo = Controller.api.userinfo.get();
  75. $.extend(params, {
  76. uid: userinfo ? userinfo.id : '',
  77. token: userinfo ? userinfo.token : '',
  78. version: Config.faversion
  79. });
  80. return params;
  81. },
  82. columns: [
  83. [
  84. {field: 'id', title: 'ID', operate: false, visible: false},
  85. {
  86. field: 'home',
  87. title: __('Index'),
  88. width: '50px',
  89. formatter: Controller.api.formatter.home
  90. },
  91. {field: 'name', title: __('Name'), operate: false, visible: false, width: '120px'},
  92. {
  93. field: 'title',
  94. title: __('Title'),
  95. operate: 'LIKE',
  96. align: 'left',
  97. formatter: Controller.api.formatter.title
  98. },
  99. {field: 'intro', title: __('Intro'), operate: 'LIKE', align: 'left', class: 'visible-lg'},
  100. {
  101. field: 'author',
  102. title: __('Author'),
  103. operate: 'LIKE',
  104. width: '100px',
  105. formatter: Controller.api.formatter.author
  106. },
  107. {
  108. field: 'price',
  109. title: __('Price'),
  110. operate: 'LIKE',
  111. width: '100px',
  112. align: 'center',
  113. formatter: Controller.api.formatter.price
  114. },
  115. {
  116. field: 'downloads',
  117. title: __('Downloads'),
  118. operate: 'LIKE',
  119. width: '80px',
  120. align: 'center',
  121. formatter: Controller.api.formatter.downloads
  122. },
  123. {
  124. field: 'version',
  125. title: __('Version'),
  126. operate: 'LIKE',
  127. width: '80px',
  128. align: 'center',
  129. formatter: Controller.api.formatter.version
  130. },
  131. {
  132. field: 'toggle',
  133. title: __('Status'),
  134. width: '80px',
  135. formatter: Controller.api.formatter.toggle
  136. },
  137. {
  138. field: 'id',
  139. title: __('Operate'),
  140. align: 'center',
  141. table: table,
  142. formatter: Controller.api.formatter.operate,
  143. align: 'right'
  144. },
  145. ]
  146. ],
  147. responseHandler: function (res) {
  148. $.each(res.rows, function (i, j) {
  149. j.addon = typeof Config.addons[j.name] != 'undefined' ? Config.addons[j.name] : null;
  150. });
  151. return res;
  152. },
  153. dataType: 'jsonp',
  154. templateView: false,
  155. clickToSelect: false,
  156. search: true,
  157. showColumns: false,
  158. showToggle: false,
  159. showExport: false,
  160. showSearch: false,
  161. commonSearch: true,
  162. searchFormVisible: true,
  163. searchFormTemplate: 'searchformtpl',
  164. pageSize: 50,
  165. });
  166. // 为表格绑定事件
  167. Table.api.bindevent(table);
  168. // 离线安装
  169. require(['upload'], function (Upload) {
  170. Upload.api.upload("#faupload-addon", function (data, ret) {
  171. Config['addons'][data.addon.name] = data.addon;
  172. Toastr.success(ret.msg);
  173. operate(data.addon.name, 'enable', false);
  174. return false;
  175. }, function (data, ret) {
  176. if (ret.msg && ret.msg.match(/(login|登录)/g)) {
  177. return Layer.alert(ret.msg, {
  178. title: __('Warning'),
  179. btn: [__('Login now')],
  180. yes: function (index, layero) {
  181. $(".btn-userinfo").trigger("click");
  182. }
  183. });
  184. }
  185. });
  186. });
  187. // 查看插件首页
  188. $(document).on("click", ".btn-addonindex", function () {
  189. if ($(this).attr("href") == 'javascript:;') {
  190. Layer.msg(__('Not installed tips'), {icon: 7});
  191. } else if ($(this).closest(".operate").find("a.btn-enable").size() > 0) {
  192. Layer.msg(__('Not enabled tips'), {icon: 7});
  193. return false;
  194. }
  195. });
  196. // 切换
  197. $(document).on("click", ".btn-switch", function () {
  198. $(".btn-switch").removeClass("active");
  199. $(this).addClass("active");
  200. $("form.form-commonsearch input[name='type']").val($(this).data("type"));
  201. table.bootstrapTable('refresh', {url: ($(this).data("url") ? $(this).data("url") : $.fn.bootstrapTable.defaults.extend.index_url), pageNumber: 1});
  202. return false;
  203. });
  204. $(document).on("click", ".nav-category li a", function () {
  205. $(".nav-category li").removeClass("active");
  206. $(this).parent().addClass("active");
  207. $("form.form-commonsearch input[name='category_id']").val($(this).data("id"));
  208. table.bootstrapTable('refresh', {url: $(this).data("url"), pageNumber: 1});
  209. return false;
  210. });
  211. var tables = [];
  212. $(document).on("click", "#droptables", function () {
  213. if ($(this).prop("checked")) {
  214. Fast.api.ajax({
  215. url: "addon/get_table_list",
  216. async: false,
  217. data: {name: $(this).data("name")}
  218. }, function (data) {
  219. tables = data.tables;
  220. return false;
  221. });
  222. var html;
  223. html = tables.length > 0 ? '<div class="alert alert-warning-light droptablestips" style="max-width:480px;max-height:300px;overflow-y: auto;">' + __('The following data tables will be deleted') + ':<br>' + tables.join("<br>") + '</div>'
  224. : '<div class="alert alert-warning-light droptablestips">' + __('The Addon did not create a data table') + '</div>';
  225. $(html).insertAfter($(this).closest("p"));
  226. } else {
  227. $(".droptablestips").remove();
  228. }
  229. $(window).resize();
  230. });
  231. // 会员信息
  232. $(document).on("click", ".btn-userinfo", function () {
  233. var that = this;
  234. var area = [$(window).width() > 800 ? '500px' : '95%', $(window).height() > 600 ? '400px' : '95%'];
  235. var userinfo = Controller.api.userinfo.get();
  236. if (!userinfo) {
  237. Layer.open({
  238. content: Template("logintpl", {}),
  239. zIndex: 99,
  240. area: area,
  241. title: __('Login FastAdmin'),
  242. resize: false,
  243. btn: [__('Login'), __('Register')],
  244. yes: function (index, layero) {
  245. Fast.api.ajax({
  246. url: Config.api_url + '/user/login',
  247. dataType: 'jsonp',
  248. data: {
  249. account: $("#inputAccount", layero).val(),
  250. password: $("#inputPassword", layero).val(),
  251. _method: 'POST'
  252. }
  253. }, function (data, ret) {
  254. Controller.api.userinfo.set(data);
  255. Layer.closeAll();
  256. Layer.alert(ret.msg);
  257. }, function (data, ret) {
  258. });
  259. },
  260. btn2: function () {
  261. return false;
  262. },
  263. success: function (layero, index) {
  264. this.checkEnterKey = function(event){
  265. if(event.keyCode === 13){
  266. $(".layui-layer-btn0").trigger("click");
  267. return false;
  268. }
  269. };
  270. $(document).on('keydown', this.checkEnterKey);
  271. $(".layui-layer-btn1", layero).prop("href", "http://www.fastadmin.net/user/register.html").prop("target", "_blank");
  272. },
  273. end: function(){
  274. $(document).off('keydown', this.checkEnterKey);
  275. }
  276. });
  277. } else {
  278. Fast.api.ajax({
  279. url: Config.api_url + '/user/index',
  280. dataType: 'jsonp',
  281. data: {
  282. user_id: userinfo.id,
  283. token: userinfo.token,
  284. }
  285. }, function (data) {
  286. Layer.open({
  287. content: Template("userinfotpl", userinfo),
  288. area: area,
  289. title: __('Userinfo'),
  290. resize: false,
  291. btn: [__('Logout'), __('Cancel')],
  292. yes: function () {
  293. Fast.api.ajax({
  294. url: Config.api_url + '/user/logout',
  295. dataType: 'jsonp',
  296. data: {uid: userinfo.id, token: userinfo.token}
  297. }, function (data, ret) {
  298. Controller.api.userinfo.set(null);
  299. Layer.closeAll();
  300. Layer.alert(ret.msg);
  301. }, function (data, ret) {
  302. Controller.api.userinfo.set(null);
  303. Layer.closeAll();
  304. Layer.alert(ret.msg);
  305. });
  306. }
  307. });
  308. return false;
  309. }, function (data) {
  310. Controller.api.userinfo.set(null);
  311. $(that).trigger('click');
  312. return false;
  313. });
  314. }
  315. });
  316. var install = function (name, version, force) {
  317. var userinfo = Controller.api.userinfo.get();
  318. var uid = userinfo ? userinfo.id : 0;
  319. var token = userinfo ? userinfo.token : '';
  320. Fast.api.ajax({
  321. url: 'addon/install',
  322. data: {
  323. name: name,
  324. force: force ? 1 : 0,
  325. uid: uid,
  326. token: token,
  327. version: version,
  328. faversion: Config.faversion
  329. }
  330. }, function (data, ret) {
  331. Layer.closeAll();
  332. Config['addons'][data.addon.name] = ret.data.addon;
  333. Layer.alert(__('Online installed tips'), {
  334. btn: [__('OK')],
  335. title: __('Warning'),
  336. icon: 1
  337. });
  338. Controller.api.refresh(table, name);
  339. }, function (data, ret) {
  340. //如果是需要购买的插件则弹出二维码提示
  341. if (ret && ret.code === -1) {
  342. //扫码支付
  343. Layer.open({
  344. content: Template("paytpl", ret.data),
  345. shade: 0.8,
  346. area: area,
  347. skin: 'layui-layer-msg layui-layer-pay',
  348. title: false,
  349. closeBtn: true,
  350. btn: false,
  351. resize: false,
  352. end: function () {
  353. Layer.alert(__('Pay tips'));
  354. }
  355. });
  356. } else if (ret && ret.code === -2) {
  357. //如果登录已经超时,重新提醒登录
  358. if (uid && uid != ret.data.uid) {
  359. Controller.api.userinfo.set(null);
  360. $(".operate[data-name='" + name + "'] .btn-install").trigger("click");
  361. return;
  362. }
  363. top.Fast.api.open(ret.data.payurl, __('Pay now'), {
  364. area: area,
  365. end: function () {
  366. top.Layer.alert(__('Pay tips'));
  367. }
  368. });
  369. } else if (ret && ret.code === -3) {
  370. //插件目录发现影响全局的文件
  371. Layer.open({
  372. content: Template("conflicttpl", ret.data),
  373. shade: 0.8,
  374. area: area,
  375. title: __('Warning'),
  376. btn: [__('Continue install'), __('Cancel')],
  377. end: function () {
  378. },
  379. yes: function () {
  380. install(name, version, true);
  381. }
  382. });
  383. } else {
  384. Layer.alert(ret.msg);
  385. }
  386. return false;
  387. });
  388. };
  389. var uninstall = function (name, force, droptables) {
  390. Fast.api.ajax({
  391. url: 'addon/uninstall',
  392. data: {name: name, force: force ? 1 : 0, droptables: droptables ? 1 : 0}
  393. }, function (data, ret) {
  394. delete Config['addons'][name];
  395. Layer.closeAll();
  396. Controller.api.refresh(table, name);
  397. }, function (data, ret) {
  398. if (ret && ret.code === -3) {
  399. //插件目录发现影响全局的文件
  400. Layer.open({
  401. content: Template("conflicttpl", ret.data),
  402. shade: 0.8,
  403. area: area,
  404. title: __('Warning'),
  405. btn: [__('Continue uninstall'), __('Cancel')],
  406. end: function () {
  407. },
  408. yes: function () {
  409. uninstall(name, true, droptables);
  410. }
  411. });
  412. } else {
  413. Layer.alert(ret.msg);
  414. }
  415. return false;
  416. });
  417. };
  418. var operate = function (name, action, force) {
  419. Fast.api.ajax({
  420. url: 'addon/state',
  421. data: {name: name, action: action, force: force ? 1 : 0}
  422. }, function (data, ret) {
  423. var addon = Config['addons'][name];
  424. addon.state = action === 'enable' ? 1 : 0;
  425. Layer.closeAll();
  426. Controller.api.refresh(table, name);
  427. }, function (data, ret) {
  428. if (ret && ret.code === -3) {
  429. //插件目录发现影响全局的文件
  430. Layer.open({
  431. content: Template("conflicttpl", ret.data),
  432. shade: 0.8,
  433. area: area,
  434. title: __('Warning'),
  435. btn: [__('Continue operate'), __('Cancel')],
  436. end: function () {
  437. },
  438. yes: function () {
  439. operate(name, action, true);
  440. }
  441. });
  442. } else {
  443. Layer.alert(ret.msg);
  444. }
  445. return false;
  446. });
  447. };
  448. var upgrade = function (name, version) {
  449. var userinfo = Controller.api.userinfo.get();
  450. var uid = userinfo ? userinfo.id : 0;
  451. var token = userinfo ? userinfo.token : '';
  452. Fast.api.ajax({
  453. url: 'addon/upgrade',
  454. data: {name: name, uid: uid, token: token, version: version, faversion: Config.faversion}
  455. }, function (data, ret) {
  456. Config['addons'][name] = data.addon;
  457. Layer.closeAll();
  458. Controller.api.refresh(table, name);
  459. }, function (data, ret) {
  460. Layer.alert(ret.msg);
  461. return false;
  462. });
  463. };
  464. // 点击安装
  465. $(document).on("click", ".btn-install", function () {
  466. var that = this;
  467. var name = $(this).closest(".operate").data("name");
  468. var version = $(this).data("version");
  469. var userinfo = Controller.api.userinfo.get();
  470. var uid = userinfo ? userinfo.id : 0;
  471. if (parseInt(uid) === 0) {
  472. return Layer.alert(__('Not login tips'), {
  473. title: __('Warning'),
  474. btn: [__('Login now')],
  475. yes: function (index, layero) {
  476. $(".btn-userinfo").trigger("click");
  477. },
  478. btn2: function () {
  479. install(name, version, false);
  480. }
  481. });
  482. }
  483. install(name, version, false);
  484. });
  485. // 点击卸载
  486. $(document).on("click", ".btn-uninstall", function () {
  487. var name = $(this).closest(".operate").data('name');
  488. if (Config['addons'][name].state == 1) {
  489. Layer.alert(__('Please disable the add before trying to uninstall'), {icon: 7});
  490. return false;
  491. }
  492. Template.helper("__", __);
  493. Layer.confirm(Template("uninstalltpl", {addon: Config['addons'][name]}), {focusBtn: false}, function (index, layero) {
  494. uninstall(name, false, $("input[name='droptables']", layero).prop("checked"));
  495. });
  496. });
  497. // 点击配置
  498. $(document).on("click", ".btn-config", function () {
  499. var name = $(this).closest(".operate").data("name");
  500. Fast.api.open("addon/config?name=" + name, __('Setting'));
  501. });
  502. // 点击启用/禁用
  503. $(document).on("click", ".btn-enable,.btn-disable", function () {
  504. var name = $(this).data("name");
  505. var action = $(this).data("action");
  506. operate(name, action, false);
  507. });
  508. // 点击升级
  509. $(document).on("click", ".btn-upgrade", function () {
  510. var name = $(this).closest(".operate").data('name');
  511. if (Config['addons'][name].state == 1) {
  512. Layer.alert(__('Please disable the add before trying to upgrade'), {icon: 7});
  513. return false;
  514. }
  515. var version = $(this).data("version");
  516. Layer.confirm(__('Upgrade tips', Config['addons'][name].title), function () {
  517. upgrade(name, version);
  518. });
  519. });
  520. $(document).on("click", ".operate .btn-group .dropdown-toggle", function () {
  521. $(this).closest(".btn-group").toggleClass("dropup", $(document).height() - $(this).offset().top <= 200);
  522. });
  523. $(document).on("click", ".view-screenshots", function () {
  524. var row = Table.api.getrowbyindex(table, parseInt($(this).data("index")));
  525. var data = [];
  526. $.each(row.screenshots, function (i, j) {
  527. data.push({
  528. "src": j
  529. });
  530. });
  531. var json = {
  532. "title": row.title,
  533. "data": data
  534. };
  535. top.Layer.photos(top.JSON.parse(JSON.stringify({photos: json})));
  536. });
  537. },
  538. add: function () {
  539. Controller.api.bindevent();
  540. },
  541. config: function () {
  542. Controller.api.bindevent();
  543. },
  544. api: {
  545. formatter: {
  546. title: function (value, row, index) {
  547. var title = '<a class="title" href="' + row.url + '" data-toggle="tooltip" title="' + __('View addon home page') + '" target="_blank">' + value + '</a>';
  548. if (row.screenshots && row.screenshots.length > 0) {
  549. title += ' <a href="javascript:;" data-index="' + index + '" class="view-screenshots text-success" title="' + __('View addon screenshots') + '" data-toggle="tooltip"><i class="fa fa-image"></i></a>';
  550. }
  551. return title;
  552. },
  553. operate: function (value, row, index) {
  554. return Template("operatetpl", {item: row, index: index});
  555. },
  556. toggle: function (value, row, index) {
  557. if (!row.addon) {
  558. return '';
  559. }
  560. return '<a href="javascript:;" data-toggle="tooltip" title="' + __('Click to toggle status') + '" class="btn btn-toggle btn-' + (row.addon.state == 1 ? "disable" : "enable") + '" data-action="' + (row.addon.state == 1 ? "disable" : "enable") + '" data-name="' + row.name + '"><i class="fa ' + (row.addon.state == 0 ? 'fa-toggle-on fa-rotate-180 text-gray' : 'fa-toggle-on text-success') + ' fa-2x"></i></a>';
  561. },
  562. author: function (value, row, index) {
  563. var url = 'javascript:';
  564. if (typeof row.homepage !== 'undefined') {
  565. url = row.homepage;
  566. } else if (typeof row.qq !== 'undefined' && row.qq) {
  567. url = 'https://wpa.qq.com/msgrd?v=3&uin=' + row.qq + '&site=fastadmin.net&menu=yes';
  568. }
  569. return '<a href="' + url + '" target="_blank" data-toggle="tooltip" class="text-primary">' + value + '</a>';
  570. },
  571. price: function (value, row, index) {
  572. if (isNaN(value)) {
  573. return value;
  574. }
  575. return parseFloat(value) == 0 ? '<span class="text-success">' + __('Free') + '</span>' : '<span class="text-danger">¥' + value + '</span>';
  576. },
  577. downloads: function (value, row, index) {
  578. return value;
  579. },
  580. version: function (value, row, index) {
  581. return row.addon && row.addon.version != row.version ? '<a href="' + row.url + '?version=' + row.version + '" target="_blank"><span class="releasetips text-primary" data-toggle="tooltip" title="' + __('New version tips', row.version) + '">' + row.addon.version + '<i></i></span></a>' : row.version;
  582. },
  583. home: function (value, row, index) {
  584. return row.addon && parseInt(row.addon.state) > 0 ? '<a href="' + row.addon.url + '" data-toggle="tooltip" title="' + __('View addon index page') + '" target="_blank"><i class="fa fa-home text-primary"></i></a>' : '<a href="javascript:;"><i class="fa fa-home text-gray"></i></a>';
  585. },
  586. },
  587. bindevent: function () {
  588. Form.api.bindevent($("form[role=form]"));
  589. },
  590. userinfo: {
  591. get: function () {
  592. var userinfo = localStorage.getItem("fastadmin_userinfo");
  593. return userinfo ? JSON.parse(userinfo) : null;
  594. },
  595. set: function (data) {
  596. if (data) {
  597. localStorage.setItem("fastadmin_userinfo", JSON.stringify(data));
  598. } else {
  599. localStorage.removeItem("fastadmin_userinfo");
  600. }
  601. }
  602. },
  603. refresh: function (table, name) {
  604. //刷新左侧边栏
  605. Fast.api.refreshmenu();
  606. //刷新行数据
  607. if ($(".operate[data-name='" + name + "']").length > 0) {
  608. var index = $(".operate[data-name='" + name + "']").closest("tr[data-index]").data("index");
  609. var row = Table.api.getrowbyindex(table, index);
  610. row.addon = typeof Config['addons'][name] !== 'undefined' ? Config['addons'][name] : undefined;
  611. table.bootstrapTable("updateRow", {index: index, row: row});
  612. } else if ($(".btn-switch.active").data("type") == "local") {
  613. $(".btn-refresh").trigger("click");
  614. }
  615. }
  616. }
  617. };
  618. return Controller;
  619. });