Merge branch 'feature/continue-joinpeertube' into 'master'
Handle errors in instance listing See merge request framasoft/joinpeertube!4
This commit is contained in:
commit
ca4cf8e630
3 changed files with 18 additions and 12 deletions
|
@ -119,7 +119,8 @@ or the entire fediverse.
|
|||
Liste des instances
|
||||
|
||||
<div id="instances-list" class="list-group"></div>
|
||||
<div class="alert alert-info">This is like picking an e-mail hosting provider: the domain will also be part of your username!</div>
|
||||
<div id="instances-list-error" class="alert alert-danger" style="display: none">We are sorry but we failed to list available instances. Please try again later.</div>
|
||||
<div class="alert alert-info">This is like picking an e-mail hosting provider: the domain will be part of your username!</div>
|
||||
|
||||
|
||||
{{% /grid %}}
|
||||
|
|
|
@ -119,7 +119,8 @@ Liste des instances
|
|||
|
||||
<div id="instances-list" class="list-group"></div>
|
||||
|
||||
<div class="alert alert-info">This is like picking an e-mail hosting provider: the domain will also be part of your username!</div>
|
||||
<div id="instances-list-error" class="alert alert-danger" style="display: none">Nous sommes désolé mais nous n'arrivons pas à récupérer la liste des instances. Merci de réessayer plus tard.</div>
|
||||
<div class="alert alert-info">C'est comme choisir un fournisseur d'email : le nom de domaine fera partie de votre identifiant !</div>
|
||||
|
||||
{{% /grid %}}
|
||||
{{% /grid %}}
|
||||
|
|
|
@ -6,19 +6,23 @@ $(function () {
|
|||
signup: true,
|
||||
healthy: true
|
||||
}
|
||||
const instancesListElement = $('#instances-list')
|
||||
|
||||
$.get(instancesApi, data, function (res) {
|
||||
const instances = res.data
|
||||
$.get(instancesApi, data)
|
||||
.done(function (res) {
|
||||
const instances = res.data
|
||||
|
||||
const lis = []
|
||||
instances.forEach(function (instance) {
|
||||
const el = createInstanceElement(instance.host, instance.name, instance.shortDescription)
|
||||
lis.push(el)
|
||||
const lis = []
|
||||
instances.forEach(function (instance) {
|
||||
const el = createInstanceElement(instance.host, instance.name, instance.shortDescription)
|
||||
lis.push(el)
|
||||
})
|
||||
|
||||
instancesListElement.append(lis)
|
||||
})
|
||||
.fail(function (err) {
|
||||
$('#instances-list-error').css('display', 'block')
|
||||
})
|
||||
|
||||
$('#instances-list').append(lis)
|
||||
|
||||
})
|
||||
|
||||
function createInstanceElement (host, name, description) {
|
||||
const a = $('<a>', {
|
||||
|
|
Loading…
Reference in a new issue