From 534e0a982bc84b79f7c7d910890bb2e7297df9ea Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Mon, 4 Jan 2021 10:38:49 -0700 Subject: [PATCH] Monitoring UI Polish - Overview & Create Route rancher/dashboard#1986 update receiver tabs and labeled tooltips fix styling on receiver responder rows --- assets/styles/app.scss | 1 + assets/styles/global/_resource.scss | 92 +++++ assets/translations/en-us.yaml | 26 ++ components/CruResource.vue | 98 +---- components/form/LabeledInput.vue | 2 +- components/form/LabeledSelect.vue | 2 +- components/form/LabeledTooltip.vue | 4 +- edit/monitoring.coreos.com.receiver/index.vue | 20 +- .../types/opsgenie.vue | 389 +++++++++--------- .../types/pagerduty.vue | 154 ++++--- .../types/slack.vue | 38 +- models/monitoring.coreos.com.receiver.js | 27 +- pages/c/_cluster/monitoring/index.vue | 185 ++++----- 13 files changed, 542 insertions(+), 496 deletions(-) create mode 100644 assets/styles/global/_resource.scss diff --git a/assets/styles/app.scss b/assets/styles/app.scss index 85a1e2f4b5..b3a1cf59b4 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -25,6 +25,7 @@ @import "./global/tooltip"; @import "./global/table"; @import "./global/select"; +@import "./global/resource"; @import "./vendor/vue-select"; @import "./vendor/vue-js-modal"; diff --git a/assets/styles/global/_resource.scss b/assets/styles/global/_resource.scss new file mode 100644 index 0000000000..7e68931852 --- /dev/null +++ b/assets/styles/global/_resource.scss @@ -0,0 +1,92 @@ +.create-resource-container { + .subtypes-container { + display: flex; + flex-wrap: wrap; + width: 100%; + } + .subtype-content { + width: 100%; + } + + .subtype-banner { + border-left: 5px solid var(--primary); + border-radius: var(--border-radius); + display: flex; + flex-basis: 40%; + margin: 10px; + min-height: 100px; + padding: 10px; + box-shadow: 0 0 20px var(--shadow); + + &.disabled { + cursor: not-allowed !important; + background-color: var(--disabled-bg); + } + + &.selected { + background-color: var(--accent-btn); + } + + &.top { + background-image: linear-gradient( + -90deg, + var(--body-bg), + var(--accent-btn) + ); + + h2 { + margin: 0px; + } + } + + .title { + align-items: center; + display: flex; + width: 100%; + + h5 { + margin: 0; + } + + .flex-right { + margin-left: auto; + } + } + + .description { + color: var(--input-label); + display: flex; + flex-direction: column; + justify-content: center; + } + + &:not(.top) { + align-items: top; + flex-direction: row; + justify-content: start; + &:hover { + cursor: pointer; + box-shadow: 0px 0px 1px var(--outline-width) var(--outline); + } + } + + .round-image { + border-radius: 50%; + height: 50px; + margin-right: 10px; + width: 50px; + overflow: hidden; + } + + .banner-abbrv { + align-items: center; + background-color: var(--primary); + color: white; + display: flex; + font-size: 2.5em; + height: 100%; + justify-content: center; + width: 100%; + } + } +} diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index 14ec509802..0b9a36342d 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -1119,6 +1119,32 @@ monitoring: block: Block file: Filesystem +monitoringReceiver: + addButton: Add {type} + custom: + label: Custom + title: Custom Config + info: The YAML provided here will be directly appended to your receiver within the Alertmanager Config Secret. + email: + label: Email + title: Email Config + opsgenie: + label: Opsgenie + title: Opsgenie Config + pagerduty: + label: PagerDuty + title: PagerDuty Config + info: "You can find additional info on creating an Integration Key for PagerDuty here." + slack: + label: Slack + title: Slack Config + info: "You can find additional info on creating Incoming Webhooks for Slack here ." + webhook: + label: Webhook + title: Webhook Config + + + monitoringRoute: groups: label: Group By diff --git a/components/CruResource.vue b/components/CruResource.vue index 59a1e01b97..f82b7eca6b 100644 --- a/components/CruResource.vue +++ b/components/CruResource.vue @@ -359,7 +359,7 @@ export default { - diff --git a/components/form/LabeledInput.vue b/components/form/LabeledInput.vue index 1a92bd26c9..2a8935ba73 100644 --- a/components/form/LabeledInput.vue +++ b/components/form/LabeledInput.vue @@ -22,8 +22,8 @@ export default { }, tooltip: { - type: String, default: null, + type: [String, Object] }, hoverTooltip: { diff --git a/components/form/LabeledSelect.vue b/components/form/LabeledSelect.vue index 33d71452e7..4a6c7e52c3 100644 --- a/components/form/LabeledSelect.vue +++ b/components/form/LabeledSelect.vue @@ -72,7 +72,7 @@ export default { }, tooltip: { default: null, - type: String + type: [String, Object] }, value: { default: null, diff --git a/components/form/LabeledTooltip.vue b/components/form/LabeledTooltip.vue index 8e5e73be66..76c054d78f 100644 --- a/components/form/LabeledTooltip.vue +++ b/components/form/LabeledTooltip.vue @@ -2,7 +2,7 @@ export default { props: { value: { - type: String, + type: [String, Object], default: null }, @@ -22,7 +22,7 @@ export default {