这是indexloc提供的服务,不要输入任何密码
Skip to content

changed language support for following windows: chat, data-upload and… #3010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import System from "@/models/system";
import showToast from "@/utils/toast";
import { Warning } from "@phosphor-icons/react";
import { Tooltip } from "react-tooltip";

export default function ConfluenceOptions() {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const [accessType, setAccessType] = useState("username");

Expand Down Expand Up @@ -61,12 +63,11 @@ export default function ConfluenceOptions() {
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold flex gap-x-2 items-center">
<p className="font-bold text-theme-text-primary">
Confluence deployment type
{t("connectors.confluence.deployment_type")}
</p>
</label>
<p className="text-xs font-normal text-theme-text-secondary">
Determine if your Confluence instance is hosted on Atlassian
cloud or self-hosted.
{t("connectors.confluence.deployment_type_explained")}
</p>
</div>
<select
Expand All @@ -85,10 +86,12 @@ export default function ConfluenceOptions() {
<div className="flex flex-col pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold flex gap-x-2 items-center">
<p className="font-bold text-white">Confluence base URL</p>
<p className="font-bold text-white">
{t("connectors.confluence.base_url")}
</p>
</label>
<p className="text-xs font-normal text-theme-text-secondary">
This is the base URL of your Confluence space.
{t("connectors.confluence.base_url_explained")}
</p>
</div>
<input
Expand All @@ -104,11 +107,10 @@ export default function ConfluenceOptions() {
<div className="flex flex-col pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold">
Confluence space key
{t("connectors.confluence.space_key")}
</label>
<p className="text-xs font-normal text-theme-text-secondary">
This is the spaces key of your confluence instance that will
be used. Usually begins with ~
{t("connectors.confluence.space_key_explained")}
</p>
</div>
<input
Expand All @@ -124,11 +126,10 @@ export default function ConfluenceOptions() {
<div className="flex flex-col pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold">
Confluence Auth Type
{t("connectors.confluence.auth_type")}
</label>
<p className="text-xs font-normal text-theme-text-secondary">
Your Confluence authentication type, eg: username and access
token / personal access token.
{t("connectors.confluence.auth_type_explained")}
</p>
</div>
<select
Expand All @@ -139,11 +140,11 @@ export default function ConfluenceOptions() {
>
{[
{
name: "Username and Access Token",
name: t("connectors.confluence.auth_type_username"),
value: "username",
},
{
name: "Personal Access Token",
name: t("connectors.confluence.auth_type_personal"),
value: "personalToken",
},
].map((type) => {
Expand All @@ -160,10 +161,10 @@ export default function ConfluenceOptions() {
<div className="flex flex-col pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold">
Confluence Username
{t("connectors.confluence.username")}
</label>
<p className="text-xs font-normal text-theme-text-secondary">
Your Confluence username.
{t("connectors.confluence.username_explained")}
</p>
</div>
<input
Expand All @@ -180,7 +181,7 @@ export default function ConfluenceOptions() {
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold flex gap-x-2 items-center">
<p className="font-bold text-white">
Confluence Access Token
{t("connectors.confluence.token")}
</p>
<Warning
size={14}
Expand All @@ -195,23 +196,22 @@ export default function ConfluenceOptions() {
clickable={true}
>
<p className="text-sm">
You need to provide an access token for
authentication. You can generate an access token{" "}
{t("connectors.confluence.token_explained_start")}
<a
href="https://id.atlassian.com/manage-profile/security/api-tokens"
target="_blank"
rel="noopener noreferrer"
className="underline"
onClick={(e) => e.stopPropagation()}
>
here
{t("connectors.confluence.token_explained_link")}
</a>
.
</p>
</Tooltip>
</label>
<p className="text-xs font-normal text-theme-text-secondary">
Access token for authentication.
{t("connectors.confluence.token_desc")}
</p>
</div>
<input
Expand All @@ -230,10 +230,10 @@ export default function ConfluenceOptions() {
<div className="flex flex-col pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold">
Confluence Personal Access Token
{t("connectors.confluence.pat_token")}
</label>
<p className="text-xs font-normal text-theme-text-secondary">
Your Confluence personal access token.
{t("connectors.confluence.pat_token_explained")}
</p>
</div>
<input
Expand All @@ -260,8 +260,7 @@ export default function ConfluenceOptions() {
</button>
{loading && (
<p className="text-xs text-theme-text-secondary">
Once complete, all pages will be available for embedding into
workspaces.
{t("connectors.confluence.task_explained")}
</p>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from "react";
import System from "@/models/system";
import { useTranslation } from "react-i18next";
import showToast from "@/utils/toast";
import pluralize from "pluralize";
import { TagsInput } from "react-tag-input-component";
Expand All @@ -8,6 +9,7 @@ import { Tooltip } from "react-tooltip";

const DEFAULT_BRANCHES = ["main", "master"];
export default function GithubOptions() {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const [repo, setRepo] = useState(null);
const [accessToken, setAccessToken] = useState(null);
Expand Down Expand Up @@ -68,10 +70,10 @@ export default function GithubOptions() {
<div className="flex flex-col pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold">
GitHub Repo URL
{t("connectors.github.URL")}
</label>
<p className="text-xs font-normal text-theme-text-secondary">
Url of the GitHub repo you wish to collect.
{t("connectors.github.URL_explained")}
</p>
</div>
<input
Expand All @@ -89,16 +91,18 @@ export default function GithubOptions() {
<div className="flex flex-col pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white font-bold text-sm flex gap-x-2 items-center">
<p className="font-bold text-white">GitHub Access Token</p>{" "}
<p className="font-bold text-white">
{t("connectors.github.token")}
</p>{" "}
<p className="text-xs font-light flex items-center">
<span className="text-theme-text-secondary">
optional
{t("connectors.github.optional")}
</span>
<PATTooltip accessToken={accessToken} />
</p>
</label>
<p className="text-xs font-normal text-theme-text-secondary">
Access Token to prevent rate limiting.
{t("connectors.github.token_explained")}
</p>
</div>
<input
Expand All @@ -122,11 +126,12 @@ export default function GithubOptions() {
<div className="flex flex-col w-full py-4 pr-10">
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm flex gap-x-2 items-center">
<p className="text-white text-sm font-bold">File Ignores</p>
<p className="text-white text-sm font-bold">
{t("connectors.github.ignores")}
</p>
</label>
<p className="text-xs font-normal text-theme-text-secondary">
List in .gitignore format to ignore specific files during
collection. Press enter after each entry you want to save.
{t("connectors.github.git_ignore")}
</p>
</div>
<TagsInput
Expand Down Expand Up @@ -154,8 +159,7 @@ export default function GithubOptions() {
</button>
{loading && (
<p className="text-xs text-white/50">
Once complete, all files will be available for embedding into
workspaces in the document picker.
{t("connectors.github.task_explained")}
</p>
)}
</div>
Expand All @@ -166,6 +170,7 @@ export default function GithubOptions() {
}

function GitHubBranchSelection({ repo, accessToken }) {
const { t } = useTranslation();
const [allBranches, setAllBranches] = useState(DEFAULT_BRANCHES);
const [loading, setLoading] = useState(true);

Expand Down Expand Up @@ -194,7 +199,7 @@ function GitHubBranchSelection({ repo, accessToken }) {
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold">Branch</label>
<p className="text-xs font-normal text-theme-text-secondary">
Branch you wish to collect files from.
{t("connectors.github.branch")}
</p>
</div>
<select
Expand All @@ -203,7 +208,7 @@ function GitHubBranchSelection({ repo, accessToken }) {
className="border-none bg-theme-settings-input-bg border-gray-500 text-white focus:outline-primary-button active:outline-primary-button outline-none text-sm rounded-lg block w-full p-2.5"
>
<option disabled={true} selected={true}>
-- loading available branches --
{t("connectors.github.branch_loading")}
</option>
</select>
</div>
Expand All @@ -215,7 +220,7 @@ function GitHubBranchSelection({ repo, accessToken }) {
<div className="flex flex-col gap-y-1 mb-4">
<label className="text-white text-sm font-bold">Branch</label>
<p className="text-xs font-normal text-theme-text-secondary">
Branch you wish to collect files from.
{t("connectors.github.branch_explained")}
</p>
</div>
<select
Expand All @@ -236,15 +241,18 @@ function GitHubBranchSelection({ repo, accessToken }) {
}

function PATAlert({ accessToken }) {
const { t } = useTranslation();
if (!!accessToken) return null;
return (
<div className="flex flex-col md:flex-row md:items-center gap-x-2 text-white mb-4 bg-blue-800/30 w-fit rounded-lg px-4 py-2">
<div className="gap-x-2 flex items-center">
<Info className="shrink-0" size={25} />
<p className="text-sm">
Without filling out the <b>Github Access Token</b> this data connector
will only be able to collect the <b>top-level</b> files of the repo
due to GitHub's public API rate-limits.
<span
dangerouslySetInnerHTML={{
__html: t("connectors.github.token_information"),
}}
/>
<br />
<br />
<a
Expand All @@ -255,7 +263,7 @@ function PATAlert({ accessToken }) {
onClick={(e) => e.stopPropagation()}
>
{" "}
Get a free Personal Access Token with a GitHub account here.
{t("connectors.github.token_personal")}
</a>
</p>
</div>
Expand All @@ -264,6 +272,7 @@ function PATAlert({ accessToken }) {
}

function PATTooltip({ accessToken }) {
const { t } = useTranslation();
if (!!accessToken) return null;
return (
<>
Expand All @@ -282,28 +291,27 @@ function PATTooltip({ accessToken }) {
clickable={true}
>
<p className="text-sm">
Without a{" "}
{t("connectors.github.token_explained_start")}
<a
href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens"
rel="noreferrer"
target="_blank"
className="underline"
onClick={(e) => e.stopPropagation()}
>
Personal Access Token
{t("connectors.github.token_explained_link1")}
</a>
, the GitHub API may limit the number of files that can be collected
due to rate limits. You can{" "}
{t("connectors.github.token_explained_middle")}
<a
href="https://github.com/settings/personal-access-tokens/new"
rel="noreferrer"
target="_blank"
className="underline"
onClick={(e) => e.stopPropagation()}
>
create a temporary Access Token
</a>{" "}
to avoid this issue.
{t("connectors.github.token_explained_link2")}
</a>
{t("connectors.github.token_explained_end")}
</p>
</Tooltip>
</>
Expand Down
Loading