-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from stzups/dev
v0.3 Architecture rework
- Loading branch information
Showing
138 changed files
with
3,353 additions
and
2,407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM postgres | ||
COPY init.sql /docker-entrypoint-initdb.d/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
CREATE DATABASE board; | ||
|
||
-- Connect to board database (currently on default postgres database) | ||
\c board | ||
REVOKE CONNECT ON DATABASE board FROM PUBLIC; | ||
REVOKE ALL ON SCHEMA public FROM PUBLIC; | ||
|
||
CREATE USER board_room PASSWORD 'changeme'; | ||
GRANT CONNECT ON DATABASE board TO board_room; | ||
GRANT USAGE ON SCHEMA public TO board_room; | ||
|
||
-- Create tables and grant permissions | ||
CREATE TABLE users( | ||
id bigint NOT NULL, | ||
owned_documents bigint[] NOT NULL, | ||
shared_documents bigint[] NOT NULL, | ||
PRIMARY KEY (id) | ||
); | ||
GRANT SELECT, INSERT, UPDATE ON users TO board_room; | ||
|
||
CREATE TABLE documents( | ||
id bigint NOT NULL, | ||
owner bigint NOT NULL, | ||
name varchar(64) not null, | ||
PRIMARY KEY (id) | ||
); | ||
GRANT SELECT, INSERT, UPDATE, DELETE ON documents TO board_room; | ||
|
||
CREATE TABLE canvases( | ||
document bigint NOT NULL, | ||
data bytea NOT NULL, | ||
PRIMARY KEY (document) | ||
); | ||
GRANT SELECT, INSERT, UPDATE, DELETE ON canvases TO board_room; | ||
|
||
CREATE TABLE persistent_user_sessions( | ||
id bigint NOT NULL, | ||
"user" bigint NOT NULL, | ||
creation_time timestamp, | ||
hashed_token bytea NOT NULL, | ||
PRIMARY KEY (id) | ||
); | ||
GRANT SELECT, INSERT, DELETE ON persistent_user_sessions TO board_room; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# Nginx | ||
# | ||
FROM nginx | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
WORKDIR /user/share/nginx/html | ||
|
||
COPY html . |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export default class Client { | ||
constructor(id, user) { | ||
this.id = id; | ||
this.user = user; | ||
//tooltip | ||
this.icon = document.createElement('img'); | ||
this.icon.setAttribute('src', 'assets/default.png'); | ||
this.icon.addEventListener('mouseenter', (event) => { | ||
let rect = this.icon.getBoundingClientRect(); | ||
this.iconTooltip.style.visibility = 'visible'; | ||
this.iconTooltip.style.top = rect.top + 'px'; | ||
this.iconTooltip.style.left = rect.left + -50 + 'px'; | ||
}) | ||
this.icon.addEventListener('mouseleave', (event) => { | ||
this.iconTooltip.style.visibility = 'hidden'; | ||
}) | ||
this.iconTooltip = document.createElement('div'); | ||
if (user != null) { | ||
this.iconTooltip.innerText = user.id; | ||
} | ||
this.iconTooltip.style.position = 'absolute'; | ||
this.iconTooltip.style.visibility = 'hidden'; | ||
this.iconTooltip.style.zIndex = '1000'; | ||
this.iconTooltip.style.color = 'black'; | ||
document.getElementsByTagName('body')[0].parentNode.appendChild(this.iconTooltip); | ||
} | ||
} |
Oops, something went wrong.