Skip to content

Commit 08812ee

Browse files
committed
feat(frontend): simplify setup to 3 fields + improve loading messages
- Removed DASHSCOPE_API_KEY and SMTP_PASSWORD from setup form and settings page — only STUID, UISPSW, and GitHub PAT are needed. - Granular loading messages: Connecting → Deriving key → Downloading index → Shard i/n — so users know what stage the spinner is at.
1 parent 154f747 commit 08812ee

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

frontend/index.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,6 @@ <h2 class="text-xl font-bold text-gray-800 mb-1">iCourse Subscriber</h2>
221221
<input x-model="setup.uispsw" type="password"
222222
class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-300 focus:outline-none">
223223
</div>
224-
<div>
225-
<label class="block text-xs text-gray-500 mb-1">DASHSCOPE_API_KEY</label>
226-
<input x-model="setup.dashscope" type="password" placeholder="sk-..."
227-
class="w-full border rounded-lg px-3 py-2 text-sm font-mono focus:ring-2 focus:ring-blue-300 focus:outline-none">
228-
</div>
229-
<div>
230-
<label class="block text-xs text-gray-500 mb-1">SMTP_PASSWORD (QQ authorization code)</label>
231-
<input x-model="setup.smtp" type="password"
232-
class="w-full border rounded-lg px-3 py-2 text-sm font-mono focus:ring-2 focus:ring-blue-300 focus:outline-none">
233-
</div>
234224

235225
<!-- Advanced -->
236226
<details class="text-sm">
@@ -533,8 +523,6 @@ <h2 class="text-lg font-bold text-gray-800 mb-4">Credentials</h2>
533523
{key: 'token', label: 'GitHub PAT'},
534524
{key: 'stuid', label: 'STUID'},
535525
{key: 'uispsw', label: 'UISPSW'},
536-
{key: 'dashscope', label: 'DASHSCOPE_API_KEY'},
537-
{key: 'smtp', label: 'SMTP_PASSWORD'}
538526
]" :key="field.key">
539527
<div>
540528
<label class="block text-xs text-gray-500 mb-1" x-text="field.label"></label>

frontend/js/app.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ document.addEventListener("alpine:init", () => {
207207
detailView: "summary",
208208
searchQuery: "", searchResults: [],
209209
commitSha: null,
210-
setup: { token: "", stuid: "", uispsw: "", dashscope: "", smtp: "" },
210+
setup: { token: "", stuid: "", uispsw: "" },
211211
setupError: "", setupTesting: false,
212212
settingsForm: {}, showSecrets: {},
213213
exportDialogOpen: false, exportSelection: {}, exportingPdf: false,
@@ -240,23 +240,27 @@ document.addEventListener("alpine:init", () => {
240240
async _loadDB(creds) {
241241
this.view = "loading"; this.error = null;
242242
try {
243-
this.loadingMsg = "Checking for updates...";
243+
this.loadingMsg = "Connecting to GitHub API...";
244244
var manifest = await ICS.github.fetchShardManifest(
245245
this.repoOwner, this.repoName, this.dataBranch, creds.token,
246246
);
247247
this.commitSha = manifest.commitSha;
248248

249249
if (manifest.format === "sharded") {
250+
this.loadingMsg = "Deriving decryption key...";
250251
var pw = await ICS.crypto.buildPasswordV2(creds);
252+
253+
this.loadingMsg = "Downloading + decrypting shard index...";
251254
var self = this;
252255
await _loadFromShardManifest(
253256
manifest, this.repoOwner, this.repoName, pw, creds.token,
254257
function (i, n, name) {
255-
self.loadingMsg = "Loading shard " + i + "/" + n + " (" + name + ")...";
258+
self.loadingMsg = "Shard " + i + "/" + n
259+
+ " — downloading + decrypting (" + name + ")...";
256260
},
257261
);
258262
} else {
259-
this.loadingMsg = "Loading legacy database...";
263+
this.loadingMsg = "Downloading + decrypting legacy database...";
260264
await _loadFromLegacyBlob(
261265
manifest, this.repoOwner, this.repoName, creds, creds.token,
262266
);
@@ -507,7 +511,7 @@ document.addEventListener("alpine:init", () => {
507511
localStorage.removeItem(_LS + "settings");
508512
indexedDB.deleteDatabase(_idbName);
509513
this.view = "setup";
510-
this.setup = { token: "", stuid: "", uispsw: "", dashscope: "", smtp: "" };
514+
this.setup = { token: "", stuid: "", uispsw: "" };
511515
},
512516

513517
// ── Subscriptions editor ────────────────────────────────────────

0 commit comments

Comments
 (0)