Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Commit 792a4fe

Browse files
committed
feat: blinko setting improve
1 parent 0a8ef25 commit 792a4fe

File tree

4 files changed

+87
-13
lines changed

4 files changed

+87
-13
lines changed

electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trackflow",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "TrackFlow Desktop App",
55
"main": "dist/main.js",
66
"repository": {
879 KB
Loading

frontend/src/App.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { WebDAVManager } from './components/WebDAVManager'
2828
import { ShortcutSettings } from './components/ShortcutSettings'
2929
import { Search } from './components/Search'
3030
import { BlinkoConfig } from './components/BlinkoConfig'
31+
import { IntegrationSettings } from './components/IntegrationSettings'
3132

3233
interface Project {
3334
id: string;
@@ -148,7 +149,7 @@ function App() {
148149
domain: '',
149150
token: ''
150151
});
151-
const [isBlinkoConfigOpen, setIsBlinkoConfigOpen] = useState(false);
152+
const [isIntegrationSettingsOpen, setIsIntegrationSettingsOpen] = useState(false);
152153

153154
// 模拟加载效果
154155
useEffect(() => {
@@ -609,10 +610,10 @@ function App() {
609610
快捷键设置
610611
</button>
611612
<button
612-
onClick={() => setIsBlinkoConfigOpen(true)}
613+
onClick={() => setIsIntegrationSettingsOpen(true)}
613614
className="w-full flex items-center justify-center px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-900 bg-gray-50 rounded-md hover:bg-gray-100"
614615
>
615-
Blinko 设置
616+
联动设置
616617
</button>
617618
{currentUser?.role === 'admin' && (
618619
<button
@@ -1174,20 +1175,20 @@ function App() {
11741175
</div>
11751176
)}
11761177

1177-
{/* Blinko 配置弹窗 */}
1178+
{/* 联动设置弹窗 */}
11781179
<Modal
1179-
isOpen={isBlinkoConfigOpen}
1180-
onClose={() => setIsBlinkoConfigOpen(false)}
1181-
title="Blinko 设置"
1180+
isOpen={isIntegrationSettingsOpen}
1181+
onClose={() => setIsIntegrationSettingsOpen(false)}
1182+
title="联动设置"
11821183
>
1183-
<BlinkoConfig
1184-
config={blinkoConfig}
1185-
onSave={(newConfig) => {
1184+
<IntegrationSettings
1185+
blinkoConfig={blinkoConfig}
1186+
onSaveBlinkoConfig={(newConfig) => {
11861187
setBlinkoConfig(newConfig);
1187-
setIsBlinkoConfigOpen(false);
1188+
setIsIntegrationSettingsOpen(false);
11881189
showToast('success', 'Blinko 配置已保存');
11891190
}}
1190-
onClose={() => setIsBlinkoConfigOpen(false)}
1191+
onClose={() => setIsIntegrationSettingsOpen(false)}
11911192
/>
11921193
</Modal>
11931194
</div>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import React, { useState } from 'react';
2+
import { BlinkoConfig } from './BlinkoConfig';
3+
4+
interface IntegrationSettingsProps {
5+
blinkoConfig: {
6+
domain: string;
7+
token: string;
8+
};
9+
onSaveBlinkoConfig: (config: { domain: string; token: string }) => void;
10+
onClose: () => void;
11+
}
12+
13+
export const IntegrationSettings: React.FC<IntegrationSettingsProps> = ({
14+
blinkoConfig,
15+
onSaveBlinkoConfig,
16+
onClose,
17+
}) => {
18+
const [activeTab, setActiveTab] = useState('blinko');
19+
20+
return (
21+
<div className="space-y-4">
22+
{/* 集成列表 */}
23+
<div className="border-b border-gray-200">
24+
<nav className="-mb-px flex space-x-8">
25+
<button
26+
onClick={() => setActiveTab('blinko')}
27+
className={`
28+
whitespace-nowrap pb-4 px-1 border-b-2 font-medium text-sm
29+
${activeTab === 'blinko'
30+
? 'border-blue-500 text-blue-600'
31+
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'}
32+
`}
33+
>
34+
Blinko
35+
</button>
36+
{/* 这里可以添加其他集成的标签 */}
37+
</nav>
38+
</div>
39+
40+
{/* Blinko 设置 */}
41+
{activeTab === 'blinko' && (
42+
<div className="space-y-4">
43+
<div className="flex items-center space-x-4 p-4 bg-gray-50 rounded-lg">
44+
<img src="./project-icons/blinko-logo.png" alt="Blinko Logo" className="w-12 h-12" />
45+
<div>
46+
<h3 className="text-lg font-medium text-gray-900">Blinko</h3>
47+
<p className="text-sm text-gray-500">
48+
开源的个人笔记工具,注重隐私保护
49+
</p>
50+
<a
51+
href="https://github.com/blinko-space/blinko"
52+
target="_blank"
53+
rel="noopener noreferrer"
54+
className="text-sm text-blue-600 hover:text-blue-700 flex items-center mt-1"
55+
>
56+
访问项目主页
57+
<svg className="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
58+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
59+
</svg>
60+
</a>
61+
</div>
62+
</div>
63+
64+
<BlinkoConfig
65+
config={blinkoConfig}
66+
onSave={onSaveBlinkoConfig}
67+
onClose={onClose}
68+
/>
69+
</div>
70+
)}
71+
</div>
72+
);
73+
};

0 commit comments

Comments
 (0)