Skip to content

Commit 4490b74

Browse files
committed
add github module
1 parent 67ce15e commit 4490b74

File tree

11 files changed

+251
-257
lines changed

11 files changed

+251
-257
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ build
1919
/electron/dist/*.dmg
2020
/electron/dist/*.exe
2121
/electron/dist/*.AppleImage
22-
/electron/dist/*.blockmap
22+
/electron/dist/*.blockmap
23+
/electron/dist/builder-debug.yml

electron/dist/builder-debug.yml

Lines changed: 0 additions & 243 deletions
This file was deleted.

electron/icons.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ <h1 class="splash-title">LoFS</h1>
194194
<button id="database-btn">
195195
<div id="database-icon"></div>
196196
</button>
197+
<button id="github-btn">
198+
<div id="github-icon"></div>
199+
</button>
197200
</div>
198201
</div>
199202

@@ -566,6 +569,14 @@ <h2>API-Key</h2>
566569
</section>
567570
</section>
568571
</div>
572+
<!-- Github 页面 -->
573+
<div id="github-page" style="display: none;">
574+
<div class="github-section">
575+
<div class="github-content">
576+
<webview id="github-webview" src="https://github.com/Oli51467/local_fs" style="width:100%; height:100%; border:0;"></webview>
577+
</div>
578+
</div>
579+
</div>
569580
<!-- 数据库页面 -->
570581
<div id="database-page">
571582
<div class="database-section">
@@ -631,12 +642,15 @@ <h3>图片文件</h3>
631642
</div>
632643
</div>
633644
</div>
645+
646+
634647
<!-- 模块化样式文件 -->
635648
<link rel="stylesheet" href="./src/styles/splash.css">
636649
<link rel="stylesheet" href="./src/styles/settings.css">
637650
<link rel="stylesheet" href="./src/styles/explorer.css">
638651
<link rel="stylesheet" href="./src/styles/chat.css">
639652
<link rel="stylesheet" href="./src/styles/database.css">
653+
<link rel="stylesheet" href="./src/styles/github.css">
640654
<link rel="stylesheet" href="./src/styles/model.css">
641655
<link rel="stylesheet" href="./src/styles/codeViewer.css">
642656

electron/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ function createWindow() {
108108
preload: path.join(__dirname, 'preload.js'),
109109
contextIsolation: true,
110110
nodeIntegration: false,
111+
webviewTag: true,
111112
webSecurity: false,
112113
allowRunningInsecureContent: true,
113114
experimentalFeatures: false,

electron/renderer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ function renderIcons() {
125125
{ id: 'chat-icon', icon: icons.chat },
126126
{ id: 'model-icon', icon: icons.model },
127127
{ id: 'settings-icon', icon: icons.settings },
128-
{ id: 'database-icon', icon: icons.database }
128+
{ id: 'database-icon', icon: icons.database },
129+
{ id: 'github-icon', icon: icons.github }
129130
];
130131

131132
elements.forEach(({ id, icon }) => {
@@ -173,11 +174,14 @@ configureViewStateModule({
173174
getResourceTitleEl: () => document.getElementById('resource-title'),
174175
getDatabasePageEl: () => document.getElementById('database-page'),
175176
getModelPageEl: () => document.getElementById('model-page'),
177+
getGithubPageEl: () => document.getElementById('github-page'),
178+
getGithubWebview: () => document.getElementById('github-webview'),
176179
getHeaderButtons: () => document.querySelectorAll('#file-tree-header > div > button'),
177180
getSearchButton: () => document.getElementById('search-btn'),
178181
getSearchInput: () => document.getElementById('search-input'),
179182
getDatabaseButton: () => document.getElementById('database-btn'),
180183
getModelButton: () => document.getElementById('model-btn'),
184+
getGithubButton: () => document.getElementById('github-btn'),
181185
getToggleTreeButton: () => document.getElementById('toggle-tree'),
182186
getChatButton: () => document.getElementById('chat-btn'),
183187
getChatHistoryContainer: () => document.getElementById('chat-history-container'),

0 commit comments

Comments
 (0)