Skip to content

Commit

Permalink
feat: Add HomePage for Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Sep 4, 2023
1 parent 49fa7cc commit 6ed7e33
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/i18n/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"add_service": "Add Service",
"test_failed": "Test Failed",
"install_plugin": "Install Plugin",
"uninstall_success": "Plugin Uninstall Successfully"
"uninstall_success": "Plugin Uninstall Successfully",
"homepage": "Homepage"
},
"history": {
"label": "History",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"add_service": "添加服务",
"test_failed": "测试失败",
"install_plugin": "安装外部插件",
"uninstall_success": "插件卸载成功"
"uninstall_success": "插件卸载成功",
"homepage": "插件主页"
},
"history": {
"label": "历史记录",
Expand Down
12 changes: 11 additions & 1 deletion src/window/Config/pages/Service/PluginConfig/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useTranslation } from 'react-i18next';
import { Button, Input } from '@nextui-org/react';
import toast, { Toaster } from 'react-hot-toast';
import { open } from '@tauri-apps/api/shell';
import React, { useState } from 'react';
import { useAtomValue } from 'jotai';

import { useConfig, useToastStyle } from '../../../../../hooks';
import { invoke } from '@tauri-apps/api';
Expand All @@ -19,6 +19,16 @@ export function PluginConfig(props) {
return (
<>
<Toaster />
<div className={'config-item'}>
<h3 className='my-auto'>{t('config.service.homepage')}</h3>
<Button
onPress={() => {
open(pluginList[name].homepage);
}}
>
{t('config.service.homepage')}
</Button>
</div>
{pluginList[name].needs.length === 0 ? (
<div>{t('services.no_need')}</div>
) : (
Expand Down

0 comments on commit 6ed7e33

Please sign in to comment.