mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Define domain addition route before domain info.
This commit is contained in:
parent
329cdd0329
commit
cda818783a
2 changed files with 25 additions and 25 deletions
2
src/dist/js/script.min.js
vendored
2
src/dist/js/script.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -30,29 +30,6 @@
|
|||
});
|
||||
});
|
||||
|
||||
// List existing domains
|
||||
app.get('#/domains/:domain', function (c) {
|
||||
c.api('/domains/main', function(dataMain) {
|
||||
domain = {
|
||||
name: c.params['domain'],
|
||||
main: (c.params['domain'] == dataMain.current_main_domain) ? true : false,
|
||||
url: "https://"+c.params['domain']
|
||||
}
|
||||
c.view('domain/domain_info', domain);
|
||||
}, 'PUT');
|
||||
});
|
||||
|
||||
// Domain DNS
|
||||
app.get('#/domains/:domain/dns', function (c) {
|
||||
c.api('/domains/' + c.params['domain'] + '/dns', function(data) {
|
||||
domain = {
|
||||
name: c.params['domain'],
|
||||
dns: data
|
||||
}
|
||||
c.view('domain/domain_dns', domain);
|
||||
});
|
||||
});
|
||||
|
||||
// Add domain form
|
||||
app.get('#/domains/add', function (c) {
|
||||
$.get('https://dyndns.yunohost.org/domains', function() {})
|
||||
|
@ -101,6 +78,29 @@
|
|||
}, 'POST', params);
|
||||
});
|
||||
|
||||
// Get existing domain info
|
||||
app.get('#/domains/:domain', function (c) {
|
||||
c.api('/domains/main', function(dataMain) {
|
||||
domain = {
|
||||
name: c.params['domain'],
|
||||
main: (c.params['domain'] == dataMain.current_main_domain) ? true : false,
|
||||
url: "https://"+c.params['domain']
|
||||
}
|
||||
c.view('domain/domain_info', domain);
|
||||
}, 'PUT');
|
||||
});
|
||||
|
||||
// Domain DNS
|
||||
app.get('#/domains/:domain/dns', function (c) {
|
||||
c.api('/domains/' + c.params['domain'] + '/dns', function(data) {
|
||||
domain = {
|
||||
name: c.params['domain'],
|
||||
dns: data
|
||||
}
|
||||
c.view('domain/domain_dns', domain);
|
||||
});
|
||||
});
|
||||
|
||||
// Remove existing domain
|
||||
app.get('#/domains/:domain/delete', function (c) {
|
||||
c.confirm(
|
||||
|
@ -150,4 +150,4 @@
|
|||
}
|
||||
});
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue