mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 22:27:48 +00:00
Frontend bot logic
This commit is contained in:
@@ -92,7 +92,7 @@ export const IntegrationsPage = withProjectPermission(
|
|||||||
isIntegrationsAuthorizedEmpty &&
|
isIntegrationsAuthorizedEmpty &&
|
||||||
isIntegrationsEmpty
|
isIntegrationsEmpty
|
||||||
) {
|
) {
|
||||||
if (bot?.id)
|
if (bot?.id && currentWorkspace?.version === "v1")
|
||||||
updateBotActiveStatusSync({
|
updateBotActiveStatusSync({
|
||||||
isActive: false,
|
isActive: false,
|
||||||
botId: bot.id,
|
botId: bot.id,
|
||||||
@@ -113,7 +113,7 @@ export const IntegrationsPage = withProjectPermission(
|
|||||||
if (!selectedCloudIntegration) return;
|
if (!selectedCloudIntegration) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (bot && !bot.isActive) {
|
if (bot && !bot.isActive && currentWorkspace?.version === "v1") {
|
||||||
const botKey = generateBotKey(bot.publicKey, latestWsKey!);
|
const botKey = generateBotKey(bot.publicKey, latestWsKey!);
|
||||||
await updateBotActiveStatus({
|
await updateBotActiveStatus({
|
||||||
workspaceId,
|
workspaceId,
|
||||||
|
|||||||
+4
-1
@@ -20,6 +20,7 @@ export const E2EESection = () => {
|
|||||||
* 3. Encrypt project key with bot's public key
|
* 3. Encrypt project key with bot's public key
|
||||||
* 4. Send encrypted project key to backend and set bot status to active
|
* 4. Send encrypted project key to backend and set bot status to active
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const toggleBotActivate = async () => {
|
const toggleBotActivate = async () => {
|
||||||
let botKey;
|
let botKey;
|
||||||
try {
|
try {
|
||||||
@@ -75,7 +76,9 @@ export const E2EESection = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return bot ? (
|
if (!currentWorkspace) return null;
|
||||||
|
|
||||||
|
return bot && currentWorkspace.version === "v1" ? (
|
||||||
<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||||
<p className="mb-3 text-xl font-semibold">End-to-End Encryption</p>
|
<p className="mb-3 text-xl font-semibold">End-to-End Encryption</p>
|
||||||
<p className="mb-8 text-gray-400">
|
<p className="mb-8 text-gray-400">
|
||||||
|
|||||||
Reference in New Issue
Block a user