mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (plg_backend_psql): caching issue
This commit is contained in:
parent
2da5a67e82
commit
d1b993a028
3 changed files with 19 additions and 5 deletions
|
|
@ -63,12 +63,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.component_formviewer .formbuilder .component_input[disabled],
|
.component_formviewer .formbuilder .component_input[disabled],
|
||||||
|
.component_formviewer .formbuilder .component_input[readonly],
|
||||||
.component_formviewer .formbuilder .component_textarea[disabled],
|
.component_formviewer .formbuilder .component_textarea[disabled],
|
||||||
.component_formviewer .formbuilder .component_select[disabled] {
|
.component_formviewer .formbuilder .component_textarea[readonly],
|
||||||
|
.component_formviewer .formbuilder .component_select[disabled],
|
||||||
|
.component_formviewer .formbuilder .component_select[readonly] {
|
||||||
background: rgba(0, 0, 0, 0.05);
|
background: rgba(0, 0, 0, 0.05);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding-left: 7px;
|
padding-left: 7px;
|
||||||
border-color: rgba(0, 0, 0, 0.02);
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.component_formviewer fieldset {
|
.component_formviewer fieldset {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { animate, slideXIn, opacityOut } from "../../lib/animate.js";
|
||||||
import { qs, qsa, safe } from "../../lib/dom.js";
|
import { qs, qsa, safe } from "../../lib/dom.js";
|
||||||
import { loadCSS } from "../../helpers/loader.js";
|
import { loadCSS } from "../../helpers/loader.js";
|
||||||
import { createForm, mutateForm } from "../../lib/form.js";
|
import { createForm, mutateForm } from "../../lib/form.js";
|
||||||
import { formTmpl } from "../../components/form.js";
|
import { formTmpl, $renderInput } from "../../components/form.js";
|
||||||
import { createLoader } from "../../components/loader.js";
|
import { createLoader } from "../../components/loader.js";
|
||||||
import ctrlError from "../ctrl_error.js";
|
import ctrlError from "../ctrl_error.js";
|
||||||
|
|
||||||
|
|
@ -56,6 +56,14 @@ export default function(render, { acl$, getFilename, getDownloadUrl }) {
|
||||||
return formSpec;
|
return formSpec;
|
||||||
}))),
|
}))),
|
||||||
rxjs.mergeMap((formSpec) => rxjs.from(createForm(formSpec, formTmpl({
|
rxjs.mergeMap((formSpec) => rxjs.from(createForm(formSpec, formTmpl({
|
||||||
|
renderInput: (opts) => {
|
||||||
|
let $el = $renderInput({ autocomplete: true })(opts);
|
||||||
|
if ($el.hasAttribute("disabled")) {
|
||||||
|
$el.removeAttribute("disabled");
|
||||||
|
$el.setAttribute("readonly", "true");
|
||||||
|
}
|
||||||
|
return $el;
|
||||||
|
},
|
||||||
renderLeaf: ({ label, format, description, required }) => createElement(`
|
renderLeaf: ({ label, format, description, required }) => createElement(`
|
||||||
<label class="no-select">
|
<label class="no-select">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,11 @@ func init() {
|
||||||
func (this PSQL) Init(params map[string]string, app *App) (IBackend, error) {
|
func (this PSQL) Init(params map[string]string, app *App) (IBackend, error) {
|
||||||
if d := PGCache.Get(params); d != nil {
|
if d := PGCache.Get(params); d != nil {
|
||||||
backend := d.(*PSQL)
|
backend := d.(*PSQL)
|
||||||
backend.ctx = app.Context
|
if backend.db.Ping() == nil {
|
||||||
return backend, nil
|
backend.ctx = app.Context
|
||||||
|
return backend, nil
|
||||||
|
}
|
||||||
|
PGCache.Del(params)
|
||||||
}
|
}
|
||||||
host := params["host"]
|
host := params["host"]
|
||||||
port := withDefault(params["port"], "5432")
|
port := withDefault(params["port"], "5432")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue