UI controller fixes

This commit is contained in:
ycc
2024-01-04 15:14:59 +01:00
parent b3d6e85ec5
commit 6df0a3871b
25 changed files with 483 additions and 206 deletions

View File

@ -9,6 +9,7 @@ CREATE SEQUENCE sq_dbuserrole;
CREATE SEQUENCE sq_dbentity;
CREATE SEQUENCE sq_dbform;
CREATE SEQUENCE sq_dbformfields;
CREATE SEQUENCE sq_dbtableview;
CREATE TABLE IF NOT EXISTS public.dbrole
(
@ -60,6 +61,7 @@ CREATE TABLE IF NOT EXISTS public.dbform
(
id integer NOT NULL DEFAULT nextval('sq_dbform'),
tablename character varying(255),
formtype character varying(255),
formname character varying(255),
title character varying(255),
header character varying(2000),
@ -76,12 +78,31 @@ CREATE TABLE IF NOT EXISTS public.dbformfields
label character varying(255),
placeholder character varying(255),
defaultvalue character varying(255),
linkcolumns character varying(255),
linkcolumns character varying(1000),
linkrestriction character varying(255),
linkorder character varying(255),
required bool,
description text,
readonly bool,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.dbtableview
(
id integer NOT NULL DEFAULT nextval('sq_dbtableview'),
form_id integer,
tablename character varying(255),
tableviewtype character varying(255),
title character varying(255),
header character varying(2000),
tablecolumns character varying(2000),
tablerestriction character varying(255),
tableorder character varying(255),
tableorderdir character varying(255),
required bool,
description text,
PRIMARY KEY (id)
);
END;

View File

@ -2,7 +2,6 @@
-- Please log an issue at https://redmine.postgresql.org/projects/pgadmin4/issues/new if you find any bugs, including reproduction steps.
BEGIN;
CREATE TABLE IF NOT EXISTS public.axis
(
id SERIAL,
@ -11,7 +10,6 @@ CREATE TABLE IF NOT EXISTS public.axis
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.employee
(
id SERIAL,
@ -52,20 +50,64 @@ CREATE TABLE IF NOT EXISTS public.project
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.metric
(
id SERIAL,
name character varying(255),
entity_id integer,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.metricvalue
(
id SERIAL,
measuredate date,
intvalue integer,
floatvalue float,
metric_id integer,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.position
(
id SERIAL,
reference character varying(255),
label character varying(255),
latitude float,
longitude float,
metric_id integer,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.action
(
id SERIAL,
status character varying(255),
position_id integer,
machine_id integer,
description character varying(255),
priority integer,
driver_dbuser_id integer,
actor_dbuser_id integer,
creationdate date,
planneddate date,
closingdate date,
comment character varying(1000),
verified boolean,
PRIMARY KEY (id)
);
ALTER TABLE public.axis
ADD FOREIGN KEY (entity_id)
REFERENCES public.entity (id)
NOT VALID;
ALTER TABLE public.employee
ADD FOREIGN KEY (dbuser_id)
REFERENCES public.dbuser (id)
NOT VALID;
ALTER TABLE public.project
ADD FOREIGN KEY (entity_id)
REFERENCES public.entity (id)

View File

@ -7,6 +7,7 @@ services:
restart: always
volumes:
- ./autoload:/docker-entrypoint-initdb.d
- /opt/data/containers/sqldb/pgdata:/var/lib/postgresql/data
environment:
POSTGRES_DB: test
POSTGRES_USER: test
@ -18,4 +19,17 @@ services:
image: adminer
restart: always
ports:
- 8888:8080
- 8888:8080
grafana:
image: grafana/grafana:9.5.12
restart: always
environment:
GF_SMTP_ENABLED: "true"
GF_SMTP_HOST: "smtp.example.com"
ports:
- "3000:3000"
volumes:
- /opt/data/containers/sqldb/grafana:/var/lib/grafana
depends_on:
- pg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

View File

@ -1,60 +0,0 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body
{
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
// End Swagger UI call region
window.ui = ui;
};
</script>
</body>
</html>

View File

@ -1,79 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<title>Swagger UI: OAuth2 Redirect</title>
</head>
<body>
<script>
'use strict';
function run () {
var oauth2 = window.opener.swaggerUIRedirectOauth2;
var sentState = oauth2.state;
var redirectUrl = oauth2.redirectUrl;
var isValid, qp, arr;
if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
} else {
qp = location.search.substring(1);
}
arr = qp.split("&");
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
qp = qp ? JSON.parse('{' + arr.join() + '}',
function (key, value) {
return key === "" ? value : decodeURIComponent(value);
}
) : {};
isValid = qp.state === sentState;
if ((
oauth2.auth.schema.get("flow") === "accessCode" ||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
oauth2.auth.schema.get("flow") === "authorization_code"
) && !oauth2.auth.code) {
if (!isValid) {
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
});
}
if (qp.code) {
delete oauth2.state;
oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else {
let oauthErrorMsg;
if (qp.error) {
oauthErrorMsg = "["+qp.error+"]: " +
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
(qp.error_uri ? "More info: "+qp.error_uri : "");
}
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
});
}
} else {
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
}
window.close();
}
if (document.readyState !== 'loading') {
run();
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long