Skip to content

Commit

Permalink
[frontend/backend] Public dashboard: phase 1 (create/delete public da…
Browse files Browse the repository at this point in the history
…shboards and first widget) (#4903)

Co-authored-by: Landry Trebon <landry.trebon@filigran.io>
  • Loading branch information
2 people authored and Archidoit committed Jun 3, 2024
1 parent 2c20420 commit cae516c
Show file tree
Hide file tree
Showing 64 changed files with 2,671 additions and 400 deletions.
16 changes: 15 additions & 1 deletion opencti-platform/opencti-front/lang/front/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2651,5 +2651,19 @@
"AI Powered": "KI-gesteuert",
"Missing token": "Fehlendes Token",
"Generative AI is a beta feature as we are currently fine-tuning our models. Consider checking important information.": "Die generative KI ist eine Betafunktion, da wir derzeit unsere Modelle feinabstimmen. Überprüfen Sie wichtige Informationen.",
"Accept": "Akzeptieren Sie"
"Accept": "Akzeptieren Sie",
"Share as public dashboard": "Als öffentliches Dashboard freigeben",
"To prevent people seeing all the data...": "Um zu verhindern, dass andere Personen alle Daten im öffentlichen Dashboard sehen können, wählen Sie eine Markierungsdefinition, um die gemeinsamen Daten einzuschränken.",
"Max level markings": "Max Level Markierungen",
"Copy link": "Link kopieren",
"Public dashboards": "Öffentliche Dashboards",
"Existing public dashboards": "Vorhandene öffentliche Dashboards",
"No public dashboard created yet": "Noch kein öffentliches Dashboard erstellt",
"Create a new public dashboard": "Erstellen Sie ein neues öffentliches Dashboard",
"Public dashboard ID": "Öffentliche Dashboard-ID",
"Specify the ID of your public dashboard": "Geben Sie die ID Ihres öffentlichen Dashboards an",
"Disable public dashboard": "Öffentliches Dashboard deaktivieren",
"Delete public dashboard": "Öffentliches Dashboard löschen",
"Are you sure you want to delete this public dashboard?": "Sind Sie sicher, dass Sie dieses öffentliche Dashboard löschen möchten?",
"A public dashboard is a snapshot...": "Ein öffentliches Dashboard ist ein Schnappschuss eines privaten Dashboards zu einem bestimmten Zeitpunkt. Wenn Sie das private Dashboard ändern, werden die bereits erstellten öffentlichen Dashboards nicht geändert."
}
14 changes: 14 additions & 0 deletions opencti-platform/opencti-front/lang/front/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2563,9 +2563,23 @@
"Option 'Let the user choose marking definitions'...": "Option 'Let the user choose marking definitions' will ask the user to choose (when importing the CSV file) which marking definitions to apply when the data is missing in the CSV file.",
"Update without references": "Update without references",
"Max Confidence Level:": "Max Confidence Level:",
"Share as public dashboard": "Share as public dashboard",
"Public dashboards": "Public dashboards",
"Existing public dashboards": "Existing public dashboards",
"No public dashboard created yet": "No public dashboard created yet",
"Create a new public dashboard": "Create a new public dashboard",
"To prevent people seeing all the data...": "To prevent people seeing all the data in the public dashboard, select a marking definition to restrict the shared data.",
"Max level markings": "Max level markings",
"Public dashboard ID": "Public dashboard ID",
"Specify the ID of your public dashboard": "Specify the ID of your public dashboard",
"Copy link": "Copy link",
"Disable public dashboard": "Disable public dashboard",
"Delete public dashboard": "Delete public dashboard",
"Are you sure you want to delete this public dashboard?": "Are you sure you want to delete this public dashboard?",
"Please, verify the validity of the selected CSV mapper for the given URL.": "Please, verify the validity of the selected CSV mapper for the given URL.",
"Only successful tests allow the ingestion creation.": "Only successful tests allow the ingestion creation.",
"Only successful tests allow the ingestion edition.": "Only successful tests allow the ingestion edition.",
"A public dashboard is a snapshot...": "A public dashboard is a snapshot of a private dashboard at a specific time. If you modify the private dashboard, already created public dashboards won't be modified.",
"Request for takedown date": "Request for takedown date",
"Enable AI powered platform": "Enable AI powered platform",
"To use AI, please enable it in the configuration of your platform.": "To use AI, please enable it in the configuration of your platform.",
Expand Down
20 changes: 19 additions & 1 deletion opencti-platform/opencti-front/lang/front/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2563,6 +2563,14 @@
"Option 'Let the user choose marking definitions'...": "La opción 'Dejar que el usuario elija las definiciones de marcado' pedirá al usuario que elija (al importar el archivo CSV) qué definiciones de marcado aplicar cuando falten datos en el archivo CSV.",
"Update without references": "Actualizar sin referencias",
"Max Confidence Level:": "Nivel Máximo de Confianza:",
"Share as public dashboard": "Compartir como tablero público",
"To prevent people seeing all the data...": "Para evitar que los usuarios vean todos los datos del panel público, seleccione una definición de marcado para restringir los datos compartidos.",
"Max level markings": "Marcas de nivel máximo",
"Copy link": "Copiar enlace",
"Disable link": "Desactivar enlace",
"Delete link": "Borrar enlace",
"Are you sure you want to delete this dashboard link?": "¿Está seguro de que desea eliminar este enlace del panel de control?",
"The Max Confidence Level is currently defined at the user level. It overrides Max Confidence Level from user’s groups.": "El nivel de confianza máximo se define actualmente a nivel de usuario. Anula el nivel de confianza máximo de los grupos de usuarios.",
"Please, verify the validity of the selected CSV mapper for the given URL.": "Por favor, verifique la validez del asignador CSV seleccionado para la URL proporcionada.",
"Only successful tests allow the ingestion creation.": "Sólo las pruebas exitosas permiten la creación de la ingesta.",
"Only successful tests allow the ingestion edition.": "Sólo las pruebas exitosas permiten la edición de ingesta.",
Expand Down Expand Up @@ -2651,5 +2659,15 @@
"AI Powered": "AI Powered",
"Missing token": "Ficha perdida",
"Generative AI is a beta feature as we are currently fine-tuning our models. Consider checking important information.": "La IA Generativa es una característica beta ya que actualmente estamos afinando nuestros modelos. Considere comprobar la información importante.",
"Accept": "Aceptar"
"Accept": "Aceptar",
"Public dashboards": "Cuadros de mando públicos",
"Existing public dashboards": "Cuadros de mando públicos existentes",
"No public dashboard created yet": "Aún no se ha creado ningún panel público",
"Create a new public dashboard": "Crear un nuevo panel público",
"Public dashboard ID": "ID del panel público",
"Specify the ID of your public dashboard": "Especifique el ID de su panel de control público",
"Disable public dashboard": "Desactivar panel público",
"Delete public dashboard": "Borrar panel público",
"Are you sure you want to delete this public dashboard?": "¿Está seguro de que desea eliminar este panel público?",
"A public dashboard is a snapshot...": "Un panel público es una instantánea de un panel privado en un momento determinado. Si modifica el panel privado, los paneles públicos ya creados no se modificarán."
}
14 changes: 14 additions & 0 deletions opencti-platform/opencti-front/lang/front/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2563,9 +2563,23 @@
"Option 'Let the user choose marking definitions'...": "L'option 'Let the user choose marking definitions' demandera à l'utilisateur de choisir (lors de l'importation du fichier CSV) les définitions de marquage à appliquer lorsque les données sont manquantes dans le fichier CSV.",
"Update without references": "Mise à jour sans références",
"Max Confidence Level:": "Niveau de confiance maximum :",
"Share as public dashboard": "Partager comme tableau de bord public",
"To prevent people seeing all the data...": "Pour empêcher les gens de voir toutes les données du tableau de bord public, sélectionnez une définition de marquage pour restreindre les données partagées.",
"Max level markings": "Marquage de niveau maximum",
"Copy link": "Copier le lien",
"Please, verify the validity of the selected CSV mapper for the given URL.": "Veuillez vérifier la validité du mappeur CSV sélectionné pour l'URL donnée.",
"Only successful tests allow the ingestion creation.": "Seuls les tests réussis permettent la création de l'ingestion.",
"Only successful tests allow the ingestion edition.": "Seuls les tests réussis permettent l'édition de l'ingestion.",
"Public dashboards": "Tableaux de bord publics",
"Existing public dashboards": "Tableaux de bord publics existants",
"No public dashboard created yet": "Aucun tableau de bord public n'a encore été créé",
"Create a new public dashboard": "Créer un nouveau tableau de bord public",
"Public dashboard ID": "ID du tableau de bord public",
"Specify the ID of your public dashboard": "Spécifiez l'ID de votre tableau de bord public",
"Disable public dashboard": "Désactiver le tableau de bord public",
"Delete public dashboard": "Supprimer le tableau de bord public",
"Are you sure you want to delete this public dashboard?": "Êtes-vous sûr de vouloir supprimer ce tableau de bord public ?",
"A public dashboard is a snapshot...": "Un tableau de bord public est un instantané d'un tableau de bord privé à un moment précis. Si vous modifiez le tableau de bord privé, les tableaux de bord publics déjà créés ne seront pas modifiés.",
"Home": "Accueil",
"Request for takedown date": "Date de la demande de démontage",
"Enable AI powered platform": "Activer la plateforme alimentée par l'IA",
Expand Down
14 changes: 14 additions & 0 deletions opencti-platform/opencti-front/lang/front/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2563,9 +2563,23 @@
"Option 'Let the user choose marking definitions'...": "オプション 'ユーザーにマーキング定義を選択させる' は、CSVファイルにデータがない場合に適用するマーキング定義を(CSVファイルのインポート時に)ユーザーに選択させます。",
"Update without references": "参照なしで更新",
"Max Confidence Level:": "最大信頼度:",
"Share as public dashboard": "公開ダッシュボードとして共有",
"To prevent people seeing all the data...": "公開ダッシュボードのすべてのデータを見られないようにするには、共有データを制限するマーキング定義を選択します。",
"Max level markings": "最大レベルのマーキング",
"Copy link": "リンクをコピー",
"Please, verify the validity of the selected CSV mapper for the given URL.": "指定された URL に対して選択した CSV マッパーが有効であることを確認してください。",
"Only successful tests allow the ingestion creation.": "成功したテストのみが取り込みの作成を許可します。",
"Only successful tests allow the ingestion edition.": "テストが成功した場合のみ、インジェスト エディションが許可されます。",
"Public dashboards": "公開ダッシュボード",
"Existing public dashboards": "既存の公開ダッシュボード",
"No public dashboard created yet": "まだ作成されていない公開ダッシュボード",
"Create a new public dashboard": "新しい公開ダッシュボードを作成する",
"Public dashboard ID": "公開ダッシュボードID",
"Specify the ID of your public dashboard": "公開ダッシュボードのIDを指定する",
"Disable public dashboard": "公開ダッシュボードを無効にする",
"Delete public dashboard": "公開ダッシュボードを削除する",
"Are you sure you want to delete this public dashboard?": "本当にこの公開ダッシュボードを削除しますか?",
"A public dashboard is a snapshot...": "パブリック・ダッシュボードは、特定の時刻におけるプライベート・ダッシュボードのスナップショットです。プライベートダッシュボードを変更しても、すでに作成されたパブリックダッシュボードは変更されません。",
"Request for takedown date": "削除要請日",
"Enable AI powered platform": "AIプラットフォームの有効化",
"To use AI, please enable it in the configuration of your platform.": "AIを使用するには、プラットフォームの設定でAIを有効にしてください。",
Expand Down
14 changes: 14 additions & 0 deletions opencti-platform/opencti-front/lang/front/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2563,9 +2563,23 @@
"Option 'Let the user choose marking definitions'...": "选项 '让用户选择标记定义'将要求用户(在导入 CSV 文件时)选择在 CSV 文件中缺少数据时应用哪些标记定义。",
"Update without references": "无引用更新",
"Max Confidence Level:": "最大置信度:",
"Share as public dashboard": "作为公共仪表板共享",
"To prevent people seeing all the data...": "要防止他人看到公共仪表板中的所有数据,请选择标记定义来限制共享数据。",
"Max level markings": "最大级别标记",
"Copy link": "复制链接",
"Please, verify the validity of the selected CSV mapper for the given URL.": "请验证给定 URL 所选 CSV 映射器的有效性。",
"Only successful tests allow the ingestion creation.": "只有成功的测试才允许创建摄取。",
"Only successful tests allow the ingestion edition.": "只有成功的测试才允许摄取版本。",
"Public dashboards": "公共仪表板",
"Existing public dashboards": "现有公共仪表盘",
"No public dashboard created yet": "尚未创建公共仪表盘",
"Create a new public dashboard": "创建新的公共仪表盘",
"Public dashboard ID": "公共仪表板 ID",
"Specify the ID of your public dashboard": "指定公共仪表板的 ID",
"Disable public dashboard": "禁用公共仪表盘",
"Delete public dashboard": "删除公共仪表板",
"Are you sure you want to delete this public dashboard?": "您确定要删除此公共仪表板吗?",
"A public dashboard is a snapshot...": "公共仪表盘是私人仪表盘在特定时间的快照。如果修改了私人仪表盘,则不会修改已创建的公共仪表盘。",
"Request for takedown date": "请求删除日期",
"Enable AI powered platform": "启用人工智能平台",
"To use AI, please enable it in the configuration of your platform.": "要使用人工智能,请在平台配置中启用人工智能。",
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"@types/react": "18.2.55",
"@types/react-csv": "1.1.10",
"@types/react-dom": "18.2.19",
"@types/react-grid-layout": "^1.3.5",
"@types/react-relay": "16.0.6",
"@types/react-router-dom": "5.3.3",
"@types/react-syntax-highlighter": "15.5.11",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import { useFormatter } from '../i18n';
import useEnterpriseEdition from '../../utils/hooks/useEnterpriseEdition';

const WidgetAccessDenied = () => {
const { t_i18n } = useFormatter();
const isEnterpriseEdition = useEnterpriseEdition();

return (
<div
style={{
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<span style={{ textAlign: 'center' }}>
{!isEnterpriseEdition
? t_i18n('This feature is only available in OpenCTI Enterprise Edition.')
: t_i18n('You are not authorized to see this data.')}
</span>
</div>
);
};

export default WidgetAccessDenied;
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import Typography from '@mui/material/Typography';
import Paper from '@mui/material/Paper';
import React, { CSSProperties, ReactNode } from 'react';
import makeStyles from '@mui/styles/makeStyles';

const useStyles = makeStyles({
paper: {
minHeight: 110,
height: '100%',
margin: '4px 0 0 0',
padding: '0 0 10px 0',
borderRadius: 4,
},
});

interface WidgetContainerProps {
children: ReactNode
height?: CSSProperties['height']
title: string
variant: string
withoutTitle?: boolean
}

const WidgetContainer = ({
children,
height,
title,
variant,
withoutTitle = false,
}: WidgetContainerProps) => {
const classes = useStyles();

return (
<div style={{ height: height || '100%' }}>
{!withoutTitle && (
<Typography
variant="h4"
gutterBottom={true}
style={{
margin: variant !== 'inLine' ? '0 0 10px 0' : '-10px 0 10px -7px',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
}}
>
{title}
</Typography>
)}
{variant !== 'inLine' ? (
<Paper classes={{ root: classes.paper }} variant="outlined">
{children}
</Paper>
) : (
children
)}
</div>
);
};

export default WidgetContainer;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import CircularProgress from '@mui/material/CircularProgress';
import React from 'react';

const WidgetLoader = () => {
return (
<div
style={{
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<CircularProgress size={40} thickness={2} />
</div>
);
};

export default WidgetLoader;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { useFormatter } from '../i18n';

const WidgetNoData = () => {
const { t_i18n } = useFormatter();

return (
<div
style={{
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<p>{t_i18n('No entities of this type has been found.')}</p>
</div>
);
};

export default WidgetNoData;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import ItemNumberDifference from '../ItemNumberDifference';
import { useFormatter } from '../i18n';

interface WidgetNumberProps {
total: number
value: number
}

const WidgetNumber = ({ total, value }: WidgetNumberProps) => {
const { t_i18n, n } = useFormatter();
const difference = total - value;

return (
<>
<div style={{ float: 'left', fontSize: 40 }}>
{n(total)}
</div>
<ItemNumberDifference
difference={difference}
description={t_i18n('24 hours')}
/>
</>
);
};

export default WidgetNumber;
Loading

0 comments on commit cae516c

Please sign in to comment.