v1.18.x
Barış Soner Uşaklı 7 years ago
parent a0dfc43cc4
commit c7b73b4e41

@ -33,11 +33,18 @@ pluginsController.get = function (req, res, next) {
var compatiblePkgNames = payload.compatible.map(function (pkgData) { var compatiblePkgNames = payload.compatible.map(function (pkgData) {
return pkgData.name; return pkgData.name;
}); });
var installedPlugins = payload.compatible.filter(function (plugin) {
return plugin && plugin.installed;
});
var activePlugins = payload.all.filter(function (plugin) {
return plugin && plugin.installed && plugin.active;
});
res.render('admin/extend/plugins', { res.render('admin/extend/plugins', {
installed: payload.compatible.filter(function (plugin) { installed: installedPlugins,
return plugin.installed; installedCount: installedPlugins.length,
}), activeCount: activePlugins.length,
inactiveCount: Math.max(0, installedPlugins.length - activePlugins.length),
upgradeCount: payload.compatible.reduce(function (count, current) { upgradeCount: payload.compatible.reduce(function (count, current) {
if (current.installed && current.outdated) { if (current.installed && current.outdated) {
count += 1; count += 1;

@ -1,7 +1,16 @@
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li class="active"><a href="#installed" data-toggle="tab">[[admin/extend/plugins:installed]]</a></li> <li class="active"><a href="#installed" data-toggle="tab">
<li><a href="#active" data-toggle="tab">[[admin/extend/plugins:active]]</a></li> [[admin/extend/plugins:installed]]
<li><a href="#deactive" data-toggle="tab">[[admin/extend/plugins:inactive]]</a></li> <span class="badge">{installedCount}</span>
</a></li>
<li><a href="#active" data-toggle="tab">
[[admin/extend/plugins:active]]
<span class="badge">{activeCount}</span>
</a></li>
<li><a href="#deactive" data-toggle="tab">
[[admin/extend/plugins:inactive]]
<span class="badge">{inactiveCount}</span>
</a></li>
<li><a href="#upgrade" data-toggle="tab"> <li><a href="#upgrade" data-toggle="tab">
[[admin/extend/plugins:out-of-date]] [[admin/extend/plugins:out-of-date]]
<span class="badge">{upgradeCount}</span> <span class="badge">{upgradeCount}</span>

Loading…
Cancel
Save