diff --git a/app.js b/app.js index dbd3f64..858f8dd 100644 --- a/app.js +++ b/app.js @@ -29,6 +29,7 @@ app.resource('api/mods', modsRoutes); var serversResource = app.resource('api/servers', serversRoutes); app.resource('api/settings', require('./routes/settings')); +app.post('/api/mods/refresh', modsRoutes.refresh); app.post('/api/mods/search', modsRoutes.search); app.get('/api/servers/:server/start', serversRoutes.start); app.get('/api/servers/:server/stop', serversRoutes.stop); diff --git a/public/js/app/views/mods/list.js b/public/js/app/views/mods/list.js index 963cfde..e8befc2 100644 --- a/public/js/app/views/mods/list.js +++ b/public/js/app/views/mods/list.js @@ -18,7 +18,8 @@ define(function (require) { template: template, events: { - "click #download": "download" + "click #download": "download", + "click #refresh": "refresh", }, initialize: function (options) { @@ -37,5 +38,19 @@ define(function (require) { view.modal = modal; modal.open(); }, + + refresh: function (event) { + event.preventDefault(); + $.ajax({ + url: "/api/mods/refresh", + type: 'POST', + success: function (resp) { + + }, + error: function (resp) { + + }, + }); + }, }); }); diff --git a/public/js/tpl/mods/list.html b/public/js/tpl/mods/list.html index be4bad5..369e682 100644 --- a/public/js/tpl/mods/list.html +++ b/public/js/tpl/mods/list.html @@ -1,13 +1,18 @@ + + + Refresh + + + + + Search & Download + +
Mod | -- - - Search & Download - - | +
---|