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>,
|
config: Option<domain::config::Config>,
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.domain_manager.get_config(&args.domain) {
|
let config = match self.domain_manager.get_config(&args.domain) {
|
||||||
Ok(_config) => self.render_error_page(500, "TODO not yet implemented"),
|
Ok(config) => Some(config),
|
||||||
Err(domain::manager::GetConfigError::NotFound) => self.render_page(
|
Err(domain::manager::GetConfigError::NotFound) => None,
|
||||||
"/domain.html",
|
|
||||||
&Response {
|
|
||||||
domain: args.domain,
|
|
||||||
config: None,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Err(domain::manager::GetConfigError::Unexpected(e)) => {
|
Err(domain::manager::GetConfigError::Unexpected(e)) => {
|
||||||
self.render_error_page(500, format!("retrieving configuration: {}", e).as_str())
|
return self
|
||||||
|
.render_error_page(500, format!("retrieving configuration: {}", e).as_str());
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
self.render_page(
|
||||||
|
"/domain.html",
|
||||||
|
&Response {
|
||||||
|
domain: args.domain,
|
||||||
|
config: config,
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn domain_init(&self, args: DomainInitArgs, domain_config: util::FlatConfig) -> SvcResponse {
|
fn domain_init(&self, args: DomainInitArgs, domain_config: util::FlatConfig) -> SvcResponse {
|
||||||
|
@ -2,11 +2,21 @@
|
|||||||
Configure New Domain
|
Configure New Domain
|
||||||
</h2>
|
</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.
|
<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 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
|
to serve your domain. When you update the given branch, your domain will be
|
||||||
automatically updated too!</p>
|
automatically updated too!</p>
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<p><em>In the future Domiply will support more backends than just git
|
<p><em>In the future Domiply will support more backends than just git
|
||||||
repos.</em></p>
|
repos.</em></p>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user