From 79159dc8096cfd3c48228402d62b501f5bdf7cd5 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Fri, 22 Dec 2023 00:44:34 +0800 Subject: [PATCH] Improve TokenEditPage --- web/src/TokenEditPage.js | 61 ++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/web/src/TokenEditPage.js b/web/src/TokenEditPage.js index fe03bbc3..2b42a324 100644 --- a/web/src/TokenEditPage.js +++ b/web/src/TokenEditPage.js @@ -17,6 +17,9 @@ import {Button, Card, Col, Input, Row} from "antd"; import * as TokenBackend from "./backend/TokenBackend"; import * as Setting from "./Setting"; import i18next from "i18next"; +import copy from "copy-to-clipboard"; + +const {TextArea} = Input; class TokenEditPage extends React.Component { constructor(props) { @@ -70,6 +73,7 @@ class TokenEditPage extends React.Component { } renderToken() { + const editorWidth = Setting.isMobile() ? 22 : 9; return ( @@ -81,7 +85,7 @@ class TokenEditPage extends React.Component { } style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner"> - {i18next.t("general:Name")}: + {Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} : { @@ -91,7 +95,7 @@ class TokenEditPage extends React.Component { - {i18next.t("general:Application")}: + {Setting.getLabel(i18next.t("general:Application"), i18next.t("general:Application - Tooltip"))} : { @@ -101,7 +105,7 @@ class TokenEditPage extends React.Component { - {i18next.t("general:Organization")}: + {Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} : { @@ -111,7 +115,7 @@ class TokenEditPage extends React.Component { - {i18next.t("general:User")}: + {Setting.getLabel(i18next.t("general:User"), i18next.t("general:User - Tooltip"))} : { @@ -121,7 +125,7 @@ class TokenEditPage extends React.Component { - {i18next.t("token:Authorization code")}: + {Setting.getLabel(i18next.t("token:Authorization code"), i18next.t("token:Authorization code - Tooltip"))} : { @@ -131,17 +135,7 @@ class TokenEditPage extends React.Component { - {i18next.t("token:Access token")}: - - - { - this.updateTokenField("accessToken", e.target.value); - }} /> - - - - - {i18next.t("token:Expires in")}: + {Setting.getLabel(i18next.t("token:Expires in"), i18next.t("token:Expires in - Tooltip"))} : { @@ -151,7 +145,7 @@ class TokenEditPage extends React.Component { - {i18next.t("provider:Scope")}: + {Setting.getLabel(i18next.t("provider:Scope"), i18next.t("provider:Scope - Tooltip"))} { @@ -161,7 +155,7 @@ class TokenEditPage extends React.Component { - {i18next.t("token:Token type")}: + {Setting.getLabel(i18next.t("token:Token type"), i18next.t("token:Token type - Tooltip"))} : { @@ -169,6 +163,37 @@ class TokenEditPage extends React.Component { }} /> + + + {Setting.getLabel(i18next.t("token:Access token"), i18next.t("token:Access token - Tooltip"))} : + + + +