diff --git a/commons/src/api/ca.rs b/commons/src/api/ca.rs index 7c21a074..753a53f4 100644 --- a/commons/src/api/ca.rs +++ b/commons/src/api/ca.rs @@ -333,7 +333,7 @@ impl TrustAnchorLocator { /// Creates a new TAL, panics when the provided Cert is not a TA cert. pub fn new(uris: Vec, cert: &Cert) -> Self { if cert.authority_key_identifier().is_some() { - panic!("Trying to create TrustAnchorLocator for a non-TA certificate.") + panic!("Trying to create TAL for a non-TA certificate.") } let encoded_ski = cert.subject_public_key_info().to_info_bytes(); TrustAnchorLocator { uris, encoded_ski } @@ -385,7 +385,7 @@ impl RepoInfo { pub fn ca_repository(&self, name_space: &str) -> uri::Rsync { match name_space { "" => self.base_uri.clone(), - _ => uri::Rsync::from_string(format!("{}{}/", self.base_uri.to_string(), name_space)).unwrap() + _ => self.base_uri.join(name_space.as_ref()).join(b"/") } } @@ -420,7 +420,8 @@ impl RepoInfo { impl PartialEq for RepoInfo { fn eq(&self, other: &RepoInfo) -> bool { - self.base_uri == other.base_uri && self.rpki_notify.as_str() == other.rpki_notify.as_str() + self.base_uri == other.base_uri && + self.rpki_notify.as_str() == other.rpki_notify.as_str() } } @@ -955,10 +956,10 @@ pub struct ResourceSet { } impl ResourceSet { - pub fn from_strs(asns: &str, ipv4: &str, ipv6: &str) -> Result { - let asn = AsResources::from_str(asns).map_err(|_| ResourceSetError::AsnParsing)?; - let v4 = Ipv4Resources::from_str(ipv4).map_err(|_| ResourceSetError::Ipv4Parsing)?; - let v6 = Ipv6Resources::from_str(ipv6).map_err(|_| ResourceSetError::Ipv6Parsing)?; + pub fn from_strs(asn: &str, v4: &str, v6: &str) -> Result { + let asn = AsResources::from_str(asn).map_err(|_| ResSetErr::Asn)?; + let v4 = Ipv4Resources::from_str(v4).map_err(|_| ResSetErr::V4)?; + let v6 = Ipv6Resources::from_str(v6).map_err(|_| ResSetErr::V6)?; Ok(ResourceSet { asn , v4, v6 }) } @@ -1115,21 +1116,21 @@ impl TrustAnchorInfo { } } -//------------ ResourceSetError ---------------------------------------------- +//------------ ResSetErr ----------------------------------------------------- #[derive(Clone, Debug, Display, Eq, PartialEq)] -pub enum ResourceSetError { +pub enum ResSetErr { #[display(fmt="Cannot parse ASN resources")] - AsnParsing, + Asn, #[display(fmt="Cannot parse IPv4 resources")] - Ipv4Parsing, + V4, #[display(fmt="Cannot parse IPv6 resources")] - Ipv6Parsing, + V6, #[display(fmt="Mixed Address Families in configured resource set")] - MixedFamilies, + Mix, } diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 70caacaa..b7cd2e7f 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -6,7 +6,7 @@ build = "build-ui.rs" [dependencies] actix-identity = "0.1.0" -actix-web = { version = "1.0.0", features = ["ssl"] } +actix-web = { version = "1.0.3", features = ["ssl"] } actix-session = "0.1.0" actix-service = "0.4.0" base64 = "^0.9" diff --git a/daemon/ui/src/App.vue b/daemon/ui/src/App.vue index a3ecccdd..57b19e15 100644 --- a/daemon/ui/src/App.vue +++ b/daemon/ui/src/App.vue @@ -10,7 +10,25 @@ - + + + + {{ $t("publishers.publishers") }} + + + {{ $t("trustanchor.ta") }} + + +   + +
@@ -44,6 +62,12 @@ body { color: #ffffff; z-index: 3; } +.el-menu-item a { + text-decoration: none; +} +.logo { + line-height: 10px; +} .logo img { width: 146px; margin-left: -14px; @@ -69,13 +93,25 @@ export default { langs: [ {iso: "it", label: "Italiano"}, {iso: "en", label: "English"} - ] + ], + activeIndex: null }; }, + watch: { + $route (to, from) { + this.activeIndex = this.getActiveIndex(to.name); + } + }, + mounted: function(){ + this.activeIndex = this.getActiveIndex(this.$route.name); + }, created() { this.loadUser(); }, methods: { + getActiveIndex(path) { + return ''+ (['publishers', 'trustanchor'].indexOf(path) + 1); + }, loadUser() { this.user = JSON.parse(localStorage.getItem("user")); }, diff --git a/daemon/ui/src/locales/en.json b/daemon/ui/src/locales/en.json index f28dbfe4..9a71bf3e 100644 --- a/daemon/ui/src/locales/en.json +++ b/daemon/ui/src/locales/en.json @@ -27,6 +27,7 @@ "nopublisherdata": "No published data found." }, "trustanchor": { + "ta": "Trust Anchor", "absent": "There is no embedded Trust Anchor configured", "sure" : "Are you sure? You typically only need this in test and development situations.", "present": "Embedded Trust Anchor Details", diff --git a/daemon/ui/src/router.js b/daemon/ui/src/router.js index 87fe7245..ffde2f2a 100644 --- a/daemon/ui/src/router.js +++ b/daemon/ui/src/router.js @@ -1,7 +1,6 @@ import Vue from 'vue' import Router from 'vue-router' -import Home from './views/Home.vue' import Login from './views/Login.vue' import Publishers from './views/Publishers.vue' import PublisherDetails from './views/PublisherDetails.vue' @@ -15,7 +14,7 @@ const router = new Router({ { path: '/', name: 'home', - component: Home + redirect: { name: 'publishers' } }, { path: '/publishers', diff --git a/daemon/ui/src/views/Home.vue b/daemon/ui/src/views/Home.vue deleted file mode 100644 index 5e2d47ac..00000000 --- a/daemon/ui/src/views/Home.vue +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/daemon/ui/src/views/TrustAnchor.vue b/daemon/ui/src/views/TrustAnchor.vue index a3119fbe..7444a906 100644 --- a/daemon/ui/src/views/TrustAnchor.vue +++ b/daemon/ui/src/views/TrustAnchor.vue @@ -1,127 +1,142 @@ - \ No newline at end of file + diff --git a/daemon/ui/vue.config.js b/daemon/ui/vue.config.js index 27147ecb..c2322325 100644 --- a/daemon/ui/vue.config.js +++ b/daemon/ui/vue.config.js @@ -2,7 +2,7 @@ const webpack = require('webpack') module.exports = { devServer: { - proxy: 'http://localhost:3000' + proxy: 'https://localhost:3000' }, publicPath: '/ui',