Merge pull request #264 from YunoHost/burn-applists

Remove the appslist system from the webadmin
This commit is contained in:
Alexandre Aubin 2019-11-07 09:31:00 +01:00 committed by GitHub
commit ffe7f2d66e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 198 deletions

View file

@ -308,80 +308,4 @@
});
});
});
// List available apps lists
app.get('#/tools/appslists', function (c) {
c.api('GET', '/appslists', {}, function(data) {
list = [];
$.each(data, function(listname, listinfo) {
list.push({
'name': listname,
'url': listinfo['url'],
'lastUpdate': listinfo['lastUpdate']
});
});
c.view('tools/tools_appslists_list', {
appslists: list
});
});
});
// Add a new apps list
app.post('#/tools/appslists', function (c) {
list = {
'name' : c.params['appslist_name'],
'url' : c.params['appslist_url']
}
c.api('PUT', '/appslists', list, function(data) {
c.redirect_to('#/tools/appslists/' + list.name);
});
});
// Show appslist info and operations
app.get('#/tools/appslists/:appslist', function (c) {
c.api('GET', '/appslists', {}, function(data) {
if (typeof data[c.params['appslist']] !== 'undefined') {
list = {
'name' : c.params['appslist'],
'url': data[c.params['appslist']]['url'],
'lastUpdate': data[c.params['appslist']]['lastUpdate'],
'removable' : (c.params['appslist'] !== 'yunohost') ? true : false // Do not remove default apps list
};
c.view('tools/tools_appslists_info', {appslist: list});
}
else {
c.flash('warning', y18n.t('appslists_unknown_list', [c.params['appslist']]));
c.redirect_to('#/tools/appslists', {slide: false});
}
});
});
// Refresh available apps list
app.get('#/tools/appslists/refresh', function (c) {
c.api('PUT', '/appslists', {}, function(data) {
c.redirect_to('#/apps/install', {slide: false});
});
});
// Refresh specific apps list
app.get('#/tools/appslists/:appslist/refresh', function (c) {
c.api('PUT', '/appslists', {'name' : c.params['appslist']}, function(data) {
c.redirect_to('#/tools/appslists', {slide: false});
});
});
// Remove apps list
app.get('#/tools/appslists/:appslist/remove', function (c) {
c.confirm(
y18n.t('appslist'),
y18n.t('appslists_confirm_remove', [c.params['app']]),
function() {
c.api('DELETE', '/appslists', {'name' : c.params['appslist']}, function() {
c.redirect_to('#/tools/appslists');
});
}
);
});
})();

View file

@ -18,7 +18,6 @@
"app_info_uninstall_desc": "Remove this application.",
"app_install_cancel": "Installation cancelled.",
"app_install_custom_no_manifest": "No manifest.json file",
"app_list": "App list",
"app_level": "App level",
"app_make_default": "Make default",
"app_no_actions": "This application doesn't have any actions",
@ -257,8 +256,6 @@
"previous": "Previous",
"protocol": "Protocol",
"read_more": "Read more",
"rerun_diagnosis": "Rerun diagnosis",
"refresh_app_list": "Refresh list",
"request_adoption": "waiting adoption",
"request_adoption_details": "The current maintainer would like to stop maintaining this app. Feel free to propose yourself as the new maintainer!",
"request_help": "need help",
@ -378,15 +375,6 @@
"regenerate_selfsigned_cert": "Regenerate self-signed certificate",
"revert_to_selfsigned_cert_message": "If you really want to, you can reinstall a self-signed certificate. (Not recommended)",
"revert_to_selfsigned_cert": "Revert to a self-signed certificate",
"appslists": "Applications lists",
"appslists_no_lists": "No applications lists",
"appslists_custom": "Custom applications list",
"appslists_manage": "Manage applications lists",
"appslists_confirm_remove": "Are you sure you want to remove this applications list?",
"appslists_info_refresh_desc": "Refresh applications status for this list.",
"appslists_info_remove_desc": "Applications from this list will not be available anymore.",
"appslists_last_update": "Last update",
"appslists_unknown_list": "Unknown apps list: %s",
"name": "Name",
"purge_user_data_checkbox": "Purge %s's data? (This will remove the content of its home and mail directories.)",
"purge_user_data_warning": "Purging user's data is not reversible. Be sure you know what you're doing!"

View file

@ -1,49 +0,0 @@
<div class="btn-breadcrumb">
<a href="#/" ><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
<a href="#/tools">{{t 'tools'}}</a>
<a href="#/tools/appslists">{{t 'appslists'}}</a>
<a href="#/tools/appslists/{{name}}">{{appslist.name}}</a>
</div>
<div class="separator"></div>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title"><span class="fa-fw fa-info-circle"></span> {{t 'infos'}}</h2>
</div>
<div class="panel-body">
<dl class="dl-horizontal">
<dt>{{t 'name'}}</dt>
<dd>{{appslist.name}}</dd>
<dt>{{t 'url'}}</dt>
<dd>{{appslist.url}}</dd>
<dt>{{t 'appslists_last_update'}}</dt>
<dd>{{formatTime appslist.lastUpdate day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>
</dl>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
<span class="fa-fw fa-wrench"></span> {{t 'operations'}}
</h2>
</div>
<div class="panel-body">
<div class="container">
<p>{{t 'appslists_info_refresh_desc'}}</p>
<a href="#/tools/appslists/{{appslist.name}}/refresh" role="button" class="btn btn-info slide">
<span class="fa-refresh"></span> {{t 'refresh_app_list'}}
</a>
</div>
{{#appslist.removable}}
<hr>
<div class="container">
<p>{{t 'appslists_info_remove_desc'}}</p>
<a role="button" href="#/tools/appslists/{{appslist.name}}/remove" class="btn btn-danger slide back">
<span class="fa-trash-o"></span> {{t 'remove'}}
</a>
</div>
{{/appslist.removable}}
</div>
</div>

View file

@ -1,57 +0,0 @@
<div class="btn-breadcrumb">
<a href="#/" ><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
<a href="#/tools">{{t 'tools'}}</a>
<a href="#/tools/appslists">{{t 'appslists'}}</a>
</div>
<div class="separator"></div>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title"><span class="fa-fw fa-list"></span> {{t 'appslists'}}</h2>
</div>
<div class="list-group">
{{#appslists}}
<a href="#/tools/appslists/{{name}}" class="list-group-item">
<span class="fa-chevron-right pull-right"></span>
<h2 class="list-group-item-heading">
{{name}}
</h2>
</a>
{{/appslists}}
{{^appslists}}
<p class="list-group-item text-warning">
<span class="fa-exclamation-triangle"></span>
{{t 'appslists_no_lists'}}
</p>
{{/appslists}}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title"><span class="fa-fw fa-plus"></span> {{t 'appslists_custom'}}</h2>
</div>
<div class="panel-body">
<form action="#/tools/appslists" method="POST" class="form-horizontal">
<div class="form-group has-feedback">
<label for="appslist_name" class="col-md-2 col-sm-12 control-label">{{t 'name'}}</label>
<div class="col-md-10 col-sm-12">
<input type="text" id="appslist_name" name="appslist_name" class="form-control" value="" required />
</div>
</div>
<div class="form-group has-feedback">
<label for="appslist_url" class="col-md-2 col-sm-12 control-label">{{t 'url'}}</label>
<div class="col-md-10 col-sm-12">
<input type="url" id="appslist_url" name="appslist_url" class="form-control" value="" placeholder="https://some.domain.tld/somelist.json" required />
</div>
</div>
<div class="form-group">
<div class="col-md-10 col-md-push-2 col-sm-12">
<input type="submit" class="btn btn-success slide" value="{{t 'add'}}">
</div>
</div>
</form>
</div>
</div>

View file

@ -38,10 +38,6 @@
<span class="fa-chevron-right pull-right"></span>
<h2 class="list-group-item-heading">{{t 'tools_security_feed'}}</h2>
</a>
<a href="#/tools/appslists" class="list-group-item slide clearfix">
<span class="pull-right fa-chevron-right"></span>
<h2 class="list-group-item-heading">{{t 'appslists'}}</h2>
</a>
<a href="#/tools/ca" class="list-group-item slide">
<span class="fa-chevron-right pull-right"></span>
<h2 class="list-group-item-heading">{{t 'tools_download_ca'}}</h2>