feat: add active time display to AssetDetailsCard and update related components
This commit is contained in:
parent
3385d91b8d
commit
f653015345
|
@ -13,6 +13,7 @@ interface AssetDetailsCardInterface {
|
||||||
enableStatue?: boolean;
|
enableStatue?: boolean;
|
||||||
count?: number;
|
count?: number;
|
||||||
totalCapacity?: number;
|
totalCapacity?: number;
|
||||||
|
activeTime?: any;
|
||||||
assetDetails?: {
|
assetDetails?: {
|
||||||
assetName: string;
|
assetName: string;
|
||||||
const: string;
|
const: string;
|
||||||
|
@ -59,6 +60,7 @@ const AssetDetailsCard: React.FC<AssetDetailsCardInterface> = ({
|
||||||
status,
|
status,
|
||||||
count,
|
count,
|
||||||
totalCapacity,
|
totalCapacity,
|
||||||
|
activeTime,
|
||||||
assetDetails,
|
assetDetails,
|
||||||
}) => {
|
}) => {
|
||||||
const [moreDetails, setMoreDetails] = useState(false);
|
const [moreDetails, setMoreDetails] = useState(false);
|
||||||
|
@ -75,7 +77,10 @@ const AssetDetailsCard: React.FC<AssetDetailsCardInterface> = ({
|
||||||
<div className="content">
|
<div className="content">
|
||||||
<div className="name">{name}</div>
|
<div className="name">{name}</div>
|
||||||
{enableStatue && (
|
{enableStatue && (
|
||||||
<div className="status-container">{GetStatus(status)}</div>
|
<>
|
||||||
|
<div className="active-time">Active Time : <span className="value">{activeTime}</span></div>
|
||||||
|
<div className="status-container">{GetStatus(status)}</div>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
{!enableStatue && totalCapacity && (
|
{!enableStatue && totalCapacity && (
|
||||||
<div className="storage-container">Storage/Inventory</div>
|
<div className="storage-container">Storage/Inventory</div>
|
||||||
|
|
|
@ -26,7 +26,7 @@ const MachineContentUi: React.FC<MachineContentUiProps> = ({ machine }) => {
|
||||||
center
|
center
|
||||||
distanceFactor={20}
|
distanceFactor={20}
|
||||||
>
|
>
|
||||||
<AssetDetailsCard name={machine.modelName} status={machine.state} />
|
<AssetDetailsCard name={machine.modelName} status={machine.state} activeTime={machine.activeTime}/>
|
||||||
</Html>
|
</Html>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@ const RoboticArmContentUi: React.FC<RoboticArmContentUiProps> = ({ roboticArm })
|
||||||
center
|
center
|
||||||
distanceFactor={20}
|
distanceFactor={20}
|
||||||
>
|
>
|
||||||
<AssetDetailsCard name={roboticArm.modelName} status={roboticArm.state} />
|
<AssetDetailsCard name={roboticArm.modelName} status={roboticArm.state} activeTime={roboticArm.activeTime}/>
|
||||||
</Html>
|
</Html>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,6 +44,8 @@ const VehicleContentUi: React.FC<VehicleContentUiProps> = ({ vehicle }) => {
|
||||||
status={vehicle.state}
|
status={vehicle.state}
|
||||||
count={vehicle.currentLoad}
|
count={vehicle.currentLoad}
|
||||||
totalCapacity={vehicle.point.action.loadCapacity}
|
totalCapacity={vehicle.point.action.loadCapacity}
|
||||||
|
activeTime={vehicle.activeTime}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</Html>
|
</Html>
|
||||||
);
|
);
|
||||||
|
|
|
@ -9,15 +9,16 @@
|
||||||
transform: translate(-50%, 0);
|
transform: translate(-50%, 0);
|
||||||
width: 70vw;
|
width: 70vw;
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
|
|
||||||
&.hide {
|
&.hide {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
.simulation-player-container
|
|
||||||
.controls-container
|
.simulation-player-container .controls-container .simulation-button-container {
|
||||||
.simulation-button-container {
|
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.simulation-player-container {
|
.simulation-player-container {
|
||||||
background: var(--background-color);
|
background: var(--background-color);
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
|
@ -327,6 +328,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.open {
|
.open {
|
||||||
|
|
||||||
.start-displayer,
|
.start-displayer,
|
||||||
.end-displayer {
|
.end-displayer {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -423,13 +425,16 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
outline: 1px solid transparent;
|
outline: 1px solid transparent;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
outline: 1px solid var(--border-color);
|
outline: 1px solid var(--border-color);
|
||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hide {
|
&.hide {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
@ -496,6 +501,7 @@
|
||||||
|
|
||||||
.asset-details-card-wrapper {
|
.asset-details-card-wrapper {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
.asset-details-card-container {
|
.asset-details-card-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
@ -527,6 +533,7 @@
|
||||||
.asset-details-header {
|
.asset-details-header {
|
||||||
@include flex-space-between;
|
@include flex-space-between;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
.name {
|
.name {
|
||||||
text-wrap: nowrap;
|
text-wrap: nowrap;
|
||||||
|
@ -536,20 +543,34 @@
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-container {
|
.status-container {
|
||||||
.status {
|
.status {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
|
padding-top: 4px;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
@include flex-center;
|
@include flex-center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.active-time {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
.value {
|
||||||
|
color: var(--highlight-text-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.storage-container {
|
.storage-container {
|
||||||
font-size: var(--font-size-tiny);
|
font-size: var(--font-size-tiny);
|
||||||
color: var(--highlight-text-color);
|
color: var(--highlight-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,6 +582,7 @@
|
||||||
border-radius: #{$border-radius-small};
|
border-radius: #{$border-radius-small};
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.process-running {
|
.process-running {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 35%;
|
width: 35%;
|
||||||
|
@ -584,6 +606,7 @@
|
||||||
top: -2px;
|
top: -2px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
|
|
||||||
.count-ui-container {
|
.count-ui-container {
|
||||||
background: var(--background-color-solid);
|
background: var(--background-color-solid);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
@ -593,19 +616,24 @@
|
||||||
max-width: 80px;
|
max-width: 80px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
@include flex-center;
|
@include flex-center;
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
@include flex-center;
|
@include flex-center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.display {
|
.display {
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.value-container {
|
.value-container {
|
||||||
@include flex-center;
|
@include flex-center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
|
||||||
.progress-bar {
|
.progress-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -621,13 +649,12 @@
|
||||||
background: var(--background-color);
|
background: var(--background-color);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.fill {
|
.fill {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: linear-gradient(
|
background: linear-gradient(to top,
|
||||||
to top,
|
var(--background-color-accent) var(--process-fill-percentage),
|
||||||
var(--background-color-accent) var(--process-fill-percentage),
|
transparent var(--process-fill-percentage));
|
||||||
transparent var(--process-fill-percentage)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,6 +672,7 @@
|
||||||
from {
|
from {
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
transform: translateX(300%);
|
transform: translateX(300%);
|
||||||
}
|
}
|
||||||
|
@ -654,10 +682,12 @@
|
||||||
0% {
|
0% {
|
||||||
background-position: 0% 50%;
|
background-position: 0% 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
background-position: 100% 50%;
|
background-position: 100% 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
background-position: 0% 50%;
|
background-position: 0% 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue