chore: ci update

This commit is contained in:
shuai 2023-09-25 10:04:02 +08:00
parent f68126c2db
commit c16b5f6809
14 changed files with 2340 additions and 2271 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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>

View File

@ -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}

View File

@ -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>

View File

@ -1,4 +1,4 @@
plugin:
algolia:
serarch_info:
ui:
search_by: Search by

View File

@ -1,4 +1,4 @@
plugin:
algolia:
serarch_info:
ui:
search_by: 搜索提供

View File

@ -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 = {
@ -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>

View File

@ -1,4 +1,4 @@
slug_name: algolia
slug_name: serarch_info
type: search
version: 0.0.1
author: Answer.dev

View File

@ -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,

View File

@ -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>
);

View File

@ -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,
};

View File

@ -1,3 +1,3 @@
export default null;
// export { default as Demo } from './Demo';
// export { default as Demo } from './Demo';

View File

@ -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();