|
|
|
@ -861,10 +861,10 @@ export function Workspace() { |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<div className="d-flex flex-column w-100 pb-4 mb-2 remixui_fileexplorer" data-id="remixUIWorkspaceExplorer" onClick={resetFocus}> |
|
|
|
|
<div> |
|
|
|
|
<div className='mb-1'> |
|
|
|
|
<header> |
|
|
|
|
<div className="mx-2 my-2 d-flex flex-column"> |
|
|
|
|
<div className="d-flex"> |
|
|
|
|
<div className="mx-2 d-flex"> |
|
|
|
|
{currentWorkspace !== LOCALHOST ? ( |
|
|
|
|
<span className="remixui_topmenu d-flex"> |
|
|
|
|
<Dropdown id="workspacesMenuDropdown" data-id="workspacesMenuDropdown" onToggle={() => hideIconsMenu(!showIconsMenu)} show={showIconsMenu}> |
|
|
|
@ -904,72 +904,74 @@ export function Workspace() { |
|
|
|
|
</label> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
<Dropdown id="workspacesSelect" data-id="workspacesSelect" onToggle={toggleDropdown} show={showDropdown}> |
|
|
|
|
<Dropdown.Toggle |
|
|
|
|
as={CustomToggle} |
|
|
|
|
id="dropdown-custom-components" |
|
|
|
|
className="btn btn-light btn-block w-100 d-inline-block border border-dark form-control mt-1" |
|
|
|
|
icon={selectedWorkspace && selectedWorkspace.isGitRepo && !(currentWorkspace === LOCALHOST) ? 'far fa-code-branch' : null} |
|
|
|
|
> |
|
|
|
|
{selectedWorkspace ? selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly('localhost') : NO_WORKSPACE} |
|
|
|
|
</Dropdown.Toggle> |
|
|
|
|
|
|
|
|
|
<Dropdown.Menu as={CustomMenu} className="w-100 custom-dropdown-items" data-id="custom-dropdown-items"> |
|
|
|
|
<Dropdown.Item |
|
|
|
|
onClick={() => { |
|
|
|
|
createWorkspace() |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{ |
|
|
|
|
<span className="pl-3"> |
|
|
|
|
{' '} |
|
|
|
|
- <FormattedMessage id="filePanel.createNewWorkspace" /> -{' '} |
|
|
|
|
</span> |
|
|
|
|
} |
|
|
|
|
</Dropdown.Item> |
|
|
|
|
<Dropdown.Item |
|
|
|
|
onClick={() => { |
|
|
|
|
switchWorkspace(LOCALHOST) |
|
|
|
|
}} |
|
|
|
|
<div className='mx-2'> |
|
|
|
|
<Dropdown id="workspacesSelect" data-id="workspacesSelect" onToggle={toggleDropdown} show={showDropdown}> |
|
|
|
|
<Dropdown.Toggle |
|
|
|
|
as={CustomToggle} |
|
|
|
|
id="dropdown-custom-components" |
|
|
|
|
className="btn btn-light btn-block w-100 d-inline-block border border-dark form-control mt-1" |
|
|
|
|
icon={selectedWorkspace && selectedWorkspace.isGitRepo && !(currentWorkspace === LOCALHOST) ? 'far fa-code-branch' : null} |
|
|
|
|
> |
|
|
|
|
{currentWorkspace === LOCALHOST ? ( |
|
|
|
|
<span>✓ localhost </span> |
|
|
|
|
) : ( |
|
|
|
|
<span className="pl-3"> |
|
|
|
|
{' '} |
|
|
|
|
<FormattedMessage id="filePanel.connectToLocalhost" />{' '} |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
</Dropdown.Item> |
|
|
|
|
{global.fs.browser.workspaces.map(({name, isGitRepo}, index) => ( |
|
|
|
|
{selectedWorkspace ? selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly('localhost') : NO_WORKSPACE} |
|
|
|
|
</Dropdown.Toggle> |
|
|
|
|
|
|
|
|
|
<Dropdown.Menu as={CustomMenu} className="w-100 custom-dropdown-items" data-id="custom-dropdown-items"> |
|
|
|
|
<Dropdown.Item |
|
|
|
|
key={index} |
|
|
|
|
onClick={() => { |
|
|
|
|
switchWorkspace(name) |
|
|
|
|
createWorkspace() |
|
|
|
|
}} |
|
|
|
|
data-id={`dropdown-item-${name}`} |
|
|
|
|
> |
|
|
|
|
{isGitRepo ? ( |
|
|
|
|
<div className="d-flex justify-content-between"> |
|
|
|
|
<span>{currentWorkspace === name ? <span>✓ {name} </span> : <span className="pl-3">{name}</span>}</span> |
|
|
|
|
<i className="fas fa-code-branch pt-1"></i> |
|
|
|
|
</div> |
|
|
|
|
) : ( |
|
|
|
|
<span>{currentWorkspace === name ? <span>✓ {name} </span> : <span className="pl-3">{name}</span>}</span> |
|
|
|
|
)} |
|
|
|
|
{ |
|
|
|
|
<span className="pl-3"> |
|
|
|
|
{' '} |
|
|
|
|
- <FormattedMessage id="filePanel.createNewWorkspace" /> -{' '} |
|
|
|
|
</span> |
|
|
|
|
} |
|
|
|
|
</Dropdown.Item> |
|
|
|
|
))} |
|
|
|
|
{(global.fs.browser.workspaces.length <= 0 || currentWorkspace === NO_WORKSPACE) && ( |
|
|
|
|
<Dropdown.Item |
|
|
|
|
onClick={() => { |
|
|
|
|
switchWorkspace(NO_WORKSPACE) |
|
|
|
|
switchWorkspace(LOCALHOST) |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{<span className="pl-3">NO_WORKSPACE</span>} |
|
|
|
|
{currentWorkspace === LOCALHOST ? ( |
|
|
|
|
<span>✓ localhost </span> |
|
|
|
|
) : ( |
|
|
|
|
<span className="pl-3"> |
|
|
|
|
{' '} |
|
|
|
|
<FormattedMessage id="filePanel.connectToLocalhost" />{' '} |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
</Dropdown.Item> |
|
|
|
|
)} |
|
|
|
|
</Dropdown.Menu> |
|
|
|
|
</Dropdown> |
|
|
|
|
{global.fs.browser.workspaces.map(({name, isGitRepo}, index) => ( |
|
|
|
|
<Dropdown.Item |
|
|
|
|
key={index} |
|
|
|
|
onClick={() => { |
|
|
|
|
switchWorkspace(name) |
|
|
|
|
}} |
|
|
|
|
data-id={`dropdown-item-${name}`} |
|
|
|
|
> |
|
|
|
|
{isGitRepo ? ( |
|
|
|
|
<div className="d-flex justify-content-between"> |
|
|
|
|
<span>{currentWorkspace === name ? <span>✓ {name} </span> : <span className="pl-3">{name}</span>}</span> |
|
|
|
|
<i className="fas fa-code-branch pt-1"></i> |
|
|
|
|
</div> |
|
|
|
|
) : ( |
|
|
|
|
<span>{currentWorkspace === name ? <span>✓ {name} </span> : <span className="pl-3">{name}</span>}</span> |
|
|
|
|
)} |
|
|
|
|
</Dropdown.Item> |
|
|
|
|
))} |
|
|
|
|
{(global.fs.browser.workspaces.length <= 0 || currentWorkspace === NO_WORKSPACE) && ( |
|
|
|
|
<Dropdown.Item |
|
|
|
|
onClick={() => { |
|
|
|
|
switchWorkspace(NO_WORKSPACE) |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{<span className="pl-3">NO_WORKSPACE</span>} |
|
|
|
|
</Dropdown.Item> |
|
|
|
|
)} |
|
|
|
|
</Dropdown.Menu> |
|
|
|
|
</Dropdown> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</header> |
|
|
|
|
</div> |
|
|
|
|