Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI enhancements #1124

Merged
merged 8 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ui_src/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ const App = withRouter((props) => {
path={`${pathDomains.administration}/integrations`}
component={<AppWrapper content={<Administration step={'integrations'} />}></AppWrapper>}
/>
<PrivateRoute
exact
path={`${pathDomains.administration}/cluster_configuration`}
component={<AppWrapper content={<Administration step={'cluster_configuration'} />}></AppWrapper>}
/>
<PrivateRoute
exact
path={`${pathDomains.administration}/usage`}
Expand Down
7 changes: 6 additions & 1 deletion ui_src/src/components/sideBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@ function SideBar() {
return (
<div className="sidebar-container">
<div className="upper-icons">
<img src={Logo} width="45" className="logoimg" alt="logo" onClick={() => history.push(pathDomains.overview)} />
{isCloud() ? (
<img src={state?.companyLogo || Logo} width="45" height="45" className="logoimg" alt="logo" onClick={() => history.push(pathDomains.overview)} />
avrhamNeeman marked this conversation as resolved.
Show resolved Hide resolved
) : (
<img src={Logo} width="45" height="45" className="logoimg" alt="logo" onClick={() => history.push(pathDomains.overview)} />
)}

<div
className="item-wrapper"
onMouseEnter={() => setHoveredItem('overview')}
Expand Down
17 changes: 4 additions & 13 deletions ui_src/src/domain/administration/accountMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,19 @@ function AccountMenu({ selectedMenuItem, setMenuItem }) {
<img src={selectedMenuItem === 'integrations' ? IntegrationColor : IntegrationGray} alt="notifications" />
Integrations
</div>
<div className={selectedMenuItem === 'cluster_configuration' ? 'menu-item selected' : 'menu-item'} onClick={() => setMenuItem('cluster_configuration')}>
<img src={selectedMenuItem === 'cluster_configuration' ? ClusterConfColor : ClusterConfGray} alt="clusterConfiguration" />
Environment configuration
</div>
{!isCloud() && (
<>
<div
className={selectedMenuItem === 'cluster_configuration' ? 'menu-item selected' : 'menu-item'}
onClick={() => setMenuItem('cluster_configuration')}
>
<img src={selectedMenuItem === 'cluster_configuration' ? ClusterConfColor : ClusterConfGray} alt="clusterConfiguration" />
Environment configuration
</div>
<div className={selectedMenuItem === 'version_upgrade' ? 'menu-item selected' : 'menu-item'} onClick={() => setMenuItem('version_upgrade')}>
<img src={selectedMenuItem === 'version_upgrade' ? versionUpgradeColor : versionUpgradeGray} alt="versionUpgrade" />
System information
{!state.isLatest && <div className="update-available">Update available</div>}
</div>
</>
)}
{isCloud() && (
<div className={selectedMenuItem === 'usage' ? 'menu-item selected' : 'menu-item'} onClick={() => setMenuItem('usage')}>
<img src={selectedMenuItem === 'usage' ? RequestsColor : RequestsGray} alt="usage report" />
Usage Report
</div>
)}
</div>
</>
);
Expand Down
2 changes: 2 additions & 0 deletions ui_src/src/domain/administration/billing/billingMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import RequestsGray from '../../../assets/images/setting/requestsGray.svg';
function BillingMenu({ selectedMenuItem, setMenuItem }) {
return (
<div className="side-menu">
<p className="header">Billing</p>
<p className="sub-header">View your monthly usage</p>
<div className={selectedMenuItem === 'usage' ? 'menu-item selected' : 'menu-item'} onClick={() => setMenuItem('usage')}>
<img src={selectedMenuItem === 'usage' ? RequestsColor : RequestsGray} alt="usage report" />
Usage Report
Expand Down
68 changes: 37 additions & 31 deletions ui_src/src/domain/administration/clusterConfiguration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import './style.scss';

import React, { useEffect, useState } from 'react';

import { compareObjects } from '../../../services/valueConvertor';
import { compareObjects, isCloud } from '../../../services/valueConvertor';
import BrokerHostname from '../../../assets/images/BrokerHostname.svg';
import UIHostname from '../../../assets/images/UIHostname.svg';
import DeadLetterInHours from '../../../assets/images/DeadLetterInHours.svg';
Expand Down Expand Up @@ -111,16 +111,18 @@ function ClusterConfiguration() {
{!isLoading && (
<>
<div className="configuration-body">
<SliderRow
title="MAX MESSAGE SIZE"
desc="Maximum message size (payload + headers) in megabytes"
value={formFields?.max_msg_size_mb}
img={DeadLetterInHours}
min={1}
max={12}
unit={'mb'}
onChanges={(e) => handleChange('max_msg_size_mb', e)}
/>
{!isCloud && (
avrhamNeeman marked this conversation as resolved.
Show resolved Hide resolved
<SliderRow
title="MAX MESSAGE SIZE"
desc="Maximum message size (payload + headers) in megabytes"
value={formFields?.max_msg_size_mb}
img={DeadLetterInHours}
min={1}
max={12}
unit={'mb'}
onChanges={(e) => handleChange('max_msg_size_mb', e)}
/>
)}
<SliderRow
title="DEAD LETTERED MESSAGES RETENTION IN HOURS"
desc="Amount of hours to retain dead lettered messages in a DLS"
Expand All @@ -131,26 +133,30 @@ function ClusterConfiguration() {
unit={'h'}
onChanges={(e) => handleChange('dls_retention', e)}
/>
<SliderRow
title="LOGS RETENTION IN DAYS"
desc="Amount of days to retain system logs"
img={LogsRetentionInDays}
value={formFields?.logs_retention}
min={1}
max={100}
unit={'d'}
onChanges={(e) => handleChange('logs_retention', e)}
/>
<TieredInputRow
title="TIERED STORAGE UPLOAD INTERVAL"
desc="(if configured) The interval which the broker will migrate a batch of messages to the second storage tier"
img={TieredStorageInterval}
value={formFields?.tiered_storage_time_sec}
onChanges={(e, err) => {
handleChange('tiered_storage_time_sec', e, err);
}}
/>
{localStorage.getItem(LOCAL_STORAGE_ENV) !== 'docker' && (
{!isCloud && (
avrhamNeeman marked this conversation as resolved.
Show resolved Hide resolved
<SliderRow
title="LOGS RETENTION IN DAYS"
desc="Amount of days to retain system logs"
img={LogsRetentionInDays}
value={formFields?.logs_retention}
min={1}
max={100}
unit={'d'}
onChanges={(e) => handleChange('logs_retention', e)}
/>
)}
{!isCloud && (
avrhamNeeman marked this conversation as resolved.
Show resolved Hide resolved
<TieredInputRow
title="TIERED STORAGE UPLOAD INTERVAL"
desc="(if configured) The interval which the broker will migrate a batch of messages to the second storage tier"
img={TieredStorageInterval}
value={formFields?.tiered_storage_time_sec}
onChanges={(e, err) => {
handleChange('tiered_storage_time_sec', e, err);
}}
/>
)}
{localStorage.getItem(LOCAL_STORAGE_ENV) !== 'docker' && !isCloud() && (
<>
<InputRow
title="BROKER HOSTNAME"
Expand Down
14 changes: 6 additions & 8 deletions ui_src/src/domain/administration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ function Administration({ step }) {
break;
}
case 'cluster_configuration':
if (!isCloud()) {
if (window.location.href.split('/cluster_configuration').length > 1) {
return <ClusterConfiguration />;
} else {
history.replace(`${pathDomains.administration}/cluster_configuration`);
break;
}
if (window.location.href.split('/cluster_configuration').length > 1) {
return <ClusterConfiguration />;
} else {
history.replace(`${pathDomains.administration}/cluster_configuration`);
break;
}
case 'version_upgrade':
if (!isCloud()) {
Expand Down Expand Up @@ -84,7 +82,7 @@ function Administration({ step }) {
<div className="setting-container">
<div className="menu-container">
<AccountMenu selectedMenuItem={selectedMenuItem} setMenuItem={(item) => selectMenuItem(item)} />
{/* {isCloud() && <BillingMenu selectedMenuItem={selectedMenuItem} setMenuItem={(item) => selectMenuItem(item)} />} */}
{isCloud() && <BillingMenu selectedMenuItem={selectedMenuItem} setMenuItem={(item) => selectMenuItem(item)} />}
</div>

<div className="setting-items">{getComponent()}</div>
Expand Down
12 changes: 0 additions & 12 deletions ui_src/src/domain/overview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,6 @@ function OverView() {
Welcome, <span className="username">{username}</span>
</h1>
)}
{isCloud() && (
<div className="org-details">
<div className="hostname">
<p>Account ID : </p>
<span>{localStorage.getItem(LOCAL_STORAGE_ACCOUNT_ID)}</span>
</div>
<div className="hostname">
<p>Broker Hostname : </p>
<span>{host}</span>
</div>
</div>
)}
</div>
</div>
<div>
Expand Down