-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
195 lines (169 loc) · 4.26 KB
/
popup.html
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html>
<head>
<title>Magnet Link Manager</title>
<style>
body {
width: 400px;
padding: 16px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
.container {
display: flex;
flex-direction: column;
gap: 16px;
}
.settings-panel, .links-panel {
background: #f5f5f5;
padding: 16px;
border-radius: 8px;
}
.form-group {
margin-bottom: 12px;
}
label {
display: block;
margin-bottom: 4px;
font-weight: 500;
color: #333;
}
input[type="text"],
input[type="password"],
input[type="url"] {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
button {
background-color: #2196F3;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-weight: 500;
transition: background-color 0.2s;
}
button:hover {
background-color: #1976D2;
}
button.secondary {
background-color: #757575;
}
button.secondary:hover {
background-color: #616161;
}
.magnet-list {
max-height: 300px;
overflow-y: auto;
}
.magnet-item {
display: flex;
align-items: center;
padding: 8px;
border-bottom: 1px solid #ddd;
}
.magnet-item:last-child {
border-bottom: none;
}
.magnet-item input[type="checkbox"] {
margin-right: 8px;
}
.magnet-name {
flex-grow: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tab-container {
margin-bottom: 16px;
}
.tab-buttons {
display: flex;
gap: 8px;
margin-bottom: 16px;
}
.tab-button {
background: none;
border: none;
padding: 8px 16px;
cursor: pointer;
border-bottom: 2px solid transparent;
color: #666;
}
.tab-button.active {
border-bottom-color: #2196F3;
color: #2196F3;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
.status-message {
padding: 8px;
margin-top: 8px;
border-radius: 4px;
display: none;
}
.status-message.success {
background-color: #C8E6C9;
color: #2E7D32;
display: block;
}
.status-message.error {
background-color: #FFCDD2;
color: #C62828;
display: block;
}
</style>
</head>
<body>
<div class="container">
<div class="tab-container">
<div class="tab-buttons">
<button class="tab-button active" data-tab="links">Magnet Links</button>
<button class="tab-button" data-tab="settings">Settings</button>
</div>
<div class="tab-content active" id="links-tab">
<div class="links-panel">
<h3>Available Magnet Links</h3>
<div id="magnet-list" class="magnet-list">
<div class="magnet-item">
<p>No magnet links found on this page.</p>
</div>
</div>
<div style="margin-top: 16px; display: flex; gap: 8px;">
<button id="refresh-links">Refresh Links</button>
<button id="download-selected">Download Selected</button>
</div>
</div>
</div>
<div class="tab-content" id="settings-tab">
<div class="settings-panel">
<h3>qBittorrent Settings</h3>
<div class="form-group">
<label for="webui-url">WebUI URL:</label>
<input type="url" id="webui-url" placeholder="http://localhost:8080">
</div>
<div class="form-group">
<label for="username">Username:</label>
<input type="text" id="username">
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" id="password">
</div>
<button id="save-settings">Save Settings</button>
<button id="test-connection" class="secondary" style="margin-left: 8px;">Test Connection</button>
</div>
</div>
</div>
<div id="status-message" class="status-message"></div>
</div>
<script src="popup.js"></script>
</body>
</html>