-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #956 from bond95/console-page
Added NoVNC console page
- Loading branch information
Showing
48 changed files
with
1,389 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,113 @@ | ||
import { | ||
CHECK_CONSOLE_IN_USE, | ||
OPEN_CONSOLE_MODAL, | ||
SET_CONSOLE_NOVNC_STATUS, | ||
SET_CONSOLE_TICKETS, | ||
DOWNLOAD_CONSOLE_VM, | ||
SET_CONSOLE_IN_USE, | ||
SET_CONSOLE_LOGON, | ||
} from '_/constants' | ||
SET_ACTIVE_CONSOLE, | ||
SET_NEW_CONSOLE_MODAL, | ||
CLOSE_CONSOLE_MODAL, | ||
SET_IN_USE_CONSOLE_MODAL_STATE, | ||
SET_LOGON_CONSOLE_MODAL_STATE, | ||
} from '../constants' | ||
|
||
export function setConsoleInUse ({ vmId, consoleInUse }) { | ||
export function openConsoleModal ({ vmId, usbFilter, userId, consoleId, hasGuestAgent, openInPage, isNoVNC, modalId }) { | ||
return { | ||
type: SET_CONSOLE_IN_USE, | ||
type: OPEN_CONSOLE_MODAL, | ||
payload: { | ||
vmId, | ||
consoleInUse, | ||
usbFilter, | ||
userId, | ||
consoleId, | ||
hasGuestAgent, | ||
openInPage, | ||
isNoVNC, | ||
modalId, | ||
}, | ||
} | ||
} | ||
|
||
export function setConsoleLogon ({ vmId, isLogon }) { | ||
export function setActiveConsole ({ vmId, consoleId }) { | ||
return { | ||
type: SET_CONSOLE_LOGON, | ||
type: SET_ACTIVE_CONSOLE, | ||
payload: { | ||
vmId, | ||
isLogon, | ||
consoleId, | ||
}, | ||
} | ||
} | ||
|
||
export function checkConsoleInUse ({ vmId, usbFilter, userId, hasGuestAgent }) { | ||
export function downloadConsole ({ vmId, consoleId, usbFilter, hasGuestAgent, skipSSO, openInPage, isNoVNC, modalId }) { | ||
return { | ||
type: CHECK_CONSOLE_IN_USE, | ||
type: DOWNLOAD_CONSOLE_VM, | ||
payload: { | ||
vmId, | ||
consoleId, | ||
usbFilter, | ||
userId, | ||
hasGuestAgent, | ||
skipSSO, | ||
openInPage, | ||
isNoVNC, | ||
modalId, | ||
}, | ||
} | ||
} | ||
|
||
export function downloadConsole ({ vmId, consoleId, usbFilter, hasGuestAgent, skipSSO }) { | ||
export function setConsoleTickets ({ vmId, proxyTicket, ticket }) { | ||
return { | ||
type: DOWNLOAD_CONSOLE_VM, | ||
type: SET_CONSOLE_TICKETS, | ||
payload: { | ||
vmId, | ||
proxyTicket, | ||
ticket, | ||
}, | ||
} | ||
} | ||
|
||
export function setConsoleStatus ({ vmId, status, reason }) { | ||
return { | ||
type: SET_CONSOLE_NOVNC_STATUS, | ||
payload: { | ||
vmId, | ||
status, | ||
reason, | ||
}, | ||
} | ||
} | ||
|
||
export function setNewConsoleModal ({ modalId, vmId, consoleId }) { | ||
return { | ||
type: SET_NEW_CONSOLE_MODAL, | ||
payload: { | ||
modalId, | ||
vmId, | ||
consoleId, | ||
usbFilter, | ||
hasGuestAgent, | ||
skipSSO, | ||
}, | ||
} | ||
} | ||
|
||
export function closeConsoleModal ({ modalId }) { | ||
return { | ||
type: CLOSE_CONSOLE_MODAL, | ||
payload: { | ||
modalId, | ||
}, | ||
} | ||
} | ||
|
||
export function setInUseConsoleModalState ({ modalId }) { | ||
return { | ||
type: SET_IN_USE_CONSOLE_MODAL_STATE, | ||
payload: { | ||
modalId, | ||
}, | ||
} | ||
} | ||
|
||
export function setLogonConsoleModalState ({ modalId }) { | ||
return { | ||
type: SET_LOGON_CONSOLE_MODAL_STATE, | ||
payload: { | ||
modalId, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import style from './sharedStyle.css' | ||
|
||
export const SIZES = { | ||
SMALL: 'SMALL', | ||
LARGE: 'LARGE', | ||
} | ||
|
||
const Loader = ({ loaderText, size }) => { | ||
let wh = 0 | ||
switch (size) { | ||
case SIZES.SMALL: | ||
wh = 30 | ||
break | ||
case SIZES.LARGE: | ||
wh = 100 | ||
break | ||
} | ||
return <div className={style['loaderBox']}> | ||
<div style={{ height: wh, width: wh }} className={style['loader']} /> | ||
<div>{loaderText}</div> | ||
</div> | ||
} | ||
|
||
Loader.propTypes = { | ||
loaderText: PropTypes.string, | ||
size: PropTypes.oneOf(Object.values(SIZES)), | ||
} | ||
|
||
export default Loader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.