mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
parent
1f3f2d605a
commit
f973eca818
1
app.js
1
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);
|
||||
|
@ -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) {
|
||||
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,18 @@
|
||||
<a class="btn btn-primary" id="refresh" href="#">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
Refresh
|
||||
</a>
|
||||
|
||||
<a class="btn btn-primary" id="download" href="#">
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
Search & Download
|
||||
</a>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Mod</th>
|
||||
<th>
|
||||
<a class="btn btn-primary btn-xs pull-right" id="download" href="#">
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
Search & Download
|
||||
</a>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
@ -39,6 +39,11 @@ module.exports = function (modsManager) {
|
||||
res.send('destroy mod ' + req.params.mod);
|
||||
},
|
||||
|
||||
refresh: function(req, res){
|
||||
modsManager.updateMods();
|
||||
res.send(200, {});
|
||||
},
|
||||
|
||||
search: function(req, res){
|
||||
var query = req.body.query || "";
|
||||
modsManager.search(query, function (err, mods) {
|
||||
|
Loading…
Reference in New Issue
Block a user