reload trusted proxy info UI after settings save
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
- Added the local time zone name next to the `date` field label.
|
- Added the local time zone name next to the `date` field label.
|
||||||
|
|
||||||
|
- Reload trusted proxy info UI after settings save.
|
||||||
|
|
||||||
|
|
||||||
## v0.37.4
|
## v0.37.4
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
ui/dist/index.html
vendored
2
ui/dist/index.html
vendored
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<!-- prism -->
|
<!-- prism -->
|
||||||
<script src="./libs/prism/prism.js" data-manual></script>
|
<script src="./libs/prism/prism.js" data-manual></script>
|
||||||
<script type="module" crossorigin src="./assets/index-CDUQtXaP.js"></script>
|
<script type="module" crossorigin src="./assets/index-lWorQJPS.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-ouas71Vg.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-ouas71Vg.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ export function trustedProxyAccordion(pageData) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
loadProxyInfo();
|
|
||||||
|
|
||||||
async function loadProxyInfo() {
|
async function loadProxyInfo() {
|
||||||
proxyInfo.isLoading = true;
|
proxyInfo.isLoading = true;
|
||||||
|
|
||||||
@@ -48,7 +46,17 @@ export function trustedProxyAccordion(pageData) {
|
|||||||
pbEvent: "trustedProxyAccordion",
|
pbEvent: "trustedProxyAccordion",
|
||||||
className: "accordion trusted-proxy-accordion",
|
className: "accordion trusted-proxy-accordion",
|
||||||
name: "settingsAccordion",
|
name: "settingsAccordion",
|
||||||
open: () => (proxyInfo.isLoading ? false : null),
|
onmount: (el) => {
|
||||||
|
el._infoWatcher?.unwatch();
|
||||||
|
el._infoWatcher = watch(() => JSON.stringify(app.store.settings?.trustedProxy), (newHash, oldHash) => {
|
||||||
|
if (newHash != oldHash) {
|
||||||
|
loadProxyInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onunmount: (el) => {
|
||||||
|
el._infoWatcher?.unwatch();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
t.summary(
|
t.summary(
|
||||||
null,
|
null,
|
||||||
@@ -104,19 +112,16 @@ export function trustedProxyAccordion(pageData) {
|
|||||||
"Below you should see your real IP. If not - configure the correct proxy header for your environment.",
|
"Below you should see your real IP. If not - configure the correct proxy header for your environment.",
|
||||||
),
|
),
|
||||||
t.div(
|
t.div(
|
||||||
{
|
{ className: "alert info m-b-sm" },
|
||||||
hidden: () => proxyInfo.isLoading,
|
|
||||||
className: "alert info m-b-sm",
|
|
||||||
},
|
|
||||||
t.div(
|
t.div(
|
||||||
{ className: "flex gap-5" },
|
{ className: "flex gap-5" },
|
||||||
t.span(null, "Resolved user IP:"),
|
t.span(null, "Resolved user IP:"),
|
||||||
t.strong(null, () => proxyInfo.realIP || "N/A"),
|
t.strong(null, () => proxyInfo.isLoading ? "..." : (proxyInfo.realIP || "N/A")),
|
||||||
),
|
),
|
||||||
t.div(
|
t.div(
|
||||||
{ className: "flex gap-5" },
|
{ className: "flex gap-5" },
|
||||||
t.span(null, "Detected proxy header:"),
|
t.span(null, "Detected proxy header:"),
|
||||||
t.strong(null, () => proxyInfo.possibleProxyHeader || "N/A"),
|
t.strong(null, () => proxyInfo.isLoading ? "..." : (proxyInfo.possibleProxyHeader || "N/A")),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
t.div(
|
t.div(
|
||||||
@@ -198,8 +203,8 @@ export function trustedProxyAccordion(pageData) {
|
|||||||
t.div({ className: "inline-flex gap-5" }, () => {
|
t.div({ className: "inline-flex gap-5" }, () => {
|
||||||
return proxyInfo.suggestedProxyHeaders.map((header) => {
|
return proxyInfo.suggestedProxyHeaders.map((header) => {
|
||||||
return t.div({
|
return t.div({
|
||||||
type: "button",
|
role: "button",
|
||||||
className: "label sm link-hint",
|
className: "label sm link-primary",
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
pageData.formSettings.trustedProxy.headers = [header];
|
pageData.formSettings.trustedProxy.headers = [header];
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user