1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00

feat(edge): create edge device with wizard [EE-3096] (#7029)

This commit is contained in:
Chaim Lev-Ari 2022-07-28 15:34:22 +02:00 committed by GitHub
parent d574a71cb1
commit 762c664948
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 129 additions and 953 deletions

View file

@ -21,6 +21,11 @@ interface Props {
showWaitingRoomLink: boolean;
}
enum DeployType {
FDO = 'FDO',
MANUAL = 'MANUAL',
}
export function EdgeDevicesDatatableActions({
selectedItems,
isOpenAMTEnabled,
@ -105,38 +110,37 @@ export function EdgeDevicesDatatableActions({
}
async function onAddNewDeviceClick() {
if (!isFDOEnabled) {
router.stateService.go('portainer.endpoints.newEdgeDevice');
return;
}
const result = await promptAsync({
title: 'How would you like to add an Edge Device?',
inputType: 'radio',
inputOptions: [
{
text: 'Provision bare-metal using Intel FDO',
value: 'FDO',
},
{
text: 'Deploy agent manually',
value: 'MANUAL',
},
],
buttons: {
confirm: {
label: 'Confirm',
className: 'btn-primary',
},
},
});
const result = isFDOEnabled
? await promptAsync({
title: 'How would you like to add an Edge Device?',
inputType: 'radio',
inputOptions: [
{
text: 'Provision bare-metal using Intel FDO',
value: DeployType.FDO,
},
{
text: 'Deploy agent manually',
value: DeployType.MANUAL,
},
],
buttons: {
confirm: {
label: 'Confirm',
className: 'btn-primary',
},
},
})
: DeployType.MANUAL;
switch (result) {
case 'FDO':
case DeployType.FDO:
router.stateService.go('portainer.endpoints.importDevice');
break;
case 'MANUAL':
router.stateService.go('portainer.endpoints.newEdgeDevice');
case DeployType.MANUAL:
router.stateService.go('portainer.wizard.endpoints', {
edgeDevice: true,
});
break;
default:
break;