ui get form new and edit mode
This commit is contained in:
87
db/autoload/db_base.sql
Normal file
87
db/autoload/db_base.sql
Normal file
@ -0,0 +1,87 @@
|
||||
-- This script was generated by a beta version of the ERD tool in pgAdmin 4.
|
||||
-- Please log an issue at https://redmine.postgresql.org/projects/pgadmin4/issues/new if you find any bugs, including reproduction steps.
|
||||
BEGIN;
|
||||
|
||||
CREATE SEQUENCE sq_dbrole;
|
||||
CREATE SEQUENCE sq_dbtableaccess;
|
||||
CREATE SEQUENCE sq_dbuser;
|
||||
CREATE SEQUENCE sq_dbuserrole;
|
||||
CREATE SEQUENCE sq_dbentity;
|
||||
CREATE SEQUENCE sq_dbform;
|
||||
CREATE SEQUENCE sq_dbformfields;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dbrole
|
||||
(
|
||||
id integer NOT NULL DEFAULT nextval('sq_dbrole'),
|
||||
name character varying(255),
|
||||
description text,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dbtableaccess
|
||||
(
|
||||
id integer NOT NULL DEFAULT nextval('sq_dbtableaccess'),
|
||||
tableaccess character varying(255),
|
||||
dbrole_id integer,
|
||||
userrolerestrictions character varying(255),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dbuser
|
||||
(
|
||||
id integer NOT NULL DEFAULT nextval('sq_dbuser'),
|
||||
login character varying(255) UNIQUE,
|
||||
password character varying(255),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dbuserrole
|
||||
(
|
||||
id integer NOT NULL DEFAULT nextval('sq_dbuserrole'),
|
||||
dbuser_id integer,
|
||||
dbentity_id integer,
|
||||
dbrole_id integer,
|
||||
startdate timestamp without time zone,
|
||||
enddate timestamp without time zone,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dbentity
|
||||
(
|
||||
id integer NOT NULL DEFAULT nextval('sq_dbentity'),
|
||||
type character varying(255),
|
||||
parent_id bigint,
|
||||
description text,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dbform
|
||||
(
|
||||
id integer NOT NULL DEFAULT nextval('sq_dbform'),
|
||||
tablename character varying(255),
|
||||
formname character varying(255),
|
||||
title character varying(255),
|
||||
header character varying(2000),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dbformfields
|
||||
(
|
||||
id integer NOT NULL DEFAULT nextval('sq_dbformfields'),
|
||||
form_id integer,
|
||||
columnname character varying(255),
|
||||
columnorder integer,
|
||||
fieldtype character varying(255),
|
||||
label character varying(255),
|
||||
placeholder character varying(255),
|
||||
defaultvalue character varying(255),
|
||||
linkcolumns character varying(255),
|
||||
linkrestriction character varying(255),
|
||||
linkorder character varying(255),
|
||||
required bool,
|
||||
description text,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
END;
|
74
db/autoload/user_model.sql
Normal file
74
db/autoload/user_model.sql
Normal file
@ -0,0 +1,74 @@
|
||||
-- This script was generated by a beta version of the ERD tool in pgAdmin 4.
|
||||
-- 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,
|
||||
name character varying(255),
|
||||
entity_id integer,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.employee
|
||||
(
|
||||
id SERIAL,
|
||||
name character varying(255),
|
||||
firstname character varying(255),
|
||||
mail character varying(255),
|
||||
address character varying(255),
|
||||
zipcode bigint,
|
||||
city character varying(255),
|
||||
phonenumber bigint,
|
||||
mobilenumber bigint,
|
||||
socialinsurance bigint,
|
||||
persontocontactname character varying(255),
|
||||
persontocontactphone bigint,
|
||||
"position" character varying(255),
|
||||
salary money,
|
||||
entrydate timestamp without time zone,
|
||||
exitdate timestamp without time zone,
|
||||
contracttype character varying(255),
|
||||
dbuser_id integer,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.entity
|
||||
(
|
||||
id SERIAL,
|
||||
type character varying(255),
|
||||
parent_id bigint,
|
||||
description text,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.project
|
||||
(
|
||||
id SERIAL,
|
||||
name character varying(255),
|
||||
entity_id integer,
|
||||
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)
|
||||
NOT VALID;
|
||||
|
||||
END;
|
21
db/docker-compose.yml
Normal file
21
db/docker-compose.yml
Normal file
@ -0,0 +1,21 @@
|
||||
version: '3.1'
|
||||
|
||||
services:
|
||||
|
||||
pg:
|
||||
image: postgres:alpine
|
||||
restart: always
|
||||
volumes:
|
||||
- ./autoload:/docker-entrypoint-initdb.d
|
||||
environment:
|
||||
POSTGRES_DB: test
|
||||
POSTGRES_USER: test
|
||||
POSTGRES_PASSWORD: test
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 8888:8080
|
BIN
db/swagger/favicon-16x16.png
Normal file
BIN
db/swagger/favicon-16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 665 B |
BIN
db/swagger/favicon-32x32.png
Normal file
BIN
db/swagger/favicon-32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 628 B |
60
db/swagger/index.html
Normal file
60
db/swagger/index.html
Normal file
@ -0,0 +1,60 @@
|
||||
<!-- 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>
|
79
db/swagger/oauth2-redirect.html
Normal file
79
db/swagger/oauth2-redirect.html
Normal file
@ -0,0 +1,79 @@
|
||||
<!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>
|
3
db/swagger/swagger-ui-bundle.js
Normal file
3
db/swagger/swagger-ui-bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
db/swagger/swagger-ui-bundle.js.map
Normal file
1
db/swagger/swagger-ui-bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
2
db/swagger/swagger-ui-es-bundle-core.js
Normal file
2
db/swagger/swagger-ui-es-bundle-core.js
Normal file
File diff suppressed because one or more lines are too long
3
db/swagger/swagger-ui-es-bundle.js
Normal file
3
db/swagger/swagger-ui-es-bundle.js
Normal file
File diff suppressed because one or more lines are too long
3
db/swagger/swagger-ui-standalone-preset.js
Normal file
3
db/swagger/swagger-ui-standalone-preset.js
Normal file
File diff suppressed because one or more lines are too long
1
db/swagger/swagger-ui-standalone-preset.js.map
Normal file
1
db/swagger/swagger-ui-standalone-preset.js.map
Normal file
File diff suppressed because one or more lines are too long
4
db/swagger/swagger-ui.css
Normal file
4
db/swagger/swagger-ui.css
Normal file
File diff suppressed because one or more lines are too long
1
db/swagger/swagger-ui.css.map
Normal file
1
db/swagger/swagger-ui.css.map
Normal file
File diff suppressed because one or more lines are too long
2
db/swagger/swagger-ui.js
Normal file
2
db/swagger/swagger-ui.js
Normal file
File diff suppressed because one or more lines are too long
1
db/swagger/swagger-ui.js.map
Normal file
1
db/swagger/swagger-ui.js.map
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user