From cbd189230a3d5523e1e9e5f66482cc1aca77bf33 Mon Sep 17 00:00:00 2001 From: Jihyun Kang Date: Fri, 8 Dec 2023 14:14:14 +0900 Subject: [PATCH] feature: re-arrange my account dialog (#2087) * refactor: remove keypair information from my account modal * add: keypair info modal in usersettings page * add: translation for my keypair info * add: main_access_key tag in keypair information * misc: remove unused external libraries and components * misc: remove unused imports from antd library * fix: refetch keypairs on open state * fix: replace column specific width setting to rowScope and width setting in modal --- react/src/components/KeypairInfoModal.tsx | 120 ++++++++++++++++++ .../components/UserProfileSettingModal.css | 4 - .../components/UserProfileSettingModal.tsx | 48 +------ react/src/index.tsx | 19 +++ resources/i18n/de.json | 4 +- resources/i18n/el.json | 4 +- resources/i18n/en.json | 2 + resources/i18n/es.json | 4 +- resources/i18n/fi.json | 4 +- resources/i18n/fr.json | 4 +- resources/i18n/id.json | 4 +- resources/i18n/it.json | 4 +- resources/i18n/ja.json | 4 +- resources/i18n/ko.json | 4 +- resources/i18n/mn.json | 4 +- resources/i18n/ms.json | 4 +- resources/i18n/pl.json | 4 +- resources/i18n/pt-BR.json | 4 +- resources/i18n/pt.json | 4 +- resources/i18n/ru.json | 4 +- resources/i18n/tr.json | 4 +- resources/i18n/vi.json | 4 +- resources/i18n/zh-CN.json | 4 +- resources/i18n/zh-TW.json | 4 +- .../backend-ai-usersettings-general-list.ts | 27 +++- 25 files changed, 225 insertions(+), 71 deletions(-) create mode 100644 react/src/components/KeypairInfoModal.tsx delete mode 100644 react/src/components/UserProfileSettingModal.css diff --git a/react/src/components/KeypairInfoModal.tsx b/react/src/components/KeypairInfoModal.tsx new file mode 100644 index 0000000000..158b1a85ce --- /dev/null +++ b/react/src/components/KeypairInfoModal.tsx @@ -0,0 +1,120 @@ +/** + @license + Copyright (c) 2015-2023 Lablup Inc. All rights reserved. + */ +import { useSuspendedBackendaiClient } from '../hooks'; +import { useCurrentUserInfo } from '../hooks/backendai'; +import { useTanQuery } from '../hooks/reactQueryAlias'; +import BAIModal, { BAIModalProps } from './BAIModal'; +import Flex from './Flex'; +import { KeypairInfoModalQuery } from './__generated__/KeypairInfoModalQuery.graphql'; +import { Button, Table, Typography, Tag } from 'antd'; +import graphql from 'babel-plugin-relay/macro'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { useLazyLoadQuery } from 'react-relay'; + +interface KeypairInfoModalProps extends BAIModalProps { + onRequestClose: () => void; +} + +const KeypairInfoModal: React.FC = ({ + onRequestClose, + ...baiModalProps +}) => { + const { t } = useTranslation(); + const [userInfo] = useCurrentUserInfo(); + const baiClient = useSuspendedBackendaiClient(); + const { data: keypairs } = useTanQuery({ + queryKey: ['baiClient.keypair.list', baiModalProps.open], // refetch on open state + queryFn: () => { + return baiClient.keypair + .list(userInfo.email, ['access_key', 'secret_key', 'is_active'], true) + .then((res: any) => res.keypairs); + }, + suspense: true, + staleTime: 0, + cacheTime: 0, + }); + + const supportMainAccessKey = baiClient?.supports('main-access-key'); + + const { user } = useLazyLoadQuery( + graphql` + query KeypairInfoModalQuery($email: String) { + user(email: $email) { + email + main_access_key @since(version: "24.03.0") + } + } + `, + { + email: userInfo.email, + }, + ); + + return ( + { + onRequestClose(); + }} + > + {t('button.Close')} + , + ]} + > + { + ++index; + return index; + }, + showSorterTooltip: false, + rowScope: 'row', + }, + { + title: t('general.AccessKey'), + dataIndex: 'access_key', + fixed: 'left', + render: (value) => ( + + + {value} + + {supportMainAccessKey && value === user?.main_access_key && ( + {t('credential.MainAccessKey')} + )} + + ), + }, + { + title: t('general.SecretKey'), + dataIndex: 'secret_key', + fixed: 'left', + render: (value) => ( + + {value} + + ), + }, + ]} + >
+
+ ); +}; + +export default KeypairInfoModal; diff --git a/react/src/components/UserProfileSettingModal.css b/react/src/components/UserProfileSettingModal.css deleted file mode 100644 index d9cdd0fc4f..0000000000 --- a/react/src/components/UserProfileSettingModal.css +++ /dev/null @@ -1,4 +0,0 @@ -.disabled_style_readonly, -.disabled_style_readonly input { - background-color: #f5f5f5; -} diff --git a/react/src/components/UserProfileSettingModal.tsx b/react/src/components/UserProfileSettingModal.tsx index 5e72c3c997..0f37516bfa 100644 --- a/react/src/components/UserProfileSettingModal.tsx +++ b/react/src/components/UserProfileSettingModal.tsx @@ -9,13 +9,11 @@ import BAIModal from './BAIModal'; import { passwordPattern } from './ResetPasswordRequired'; import TOTPActivateModal from './TOTPActivateModal'; // @ts-ignore -import customCSS from './UserProfileSettingModal.css?raw'; import { UserProfileSettingModalQuery } from './__generated__/UserProfileSettingModalQuery.graphql'; import { ExclamationCircleFilled } from '@ant-design/icons'; import { useToggle } from 'ahooks'; -import { Modal, ModalProps, Input, Form, Select, message, Switch } from 'antd'; +import { Modal, ModalProps, Input, Form, message, Switch } from 'antd'; import graphql from 'babel-plugin-relay/macro'; -import _ from 'lodash'; import React, { useDeferredValue } from 'react'; import { useTranslation } from 'react-i18next'; import { useLazyLoadQuery } from 'react-relay'; @@ -29,8 +27,6 @@ type UserProfileFormValues = { originalPassword?: string; newPasswordConfirm?: string; newPassword?: string; - access_key?: string; - secret_key?: string; totp_activated: boolean; }; @@ -84,23 +80,6 @@ const UserProfileSettingModal: React.FC = ({ }, ); - const { data: keyPairs } = useTanQuery< - { - secret_key: string; - access_key: string; - }[] - >( - 'baiClient.keypair.list', - () => { - return baiClient.keypair - .list(userInfo.email, ['access_key', 'secret_key'], true) - .then((res: any) => res.keypairs); - }, - { - suspense: true, - }, - ); - const mutationToRemoveTotp = useTanMutation({ mutationFn: () => { return baiClient.remove_totp(); @@ -164,7 +143,6 @@ const UserProfileSettingModal: React.FC = ({ return ( <> - = ({ initialValues={{ full_name: userInfo.full_name, totp_activated: user?.totp_activated || false, - access_key: keyPairs?.[0].access_key, }} preserve={false} > @@ -207,29 +184,6 @@ const UserProfileSettingModal: React.FC = ({ > - - - - prev.access_key !== next.access_key} - > - {({ getFieldValue }) => ( - - )} - import('./components/ContainerRegistryList'), ); +const KeypairInfoModal = React.lazy( + () => import('./components/KeypairInfoModal'), +); customElements.define( 'backend-ai-react-information', @@ -270,3 +273,19 @@ customElements.define( ); }), ); + +customElements.define( + 'backend-ai-react-keypair-info-modal', + reactToWebComponent((props) => { + return ( + + { + props.dispatchEvent('close', null); + }} + /> + + ); + }), +); diff --git a/resources/i18n/de.json b/resources/i18n/de.json index ffc34d4fb6..56c0a3dc39 100644 --- a/resources/i18n/de.json +++ b/resources/i18n/de.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Melden Sie sich automatisch ab, wenn alle angemeldeten Seiten geschlossen sind, mit Ausnahme von sitzungsbasierten Seiten für Apps (z. B. Jupyter Notebook, Webterminal usw.)", "SSHKeypairEnterManuallyFinished": "SSH-Keypair wurde erfolgreich registriert.", "BootstrapScriptDescription": "Das Bootstrap-Skript wird nur einmal nach der Erstellung der Sitzung ausgeführt", - "SSHKeypairEnterManually": "SSH-Schlüsselpaar" + "SSHKeypairEnterManually": "SSH-Schlüsselpaar", + "MyKeypairInfo": "Meine Schlüsselpaarinformationen", + "DescMyKeypairInfo": "Siehe meine Schlüsselpaarinformationen" }, "webTerminalUsageGuide": { "CopyGuide": "Erweiterte Web-Terminal-Nutzung: Terminal-Inhalte kopieren", diff --git a/resources/i18n/el.json b/resources/i18n/el.json index 6f0f617d91..6e3f660223 100644 --- a/resources/i18n/el.json +++ b/resources/i18n/el.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Αποσυνδεθείτε αυτόματα εάν όλες οι συνδεδεμένες σελίδες είναι κλειστές εκτός από τις σελίδες που προέρχονται από περίοδο σύνδεσης για εφαρμογές (π.χ. jupyter notebook, web terminal κ.λπ.)", "SSHKeypairEnterManuallyFinished": "Το ζεύγος κλειδιών SSH καταχωρήθηκε με επιτυχία.", "BootstrapScriptDescription": "Το σενάριο Bootstrap θα εκτελεστεί μόνο μία φορά μετά τη δημιουργία συνεδρίας", - "SSHKeypairEnterManually": "Ζεύγος κλειδιών SSH" + "SSHKeypairEnterManually": "Ζεύγος κλειδιών SSH", + "MyKeypairInfo": "Πληροφορίες για το ζεύγος κλειδιών μου", + "DescMyKeypairInfo": "Δείτε τις πληροφορίες του ζεύγους κλειδιών μου" }, "webTerminalUsageGuide": { "CopyGuide": "Σύνθετη χρήση τερματικού Web: Αντιγραφή περιεχομένου τερματικού", diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 6ac819c83b..9723ab44be 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -897,6 +897,8 @@ "BetaFeatures": "Beta Features", "DescBetaFeatures": "Use beta features for Web UI.
Beta features may be unstable. Some beta features may not be adopted as official feature.", "DescNoBetaFeatures": "No beta feature available now. :)", + "MyKeypairInfo": "My Keypair Information", + "DescMyKeypairInfo": "See my keypair information", "BootstrapScriptDescription": "Bootstrap script will be executed only once after session creation", "EditBootstrapScript": "Edit Bootstrap Script", "EditUserConfigScript": "Edit User Config Script", diff --git a/resources/i18n/es.json b/resources/i18n/es.json index 785882eeb3..9444a73671 100644 --- a/resources/i18n/es.json +++ b/resources/i18n/es.json @@ -1364,7 +1364,9 @@ "SSHKeypairManagement": "Gestión de pares de claves SSH", "SessionTerminationDialog": "La finalización de la sesión no se puede deshacer. ¿Desea finalizar la sesión?", "ShellEnvironments": "Entornos de conchas", - "UseCompactSidebar": "Utilizar la barra lateral compacta por defecto" + "UseCompactSidebar": "Utilizar la barra lateral compacta por defecto", + "MyKeypairInfo": "Información de mi par de claves", + "DescMyKeypairInfo": "Ver la información de mi par de claves" }, "webTerminalUsageGuide": { "CopyGuide": "Uso avanzado del terminal web: Copiar el contenido del terminal", diff --git a/resources/i18n/fi.json b/resources/i18n/fi.json index 5a1ce25750..f2280e2a38 100644 --- a/resources/i18n/fi.json +++ b/resources/i18n/fi.json @@ -1407,7 +1407,9 @@ "ClearSSHKeypairInput": "__NOT_TRANSLATED__", "SSHKeypairEnterManually": "__NOT_TRANSLATED__", "General": "__NOT_TRANSLATED__", - "Logs": "__NOT_TRANSLATED__" + "Logs": "__NOT_TRANSLATED__", + "MyKeypairInfo": "Avainparini tiedot", + "DescMyKeypairInfo": "Katso avainparini tiedot" }, "sidepanel": { "Notification": "__NOT_TRANSLATED__", diff --git a/resources/i18n/fr.json b/resources/i18n/fr.json index a7948a63a6..04ec10d5fe 100644 --- a/resources/i18n/fr.json +++ b/resources/i18n/fr.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Déconnectez-vous automatiquement si toutes les pages connectées sont fermées, à l'exception des pages d'origine de session pour les applications (par exemple, bloc-notes jupyter, terminal Web, etc.)", "BootstrapScriptDescription": "Le script Bootstrap ne sera exécuté qu'une seule fois après la création de la session.", "SSHKeypairEnterManually": "Couple de clés SSH", - "SSHKeypairEnterManuallyFinished": "La paire de clés SSH a été enregistrée avec succès." + "SSHKeypairEnterManuallyFinished": "La paire de clés SSH a été enregistrée avec succès.", + "MyKeypairInfo": "Informations sur ma paire de clés", + "DescMyKeypairInfo": "Voir les informations de ma paire de clés" }, "webTerminalUsageGuide": { "CopyGuide": "Utilisation avancée du terminal Web : copier le contenu du terminal", diff --git a/resources/i18n/id.json b/resources/i18n/id.json index 60080d2a16..b920a3d337 100644 --- a/resources/i18n/id.json +++ b/resources/i18n/id.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Keluar secara otomatis jika semua halaman yang masuk ditutup kecuali halaman yang berasal dari sesi untuk aplikasi (mis. Jupyter notebook, terminal web, dll.)", "BootstrapScriptDescription": "Skrip bootstrap akan dieksekusi hanya sekali setelah pembuatan sesi", "SSHKeypairEnterManually": "SSH Keypair", - "SSHKeypairEnterManuallyFinished": "SSH Keypair telah berhasil didaftarkan." + "SSHKeypairEnterManuallyFinished": "SSH Keypair telah berhasil didaftarkan.", + "MyKeypairInfo": "Informasi Pasangan Kunci Saya", + "DescMyKeypairInfo": "Lihat informasi keypair saya" }, "webTerminalUsageGuide": { "CopyGuide": "Penggunaan Terminal Web Tingkat Lanjut: Salin konten terminal", diff --git a/resources/i18n/it.json b/resources/i18n/it.json index aa83a38b9f..6ef8eee397 100644 --- a/resources/i18n/it.json +++ b/resources/i18n/it.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Disconnettersi automaticamente se tutte le pagine di accesso vengono chiuse eccetto le pagine originate dalla sessione per le app (ad es.", "SSHKeypairEnterManuallyFinished": "La coppia di chiavi SSH è stata registrata con successo.", "BootstrapScriptDescription": "Lo script Bootstrap verrà eseguito solo una volta dopo la creazione della sessione.", - "SSHKeypairEnterManually": "Coppia di chiavi SSH" + "SSHKeypairEnterManually": "Coppia di chiavi SSH", + "MyKeypairInfo": "Informazioni sulla mia coppia di chiavi", + "DescMyKeypairInfo": "Vedi le informazioni sulla mia coppia di chiavi" }, "webTerminalUsageGuide": { "CopyGuide": "Utilizzo avanzato del terminale Web: copia il contenuto del terminale", diff --git a/resources/i18n/ja.json b/resources/i18n/ja.json index a132b5b56c..5d78a2bc15 100644 --- a/resources/i18n/ja.json +++ b/resources/i18n/ja.json @@ -841,7 +841,9 @@ "DescAutoLogout": "アプリのセッション開始ページ(jupyterノートブック、Webターミナルなど)を除き、ログインしたすべてのページが閉じている場合は、自動的にログアウトします。", "SSHKeypairEnterManuallyFinished": "SSHキーフェア登録が正常に完了しました。", "BootstrapScriptDescription": "ブートストラップスクリプトはセッション作成後一度だけ実行されます。", - "SSHKeypairEnterManually": "SSHキーペア入力" + "SSHKeypairEnterManually": "SSHキーペア入力", + "MyKeypairInfo": "私のキーペア情報", + "DescMyKeypairInfo": "私のキーペア情報を参照してください" }, "webTerminalUsageGuide": { "CopyGuide": "高度なWeb端末の使用法:端末の内容をコピーする", diff --git a/resources/i18n/ko.json b/resources/i18n/ko.json index 3935e4b334..510acb2f98 100644 --- a/resources/i18n/ko.json +++ b/resources/i18n/ko.json @@ -922,7 +922,9 @@ "Edit_ShellScriptTitle_2": " 셀 스크립트 수정하기", "AutoLogout": "자동 로그아웃", "DescAutoLogout": "세션 내 앱을 실행하기 위해 생성된 페이지를 제외한 모든 Backend.AI 웹 UI 페이지가 닫힐 경우 자동으로 로그아웃됩니다.", - "SSHKeypairEnterManuallyFinished": "SSH 키페어 등록이 성공적으로 완료되었습니다." + "SSHKeypairEnterManuallyFinished": "SSH 키페어 등록이 성공적으로 완료되었습니다.", + "MyKeypairInfo": "내 키페어 정보", + "DescMyKeypairInfo": "내 키페어 정보 보기" }, "webTerminalUsageGuide": { "CopyGuide": "웹 터미널 고급 사용법: 터미널 내용 복사하기", diff --git a/resources/i18n/mn.json b/resources/i18n/mn.json index 3200b4f10e..94ec071a1a 100644 --- a/resources/i18n/mn.json +++ b/resources/i18n/mn.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Аппликешнд зориулж суулгасан хуудсуудаас бусад нэвтэрсэн бүх хуудсыг хаасан тохиолдолд автоматаар гарах болно (ж.нь. Jupyter Notebook, вэб терминал гэх мэт).", "BootstrapScriptDescription": "Ачаалагч скрипт нь сесс үүсгэсний дараа зөвхөн нэг удаа хийгдэх болно", "SSHKeypairEnterManually": "SSH товчлуурын хослол", - "SSHKeypairEnterManuallyFinished": "SSH Keypair амжилттай бүртгэгдлээ." + "SSHKeypairEnterManuallyFinished": "SSH Keypair амжилттай бүртгэгдлээ.", + "MyKeypairInfo": "Миний товчлуурын мэдээлэл", + "DescMyKeypairInfo": "Миний товчлуурын мэдээллийг харна уу" }, "webTerminalUsageGuide": { "CopyGuide": "Дэвшилтэт вэб терминалын хэрэглээ: Терминалын агуулгыг хуулах", diff --git a/resources/i18n/ms.json b/resources/i18n/ms.json index d33ac048fe..9f0a2ef1fb 100644 --- a/resources/i18n/ms.json +++ b/resources/i18n/ms.json @@ -840,7 +840,9 @@ "DescAutoLogout": "Log keluar secara automatik jika semua halaman log masuk ditutup kecuali halaman yang berasal dari sesi untuk aplikasi (mis. Notebook jupyter, terminal web, dll.)", "SSHKeypairEnterManuallyFinished": "SSH Keypair telah berjaya didaftarkan.", "BootstrapScriptDescription": "Skrip Bootstrap akan dilaksanakan sekali sahaja selepas penciptaan sesi", - "SSHKeypairEnterManually": "SSH Keypair" + "SSHKeypairEnterManually": "SSH Keypair", + "MyKeypairInfo": "Maklumat Pasangan Kunci Saya", + "DescMyKeypairInfo": "Lihat maklumat pasangan kunci saya" }, "webTerminalUsageGuide": { "CopyGuide": "Penggunaan Terminal Web Lanjutan: Salin kandungan terminal", diff --git a/resources/i18n/pl.json b/resources/i18n/pl.json index 653570ae10..cfcedaadeb 100644 --- a/resources/i18n/pl.json +++ b/resources/i18n/pl.json @@ -843,7 +843,9 @@ "DescAutoLogout": "Wyloguj się automatycznie, jeśli wszystkie zalogowane strony są zamknięte, z wyjątkiem stron pochodzących z sesji dla aplikacji (np. notatnik jupyter, terminal internetowy itp.)", "SSHKeypairEnterManuallyFinished": "Para kluczy SSH została pomyślnie zarejestrowana.", "BootstrapScriptDescription": "Skrypt Bootstrap zostanie wykonany tylko raz po utworzeniu sesji.", - "SSHKeypairEnterManually": "Para kluczy SSH" + "SSHKeypairEnterManually": "Para kluczy SSH", + "MyKeypairInfo": "Informacje o mojej parze kluczy", + "DescMyKeypairInfo": "Zobacz informacje o mojej parze kluczy" }, "webTerminalUsageGuide": { "CopyGuide": "Zaawansowane korzystanie z terminala internetowego: Skopiuj zawartość terminala", diff --git a/resources/i18n/pt-BR.json b/resources/i18n/pt-BR.json index bb6caa53e6..a23651f02e 100644 --- a/resources/i18n/pt-BR.json +++ b/resources/i18n/pt-BR.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Saia automaticamente se todas as páginas logadas forem fechadas, exceto as páginas originadas da sessão para aplicativos (por exemplo, notebook jupyter, terminal da web, etc.)", "SSHKeypairEnterManuallyFinished": "O par de chaves SSH foi registado com sucesso.", "BootstrapScriptDescription": "O script bootstrap será executado apenas uma vez após a criação da sessão", - "SSHKeypairEnterManually": "Par de chaves SSH" + "SSHKeypairEnterManually": "Par de chaves SSH", + "MyKeypairInfo": "Minhas informações de par de chaves", + "DescMyKeypairInfo": "Ver as informações do meu par de chaves" }, "webTerminalUsageGuide": { "CopyGuide": "Uso avançado do terminal da Web: Copiar o conteúdo do terminal", diff --git a/resources/i18n/pt.json b/resources/i18n/pt.json index 25c6528d73..d7ccd8f7bf 100644 --- a/resources/i18n/pt.json +++ b/resources/i18n/pt.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Saia automaticamente se todas as páginas logadas forem fechadas, exceto as páginas originadas da sessão para aplicativos (por exemplo, notebook jupyter, terminal da web, etc.)", "SSHKeypairEnterManuallyFinished": "O par de chaves SSH foi registado com sucesso.", "BootstrapScriptDescription": "O script bootstrap será executado apenas uma vez após a criação da sessão", - "SSHKeypairEnterManually": "Par de chaves SSH" + "SSHKeypairEnterManually": "Par de chaves SSH", + "MyKeypairInfo": "Minhas informações de par de chaves", + "DescMyKeypairInfo": "Ver as informações do meu par de chaves" }, "webTerminalUsageGuide": { "CopyGuide": "Uso avançado do terminal da Web: Copiar o conteúdo do terminal", diff --git a/resources/i18n/ru.json b/resources/i18n/ru.json index d314c95bd1..f19823c9e2 100644 --- a/resources/i18n/ru.json +++ b/resources/i18n/ru.json @@ -843,7 +843,9 @@ "DescAutoLogout": "Автоматический выход из системы, если все зарегистрированные страницы закрыты, кроме страниц, созданных в сеансе для приложений (например, блокнот jupyter, веб-терминал и т. Д.)", "BootstrapScriptDescription": "Bootstrap-скрипт будет выполняться только один раз после создания сессии", "SSHKeypairEnterManually": "Пара ключей SSH", - "SSHKeypairEnterManuallyFinished": "Пара ключей SSH успешно зарегистрирована." + "SSHKeypairEnterManuallyFinished": "Пара ключей SSH успешно зарегистрирована.", + "MyKeypairInfo": "Информация о моей паре ключей", + "DescMyKeypairInfo": "Посмотреть информацию о моей паре ключей" }, "webTerminalUsageGuide": { "CopyGuide": "Расширенное использование веб-терминала: копирование содержимого терминала", diff --git a/resources/i18n/tr.json b/resources/i18n/tr.json index 55c771d6e2..4175ee01b8 100644 --- a/resources/i18n/tr.json +++ b/resources/i18n/tr.json @@ -841,7 +841,9 @@ "DescAutoLogout": "Uygulamalar için oturum kaynaklı sayfalar (örneğin jupyter notebook, web terminal, vb.)", "SSHKeypairEnterManuallyFinished": "SSH Anahtar Çifti başarıyla kaydedildi.", "BootstrapScriptDescription": "Bootstrap komut dosyası oturum oluşturulduktan sonra yalnızca bir kez çalıştırılacaktır", - "SSHKeypairEnterManually": "SSH Anahtar Çifti" + "SSHKeypairEnterManually": "SSH Anahtar Çifti", + "MyKeypairInfo": "Anahtar Çifti Bilgilerim", + "DescMyKeypairInfo": "Anahtar çifti bilgilerimi görün" }, "webTerminalUsageGuide": { "CopyGuide": "Gelişmiş Web Terminali Kullanımı: Terminal içeriğini kopyalayın", diff --git a/resources/i18n/vi.json b/resources/i18n/vi.json index 44e56a2f93..fc00cd2ab1 100644 --- a/resources/i18n/vi.json +++ b/resources/i18n/vi.json @@ -840,7 +840,9 @@ "DescAutoLogout": "Tự động đăng xuất nếu tất cả các trang đã đăng nhập đều bị đóng ngoại trừ các trang gốc phiên cho ứng dụng (ví dụ: sổ ghi chép jupyter, thiết bị đầu cuối web, v.v.)", "SSHKeypairEnterManuallyFinished": "Cặp khóa SSH đã được đăng ký thành công.", "BootstrapScriptDescription": "Tập lệnh Bootstrap sẽ chỉ được thực thi một lần sau khi tạo phiên", - "SSHKeypairEnterManually": "Cặp khóa SSH" + "SSHKeypairEnterManually": "Cặp khóa SSH", + "MyKeypairInfo": "Thông tin về cặp khóa của tôi", + "DescMyKeypairInfo": "Xem thông tin cặp khóa của tôi" }, "webTerminalUsageGuide": { "CopyGuide": "Sử dụng đầu cuối web nâng cao: Sao chép nội dung đầu cuối", diff --git a/resources/i18n/zh-CN.json b/resources/i18n/zh-CN.json index ac8d1320bb..c0027de3e7 100644 --- a/resources/i18n/zh-CN.json +++ b/resources/i18n/zh-CN.json @@ -841,7 +841,9 @@ "DescAutoLogout": "如果所有登录页面都关闭,除了应用程序的会话发起页面(例如 jupyter 笔记本、网络终端等),则自动注销", "SSHKeypairEnterManuallyFinished": "SSH 密钥对已成功注册。", "BootstrapScriptDescription": "Bootstrap 脚本只会在会话创建后执行一次", - "SSHKeypairEnterManually": "SSH 密钥对" + "SSHKeypairEnterManually": "SSH 密钥对", + "MyKeypairInfo": "我的密钥对信息", + "DescMyKeypairInfo": "查看我的密钥对信息" }, "webTerminalUsageGuide": { "CopyGuide": "高级 Web 终端使用:复制终端内容", diff --git a/resources/i18n/zh-TW.json b/resources/i18n/zh-TW.json index 506cca9dd8..dec8c87bea 100644 --- a/resources/i18n/zh-TW.json +++ b/resources/i18n/zh-TW.json @@ -841,7 +841,9 @@ "DescAutoLogout": "如果所有登錄頁面都關閉,除了應用程序的會話發起頁面(例如 jupyter 筆記本、網絡終端等),則自動註銷", "SSHKeypairEnterManuallyFinished": "SSH 密钥对已成功注册。", "BootstrapScriptDescription": "Bootstrap 脚本只会在会话创建后执行一次", - "SSHKeypairEnterManually": "SSH 密钥对" + "SSHKeypairEnterManually": "SSH 密钥对", + "MyKeypairInfo": "我的密鑰對訊息", + "DescMyKeypairInfo": "查看我的密鑰對訊息" }, "webTerminalUsageGuide": { "CopyGuide": "高級 Web 終端使用:複製終端內容", diff --git a/src/components/backend-ai-usersettings-general-list.ts b/src/components/backend-ai-usersettings-general-list.ts index b998154a2b..1a3e358400 100644 --- a/src/components/backend-ai-usersettings-general-list.ts +++ b/src/components/backend-ai-usersettings-general-list.ts @@ -103,7 +103,7 @@ export default class BackendAiUsersettingsGeneralList extends BackendAIPage { @query('#ssh-keypair-form-dialog') sshKeypairFormDialog!: BackendAIDialog; @query('#entered-ssh-public-key') enteredSSHPublicKeyInput!: TextArea; @query('#entered-ssh-private-key') enteredSSHPrivateKeyInput!: TextArea; - + @property({ type: Boolean }) isOpenMyKeypairInfoDialog = false; @query('#ui-language') languageSelect!: Select; @query('#delete-rcfile') deleteRcfileButton!: Button; @@ -960,6 +960,10 @@ export default class BackendAiUsersettingsGeneralList extends BackendAIPage { this._hideSSHKeypairGenerationDialog(); } + _openMyKeypairDialog() { + this.isOpenMyKeypairInfoDialog = true; + } + _discardCurrentEditorChange() { this._updateSelectedRcFileName(this.rcfile); this._hideCurrentEditorChangeDialog(); @@ -1201,6 +1205,21 @@ export default class BackendAiUsersettingsGeneralList extends BackendAIPage { > +
+
+
${_t('usersettings.MyKeypairInfo')}
+
+ ${_tr('usersettings.DescMyKeypairInfo')} +
+
+
+ +
+
${this.beta_feature_panel ? html`

@@ -1542,6 +1561,12 @@ export default class BackendAiUsersettingsGeneralList extends BackendAIPage { > + `; } }