mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
Key-value table on Settings page
This commit is contained in:
+170
-172
@@ -1,13 +1,13 @@
|
||||
{{- extends "layout/default" }}
|
||||
{{- block body() }}
|
||||
<div class="container-fluid" data-hx-boost="false">
|
||||
<h1 class="display-4 mb-4">Settings</h1>
|
||||
<p class="lead">
|
||||
<div class="container" data-hx-boost="false">
|
||||
<h1>Settings</h1>
|
||||
<p class="mt-4">
|
||||
PixivFE uses <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies">cookies</a> to store your
|
||||
preferences, which you can change on this page to customize your experience on this instance.
|
||||
</p>
|
||||
|
||||
<ul class="nav nav-tabs" id="settingsTabs" role="tablist">
|
||||
<ul class="nav nav-tabs mt-4" id="settingsTabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="account-tab" data-bs-toggle="tab" data-bs-target="#account" type="button" role="tab" aria-controls="account" aria-selected="true">Account</button>
|
||||
</li>
|
||||
@@ -19,42 +19,41 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3" id="settingsTabsContent">
|
||||
<div class="tab-content mt-4" id="settingsTabsContent">
|
||||
<div class="tab-pane fade show active" id="account" role="tabpanel" aria-labelledby="account-tab">
|
||||
<div class="card mb-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Login</h2>
|
||||
<p>Supported features (for now):</p>
|
||||
<ul class="list-group list-group-flush mb-3">
|
||||
<li class="list-group-item">Discovery page</li>
|
||||
<li class="list-group-item">Landing page</li>
|
||||
<li class="list-group-item">Like/Bookmark</li>
|
||||
<p class="mt-3">Supported features (for now):</p>
|
||||
<ul class="mt-2">
|
||||
<li>Discovery page</li>
|
||||
<li>Landing page</li>
|
||||
<li>Like/Bookmark</li>
|
||||
</ul>
|
||||
<p>
|
||||
<p class="mt-3">
|
||||
Log in with your Pixiv account's cookie to access features above.
|
||||
To learn how to obtain your cookie, please see
|
||||
<a href="https://pixivfe-docs.pages.dev/obtaining-pixivfe-token/">the guide on obtaining your PixivFE token</a>.
|
||||
</p>
|
||||
<p>
|
||||
<p class="mt-3">
|
||||
Cookies will be saved on your browser, and will expire after a fixed period of time.
|
||||
</p>
|
||||
<form action="/settings/token" method="post">
|
||||
<div class="mb-3">
|
||||
<form action="/settings/token" method="post" class="mt-3">
|
||||
<div>
|
||||
<input type="text" class="form-control" name="token" autocomplete="off" />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
<button type="submit" class="btn btn-primary mt-3">Log in</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card mt-4">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Logout</h2>
|
||||
<p>
|
||||
<p class="mt-3">
|
||||
To securely end your session, click the 'Logout!' button. This will
|
||||
immediately remove your session token.
|
||||
</p>
|
||||
<form action="/settings/logout" method="post">
|
||||
<form action="/settings/logout" method="post" class="mt-3">
|
||||
<button type="submit" class="btn btn-danger">Logout!</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -62,130 +61,128 @@
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="site" role="tabpanel" aria-labelledby="site-tab">
|
||||
<div class="card mb-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Image proxy server</h2>
|
||||
<p>
|
||||
<p class="mt-3">
|
||||
Choose how images are loaded in PixivFE by selecting either the built-in
|
||||
proxy or one of the provided external proxy servers. If you prefer, you can
|
||||
also specify a custom proxy server by entering its URL and clicking 'Use
|
||||
Custom Proxy'.
|
||||
</p>
|
||||
<form action="/settings/imageServer" method="post" class="mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="image-proxy" id="no-proxy" value="" required>
|
||||
<label class="form-check-label" for="no-proxy">
|
||||
No (use built-in proxy)
|
||||
</label>
|
||||
</div>
|
||||
{{- range .WorkingProxyList }}
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="image-proxy" id="proxy-{{.}}" value="{{.}}" required>
|
||||
<label class="form-check-label" for="proxy-{{.}}">
|
||||
{{.}}
|
||||
</label>
|
||||
</div>
|
||||
{{- end }}
|
||||
<div class="accordion mb-3" id="proxyAccordion">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingAllProxies">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAllProxies" aria-expanded="false" aria-controls="collapseAllProxies">
|
||||
See all built-in proxies
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseAllProxies" class="accordion-collapse collapse" aria-labelledby="headingAllProxies" data-bs-parent="#proxyAccordion">
|
||||
<div class="accordion-body">
|
||||
{{- range .ProxyList }}
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="image-proxy" id="proxy-all-{{.}}" value="{{.}}" required>
|
||||
<label class="form-check-label" for="proxy-all-{{.}}">
|
||||
{{.}}
|
||||
</label>
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
<form action="/settings/imageServer" method="post" class="mt-3">
|
||||
<div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="image-proxy" id="no-proxy" value="" required>
|
||||
<label class="form-check-label" for="no-proxy">
|
||||
No (use built-in proxy)
|
||||
</label>
|
||||
</div>
|
||||
{{- range .WorkingProxyList }}
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="image-proxy" id="proxy-{{.}}" value="{{.}}" required>
|
||||
<label class="form-check-label" for="proxy-{{.}}">
|
||||
{{.}}
|
||||
</label>
|
||||
</div>
|
||||
{{- end }}
|
||||
<details class="mt-2">
|
||||
<summary>See all built-in proxies</summary>
|
||||
{{- range .ProxyList }}
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="image-proxy" id="proxy-all-{{.}}" value="{{.}}" required>
|
||||
<label class="form-check-label" for="proxy-all-{{.}}">
|
||||
{{.}}
|
||||
</label>
|
||||
</div>
|
||||
{{- end }}
|
||||
</details>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Use selected proxy</button>
|
||||
<button type="submit" class="btn btn-primary mt-3">Use selected proxy</button>
|
||||
</form>
|
||||
<form action="/settings/imageServer" method="post">
|
||||
<div class="mb-3">
|
||||
<form action="/settings/imageServer" method="post" class="mt-4">
|
||||
<div>
|
||||
<label for="custom-image-proxy" class="form-label">Custom image proxy server</label>
|
||||
<input type="text" class="form-control" id="custom-image-proxy" name="image-proxy" required placeholder="https://example.com" autocomplete="off">
|
||||
<input type="text" class="form-control mt-2" id="custom-image-proxy" name="image-proxy" required placeholder="https://example.com" autocomplete="off">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Use custom proxy</button>
|
||||
<button type="submit" class="btn btn-primary mt-3">Use custom proxy</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card mt-4">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Open artworks in new tab</h2>
|
||||
<form action="/settings/thumbnailToNewTab" method="post">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="ttnt" id="ttnt-y" value="_blank">
|
||||
<label class="form-check-label" for="ttnt-y">Yes</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="ttnt" id="ttnt-n" value="_self">
|
||||
<label class="form-check-label" for="ttnt-n">No</label>
|
||||
<form action="/settings/thumbnailToNewTab" method="post" class="mt-3">
|
||||
<div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="ttnt" id="ttnt-y" value="_blank">
|
||||
<label class="form-check-label" for="ttnt-y">Yes</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="ttnt" id="ttnt-n" value="_self">
|
||||
<label class="form-check-label" for="ttnt-n">No</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-3">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card mt-4">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Artwork preview pop-ups</h2>
|
||||
<p><b>Require Javascript.</b></p>
|
||||
<form action="/settings/artworkPreview" method="post">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="app" id="app-c" value="cover">
|
||||
<label class="form-check-label" for="app-c">
|
||||
Cover
|
||||
<small class="text-muted d-block">Open the previewer when you click into the thumbnails</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="app" id="app-b" value="button">
|
||||
<label class="form-check-label" for="app-b">
|
||||
Button
|
||||
<small class="text-muted d-block">Add a button at the bottom-right of the thumbnails and open the previewer when you click into it</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="app" id="app-d" value="disable">
|
||||
<label class="form-check-label" for="app-d">
|
||||
Disable
|
||||
<small class="text-muted d-block">No previewing</small>
|
||||
</label>
|
||||
<p class="mt-3"><strong>Require Javascript.</strong></p>
|
||||
<form action="/settings/artworkPreview" method="post" class="mt-3">
|
||||
<div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="app" id="app-c" value="cover">
|
||||
<label class="form-check-label" for="app-c">
|
||||
Cover
|
||||
<small class="text-muted">Open the previewer when you click into the thumbnails</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="app" id="app-b" value="button">
|
||||
<label class="form-check-label" for="app-b">
|
||||
Button
|
||||
<small class="text-muted">Add a button at the bottom-right of the thumbnails and open the previewer when you click into it</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="app" id="app-d" value="disable">
|
||||
<label class="form-check-label" for="app-d">
|
||||
Disable
|
||||
<small class="text-muted">No previewing</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-3">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card mt-4">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Filter artworks</h2>
|
||||
<p>When submitted, unchecked options will be disabled and vice-versa.</p>
|
||||
<form action="/settings/filter" method="post">
|
||||
{{- hideR18 := CookieList["pixivfe-HideArtR18"] }}
|
||||
{{- hideR18G := CookieList["pixivfe-HideArtR18G"] }}
|
||||
{{- hideAI := CookieList["pixivfe-HideArtAI"] }}
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="filter-r18" name="filter-r18" value="1" {{- if hideR18 != "" }}checked{{- end }}>
|
||||
<label class="form-check-label" for="filter-r18">Hide R18</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="filter-r18g" name="filter-r18g" value="1" {{- if hideR18G != "" }}checked{{- end }}>
|
||||
<label class="form-check-label" for="filter-r18g">Hide R18G</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="filter-ai" name="filter-ai" value="1" {{- if hideAI != "" }}checked{{- end }}>
|
||||
<label class="form-check-label" for="filter-ai">Hide AI-generated artworks</label>
|
||||
<p class="mt-3">When submitted, unchecked options will be disabled and vice-versa.</p>
|
||||
<form action="/settings/filter" method="post" class="mt-3">
|
||||
<div>
|
||||
{{- hideR18 := CookieList["pixivfe-HideArtR18"] }}
|
||||
{{- hideR18G := CookieList["pixivfe-HideArtR18G"] }}
|
||||
{{- hideAI := CookieList["pixivfe-HideArtAI"] }}
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="filter-r18" name="filter-r18" value="1" {{- if hideR18 != "" }}checked{{- end }}>
|
||||
<label class="form-check-label" for="filter-r18">Hide R18</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="checkbox" id="filter-r18g" name="filter-r18g" value="1" {{- if hideR18G != "" }}checked{{- end }}>
|
||||
<label class="form-check-label" for="filter-r18g">Hide R18G</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="checkbox" id="filter-ai" name="filter-ai" value="1" {{- if hideAI != "" }}checked{{- end }}>
|
||||
<label class="form-check-label" for="filter-ai">Hide AI-generated artworks</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-3">Submit</button>
|
||||
</form>
|
||||
@@ -194,38 +191,42 @@
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="novels" role="tabpanel" aria-labelledby="novels-tab">
|
||||
<div class="card mb-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Font family</h2>
|
||||
<form action="/settings/novelFontType" method="post">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="font-type" id="font-type-mincho" value="mincho">
|
||||
<label class="form-check-label" for="font-type-mincho">Mincho</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="font-type" id="font-type-gothic" value="gothic">
|
||||
<label class="form-check-label" for="font-type-gothic">Gothic</label>
|
||||
<form action="/settings/novelFontType" method="post" class="mt-3">
|
||||
<div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="font-type" id="font-type-mincho" value="mincho">
|
||||
<label class="form-check-label" for="font-type-mincho">Mincho</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="font-type" id="font-type-gothic" value="gothic">
|
||||
<label class="form-check-label" for="font-type-gothic">Gothic</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-3">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card mt-4">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Force text orientation</h2>
|
||||
<form action="/settings/novelViewMode" method="post">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="view-mode" id="tx-ori-h" value="1">
|
||||
<label class="form-check-label" for="tx-ori-h">Horizontal</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="view-mode" id="tx-ori-v" value="2">
|
||||
<label class="form-check-label" for="tx-ori-v">Vertical</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="view-mode" id="tx-ori-n" value="">
|
||||
<label class="form-check-label" for="tx-ori-n">Don't force (default from Pixiv)</label>
|
||||
<form action="/settings/novelViewMode" method="post" class="mt-3">
|
||||
<div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="view-mode" id="tx-ori-h" value="1">
|
||||
<label class="form-check-label" for="tx-ori-h">Horizontal</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="view-mode" id="tx-ori-v" value="2">
|
||||
<label class="form-check-label" for="tx-ori-v">Vertical</label>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="view-mode" id="tx-ori-n" value="">
|
||||
<label class="form-check-label" for="tx-ori-n">Don't force (default from Pixiv)</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-3">Submit</button>
|
||||
</form>
|
||||
@@ -234,63 +235,60 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="mt-5 mb-4">Current cookie values</h2>
|
||||
<div class="card mb-4">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Cookie list</h3>
|
||||
<p class="card-text">
|
||||
Please note that some cookies here such as ShowArtR18,
|
||||
ShowArtR18G, and ShowArtAI are for features still under development.
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Cookie Name</th>
|
||||
<th>Value</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{- range k, v := CookieList }}
|
||||
<tr>
|
||||
<td>{{k}}</td>
|
||||
<td>
|
||||
<form action="/settings/set-cookie" method="post" class="row g-3">
|
||||
<div class="col-auto">
|
||||
<h2 class="card-title">Cookie list</h2>
|
||||
<p class="card-text mt-3">Please note that some cookies here such as ShowArtR18, ShowArtR18G, and ShowArtAI are for features still under development.</p>
|
||||
<div class="table-responsive mt-3">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Cookie Name</th>
|
||||
<th>Current Value</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{- range k, v := CookieList }}
|
||||
<tr>
|
||||
<td>{{k}}</td>
|
||||
<td>
|
||||
<form action="/settings/set-cookie" method="post" class="d-flex">
|
||||
<input type="hidden" name="key" value="{{k}}" />
|
||||
<input type="text" class="form-control" name="value" value="{{v}}" />
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary">Set</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{- end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-primary mt-2">Set</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{- end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card mt-4">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Raw settings</h3>
|
||||
<p>
|
||||
<p class="mt-3">
|
||||
You can save your current cookie values to quickly set your settings on other compatible instances,
|
||||
or if the current instance's cookies went expired.
|
||||
</p>
|
||||
<p>Invalid values will be ignored.</p>
|
||||
<form action="/settings/raw" method="post">
|
||||
<div class="mb-3">
|
||||
<textarea class="form-control" name="raw" rows="10">{{range k, v := CookieList}} {{k}}={{v}}{{end}}
|
||||
<p class="mt-3">Invalid values will be ignored.</p>
|
||||
<form action="/settings/raw" method="post" class="mt-3">
|
||||
<div>
|
||||
<textarea class="form-control" name="raw" rows="10">{{range k, v := CookieList}}
|
||||
{{k}}={{v}}{{end}}
|
||||
</textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Set raw settings</button>
|
||||
<button type="submit" class="btn btn-primary mt-3">Set raw settings</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="/settings/reset-all" method="post" class="mb-5">
|
||||
<form action="/settings/reset-all" method="post" class="mt-4">
|
||||
<button type="submit" class="btn btn-danger">Reset all cookies/preferences</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user