Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
(Chore): Added prerequisite to check hostname (#103)
Browse files Browse the repository at this point in the history
* (Chore): Added prerequisite to check hostname

Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>

* (Chore): Did required changes

Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>

---------

Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
Co-authored-by: Hanzla Mateen <hanzlamateen@live.com>
  • Loading branch information
Abhijay007 and hanzlamateen authored Aug 20, 2023
1 parent caa1736 commit f67db36
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/handlers/Utilities/Prerequisites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export const WindowsPrerequisites: AppModel[] = [
getAppModel('wsl', 'Windows Subsystem for Linux (WSL)', 'wsl --status;', false),
getAppModel('wslUbuntu', 'WSL Ubuntu Distribution', 'wsl --status;', false),
getAppModel('dockerDesktop', 'Docker Desktop', 'docker version;', false),
getAppModel('dockerDesktopUbuntu', 'Docker Desktop WSL Ubuntu Integration', 'wsl docker version;', false)
getAppModel('dockerDesktopUbuntu', 'Docker Desktop WSL Ubuntu Integration', 'wsl docker version;', false),
getAppModel('hostname', 'Hostname Compliance', 'hostname;', false)
]
3 changes: 2 additions & 1 deletion src/main/handlers/Utilities/Utilities.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ class Utilities {
(prerequisite.id === 'wsl' && stdOutput) ||
(prerequisite.id === 'wslUbuntu' && stdOutput.includes(': Ubuntu')) ||
((prerequisite.id === 'dockerDesktop' || prerequisite.id === 'dockerDesktopUbuntu') &&
stdOutput.includes('Server: Docker Desktop'))
stdOutput.includes('Server: Docker Desktop')) ||
(prerequisite.id === 'hostname' && !stdOutput.match(/[A-Z_]/))
) {
status = AppStatus.Configured
}
Expand Down
24 changes: 24 additions & 0 deletions src/renderer/components/Config/PrereqsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,30 @@ const PrereqsView = ({ sx }: Props) => {
.
</Typography>
)
} else if (status.id === 'hostname') {
status.description = (
<Typography fontSize={14}>
<span style={{ fontSize: 14, opacity: 0.6 }}>
If the hostname contains uppercase letters and/or underscore, you should change it to meet the requirements.
</span>
<br />
<br />
<span style={{ fontSize: 14, opacity: 0.6 }}>
You can check the hostname by running the following command in PowerShell:
<br />
<br />
<code>hostname</code>
</span>
<br />
<br />
<span style={{ fontSize: 14, opacity: 0.6 }}>
To rename Hostname you can use following command in PowerShell (With admin rights):
<br />
<br />
<code>Rename-Computer -NewName "newname"</code>
</span>
</Typography>
)
}
}

Expand Down

0 comments on commit f67db36

Please sign in to comment.