From ee1ee633d703b87b5695c9cd4edebe222795ba18 Mon Sep 17 00:00:00 2001 From: Richard Wei <54336863+WaysonWei@users.noreply.github.com> Date: Fri, 12 Aug 2022 08:43:01 +1200 Subject: [PATCH] feat(ui): portainer wizard ui change for ce EE-3576 (#7405) * ui change for wizard --- app/assets/css/theme.css | 62 +++++++++++++++---- app/assets/css/vendor-override.css | 25 ++++++-- app/assets/ico/agent.svg | 11 ++++ app/assets/ico/api.svg | 4 ++ app/assets/ico/cloud.svg | 1 + app/assets/ico/edge-agent.svg | 11 ++++ app/assets/ico/import.svg | 11 ++++ app/assets/ico/socket.svg | 4 ++ app/assets/ico/upload-cloud.svg | 1 + app/assets/ico/wizard/agent.svg | 11 ++++ app/assets/ico/wizard/api.svg | 4 ++ app/assets/ico/wizard/edge-agent.svg | 11 ++++ app/assets/ico/wizard/import.svg | 11 ++++ app/assets/ico/wizard/socket.svg | 4 ++ app/assets/ico/zap.svg | 1 + .../BoxSelector/BoxSelectorItem.css | 12 ++++ app/react/components/NavTabs/NavTabs.tsx | 4 +- .../components/Stepper/Stepper.module.css | 30 +++++---- app/react/components/Svg.tsx | 13 ++++ .../FileUpload/FileUploadField.tsx | 2 +- .../EndpointTypeView.tsx | 2 +- .../EnvironmentsCreationView.tsx | 9 +-- .../WizardAzure/WizardAzure.tsx | 10 ++- .../WizardDocker/APITab/APIForm.tsx | 9 ++- .../AgentTab/DeploymentScripts.tsx | 4 +- .../WizardDocker/SocketTab/SocketForm.tsx | 9 ++- .../WizardDocker/WizardDocker.tsx | 8 +-- .../WizardEndpointsList.tsx | 2 +- .../WizardKubernetes/KubeConfigTeaserForm.tsx | 37 +++++------ .../WizardKubernetes/WizardKubernetes.tsx | 6 +- .../shared/AgentForm/AgentForm.tsx | 9 ++- .../EdgeAgentForm/EdgeAgentForm.tsx | 7 ++- .../environments/wizard/HomeView/HomeView.tsx | 4 +- 33 files changed, 272 insertions(+), 77 deletions(-) create mode 100644 app/assets/ico/agent.svg create mode 100644 app/assets/ico/api.svg create mode 100644 app/assets/ico/cloud.svg create mode 100644 app/assets/ico/edge-agent.svg create mode 100644 app/assets/ico/import.svg create mode 100644 app/assets/ico/socket.svg create mode 100644 app/assets/ico/upload-cloud.svg create mode 100644 app/assets/ico/wizard/agent.svg create mode 100644 app/assets/ico/wizard/api.svg create mode 100644 app/assets/ico/wizard/edge-agent.svg create mode 100644 app/assets/ico/wizard/import.svg create mode 100644 app/assets/ico/wizard/socket.svg create mode 100644 app/assets/ico/zap.svg diff --git a/app/assets/css/theme.css b/app/assets/css/theme.css index a8a2c1bf6..1c4ae6984 100644 --- a/app/assets/css/theme.css +++ b/app/assets/css/theme.css @@ -102,13 +102,12 @@ --bg-switch-box-color: var(--ui-gray-5); --bg-input-group-addon-color: var(--ui-gray-3); --bg-btn-default-color: var(--white-color); - --bg-blocklist-hover-color: var(--ui-blue-3); - --bg-boxselector-color: var(--white-color); + --bg-blocklist-hover-color: var(--ui-blue-2); + --bg-boxselector-color: var(--ui-gray-2); --bg-table-color: var(--white-color); --bg-md-checkbox-color: var(--grey-12); --bg-form-control-disabled-color: var(--grey-11); --bg-modal-content-color: var(--white-color); - --bg-code-color: var(--grey-15); --bg-navtabs-color: var(--white-color); --bg-navtabs-hover-color: var(--grey-16); --bg-table-selected-color: var(--grey-14); @@ -165,6 +164,12 @@ --bg-webeditor-color: var(--ui-gray-3); --bg-button-group-color: var(--ui-white); --bg-pagination-disabled-color: var(--ui-white); + --bg-nav-container-color: var(--ui-gray-2); + --bg-code-script-color: var(--ui-white); + --bg-nav-tabs-active-color: var(--ui-gray-4); + --bg-stepper-color: var(--ui-white); + --bg-stepper-active-color: var(--ui-blue-1); + --bg-code-color: var(--ui-white); --text-main-color: var(--grey-7); --text-body-color: var(--grey-6); @@ -178,7 +183,7 @@ --text-blocklist-hover-color: var(--grey-37); --text-dashboard-item-color: var(--grey-32); --text-danger-color: var(--red-1); - --text-code-color: var(--red-2); + --text-code-color: var(--ui-gray-9); --text-navtabs-color: var(--grey-25); --text-cm-default-color: var(--blue-1); --text-cm-meta-color: var(--black-color); @@ -210,6 +215,9 @@ --text-small-select-color: var(--grey-25); --text-bootbox: var(--ui-gray-7); --text-button-group-color: var(--ui-gray-9); + --text-button-dangerlight-color: var(--ui-error-5); + --text-stepper-active-color: var(--ui-blue-8); + --text-boxselector-header: var(--ui-black); --border-color: var(--grey-42); --border-widget-color: var(--grey-43); @@ -224,8 +232,8 @@ --border-boxselector-color: var(--grey-6); --border-md-checkbox-color: var(--grey-19); --border-modal-header-color: var(--grey-45); - --border-navtabs-color: var(--grey-19); - --border-form-section-title-color: var(--grey-26); + --border-navtabs-color: var(--ui-white); + --border-form-section-title-color: var(--grey-33); --border-codemirror-cursor-color: var(--black-color); --border-codemirror-gutters-color: var(--grey-19); --border-pre-color: var(--grey-43); @@ -247,6 +255,8 @@ --border-bootbox: var(--ui-gray-5); --border-blocklist: var(--ui-gray-5); --border-widget: var(--ui-gray-5); + --border-nav-container-color: var(--ui-gray-5); + --border-stepper-color: var(--ui-gray-4); --shadow-box-color: 0 3px 10px -2px var(--grey-50); --shadow-boxselector-color: 0 3px 10px -2px var(--grey-50); @@ -283,8 +293,20 @@ --bg-card-color: var(--grey-1); --bg-main-color: var(--grey-2); --bg-body-color: var(--grey-2); + --bg-btn-default-color: var(--grey-3); + --bg-blocklist-hover-color: var(--grey-iron-10); + --bg-boxselector-color: var(--grey-iron-10); + --bg-blocklist-item-selected-color: var(--grey-3); + --bg-boxselector-wrapper-disabled-color: var(--grey-39); + --bg-card-color: var(--grey-1); --bg-checkbox-border-color: var(--grey-8); - --bg-widget-color: var(--grey-1); + --bg-code-color: var(--ui-gray-warm-11); + --bg-codemirror-color: var(--ui-gray-warm-11); + --bg-codemirror-gutters-color: var(--ui-gray-warm-8); + --bg-codemirror-selected-color: var(--ui-gray-warm-7); + --bg-dropdown-menu-color: var(--grey-1); + --bg-main-color: var(--grey-2); + --bg-widget-color: var(--ui-gray-warm-10); --bg-widget-header-color: var(--grey-1); --bg-widget-table-color: var(--grey-1); --bg-header-color: var(--grey-2); @@ -298,8 +320,7 @@ --bg-md-checkbox-color: var(--grey-31); --bg-form-control-disabled-color: var(--grey-3); --bg-modal-content-color: var(--grey-1); - --bg-code-color: var(--red-4); - --bg-navtabs-color: var(--grey-3); + --bg-navtabs-color: var(--ui-gray-warm-11); --bg-navtabs-hover-color: var(--grey-3); --bg-table-selected-color: var(--grey-3); --bg-codemirror-color: var(--ui-gray-warm-11); @@ -351,6 +372,11 @@ --bg-webeditor-color: var(--ui-gray-warm-9); --bg-button-group-color: var(--ui-black); --bg-pagination-disabled-color: var(--grey-1); + --bg-nav-container-color: var(--ui-gray-iron-10); + --bg-code-script-color: var(--ui-gray-warm-11); + --bg-nav-tabs-active-color: var(--ui-gray-warm-9); + --bg-stepper-color: var(--ui-gray-iron-10); + --bg-stepper-active-color: var(--ui-blue-8); --text-main-color: var(--white-color); --text-body-color: var(--white-color); @@ -398,6 +424,9 @@ --text-small-select-color: var(--grey-7); --text-bootbox: var(--white-color); --text-button-group-color: var(--ui-white); + --text-button-dangerlight-color: var(--ui-error-7); + --text-stepper-active-color: var(--ui-white); + --text-boxselector-header: var(--ui-white); --border-color: var(--grey-3); --border-widget-color: var(--grey-1); @@ -434,6 +463,8 @@ --border-blocklist: var(--ui-gray-9); --border-widget: var(--ui-gray-9); --border-pagination-color: var(--grey-1); + --border-nav-container-color: var(--ui-gray-neutral-8); + --border-stepper-color: var(--ui-gray-warm-9); --blue-color: var(--blue-2); --button-close-color: var(--white-color); @@ -513,11 +544,9 @@ --bg-pre-color: var(--grey-2); --bg-navtabs-hover-color: var(--grey-3); --bg-btn-default-color: var(--black-color); - --bg-code-color: var(--red-4); --bg-navtabs-color: var(--black-color); --bg-input-autofill-color: var(--black-color); - --bg-code-color: var(--grey-2); - --bg-navtabs-color: var(--grey-2); + --bg-code-color: var(--ui-black); --bg-navtabs-hover-color: var(--grey-3); --bg-btn-default-hover-color: var(--grey-3); --bg-btn-default-color: var(--black-color); @@ -536,6 +565,11 @@ --bg-webeditor-color: var(--ui-gray-warm-9); --bg-pagination-disabled-color: var(--ui-black); --bg-pagination-hover-color: var(--ui-black); + --bg-nav-container-color: var(--ui-black); + --bg-code-script-color: var(--ui-black); + --bg-nav-tabs-active-color: var(--ui-black); + --bg-stepper-active-color: var(--ui-blue-8); + --bg-stepper-color: var(--ui-black); --text-main-color: var(--white-color); --text-body-color: var(--white-color); @@ -578,6 +612,8 @@ --text-pagination-span-color: var(--ui-white); --text-bootbox: var(--white-color); --text-pagination-span-hover-color: var(--ui-white); + --text-stepper-active-color: var(--ui-white); + --text-boxselector-header: var(--ui-white); --border-color: var(--grey-55); --border-widget-color: var(--white-color); @@ -610,6 +646,8 @@ --border-bootbox: var(--black-color); --border-blocklist: var(--white-color); --border-widget: var(--white-color); + --border-nav-container-color: var(--ui-white); + --border-stepper-color: var(--ui-gray-warm-9); --shadow-box-color: none; --shadow-boxselector-color: none; diff --git a/app/assets/css/vendor-override.css b/app/assets/css/vendor-override.css index a28609942..03f2dbcbb 100644 --- a/app/assets/css/vendor-override.css +++ b/app/assets/css/vendor-override.css @@ -427,12 +427,29 @@ fieldset[disabled] .btn { } .nav-tabs > li.active > a { - border-top: 0px; - border-left: 0px; - border-right: 0px; - border-bottom: 3px solid red; + border: 0px; } .label-default { line-height: 11px; } + +/* Code Script Style */ +.code-script { + background-color: var(--bg-code-script-color); + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + padding: 5px; +} + +.nav-container { + border: 1px solid var(--border-nav-container-color); + background-color: var(--bg-nav-container-color); + border-radius: 8px; + padding: 10px; +} + +.nav-tabs > li { + background-color: var(--bg-nav-tabs-active-color); + border-top-right-radius: 8px; +} diff --git a/app/assets/ico/agent.svg b/app/assets/ico/agent.svg new file mode 100644 index 000000000..31274e7f4 --- /dev/null +++ b/app/assets/ico/agent.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/app/assets/ico/api.svg b/app/assets/ico/api.svg new file mode 100644 index 000000000..2ed7748bf --- /dev/null +++ b/app/assets/ico/api.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/ico/cloud.svg b/app/assets/ico/cloud.svg new file mode 100644 index 000000000..e4d541039 --- /dev/null +++ b/app/assets/ico/cloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/ico/edge-agent.svg b/app/assets/ico/edge-agent.svg new file mode 100644 index 000000000..a3e45f36a --- /dev/null +++ b/app/assets/ico/edge-agent.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/app/assets/ico/import.svg b/app/assets/ico/import.svg new file mode 100644 index 000000000..570da8ed2 --- /dev/null +++ b/app/assets/ico/import.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/app/assets/ico/socket.svg b/app/assets/ico/socket.svg new file mode 100644 index 000000000..b3974e2bc --- /dev/null +++ b/app/assets/ico/socket.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/ico/upload-cloud.svg b/app/assets/ico/upload-cloud.svg new file mode 100644 index 000000000..419c88656 --- /dev/null +++ b/app/assets/ico/upload-cloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/ico/wizard/agent.svg b/app/assets/ico/wizard/agent.svg new file mode 100644 index 000000000..31274e7f4 --- /dev/null +++ b/app/assets/ico/wizard/agent.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/app/assets/ico/wizard/api.svg b/app/assets/ico/wizard/api.svg new file mode 100644 index 000000000..2ed7748bf --- /dev/null +++ b/app/assets/ico/wizard/api.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/ico/wizard/edge-agent.svg b/app/assets/ico/wizard/edge-agent.svg new file mode 100644 index 000000000..a3e45f36a --- /dev/null +++ b/app/assets/ico/wizard/edge-agent.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/app/assets/ico/wizard/import.svg b/app/assets/ico/wizard/import.svg new file mode 100644 index 000000000..570da8ed2 --- /dev/null +++ b/app/assets/ico/wizard/import.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/app/assets/ico/wizard/socket.svg b/app/assets/ico/wizard/socket.svg new file mode 100644 index 000000000..b3974e2bc --- /dev/null +++ b/app/assets/ico/wizard/socket.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/ico/zap.svg b/app/assets/ico/zap.svg new file mode 100644 index 000000000..7689bf45d --- /dev/null +++ b/app/assets/ico/zap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/react/components/BoxSelector/BoxSelectorItem.css b/app/react/components/BoxSelector/BoxSelectorItem.css index 723b8d592..37f6a7f28 100644 --- a/app/react/components/BoxSelector/BoxSelectorItem.css +++ b/app/react/components/BoxSelector/BoxSelectorItem.css @@ -10,6 +10,8 @@ margin-bottom: 5px; font-weight: bold; user-select: none; + color: var(--text-boxselector-header); + padding: 0px 10px; } .boxselector_header .fa, @@ -115,6 +117,16 @@ padding-left: 20px; } +.boxselector_wrapper input[type='radio']:not(:disabled) ~ label, +.box-selector-item input[type='radio']:not(:disabled) ~ label { + background-color: var(--bg-boxselector-color); +} + +.boxselector_img_container { + line-height: 90px; + margin-bottom: 0; +} + .box-selector-item p { margin-bottom: 0; } diff --git a/app/react/components/NavTabs/NavTabs.tsx b/app/react/components/NavTabs/NavTabs.tsx index 4d7740d5d..2c2d2257d 100644 --- a/app/react/components/NavTabs/NavTabs.tsx +++ b/app/react/components/NavTabs/NavTabs.tsx @@ -19,7 +19,7 @@ export function NavTabs({ options, selectedId, onSelect = () => {} }: Props) { const selected = options.find((option) => option.id === selectedId); return ( - <> +
); function handleSelect(option: Option) { diff --git a/app/react/components/Stepper/Stepper.module.css b/app/react/components/Stepper/Stepper.module.css index f74c1cc8f..4dba12795 100644 --- a/app/react/components/Stepper/Stepper.module.css +++ b/app/react/components/Stepper/Stepper.module.css @@ -18,18 +18,18 @@ position: absolute; content: ''; width: 100%; - top: 20px; + top: 15px; left: -100%; z-index: 2; - border-bottom: 5px solid var(--bg-stepper-item-counter); + border-bottom: 3px solid var(--border-stepper-color); } .step-wrapper::after { position: absolute; content: ''; - border-bottom: 5px solid var(--bg-stepper-item-counter); + border-bottom: 3px solid var(--border-stepper-color); width: 100%; - top: 20px; + top: 15px; left: 0; z-index: 2; } @@ -46,11 +46,13 @@ display: flex; justify-content: center; align-items: center; - width: 40px; - height: 40px; + width: 30px; + height: 30px; border-radius: 50%; - background: var(--bg-stepper-item-counter); + /* background: var(--ui-white); */ + background: var(--bg-stepper-color); margin-bottom: 6px; + border: 1px solid var(--ui-gray-6); } .step-wrapper.active { @@ -59,27 +61,29 @@ } .step-wrapper.active .step { - background: #337ab7; + background: var(--bg-stepper-active-color); + border: 2px solid var(--ui-blue-8); } .step-wrapper.active .step-counter { - color: #fff; + color: var(--text-stepper-active-color); } .step-wrapper.completed .step { - background-color: #48b400; + background: var(--bg-stepper-active-color); + border: 2px solid var(--ui-blue-8); } .step-wrapper.completed .step-counter { - color: #fff; + color: var(--text-stepper-active-color); } .step-wrapper.completed::after { position: absolute; content: ''; - border-bottom: 5px solid #48b400; + border-bottom: 3px solid var(--ui-blue-8); width: 100%; - top: 20px; + top: 15px; left: 0; z-index: 3; } diff --git a/app/react/components/Svg.tsx b/app/react/components/Svg.tsx index e96d8d9f3..0c93335ad 100644 --- a/app/react/components/Svg.tsx +++ b/app/react/components/Svg.tsx @@ -3,6 +3,12 @@ import automode from '@/assets/ico/theme/auto.svg?c'; import darkmode from '@/assets/ico/theme/darkmode.svg?c'; import lightmode from '@/assets/ico/theme/lightmode.svg?c'; import highcontrastmode from '@/assets/ico/theme/highcontrastmode.svg?c'; +// wizard icons +import agent from '@/assets/ico/wizard/agent.svg?c'; +import api from '@/assets/ico/wizard/api.svg?c'; +import edgeagent from '@/assets/ico/wizard/edge-agent.svg?c'; +import cloudimport from '@/assets/ico/wizard/import.svg?c'; +import socket from '@/assets/ico/wizard/socket.svg?c'; // general icons import arrowsupdown from '@/assets/ico/arrows-updown.svg?c'; import arrowright from '@/assets/ico/arrow-right-long.svg?c'; @@ -25,6 +31,7 @@ import heartbeat from '@/assets/ico/heartbeat.svg?c'; import laptop from '@/assets/ico/laptop.svg?c'; import laptopcode from '@/assets/ico/laptop-code.svg?c'; import ldap from '@/assets/ico/ldap.svg?c'; +import magic from '@/assets/ico/magic.svg?c'; import magicwand from '@/assets/ico/magic-wand.svg?c'; import memory from '@/assets/ico/memory.svg?c'; import objectgroup from '@/assets/ico/object-group.svg?c'; @@ -71,6 +78,11 @@ import internal from '@/assets/ico/vendor/internal.svg?c'; const placeholder = Placeholder; export const SvgIcons = { + agent, + api, + edgeagent, + cloudimport, + socket, automode, darkmode, lightmode, @@ -96,6 +108,7 @@ export const SvgIcons = { laptop, laptopcode, ldap, + magic, magicwand, memory, objectgroup, diff --git a/app/react/components/form-components/FileUpload/FileUploadField.tsx b/app/react/components/form-components/FileUpload/FileUploadField.tsx index fb7dc076d..2b7179be2 100644 --- a/app/react/components/form-components/FileUpload/FileUploadField.tsx +++ b/app/react/components/form-components/FileUpload/FileUploadField.tsx @@ -46,7 +46,7 @@ export function FileUploadField({ - {value ? value.name : } + {value ? value.name : } ); diff --git a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx index 8ee8726ae..e4de5573b 100644 --- a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx @@ -33,7 +33,7 @@ export function EnvironmentTypeSelectView() {
- + - + @@ -83,11 +84,11 @@ export function EnvironmentCreationView() { )} >
diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx index 641aac38e..16cba1141 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx @@ -12,6 +12,7 @@ import { LoadingButton } from '@@/buttons/LoadingButton'; import { Input } from '@@/form-components/Input'; import { FormControl } from '@@/form-components/FormControl'; import { BoxSelector } from '@@/BoxSelector'; +import { Icon } from '@@/Icon'; import { NameField, nameValidation } from '../shared/NameField'; import { AnalyticsStateKey } from '../types'; @@ -37,7 +38,7 @@ const initialValues: FormValues = { }, }; -const options = [buildOption('api', 'fa fa-bolt', 'API', '', 'api')]; +const options = [buildOption('api', 'svg-api', 'API', '', 'api')]; interface Props { onCreate(environment: Environment, analytics: AnalyticsStateKey): void; @@ -116,11 +117,16 @@ export function WizardAzure({ onCreate }: Props) {
-