show existing domain info on get page
This commit is contained in:
parent
6c32af061b
commit
ef2c179a68
@ -179,19 +179,22 @@ impl<'svc> Service<'svc> {
|
||||
config: Option<domain::config::Config>,
|
||||
}
|
||||
|
||||
match self.domain_manager.get_config(&args.domain) {
|
||||
Ok(_config) => self.render_error_page(500, "TODO not yet implemented"),
|
||||
Err(domain::manager::GetConfigError::NotFound) => self.render_page(
|
||||
let config = match self.domain_manager.get_config(&args.domain) {
|
||||
Ok(config) => Some(config),
|
||||
Err(domain::manager::GetConfigError::NotFound) => None,
|
||||
Err(domain::manager::GetConfigError::Unexpected(e)) => {
|
||||
return self
|
||||
.render_error_page(500, format!("retrieving configuration: {}", e).as_str());
|
||||
}
|
||||
};
|
||||
|
||||
self.render_page(
|
||||
"/domain.html",
|
||||
&Response {
|
||||
domain: args.domain,
|
||||
config: None,
|
||||
config: config,
|
||||
},
|
||||
),
|
||||
Err(domain::manager::GetConfigError::Unexpected(e)) => {
|
||||
self.render_error_page(500, format!("retrieving configuration: {}", e).as_str())
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fn domain_init(&self, args: DomainInitArgs, domain_config: util::FlatConfig) -> SvcResponse {
|
||||
|
@ -2,11 +2,21 @@
|
||||
Configure New Domain
|
||||
</h2>
|
||||
|
||||
{{# if data.config }}
|
||||
|
||||
<p>Your domain <code>{{ data.domain }}</code> is already configured with
|
||||
Domiply. You can see the existing configuration below. If you modify any values
|
||||
you will need to hit the "Next" button to complete the update.</p>
|
||||
|
||||
{{ else }}
|
||||
|
||||
<p>Your domain <code>{{ data.domain }}</code> is not yet configured with Domiply.
|
||||
To get started, please input the details of a public git repo which will be used
|
||||
to serve your domain. When you update the given branch, your domain will be
|
||||
automatically updated too!</p>
|
||||
|
||||
{{/if}}
|
||||
|
||||
<p><em>In the future Domiply will support more backends than just git
|
||||
repos.</em></p>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user