Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
53 changes: 50 additions & 3 deletions react/src/component/DeviceAgentsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,14 @@ export default class DeviceAgentsView extends BaseView {
style={{ backgroundColor: folderHeadBgColor }}
onClick={() => this.changeCollapseStatus(agent.agentId)}>

<div style={{ color: 'white', fontSize: 'large', fontWeight: 'bold' }}>
<div style={{ color: 'white', fontSize: 'large', fontWeight: 'bold', display: 'flex', alignItems: 'center', gap: '6px' }}>
{agent.agentName}: {agent.devices.length}
{agent.teamId ?
<MUITooltip title={"Private — Team: " + agent.teamName}>
<span className="material-icons-outlined" style={{ fontSize: '1.1rem', color: '#ffd54f' }}>lock</span>
</MUITooltip>
: null
}
</div>

<div class='deviceAgents-agentBanner-tail'>
Expand Down Expand Up @@ -574,8 +580,49 @@ export default class DeviceAgentsView extends BaseView {
}

componentDidMount() {
this.getLatestAgentVersion()
this.updateDeviceListData()
// MOCK DATA for visual testing - remove before PR
this.setState({
latestAgentVersion: '999',
agents: [
{
agentId: 'agent-private-1',
agentName: 'Private Agent (Team A)',
agentOS: 'Linux',
agentVersionCode: '999',
agentVersionName: '1.0.0',
agentStatus: 'HEALTHY',
teamId: 'team-001',
teamName: 'Team Alpha',
userName: 'user@example.com',
hostname: 'host-private',
ip: '192.168.1.1',
functionAvailabilities: [],
devices: [
{ id: 'd1', serialNum: 'PRIV001', name: 'Pixel 6', model: 'Pixel 6', status: 'ONLINE', brand: 'Google', type: 'ANDROID', isPrivate: true, osSDKInt: '31', screenSize: '1080x2400', screenDensity: 420, deviceGroup: ['groupA'] },
{ id: 'd2', serialNum: 'PUB002', name: 'Galaxy S21', model: 'Galaxy S21', status: 'ONLINE', brand: 'Samsung', type: 'ANDROID', isPrivate: false, osSDKInt: '30', screenSize: '1080x2400', screenDensity: 400, deviceGroup: [] },
]
},
{
agentId: 'agent-public-2',
agentName: 'Public Agent (No Team)',
agentOS: 'Windows',
agentVersionCode: '999',
agentVersionName: '1.0.0',
agentStatus: 'HEALTHY',
teamId: null,
teamName: null,
userName: 'admin@example.com',
hostname: 'host-public',
ip: '192.168.1.2',
functionAvailabilities: [],
devices: [
{ id: 'd3', serialNum: 'PUB003', name: 'Pixel 5', model: 'Pixel 5', status: 'TESTING', brand: 'Google', type: 'ANDROID', isPrivate: false, osSDKInt: '30', screenSize: '1080x2340', screenDensity: 432, deviceGroup: [] },
]
}
],
collapseStatus: { 'agent-private-1': true, 'agent-public-2': true },
refreshing: false,
})
}

handleCloseDeviceDialog() {
Expand Down
20 changes: 17 additions & 3 deletions react/src/component/DeviceDetailView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,28 @@ export default class DeviceDetailView extends React.Component {
item.deviceGroup ?
<span className='badge' style={{ fontSize: '0.8rem' }}>{item.deviceGroup.join(' ')}</span> : null
}
{/* ===== CHANGE FOR ISSUE #345 ===== */}
{
item.isPrivate ?
<span className='badge badge-secondary' style={{ fontSize: '0.8rem' }}>Private</span> : null
}
{/* ================================= */}
</Stack>
}>
{/* ===== CHANGE FOR ISSUE #345 ===== */}
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<span className={"badge " + badgeClass} style={{ fontSize: "1rem" }}>
{this.getDeviceName(item)}
</span>
<div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
<span className={"badge " + badgeClass} style={{ fontSize: "1rem" }}>
{this.getDeviceName(item)}
</span>
{item.isPrivate ?
<span className="material-icons-outlined" style={{ fontSize: '1rem', color: '#ffd54f' }}>lock</span>
: null
}
</div>
<span className="badge" style={{ fontSize: "0.6rem" }}>{item.serialNum}</span>
</div>
{/* ================================= */}
</Tooltip>
</div>
</div>
Expand Down