diff --git a/app/portainer/react/components/index.ts b/app/portainer/react/components/index.ts
index b176fbd2a..e99e57fdd 100644
--- a/app/portainer/react/components/index.ts
+++ b/app/portainer/react/components/index.ts
@@ -19,6 +19,7 @@ import { PorAccessControlFormTeamSelector } from '@/react/portainer/access-contr
import { PorAccessControlFormUserSelector } from '@/react/portainer/access-control/PorAccessControlForm/UsersSelector';
import { PorAccessManagementUsersSelector } from '@/react/portainer/access-control/AccessManagement/PorAccessManagementUsersSelector';
import { AccessTypeSelector } from '@/react/portainer/access-control/EditDetails/AccessTypeSelector';
+import { EdgeKeyDisplay } from '@/react/portainer/environments/ItemView/EdgeKeyDisplay';
import { PageHeader } from '@@/PageHeader';
import { TagSelector } from '@@/TagSelector';
@@ -230,4 +231,5 @@ export const componentsModule = angular
.component(
'porAccessManagementUsersSelector',
r2a(PorAccessManagementUsersSelector, ['onChange', 'options', 'value'])
- ).name;
+ )
+ .component('edgeKeyDisplay', r2a(EdgeKeyDisplay, ['edgeKey'])).name;
diff --git a/app/portainer/views/endpoints/edit/endpoint.html b/app/portainer/views/endpoints/edit/endpoint.html
index 9b18ec587..97ef69383 100644
--- a/app/portainer/views/endpoints/edit/endpoint.html
+++ b/app/portainer/views/endpoints/edit/endpoint.html
@@ -53,29 +53,7 @@
hide-async-mode="!endpoint.IsEdgeDevice"
>
-
- Join token
-
-
- For those pre-staging the edge agent, use the following join token to associate the Edge agent with this environment.
-
- You can read more about pre-staging in the userguide available here.
-
-
- {{ endpoint.EdgeKey }}
-
-
-
-
- Copy token
-
-
-
- copied
-
-
-
-
+
diff --git a/app/portainer/views/endpoints/edit/endpointController.js b/app/portainer/views/endpoints/edit/endpointController.js
index 743398da0..2e38972b2 100644
--- a/app/portainer/views/endpoints/edit/endpointController.js
+++ b/app/portainer/views/endpoints/edit/endpointController.js
@@ -103,17 +103,6 @@ function EndpointController(
SecurityFormData: new EndpointSecurityFormData(),
};
- $scope.copyEdgeAgentKey = function () {
- clipboard.copyText($scope.endpoint.EdgeKey);
- $('#copyNotificationEdgeKey').show().fadeOut(2500);
- };
-
- $scope.onToggleAllowSelfSignedCerts = function onToggleAllowSelfSignedCerts(checked) {
- return $scope.$evalAsync(() => {
- $scope.state.allowSelfSignedCerts = checked;
- });
- };
-
$scope.onDisassociateEndpoint = async function () {
confirmDisassociate().then((confirmed) => {
if (confirmed) {
diff --git a/app/react/portainer/environments/ItemView/EdgeKeyDisplay.tsx b/app/react/portainer/environments/ItemView/EdgeKeyDisplay.tsx
new file mode 100644
index 000000000..5b6860e03
--- /dev/null
+++ b/app/react/portainer/environments/ItemView/EdgeKeyDisplay.tsx
@@ -0,0 +1,25 @@
+import { CopyButton } from '@@/buttons';
+import { FormSection } from '@@/form-components/FormSection';
+import { TextTip } from '@@/Tip/TextTip';
+
+export function EdgeKeyDisplay({ edgeKey }: { edgeKey: string }) {
+ return (
+
+
+ For those pre-staging the edge agent, use the following join token to
+ associate the Edge agent with this environment.
+
+
+
+ You can read more about pre-staging in the user-guide available{' '}
+ here.
+
+
+
+ {edgeKey}
+
+
+ Copy token
+
+ );
+}
diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx
index 118efb107..2133e1ffd 100644
--- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx
+++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx
@@ -5,6 +5,7 @@ import { Environment } from '@/react/portainer/environments/types';
import { EdgeScriptForm } from '@/react/edge/components/EdgeScriptForm';
import { CommandTab } from '@/react/edge/components/EdgeScriptForm/scripts';
import { OS, EdgeInfo } from '@/react/edge/components/EdgeScriptForm/types';
+import { EdgeKeyDisplay } from '@/react/portainer/environments/ItemView/EdgeKeyDisplay';
import { Button } from '@@/buttons';
@@ -38,6 +39,14 @@ export function EdgeAgentTab({
{edgeInfo && (
<>
+
+
+
+
+
+
+
+