-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.html
More file actions
104 lines (99 loc) · 4.06 KB
/
Copy pathoptions.html
File metadata and controls
104 lines (99 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>PR-Pilot Options</title>
<link rel="stylesheet" href="options.css" />
</head>
<body>
<main class="prp-options">
<header>
<h1>PR-Pilot Settings</h1>
<p class="subtitle">Configure hybrid fallbacks, language defaults, and tone presets.</p>
</header>
<section class="card">
<h2>General</h2>
<label class="toggle">
<input type="checkbox" id="hybrid-enabled" />
<span>Hybrid mode (fallback to cloud when on-device AI is unavailable)</span>
</label>
<label>
Default target language for translation
<select id="default-target-language">
<option value="">Browser locale</option>
<option value="en">English (en)</option>
<option value="es">Spanish (es)</option>
<option value="fr">French (fr)</option>
<option value="de">German (de)</option>
<option value="it">Italian (it)</option>
<option value="pt">Portuguese (pt)</option>
<option value="ru">Russian (ru)</option>
<option value="zh">Chinese (zh)</option>
<option value="ja">Japanese (ja)</option>
<option value="ko">Korean (ko)</option>
<option value="ar">Arabic (ar)</option>
<option value="hi">Hindi (hi)</option>
<option value="custom">Custom code...</option>
</select>
</label>
<label id="default-target-language-custom" class="custom-lang" hidden>
Custom language code
<input type="text" id="default-target-language-input" placeholder="e.g. sv" maxlength="8" />
</label>
<label>
Default rewrite tone
<select id="default-tone">
<option value="concise">Concise</option>
<option value="friendly">Friendly</option>
<option value="direct">Direct</option>
<option value="non-native">Non-native-friendly</option>
</select>
</label>
<fieldset>
<legend>Tone presets enabled</legend>
<div class="tone-grid">
<label><input type="checkbox" value="concise" name="tone-preset" />Concise</label>
<label><input type="checkbox" value="friendly" name="tone-preset" />Friendly</label>
<label><input type="checkbox" value="direct" name="tone-preset" />Direct</label>
<label><input type="checkbox" value="non-native" name="tone-preset" />Non-native-friendly</label>
</div>
</fieldset>
<a class="inline-link" href="https://developer.chrome.com/docs/chrome-ai/rewriter" target="_blank" rel="noreferrer">
About Rewriter API (Origin Trial needed)
</a>
</section>
<section class="card">
<h2>Hybrid endpoints</h2>
<p class="hint">
Provide Firebase AI Logic endpoints for fallback mode. Leave blank to keep everything on-device.
</p>
<label>
Summarize endpoint
<input type="url" id="summarize-endpoint" placeholder="https://.../summarizePrPilot" />
</label>
<label>
Prompt endpoint
<input type="url" id="prompt-endpoint" placeholder="https://.../reviewPrPilot" />
</label>
<label>
Translator endpoint (optional)
<input type="url" id="translate-endpoint" placeholder="https://.../translatePrPilot" />
</label>
<label>
Auth token (optional)
<input type="text" id="hybrid-auth-token" placeholder="Bearer xxx or API key" />
</label>
</section>
<section class="card">
<h2>Diagnostics</h2>
<button id="ping-hybrid" type="button">Ping hybrid endpoints</button>
<pre id="ping-result" aria-live="polite"></pre>
</section>
<footer>
<button id="save" type="button" class="primary">Save</button>
<span id="status" role="status" aria-live="polite"></span>
</footer>
</main>
<script type="module" src="options.js"></script>
</body>
</html>