Skip to content

Commit

Permalink
Merge pull request #865 from gravitl/imad/net-1730-v-26-hide-acl-in-ce
Browse files Browse the repository at this point in the history
fix: change all occurrences of the word host to device
  • Loading branch information
imadtassaoui authored Nov 4, 2024
2 parents 369c835 + d7bc232 commit 9e62afd
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 54 deletions.
14 changes: 7 additions & 7 deletions src/components/modals/new-host-modal/NewHostModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default function NewHostModal({

return (
<Modal
title={<span style={{ fontSize: '1.25rem', fontWeight: 'bold' }}>Add a new host</span>}
title={<span style={{ fontSize: '1.25rem', fontWeight: 'bold' }}>Add a new device</span>}
open={isOpen}
className="CustomModal NewHostModal"
onCancel={(ev) => {
Expand All @@ -213,7 +213,7 @@ export default function NewHostModal({
if (isOnLastStep) {
if (selectedOs !== 'mobile') {
notify.success({
message: 'Host added successfully',
message: 'Device added successfully',
description: 'It might take a moment to reflect...',
});
}
Expand Down Expand Up @@ -332,13 +332,13 @@ export default function NewHostModal({
<Alert
style={{ marginBottom: '1rem' }}
type="warning"
message={`This enrollment key is for a relay node named ${relayNode.name}. Your host will automatically be relayed`}
message={`This enrollment key is for a relay node named ${relayNode.name}. Your device will automatically be relayed`}
showIcon
/>
)}
<Card>
<p>
Connect host to network(s){' '}
Connect device to network(s){' '}
<span style={{ fontWeight: 'bold' }}>{selectedEnrollmentKey?.networks.join(', ')}</span> via key{' '}
<span style={{ fontWeight: 'bold' }}>&quot;{selectedEnrollmentKey?.tags.join(', ')}&quot;</span>{' '}
<Button type="link" size="small" onClick={() => setCurrentStep(0)}>
Expand Down Expand Up @@ -467,7 +467,7 @@ export default function NewHostModal({
<br />
<br />
<Typography.Text>
If you prefer to continue adding the Windows host to the mesh network, you can download the
If you prefer to continue adding the Windows device to the mesh network, you can download the
installer below
</Typography.Text>
<br />
Expand Down Expand Up @@ -682,7 +682,7 @@ export default function NewHostModal({
</Typography.Text>
</li>
</ol>
<small>Note: It might take a few minutes for the host to show up in the network(s)</small>
<small>Note: It might take a few minutes for the device to show up in the network(s)</small>
</div>
)}

Expand Down Expand Up @@ -774,7 +774,7 @@ export default function NewHostModal({
</pre>
</li>
</ul>
<small>Note: It might take a few minutes for the host to show up in the network(s)</small>
<small>Note: It might take a few minutes for the device to show up in the network(s)</small>
</div>
)}
</Card>
Expand Down
14 changes: 7 additions & 7 deletions src/components/modals/update-host-modal/UpdateHostModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export default function UpdateHostModal({ isOpen, host, onUpdateHost, onCancel }
try {
const formData = await form.validateFields();
const newHost = (await HostsService.updateHost(host.id, { ...host, ...formData })).data;
notify.success({ message: `Host ${host.id} updated` });
notify.success({ message: `Device ${host.id} updated` });
storeUpdateHost(newHost.id, newHost);
onUpdateHost(newHost);
} catch (err) {
notify.error({
message: 'Failed to update host',
message: 'Failed to update device',
description: extractErrorMsg(err as any),
});
}
Expand All @@ -46,7 +46,7 @@ export default function UpdateHostModal({ isOpen, host, onUpdateHost, onCancel }
<Modal
title={
<Typography.Title style={{ fontSize: '1.25rem', fontWeight: 'bold' }}>
Update host (ID: {host.id})
Update device (ID: {host.id})
</Typography.Title>
}
open={isOpen}
Expand All @@ -63,12 +63,12 @@ export default function UpdateHostModal({ isOpen, host, onUpdateHost, onCancel }
<div className="scrollable-modal-body">
<div className="CustomModalBody">
<Form.Item
label="Host name"
label="Device name"
name="name"
rules={[{ required: true }]}
data-nmui-intercom="update-host-form_name"
>
<Input placeholder="Host name" disabled={isManagedHost(host.name)} />
<Input placeholder="Device name" disabled={isManagedHost(host.name)} />
</Form.Item>

<Form.Item
Expand Down Expand Up @@ -145,7 +145,7 @@ export default function UpdateHostModal({ isOpen, host, onUpdateHost, onCancel }
</Form.Item>

<Form.Item
label="Default Host"
label="Default Device"
name="isdefault"
valuePropName="checked"
rules={[{ required: true }]}
Expand All @@ -172,7 +172,7 @@ export default function UpdateHostModal({ isOpen, host, onUpdateHost, onCancel }
<Col xs={24} style={{ textAlign: 'right' }}>
<Form.Item noStyle data-nmui-intercom="update-host-form_submit">
<Button type="primary" onClick={updateHost}>
Update Host
Update Device
</Button>
</Form.Item>
</Col>
Expand Down
80 changes: 40 additions & 40 deletions src/pages/hosts/HostsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ export default function HostsPage(props: PageProps) {
const refreshHostKeys = useCallback(
(host: Host) => {
Modal.confirm({
title: 'Refresh host keys',
content: `Are you sure you want to refresh this host's (${host.name}) keys?`,
title: 'Refresh device keys',
content: `Are you sure you want to refresh this device's (${host.name}) keys?`,
onOk: async () => {
try {
await HostsService.refreshHostKeys(host.id);
notify.success({
message: 'Host keys refreshing...',
description: 'Host key pairs are refreshing. This may take a while.',
message: 'Device keys refreshing...',
description: 'Device key pairs are refreshing. This may take a while.',
});
} catch (err) {
notify.error({
message: 'Failed to refresh host keys',
message: 'Failed to refresh device keys',
description: extractErrorMsg(err as any),
});
}
Expand All @@ -136,18 +136,18 @@ export default function HostsPage(props: PageProps) {
const requestHostPull = useCallback(
(host: Host) => {
Modal.confirm({
title: 'Synchronise host',
content: `This will trigger the host (${host.name}) to pull latest network(s) state from the server. Proceed?`,
title: 'Synchronise device',
content: `This will trigger the device (${host.name}) to pull latest network(s) state from the server. Proceed?`,
onOk: async () => {
try {
await HostsService.requestHostPull(host.id);
notify.success({
message: 'Host is syncing...',
description: `Host pull has been initiated for ${host.name}. This may take a while.`,
message: 'Device is syncing...',
description: `Device pull has been initiated for ${host.name}. This may take a while.`,
});
} catch (err) {
notify.error({
message: 'Failed to synchronise host',
message: 'Failed to synchronise device',
description: extractErrorMsg(err as any),
});
}
Expand All @@ -161,15 +161,15 @@ export default function HostsPage(props: PageProps) {
async (host: Host) => {
Modal.confirm({
title: 'Toggle defaultness',
content: `Are you sure you want to turn ${!host.isdefault ? 'on' : 'off'} defaultness for this host?`,
content: `Are you sure you want to turn ${!host.isdefault ? 'on' : 'off'} defaultness for this device?`,
onOk: async () => {
try {
const newHost = (await HostsService.updateHost(host.id, { ...host, isdefault: !host.isdefault })).data;
notify.success({ message: `Host ${host.id} updated` });
notify.success({ message: `Device ${host.id} updated` });
storeUpdateHost(host.id, newHost);
} catch (err) {
notify.error({
message: 'Failed to update host',
message: 'Failed to update device',
description: extractErrorMsg(err as any),
});
}
Expand All @@ -191,7 +191,7 @@ export default function HostsPage(props: PageProps) {
const assocNodes = store.nodes.filter((node) => node.hostid === host.id);

Modal.confirm({
title: 'Delete host',
title: 'Delete device',
content: (
<>
<Row>
Expand Down Expand Up @@ -230,19 +230,19 @@ export default function HostsPage(props: PageProps) {

const refreshAllHostKeys = useCallback(() => {
Modal.confirm({
title: 'Refresh all device keys',
content: 'Are you sure you want to refresh all device keys?',
title: 'Refresh all devices keys',
content: 'Are you sure you want to refresh all devices keys?',
onOk: async () => {
try {
setIsRefreshingHosts(true);
await HostsService.refreshAllHostsKeys();
notify.success({
message: 'Device keys refreshing...',
message: 'Devices keys refreshing...',
description: 'Device key pairs are refreshing. This may take a while.',
});
} catch (err) {
notify.error({
message: 'Failed to refresh device keys',
message: 'Failed to refresh devices keys',
description: extractErrorMsg(err as any),
});
} finally {
Expand Down Expand Up @@ -473,7 +473,7 @@ export default function HostsPage(props: PageProps) {
},
{
key: 'refresh',
label: 'Refresh Host Keys',
label: 'Refresh Device Keys',
onClick: (ev) => {
ev.domEvent.stopPropagation();
refreshHostKeys(host);
Expand Down Expand Up @@ -585,7 +585,7 @@ export default function HostsPage(props: PageProps) {
onEditHost(host);
}}
>
Edit Host
Edit Device
</Typography.Text>
),
},
Expand Down Expand Up @@ -827,27 +827,27 @@ export default function HostsPage(props: PageProps) {
title: 'Devices',
description: (
<>
These are your devices: servers, devices, VM&quot;s, containers, laptops, and more. You can get information
about your devices on the table. Clicking on the host name will show extra host details. The ellipsis button
at the end of row shows additional operations such as making a host the default , editing its settings,
upgrading its version, deleting the host
Devices are your servers, devices, VM&quot;s, containers, laptops, and more can all be Devices. You can get
information about your devices on the table. Clicking on the device name will show extra device details. The
ellipsis button at the end of row shows additional operations such as making a device the default , editing
its settings, upgrading its version, deleting the device
</>
),
target: () => hostsTableRef.current,
},
{
title: 'Network Access Management',
description:
'You can view the networks that the host is connected to and connect or disconnect the host from a network.',
'You can view the networks that the device is connected to and connect or disconnect the device from a network.',
target: () => networkAccessManagementTabRef.current,
},
{
title: 'Network Access Manangement - Devices',
description: (
<>
You can view host information and once you select a host, you can view the networks that the host is connected
to and connect or disconnect the host from a network on the right side, On the end of the row you can click
the ellipsis button to make the host the default, edit its settings
You can view device information and once you select a device, you can view the networks that the device is
connected to and connect or disconnect the device from a network on the right side, On the end of the row you
can click the ellipsis button to make the device the default, edit its settings
</>
),
target: () => networkAccessManagementTabHostsTableRef.current,
Expand All @@ -858,34 +858,34 @@ export default function HostsPage(props: PageProps) {
target: () => networkAccessManagementTabNetworksTableRef.current,
},
{
title: 'Refresh Host Keys',
title: 'Refresh Device Keys',
description: 'Refresh all devices keys',
target: () => refreshHostKeysButtonRef.current,
},
{
title: 'Connect a Host',
description: 'You can connect a host by clicking on the button',
title: 'Connect a Device',
description: 'You can connect a device by clicking on the button',
target: () => connectHostButtonRef.current,
},
{
title: 'Connect a Host - Enrollment Keys',
title: 'Connect a Device - Enrollment Keys',
description: (
<>
You can create an enrollment key which defines the networks a host has access to or you can pick an existing
You can create an enrollment key which defines the networks a device has access to or you can pick an existing
enrollment key
</>
),
target: () => connectHostModalEnrollmentKeysTabRef.current,
},
{
title: 'Connect a Host - Select OS',
title: 'Connect a Device - Select OS',
description: (
<>You can select the OS of the host that you want to connect and follow the netclient install instructions</>
<>You can select the OS of the device that you want to connect and follow the netclient install instructions</>
),
target: () => connectHostModalSelectOSTabRef.current,
},
{
title: 'Connect a Host - Join a Network',
title: 'Connect a Device - Join a Network',
description: <>You can join a network by running the command on the terminal</>,
target: () => connectHostModalJoinNetworkTabRef.current,
},
Expand Down Expand Up @@ -959,15 +959,15 @@ export default function HostsPage(props: PageProps) {
</Col>
<Col xs={24} xl={(24 * 1) / 3} style={{ position: 'relative' }}>
<Card className="header-card" style={{ height: '20rem', position: 'absolute', width: '100%' }}>
<Typography.Title level={3}>Add a Host</Typography.Title>
<Typography.Title level={3}>Add a Device</Typography.Title>
<Typography.Text>
Start creating your network by adding devices on your platform. Servers, VM’s, your laptop, and more
are all fair game.
</Typography.Text>
<Row style={{ marginTop: 'auto' }}>
<Col>
<Button type="primary" size="large" onClick={() => setIsAddNewHostModalOpen(true)}>
<PlusOutlined /> Connect a Host
<PlusOutlined /> Connect a Device
</Button>
</Col>
</Row>
Expand Down Expand Up @@ -1010,10 +1010,10 @@ export default function HostsPage(props: PageProps) {
<Col xs={24} xl={7}>
<Card>
<Typography.Title level={4} style={{ marginTop: '0px' }}>
Add host directly
Add device directly
</Typography.Title>
<Typography.Text>
If a host is already registered with the server, you can add it into any network directly from the
If a device is already registered with the server, you can add it into any network directly from the
dashboard. Simply go to Network Access Management tab under the{' '}
<Link to={resolveAppRoute(AppRoutes.HOSTS_ROUTE)}>Devices page</Link>.
</Typography.Text>
Expand Down

0 comments on commit 9e62afd

Please sign in to comment.