Skip to content

Commit

Permalink
chore: ci update
Browse files Browse the repository at this point in the history
  • Loading branch information
shuashuai committed Sep 25, 2023
1 parent f68126c commit c16b5f6
Show file tree
Hide file tree
Showing 14 changed files with 2,337 additions and 2,268 deletions.
4,566 changes: 2,315 additions & 2,251 deletions ui/pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ui/src/pages/Search/components/Head/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const Index: FC<Props> = ({ data }) => {
<div className="mb-5">
<div className="mb-3 d-flex align-items-center justify-content-between">
<h3 className="mb-0">{t('title')}</h3>
<PluginRender type="search" slug_name="algolia" />

<PluginRender type="search" slug_name="serarch_info" />
</div>
<p>
<span className="text-secondary me-1">{t('keywords')}</span>
Expand Down
4 changes: 3 additions & 1 deletion ui/src/pages/Users/Personal/components/UserInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ const Index: FC<Props> = ({ data }) => {
className={classnames('d-flex', 'align-items-center', {
'me-3': i < a.length - 1,
})}>
{b.icon ? <SvgIcon base64={b.icon} /> : null}
{b.icon ? (
<SvgIcon base64={b.icon} svgClassName="me-2" />
) : null}
{b.url ? (
<a className="link-secondary" href={b.url}>
{b.label}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/plugins/builtin/HostingConnector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Index: FC<Props> = ({ className }) => {
className={classnames('w-100', className)}
variant="outline-secondary"
href={ucAgent?.agent_info.login_redirect_url}>
<SvgIcon base64={ucAgent?.agent_info.icon} svgClassName="btnSvg" />
<SvgIcon base64={ucAgent?.agent_info.icon} svgClassName="btnSvg me-2" />
<span>
{t('connect', { auth_name: ucAgent?.agent_info.display_name })}
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugin:
algolia:
serarch_info:
ui:
search_by: Search by
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugin:
algolia:
serarch_info:
ui:
search_by: 搜索提供
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getTransNs, getTransKeyPrefix } from '@/utils/pluginKit/utils';
import { SvgIcon } from '@/components';

import info from './info.yaml';
import { useGetAlgoliaInfo } from './services';
import { useGetSearchPLuginInfo } from './services';
import './i18n';

const pluginInfo: PluginInfo = {
Expand All @@ -15,18 +15,19 @@ const pluginInfo: PluginInfo = {
};

const Index: FC = () => {
console.log(111111);
const { t } = useTranslation(getTransNs(), {
keyPrefix: getTransKeyPrefix(pluginInfo),
});

const { data } = useGetAlgoliaInfo();
const { data } = useGetSearchPLuginInfo();
console.log(data);
if (!data?.icon) return null;
// if (!data?.icon) return null;

return (
<a
className="d-flex align-items-center"
href="https://www.algolia.com/"
href={data?.link}
target="_blank"
rel="noopener noreferrer">
<span className="small text-secondary me-2">{t('search_by')}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
slug_name: algolia
slug_name: serarch_info
type: search
version: 0.0.1
author: Answer.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import request from '@/utils/request';
export interface AlgoliaRes {
name: string;
icon: string;
link: string;
}

export const useGetAlgoliaInfo = () => {
export const useGetSearchPLuginInfo = () => {
const { data, error } = useSWR<AlgoliaRes>(
'/answer/api/v1/search/desc',
request.instance.get,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/plugins/builtin/ThirdPartyConnector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Index: FC<Props> = ({ className }) => {
{data?.map((item) => {
return (
<Button variant="outline-secondary" href={item.link} key={item.name}>
<SvgIcon base64={item.icon} svgClassName="btnSvg" />
<SvgIcon base64={item.icon} svgClassName="btnSvg me-2" />
<span>{t('connect', { auth_name: item.name })}</span>
</Button>
);
Expand Down
4 changes: 2 additions & 2 deletions ui/src/plugins/builtin/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ThirdPartyConnector from './ThirdPartyConnector';
import HostingConnector from './HostingConnector';
import Algolia from './Algolia';
import SerarchInfo from './SearchInfo';

export default {
ThirdPartyConnector,
HostingConnector,
Algolia,
SerarchInfo,
};
2 changes: 1 addition & 1 deletion ui/src/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default null;

// export { default as Demo } from './Demo';
// export { default as Demo } from './Demo';
4 changes: 2 additions & 2 deletions ui/src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ function base64ToSvg(base64: string, svgClassName?: string) {
let str = '';
if (svg && !parseError) {
if (svgClassName) {
svg.classList.add(svgClassName);
svg.setAttribute('class', svgClassName);
}
svg.classList.add('me-2');
// svg.classList.add('me-2');

// transform svg to string
const serializer = new XMLSerializer();
Expand Down

0 comments on commit c16b5f6

Please sign in to comment.