mirror of
https://github.com/pcvolkmer/cert-tools.git
synced 2025-09-13 11:12:52 +00:00
chore: colors for subject and authority key id
This commit is contained in:
@@ -572,7 +572,13 @@ impl Ui {
|
|||||||
.align_y(alignment::Vertical::Center),
|
.align_y(alignment::Vertical::Center),
|
||||||
row![
|
row![
|
||||||
text("Subject-Key-Id: ").width(160),
|
text("Subject-Key-Id: ").width(160),
|
||||||
monospace_text(cert.subject_key_id().to_string()),
|
monospace_text(cert.subject_key_id().to_string()).style(move |_| {
|
||||||
|
if idx == 0 {
|
||||||
|
text::Style::default()
|
||||||
|
} else {
|
||||||
|
self.get_cert_key_style(idx as u8 - 1)
|
||||||
|
}
|
||||||
|
}),
|
||||||
text(" "),
|
text(" "),
|
||||||
if idx == 0 {
|
if idx == 0 {
|
||||||
container(text(""))
|
container(text(""))
|
||||||
@@ -588,7 +594,13 @@ impl Ui {
|
|||||||
],
|
],
|
||||||
row![
|
row![
|
||||||
text("Authority-Key-Id: ").width(160),
|
text("Authority-Key-Id: ").width(160),
|
||||||
monospace_text(cert.authority_key_id().to_string()),
|
monospace_text(cert.authority_key_id().to_string()).style(move |_| {
|
||||||
|
if idx >= chain.certs().len() - 1 {
|
||||||
|
text::Style::default()
|
||||||
|
} else {
|
||||||
|
self.get_cert_key_style(idx as u8)
|
||||||
|
}
|
||||||
|
}),
|
||||||
text(" "),
|
text(" "),
|
||||||
if idx >= chain.certs().len() - 1 {
|
if idx >= chain.certs().len() - 1 {
|
||||||
container(text(""))
|
container(text(""))
|
||||||
@@ -1046,6 +1058,16 @@ Authority-Key-Id: {}
|
|||||||
..container::Style::default()
|
..container::Style::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_cert_key_style(&self, idx: u8) -> text::Style {
|
||||||
|
text::Style {
|
||||||
|
color: if self.wrong_chain_certificate_indexes().contains(&idx) {
|
||||||
|
Some(color!(0xaa0000))
|
||||||
|
} else {
|
||||||
|
text::Style::default().color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
Reference in New Issue
Block a user