mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Keep only uninstalled apps or multi-instance apps on app install list.
This commit is contained in:
parent
974e8774fb
commit
ae5a79c914
2 changed files with 13 additions and 11 deletions
12
js/app.js
12
js/app.js
|
@ -938,7 +938,7 @@ app = Sammy('#main', function (sam) {
|
|||
sam.get('#/apps', function (c) {
|
||||
c.api('/apps', function(data) { // http://api.yunohost.org/#!/app/app_list_get_8
|
||||
// Keep only installed apps
|
||||
data2 = { 'apps': [], 'installed': true }
|
||||
data2 = { 'apps': [], 'installed_apps': true }
|
||||
$.each(data['apps'], function(k, v) {
|
||||
if (v['installed']) data2['apps'].push(v);
|
||||
});
|
||||
|
@ -952,13 +952,15 @@ app = Sammy('#main', function (sam) {
|
|||
sam.get('#/apps/install', function (c) {
|
||||
c.api('/apps', function(data) { // http://api.yunohost.org/#!/app/app_list_get_8
|
||||
c.api('/apps?raw', function(dataraw) { // http://api.yunohost.org/#!/app/app_list_get_8
|
||||
// Keep only uninstalled apps
|
||||
data2 = { 'apps': [] }
|
||||
// Keep only uninstalled apps, or multi-instance apps
|
||||
data2 = { 'apps': [], 'installed_apps': false }
|
||||
$.each(data['apps'], function(k, v) {
|
||||
if (dataraw[v['id']].manifest.multi_instance) v['installed'] = false;
|
||||
if (!v['installed'] && !v['id'].match(/__[0-9]{1,5}$/)) data2['apps'].push(v);
|
||||
if ((!v['installed'] || dataraw[v['id']].manifest.multi_instance == "true") && !v['id'].match(/__[0-9]{1,5}$/)) {
|
||||
data2['apps'].push(v);
|
||||
}
|
||||
});
|
||||
|
||||
// Sort app list
|
||||
c.arraySortById(data2.apps);
|
||||
c.view('app/app_list', data2);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{#installed}}
|
||||
{{#installed_apps}}
|
||||
<div class="btn-breadcrumb">
|
||||
<a href="#/" ><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
|
||||
<a href="#/apps">{{t 'applications'}}</a>
|
||||
|
@ -9,9 +9,9 @@
|
|||
<span class="fa-plus"></span> {{t 'install'}}
|
||||
</a>
|
||||
</div>
|
||||
{{/installed}}
|
||||
{{/installed_apps}}
|
||||
|
||||
{{^installed}}
|
||||
{{^installed_apps}}
|
||||
<div class="btn-breadcrumb">
|
||||
<a href="#/" ><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
|
||||
<a href="#/apps">{{t 'applications'}}</a>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<span class="fa-refresh"></span> {{t 'refresh_app_list'}}
|
||||
</a>
|
||||
</div>
|
||||
{{/installed}}
|
||||
{{/installed_apps}}
|
||||
|
||||
<div class="separator"></div>
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
{{^installed}}
|
||||
{{^installed_apps}}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title"><span class="fa-fw fa-download"></span> {{t 'custom_app_install'}}</h2>
|
||||
|
@ -70,4 +70,4 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{/installed}}
|
||||
{{/installed_apps}}
|
||||
|
|
Loading…
Add table
Reference in a new issue