Skip to content

Commit f5bcb0d

Browse files
Pive01whummer
andauthored
add support on Windows (#26)
* added checks for finding location of home folder * removed unused file/log * added backed support for storing os name * Now use binaries and not containers for dir check * Updated getUsersFromBinaryUnix() buildMountArg() * added missing ".cache" * added missing space * added newlines on binaries * fixed stop button when container doesn't start * removed redundant checks * Changed MountPointForm UI * removed leftovers * changed mount point for mac users and refactor * Fixed flooding of error toast in debug mode * enhanced update info for better legibility * env variable always uppercase * Removed Default from DataGrid * Editable configurations * Updated description * Changed mountPoint if error * Added new format rules for better formatting * fixed typo and double quotes * Update ui/src/components/Views/Update/UpdateDialog.tsx Co-authored-by: Waldemar Hummer <[email protected]> * Update ui/src/components/Header/Controller.tsx Co-authored-by: Waldemar Hummer <[email protected]> * Fixed bugs and indent issue * Updated mountPoint file format * added missing "." * removed indent from line * Applied review suggestions --------- Co-authored-by: Waldemar Hummer <[email protected]>
1 parent cc8e563 commit f5bcb0d

27 files changed

+408
-183
lines changed

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ LABEL org.opencontainers.image.title="LocalStack" \
4040
on their local machine without connecting to a remote cloud provider! LocalStack empowers developers to use over 75+ AWS services locally while helping them simplify their testing \
4141
and development workflow. LocalStack supports a comprehensive list of APIs, which you can view on our <a href=\"https://docs.localstack.cloud/user-guide/aws/feature-coverage/\"> \
4242
Feature coverage page</a>. <br><br> \
43-
Make sure to have also installed awscli-local. You can install it via pip: <b>pip install awscli-local</b> \
43+
Make sure to have the option \"Show Docker Extensions system containers\" enabled. You can enable it by going to Settings > Extensions > Show Docker Extensions system containers \
4444
<h2>This extension supports the following main features:</h2>\
4545
<ul>\
4646
<li> Control LocalStack: Start, stop, and restart LocalStack from the Docker Desktop. You can also see the current status of your LocalStack instance and navigate to LocalStack Web Application. </li>\
@@ -59,4 +59,9 @@ COPY docker-compose.yaml .
5959
COPY metadata.json .
6060
COPY localstack.svg .
6161
COPY --from=client-builder /ui/build ui
62+
COPY --chmod=0755 scripts/windows/checkWSLOS.cmd /windows/checkWSLOS.cmd
63+
COPY --chmod=0755 scripts/windows/checkUser.cmd /windows/checkUser.cmd
64+
COPY --chmod=0755 scripts/darwin/checkUser.sh /darwin/checkUser.sh
65+
COPY --chmod=0755 scripts/linux/checkUser.sh /linux/checkUser.sh
66+
6267
CMD /service -socket /run/guest-services/extension-LocalStack.sock

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
IMAGE?=localstack/localstack-docker-desktop
2-
TAG?=0.3.1
2+
TAG?=0.3.2
33

44
BUILDER=buildx-multi-arch
55

metadata.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,29 @@
1515
"socket": "extension-LocalStack.sock"
1616
}
1717
}
18+
},
19+
"host": {
20+
"binaries": [
21+
{
22+
"darwin": [
23+
{
24+
"path": "/darwin/checkUser.sh"
25+
}
26+
],
27+
"linux": [
28+
{
29+
"path": "/linux/checkUser.sh"
30+
}
31+
],
32+
"windows": [
33+
{
34+
"path": "/windows/checkWSLOS.cmd"
35+
},
36+
{
37+
"path": "/windows/checkUser.cmd"
38+
}
39+
]
40+
}
41+
]
1842
}
1943
}

scripts/darwin/checkUser.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
ls /Users

scripts/linux/checkUser.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
ls /home

scripts/windows/checkUser.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dir \\wsl.localhost\%1\home | findstr /v /s /c:"."
2+
:: exclude directories that starts with . (so "." and "..")

scripts/windows/checkWSLOS.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wsl -l -v

ui/.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
'react/require-default-props': 'off',
3939
'react/function-component-definition': 'off',
4040
'react/jsx-props-no-spreading': 'off',
41-
'indent': ['error', 2],
41+
'indent': ['error', 2,{ 'SwitchCase': 1 }],
4242
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
4343
'eol-last': ['error', 'always'],
4444
'no-param-reassign': 'off',
@@ -47,6 +47,8 @@ module.exports = {
4747
'import/prefer-default-export': 'off',
4848
'import/no-named-as-default': 'off',
4949
'no-use-before-define': 'off',
50+
'no-multi-spaces': 'error',
51+
'comma-spacing': ['error', { 'before': false, 'after': true }],
5052
'no-shadow': 'off',
5153
'curly': 'error',
5254
'no-unused-vars': 'warn',

ui/src/App.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { ReactElement, useState } from 'react';
22
import { createStyles, makeStyles } from '@mui/styles';
33
import { ControlledTabPanels, Header, LogsPage, MountPointForm, ConfigPage, StatusPage } from './components';
4-
import { useMountPoint } from './services/hooks';
4+
import { useDDClient, useMountPoint } from './services/hooks';
55

66
const useStyles = makeStyles(() => createStyles({
77
sticky: {
@@ -13,9 +13,11 @@ const useStyles = makeStyles(() => createStyles({
1313

1414
export const App = (): ReactElement => {
1515
const [selected, setSelected] = useState<number>(0);
16-
const { data: mountPoint } = useMountPoint();
16+
const { user, os } = useMountPoint();
1717
const classes = useStyles();
18-
const shouldDialogOpen = !mountPoint || mountPoint === '';
18+
const ddClient = useDDClient();
19+
const userMissing = !user;
20+
const shouldDialogOpen = ddClient.host.platform === 'win32' ? !os || userMissing : userMissing;
1921

2022
return (
2123
<>

ui/src/components/Feedback/ConfirmableButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ export const ConfirmableButton = ({
7171
<DialogActions>
7272
<Button
7373
color= {cancelColor || 'primary'}
74-
variant="outlined"
74+
variant='outlined'
7575
onClick={() => setShowConfirmDialog(false)}
7676
>
7777
{cancelText || 'Cancel'}
7878
</Button>
7979
<Button
8080
autoFocus
8181
color= {okColor || 'error'}
82-
variant="contained"
82+
variant='contained'
8383
onClick={(event: MouseEvent<HTMLButtonElement>) => {
8484
if (rest.onClick) rest.onClick(event as any); // eslint-disable-line
8585
setShowConfirmDialog(false);

0 commit comments

Comments
 (0)