Compare commits
10 Commits
feature/no
...
feature/st
| Author | SHA1 | Date | |
|---|---|---|---|
| aaf33ffa8f | |||
| f4e85c870c | |||
| 76651b1e46 | |||
| cb21560f7c | |||
| 5f07a04c43 | |||
| ece5a1ae85 | |||
| e48bac4ce2 | |||
| d0866ab73f | |||
| a13b4f40d4 | |||
| 008501357f |
@@ -12,6 +12,7 @@ import de.srsoftware.tools.ColorLogger;
|
|||||||
import de.srsoftware.umbrella.bookmarks.BookmarkApi;
|
import de.srsoftware.umbrella.bookmarks.BookmarkApi;
|
||||||
import de.srsoftware.umbrella.company.CompanyModule;
|
import de.srsoftware.umbrella.company.CompanyModule;
|
||||||
import de.srsoftware.umbrella.contact.ContactModule;
|
import de.srsoftware.umbrella.contact.ContactModule;
|
||||||
|
import de.srsoftware.umbrella.core.SettingsService;
|
||||||
import de.srsoftware.umbrella.core.Util;
|
import de.srsoftware.umbrella.core.Util;
|
||||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||||
import de.srsoftware.umbrella.documents.DocumentApi;
|
import de.srsoftware.umbrella.documents.DocumentApi;
|
||||||
@@ -88,6 +89,7 @@ public class Application {
|
|||||||
new WebHandler().bindPath("/").on(server);
|
new WebHandler().bindPath("/").on(server);
|
||||||
new WikiModule(config).bindPath("/api/wiki").on(server);
|
new WikiModule(config).bindPath("/api/wiki").on(server);
|
||||||
new FileModule(config).bindPath("/api/files").on(server);
|
new FileModule(config).bindPath("/api/files").on(server);
|
||||||
|
new SettingsService(config).bindPath("/api/settings").on(server);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.log(ERROR,"Startup failed",e);
|
LOG.log(ERROR,"Startup failed",e);
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ public class MessageApi extends BaseHandler{
|
|||||||
if (++counter > 300) counter = sendBeacon(addr,stream);
|
if (++counter > 300) counter = sendBeacon(addr,stream);
|
||||||
} else {
|
} else {
|
||||||
var event = eventQueue.removeFirst();
|
var event = eventQueue.removeFirst();
|
||||||
//if (event.isIntendedFor(user.get())) {
|
if (event.isIntendedFor(user.get())) {
|
||||||
LOG.log(DEBUG, "sending event to {0}", addr);
|
LOG.log(DEBUG, "sending event to {0}", addr);
|
||||||
sendEvent(stream, event);
|
sendEvent(stream, event);
|
||||||
counter = 0;
|
counter = 0;
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG.log(INFO,"{0} disconnected from event stream.",addr);
|
LOG.log(INFO,"{0} disconnected from event stream.",addr);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class MessageBus {
|
|||||||
|
|
||||||
private MessageBus(){}
|
private MessageBus(){}
|
||||||
|
|
||||||
public void dispatch(Event event){
|
public void dispatch(Event<?> event){
|
||||||
new Thread(() -> { // TODO: use thread pool
|
new Thread(() -> { // TODO: use thread pool
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package de.srsoftware.umbrella.messagebus.events;
|
||||||
|
|
||||||
|
import de.srsoftware.umbrella.core.ModuleRegistry;
|
||||||
|
import de.srsoftware.umbrella.core.api.Owner;
|
||||||
|
import de.srsoftware.umbrella.core.constants.Field;
|
||||||
|
import de.srsoftware.umbrella.core.model.*;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||||
|
import static de.srsoftware.umbrella.core.model.Translatable.t;
|
||||||
|
|
||||||
|
public class ItemEvent extends Event<Item>{
|
||||||
|
public ItemEvent(UmbrellaUser initiator, String module, Item item, EventType type) {
|
||||||
|
super(initiator, module, item, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<UmbrellaUser> audience() {
|
||||||
|
Owner owner = payload().location().resolve().owner().resolve();
|
||||||
|
if (owner instanceof UmbrellaUser user) return List.of(user);
|
||||||
|
if (owner instanceof Company company) return ModuleRegistry.companyService().getMembers(company.id());
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Translatable describe() {
|
||||||
|
return switch (eventType()){
|
||||||
|
case CREATE -> describeCreate();
|
||||||
|
case null, default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private Translatable describeCreate() {
|
||||||
|
var loc = payload().location().resolve().name();
|
||||||
|
return t("{user} added \"{item}\" to \"{location}\"", USER,initiator().name(), ITEM, payload().name(), LOCATION, loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Translatable subject() {
|
||||||
|
var loc = payload().location().resolve().name();
|
||||||
|
return switch (eventType()){
|
||||||
|
case CREATE -> t("A new item has been added to \"{location}\":",LOCATION,loc);
|
||||||
|
case null, default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
/* © SRSoftware 2025 */
|
||||||
|
package de.srsoftware.umbrella.core;
|
||||||
|
|
||||||
|
import static de.srsoftware.umbrella.core.ModuleRegistry.userService;
|
||||||
|
import static de.srsoftware.umbrella.core.constants.Constants.CLASS;
|
||||||
|
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||||
|
import static de.srsoftware.umbrella.core.constants.Path.MENU;
|
||||||
|
import static de.srsoftware.umbrella.core.constants.Text.*;
|
||||||
|
import static de.srsoftware.umbrella.core.constants.Text.USERS;
|
||||||
|
import static java.text.MessageFormat.format;
|
||||||
|
|
||||||
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
|
import de.srsoftware.configuration.Configuration;
|
||||||
|
import de.srsoftware.tools.Mappable;
|
||||||
|
import de.srsoftware.tools.Path;
|
||||||
|
import de.srsoftware.tools.SessionToken;
|
||||||
|
import de.srsoftware.umbrella.core.constants.Module;
|
||||||
|
import de.srsoftware.umbrella.core.constants.Text;
|
||||||
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||||
|
import de.srsoftware.umbrella.core.model.Token;
|
||||||
|
import de.srsoftware.umbrella.core.model.UmbrellaUser;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.*;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class SettingsService extends BaseHandler {
|
||||||
|
|
||||||
|
private final Configuration config;
|
||||||
|
|
||||||
|
public SettingsService(Configuration config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doGet(Path path, HttpExchange ex) throws IOException {
|
||||||
|
addCors(ex);
|
||||||
|
try {
|
||||||
|
Optional<Token> token = SessionToken.from(ex).map(Token::of);
|
||||||
|
var user = userService().loadUser(token);
|
||||||
|
if (user.isEmpty()) return unauthorized(ex);
|
||||||
|
var head = path.pop();
|
||||||
|
return switch (head) {
|
||||||
|
case MENU -> getMenuSettings(user.get(), ex);
|
||||||
|
case null, default -> super.doGet(path, ex);
|
||||||
|
};
|
||||||
|
} catch (UmbrellaException e) {
|
||||||
|
return send(ex, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private record MenuEntry(int pos, String module, String clazz, String title) implements Mappable {
|
||||||
|
public static MenuEntry of(int pos, String module){
|
||||||
|
return new MenuEntry(pos, module, module, module);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MenuEntry of(int pos, String module, String title){
|
||||||
|
return new MenuEntry(pos,module,module,title);
|
||||||
|
}
|
||||||
|
public static MenuEntry of(int pos, String module, String clazz, String title){
|
||||||
|
return new MenuEntry(pos,module,clazz,title);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> toMap() {
|
||||||
|
return Map.of(MODULE,module,CLASS,clazz,TITLE,title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private boolean getMenuSettings(UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||||
|
Optional<JSONObject> modules = config.get("umbrella.modules");
|
||||||
|
if (modules.isEmpty()) throw UmbrellaException.missingConfig("umbrella.modules");
|
||||||
|
|
||||||
|
var entries = new ArrayList<MenuEntry>();
|
||||||
|
entries.add(MenuEntry.of(1, Module.USER, USERS));
|
||||||
|
entries.add(MenuEntry.of(2, Module.COMPANY, COMPANIES));
|
||||||
|
entries.add(MenuEntry.of(3, Module.PROJECT,Text.PROJECTS));
|
||||||
|
entries.add(MenuEntry.of(4,Module.TASK,Text.TASKS));
|
||||||
|
entries.add(MenuEntry.of(5,Module.TAGS));
|
||||||
|
entries.add(MenuEntry.of(6,Module.DOCUMENT,"doc",Text.DOCUMENTS));
|
||||||
|
entries.add(MenuEntry.of(7,Module.BOOKMARK,"mark",BOOKMARKS));
|
||||||
|
entries.add(MenuEntry.of(8,Module.NOTES,"note",Text.NOTES));
|
||||||
|
entries.add(MenuEntry.of(9,Module.FILES,"file", FILES));
|
||||||
|
entries.add(MenuEntry.of(10,Module.TIME, Text.TIMETRACKING));
|
||||||
|
entries.add(MenuEntry.of(11,Module.WIKI));
|
||||||
|
entries.add(MenuEntry.of(12,Module.CONTACT, CONTACTS));
|
||||||
|
entries.add(MenuEntry.of(13,Module.STOCK));
|
||||||
|
entries.add(MenuEntry.of(14,Module.MESSAGE, MESSAGES));
|
||||||
|
entries.add(MenuEntry.of(15,Module.POLL,Text.POLLS));
|
||||||
|
|
||||||
|
for (var i=0; i<entries.size(); i++){
|
||||||
|
var entry = entries.get(i);
|
||||||
|
var key = format("umbrella.modules.{0}.menuIndex",entry.module);
|
||||||
|
Optional<Integer> val = config.get(key);
|
||||||
|
if (val.isEmpty()) {
|
||||||
|
key = format("umbrella.modules.{0}.menu_index",entry.module);
|
||||||
|
val = config.get(key);
|
||||||
|
}
|
||||||
|
if (val.isPresent()) {
|
||||||
|
var index = val.get();
|
||||||
|
if (index<0) {
|
||||||
|
entries.remove(i);
|
||||||
|
i--;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
entry = MenuEntry.of(index,entry.module,entry.clazz,entry.title);
|
||||||
|
entries.set(i,entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
key = format("umbrella.modules.{0}.baseUrl",entry.module);
|
||||||
|
Optional<String> baseUrl = config.get(key);
|
||||||
|
if (baseUrl.isPresent()) {
|
||||||
|
entry = MenuEntry.of(entry.pos,baseUrl.get(), entry.clazz,entry.title);
|
||||||
|
entries.set(i,entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var list = entries.stream().sorted((a,b) -> a.pos - b.pos)
|
||||||
|
.map(MenuEntry::toMap).toList();
|
||||||
|
return sendContent(ex,list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,10 @@ public class Constants {
|
|||||||
// prevent instantiation
|
// prevent instantiation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final String CLASS = "class";
|
||||||
|
public static final String CONFIG_SESSION_DURATION = "umbrella.session.duration";
|
||||||
public static final String COUNT = "COUNT(*)";
|
public static final String COUNT = "COUNT(*)";
|
||||||
|
|
||||||
public static final String FALLBACK_LANG = "de";
|
public static final String FALLBACK_LANG = "de";
|
||||||
public static final String HOME = "home";
|
public static final String HOME = "home";
|
||||||
public static final String JSONARRAY = "json array";
|
public static final String JSONARRAY = "json array";
|
||||||
@@ -20,8 +23,10 @@ public class Constants {
|
|||||||
public static final String KEEP_ALIVE = "keep-alive";
|
public static final String KEEP_ALIVE = "keep-alive";
|
||||||
public static final String NO_CACHE = "no-cache";
|
public static final String NO_CACHE = "no-cache";
|
||||||
public static final String NONE = "none";
|
public static final String NONE = "none";
|
||||||
|
|
||||||
public static final String TABLE_SETTINGS = "settings";
|
public static final String TABLE_SETTINGS = "settings";
|
||||||
public static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
public static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
public static final String UMBRELLA = "Umbrella";
|
public static final String UMBRELLA = "Umbrella";
|
||||||
public static final String UTF8 = UTF_8.displayName();
|
public static final String UTF8 = UTF_8.displayName();
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public class Field {
|
|||||||
public static final String LOGIN = "login";
|
public static final String LOGIN = "login";
|
||||||
|
|
||||||
public static final String MEMBERS = "members";
|
public static final String MEMBERS = "members";
|
||||||
|
public static final String MENU_INDEX = "menu_index";
|
||||||
public static final String MESSAGE_ID = "message_id";
|
public static final String MESSAGE_ID = "message_id";
|
||||||
public static final String MIME = "mime";
|
public static final String MIME = "mime";
|
||||||
public static final String MODULE = "module";
|
public static final String MODULE = "module";
|
||||||
|
|||||||
@@ -4,8 +4,17 @@ package de.srsoftware.umbrella.core.constants;
|
|||||||
public class Module {
|
public class Module {
|
||||||
public static final String BOOKMARK = "bookmark";
|
public static final String BOOKMARK = "bookmark";
|
||||||
public static final String COMPANY = "company";
|
public static final String COMPANY = "company";
|
||||||
|
public static final String CONTACT = "contact";
|
||||||
|
public static final String DOCUMENT = "document";
|
||||||
|
public static final String FILES = "files";
|
||||||
|
public static final String MESSAGE = "message";
|
||||||
|
public static final String NOTES = "notes";
|
||||||
|
public static final String POLL = "poll";
|
||||||
public static final String PROJECT = "project";
|
public static final String PROJECT = "project";
|
||||||
|
public static final String STOCK = "stock";
|
||||||
|
public static final String TAGS = "tags";
|
||||||
public static final String TASK = "task";
|
public static final String TASK = "task";
|
||||||
|
public static final String TIME = "time";
|
||||||
public static final String USER = "user";
|
public static final String USER = "user";
|
||||||
public static final String WIKI = "wiki";
|
public static final String WIKI = "wiki";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ public class Path {
|
|||||||
|
|
||||||
public static final String ADD = "add";
|
public static final String ADD = "add";
|
||||||
public static final String AVAILABLE = "available";
|
public static final String AVAILABLE = "available";
|
||||||
|
|
||||||
public static final String CSS = "css";
|
public static final String CSS = "css";
|
||||||
|
public static final String CLONE = "clone";
|
||||||
public static final String COMMON_TEMPLATES = "common_templates";
|
public static final String COMMON_TEMPLATES = "common_templates";
|
||||||
public static final String COMPANY = "company";
|
public static final String COMPANY = "company";
|
||||||
public static final String CONNECTED = "connected";
|
public static final String CONNECTED = "connected";
|
||||||
@@ -22,6 +24,9 @@ public class Path {
|
|||||||
public static final String LOGIN = "login";
|
public static final String LOGIN = "login";
|
||||||
|
|
||||||
public static final String LOGOUT = "logout";
|
public static final String LOGOUT = "logout";
|
||||||
|
|
||||||
|
public static final String MENU = "menu";
|
||||||
|
|
||||||
public static final String PAGE = "page";
|
public static final String PAGE = "page";
|
||||||
public static final String PASSWORD = "password";
|
public static final String PASSWORD = "password";
|
||||||
public static final String PROJECT = "project";
|
public static final String PROJECT = "project";
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package de.srsoftware.umbrella.core.constants;
|
|||||||
*/
|
*/
|
||||||
public class Text {
|
public class Text {
|
||||||
public static final String BOOKMARK = "bookmark";
|
public static final String BOOKMARK = "bookmark";
|
||||||
|
public static final String BOOKMARKS = "bookmarks";
|
||||||
public static final String BOOLEAN = "Boolean";
|
public static final String BOOLEAN = "Boolean";
|
||||||
|
|
||||||
public static final String COMPANIES = "companies";
|
public static final String COMPANIES = "companies";
|
||||||
@@ -24,6 +25,8 @@ public class Text {
|
|||||||
|
|
||||||
public static final String EMAILS_FOR_RECEIVER = "emails for {email}";
|
public static final String EMAILS_FOR_RECEIVER = "emails for {email}";
|
||||||
|
|
||||||
|
public static final String FILES = "files";
|
||||||
|
|
||||||
public static final String INVALID_DB_CODE = "Encountered invalid dbCode: {code}";
|
public static final String INVALID_DB_CODE = "Encountered invalid dbCode: {code}";
|
||||||
public static final String ITEM = "item";
|
public static final String ITEM = "item";
|
||||||
public static final String ITEMS = "items";
|
public static final String ITEMS = "items";
|
||||||
@@ -34,13 +37,16 @@ public class Text {
|
|||||||
public static final String LONG = "Long";
|
public static final String LONG = "Long";
|
||||||
|
|
||||||
public static final String MESSAGE = "message";
|
public static final String MESSAGE = "message";
|
||||||
|
public static final String MESSAGES = "messages";
|
||||||
|
|
||||||
public static final String NOTE = "note";
|
public static final String NOTE = "note";
|
||||||
|
public static final String NOTES = "notes";
|
||||||
public static final String NOTE_WITH_ID = "note ({id})";
|
public static final String NOTE_WITH_ID = "note ({id})";
|
||||||
public static final String NUMBER = "number";
|
public static final String NUMBER = "number";
|
||||||
|
|
||||||
public static final String PATH = "path";
|
public static final String PATH = "path";
|
||||||
public static final String PROJECT = "project";
|
public static final String POLLS = "polls";
|
||||||
|
public static final String PROJECTS = "projects";
|
||||||
public static final String PROJECT_WITH_ID = "project ({id})";
|
public static final String PROJECT_WITH_ID = "project ({id})";
|
||||||
public static final String PROPERTIES = "properties";
|
public static final String PROPERTIES = "properties";
|
||||||
public static final String PROPERTY = "property";
|
public static final String PROPERTY = "property";
|
||||||
@@ -52,18 +58,21 @@ public class Text {
|
|||||||
public static final String SERVICE_WITH_ID = "service ({id})";
|
public static final String SERVICE_WITH_ID = "service ({id})";
|
||||||
public static final String SESSION = "session";
|
public static final String SESSION = "session";
|
||||||
public static final String SETTINGS = "settings";
|
public static final String SETTINGS = "settings";
|
||||||
|
public static final String STOCK = "stock";
|
||||||
public static final String STRING = "string";
|
public static final String STRING = "string";
|
||||||
|
|
||||||
public static final String TABLE_WITH_NAME = "table {name}";
|
public static final String TABLE_WITH_NAME = "table {name}";
|
||||||
public static final String TAGS = "tags";
|
public static final String TAGS = "tags";
|
||||||
public static final String TASK = "task";
|
public static final String TASK = "task";
|
||||||
public static final String TASKS = "tasks";
|
public static final String TASKS = "tasks";
|
||||||
|
public static final String TIMETRACKING = "timetracking";
|
||||||
public static final String TIME_WITH_ID = "time ({id})";
|
public static final String TIME_WITH_ID = "time ({id})";
|
||||||
public static final String TYPE = "type";
|
public static final String TYPE = "type";
|
||||||
|
|
||||||
public static final String UNIT = "unit";
|
public static final String UNIT = "unit";
|
||||||
public static final String USER_WITH_ID = "user ({id})";
|
public static final String USER_WITH_ID = "user ({id})";
|
||||||
|
|
||||||
|
public static final String WIKI = "wiki";
|
||||||
public static final String WIKI_PAGE = "wiki page";
|
public static final String WIKI_PAGE = "wiki page";
|
||||||
public static final String WIKI_PAGES = "wiki pages";
|
public static final String WIKI_PAGES = "wiki pages";
|
||||||
|
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ public class DocumentApi extends BaseHandler implements DocumentService {
|
|||||||
private boolean postToDocument(HttpExchange ex, de.srsoftware.tools.Path path, UmbrellaUser user, long docId) throws IOException, UmbrellaException {
|
private boolean postToDocument(HttpExchange ex, de.srsoftware.tools.Path path, UmbrellaUser user, long docId) throws IOException, UmbrellaException {
|
||||||
var head = path.pop();
|
var head = path.pop();
|
||||||
return switch (head){
|
return switch (head){
|
||||||
case CLONE -> postCloneDoc(docId,ex,user);
|
case Path.CLONE -> postCloneDoc(docId,ex,user);
|
||||||
case POSITION -> postDocumentPosition(docId,ex,user);
|
case POSITION -> postDocumentPosition(docId,ex,user);
|
||||||
case PATH_SEND -> sendDocument(ex,path,user,docId);
|
case PATH_SEND -> sendDocument(ex,path,user,docId);
|
||||||
case null, default -> super.doPost(path,ex);
|
case null, default -> super.doPost(path,ex);
|
||||||
|
|||||||
@@ -2,27 +2,25 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { useTinyRouter } from 'svelte-tiny-router';
|
import { useTinyRouter } from 'svelte-tiny-router';
|
||||||
|
|
||||||
import { logout, user } from '../user.svelte.js';
|
import { api, get } from '../urls.svelte';
|
||||||
import { t } from '../translations.svelte.js';
|
import { error } from '../warn.svelte';
|
||||||
|
import { logout, user } from '../user.svelte';
|
||||||
|
import { t } from '../translations.svelte';
|
||||||
|
|
||||||
import TimeRecorder from './TimeRecorder.svelte';
|
import TimeRecorder from './TimeRecorder.svelte';
|
||||||
|
|
||||||
let key = $state(null);
|
let key = $state(null);
|
||||||
const router = useTinyRouter();
|
const router = useTinyRouter();
|
||||||
const modules = $state([]);
|
let modules = $state(null);
|
||||||
let expand = $state(false);
|
let expand = $state(false);
|
||||||
|
|
||||||
async function fetchModules(){
|
async function fetchModules(){
|
||||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/legacy/user/modules`;
|
let url = api('settings/menu');
|
||||||
const resp = await fetch(url,{credentials:'include'});
|
const res = await get(url);
|
||||||
if (resp.ok){
|
if (res.ok){
|
||||||
const arr = await resp.json();
|
modules = await res.json();
|
||||||
for (let entry of arr) {
|
|
||||||
let name = t('module.'+entry.module);
|
|
||||||
if (name) modules.push({name:name,url:entry.url});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('error');
|
error(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +28,11 @@ function onclick(e){
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
expand = false;
|
expand = false;
|
||||||
let href = e.target.getAttribute('href');
|
let href = e.target.getAttribute('href');
|
||||||
if (href) router.navigate(href);
|
if (href) {
|
||||||
|
if (href.includes('://')) {
|
||||||
|
window.location.href = href;
|
||||||
|
} else router.navigate(href);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,26 +58,12 @@ onMount(fetchModules);
|
|||||||
<button type="submit">{t('search')}</button>
|
<button type="submit">{t('search')}</button>
|
||||||
</form>
|
</form>
|
||||||
<button class="symbol" onclick={e => expand = !expand}> </button>
|
<button class="symbol" onclick={e => expand = !expand}> </button>
|
||||||
<a href="/user" {onclick} class="user">{t('users')}</a>
|
{#each modules as module,i}
|
||||||
<a href="/company" {onclick} class="company">{t('companies')}</a>
|
<a href={module.module.includes('://') ? module.module : '/'+module.module} {onclick} class={module.class}>{@html t(module.title)}</a>
|
||||||
<a href="/project" {onclick} class="project">{t('projects')}</a>
|
{/each}
|
||||||
<a href="/task" {onclick} class="task">{t('tasks')}</a>
|
|
||||||
<a href="/tags" {onclick} class="tags">{t('tags')}</a>
|
|
||||||
<a href="/document" {onclick} class="doc">{t('documents')}</a>
|
|
||||||
<a href="/bookmark" {onclick} class="mark">{t('bookmarks')}</a>
|
|
||||||
<a href="/notes" {onclick} class="note">{t('notes')}</a>
|
|
||||||
<a href="/files" {onclick} class="file">{t('files')}</a>
|
|
||||||
<a href="/time" {onclick} class="time">{t('timetracking')}</a>
|
|
||||||
<a href="/wiki" {onclick} class="wiki">{t('wiki')}</a>
|
|
||||||
<a href="/contact" {onclick} class="contact">{t('contacts')}</a>
|
|
||||||
<a href="/stock" {onclick} class="stock">{t('stock')}</a>
|
|
||||||
<a href="/message" {onclick} class="message">{@html t('messages')}</a>
|
|
||||||
{#if user.id == 2}
|
{#if user.id == 2}
|
||||||
<a href="https://svelte.dev/tutorial/svelte/state" target="_blank">{t('tutorial')}</a>
|
<a href="https://svelte.dev/tutorial/svelte/state" target="_blank">{t('tutorial')}</a>
|
||||||
{/if}
|
{/if}
|
||||||
{#each modules as module,i}
|
|
||||||
{#if module.name.trim()}<a href={module.url}>{module.name}</a>{/if}
|
|
||||||
{/each}
|
|
||||||
{#if user.name }
|
{#if user.name }
|
||||||
<a class="logout" onclick={logout}>{t('logout_user',{user:user.name})}</a>
|
<a class="logout" onclick={logout}>{t('logout_user',{user:user.name})}</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,11 +1,39 @@
|
|||||||
<script>
|
<script>
|
||||||
import { api, post } from '../../urls.svelte';
|
import { onDestroy, onMount } from 'svelte';
|
||||||
|
import { api, eventStream, post } from '../../urls.svelte';
|
||||||
import { error, yikes } from '../../warn.svelte';
|
import { error, yikes } from '../../warn.svelte';
|
||||||
import { t } from '../../translations.svelte';
|
import { t } from '../../translations.svelte';
|
||||||
|
|
||||||
let { items, selected = $bindable(null), location = null, drag_start = item => console.log({dragging:item}) } = $props();
|
let { items, selected = $bindable(null), location = null, drag_start = item => console.log({dragging:item}) } = $props();
|
||||||
|
let eventSource = null;
|
||||||
let newItem = $state({name:null, code: null});
|
let newItem = $state({name:null, code: null});
|
||||||
|
|
||||||
|
function handleCreateEvent(evt){
|
||||||
|
let json = JSON.parse(evt.data);
|
||||||
|
if (json.item.location.id == location.id){
|
||||||
|
items = [...items,json.item];
|
||||||
|
selected = json.item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleEvent(evt,method){
|
||||||
|
console.log(evt,method);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDeleteEvent(evt){
|
||||||
|
handleEvent(evt,'delete');
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleUpdateEvent(evt){
|
||||||
|
handleEvent(evt,'update');
|
||||||
|
}
|
||||||
|
|
||||||
|
function load(){
|
||||||
|
try {
|
||||||
|
eventSource = eventStream(handleCreateEvent,handleUpdateEvent,handleDeleteEvent);
|
||||||
|
} catch (ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
async function saveNewItem(){
|
async function saveNewItem(){
|
||||||
newItem.location = location;
|
newItem.location = location;
|
||||||
const url = api('stock/item');
|
const url = api('stock/item');
|
||||||
@@ -17,6 +45,12 @@
|
|||||||
items = [...items, it];
|
items = [...items, it];
|
||||||
} else error(res);
|
} else error(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
if (eventSource) eventSource.close();
|
||||||
|
});
|
||||||
|
onMount(load);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import LineEditor from '../../Components/LineEditor.svelte';
|
import LineEditor from '../../Components/LineEditor.svelte';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { api } from '../../urls.svelte';
|
import { api, patch, post } from '../../urls.svelte';
|
||||||
import { error, yikes } from '../../warn.svelte';
|
import { error, yikes } from '../../warn.svelte';
|
||||||
import { t } from '../../translations.svelte';
|
import { t } from '../../translations.svelte';
|
||||||
|
|
||||||
@@ -15,6 +15,15 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function doClone(ev){
|
||||||
|
let url = api('stock/clone');
|
||||||
|
let res = await post(url,{id:item.id});
|
||||||
|
if (res.ok){
|
||||||
|
let json = await res.json();
|
||||||
|
yikes(res);
|
||||||
|
} else error(res);
|
||||||
|
}
|
||||||
|
|
||||||
function byName(a,b){
|
function byName(a,b){
|
||||||
return a.name.localeCompare(b.name);
|
return a.name.localeCompare(b.name);
|
||||||
}
|
}
|
||||||
@@ -30,11 +39,7 @@
|
|||||||
},
|
},
|
||||||
add_prop : add_prop
|
add_prop : add_prop
|
||||||
}
|
}
|
||||||
const res = await fetch(url,{
|
const res = await post(url,data);
|
||||||
credentials:'include',
|
|
||||||
method:'POST',
|
|
||||||
body:JSON.stringify(data)
|
|
||||||
});
|
|
||||||
if (res.ok){
|
if (res.ok){
|
||||||
const prop = await res.json();
|
const prop = await res.json();
|
||||||
const id = prop.id;
|
const id = prop.id;
|
||||||
@@ -45,18 +50,14 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function patch(key,newVal){
|
async function update(key,newVal){
|
||||||
const url = api('stock');
|
const url = api('stock');
|
||||||
const data = {
|
const data = {
|
||||||
id : item.id,
|
id : item.id,
|
||||||
owner : item.owner,
|
owner : item.owner,
|
||||||
};
|
};
|
||||||
data[key] = newVal;
|
data[key] = newVal;
|
||||||
const res = await fetch(url,{
|
const res = await patch(url,data);
|
||||||
credentials:'include',
|
|
||||||
method:'PATCH',
|
|
||||||
body:JSON.stringify(data)
|
|
||||||
});
|
|
||||||
if (res.ok){
|
if (res.ok){
|
||||||
yikes();
|
yikes();
|
||||||
return true;
|
return true;
|
||||||
@@ -67,13 +68,19 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if item}
|
{#if item}
|
||||||
<LineEditor type="h3" editable={true} value={item.name} onSet={v => patch('name',v)} />
|
<LineEditor type="h3" editable={true} value={item.name} onSet={v => update('name',v)} />
|
||||||
Code: <LineEditor type="span" editable={true} value={item.code} onSet={v => patch('code',v)} />
|
<button class="clone symbol" title={t('clone')} onclick={doClone}></button>
|
||||||
<div>
|
<div>
|
||||||
{@html item.description.rendered}
|
{@html item.description.rendered}
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>{t('Code')}:</td>
|
||||||
|
<td>
|
||||||
|
<LineEditor type="span" editable={true} value={item.code} onSet={v => update('code',v)} />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{#each item.properties.toSorted(byName) as prop}
|
{#each item.properties.toSorted(byName) as prop}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
description = "Umbrella : Stock"
|
description = "Umbrella : Stock"
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
|
implementation(project(":bus"))
|
||||||
implementation(project(":core"))
|
implementation(project(":core"))
|
||||||
implementation("de.srsoftware:configuration.json:1.0.3")
|
implementation("de.srsoftware:configuration.json:1.0.3")
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ import static de.srsoftware.umbrella.core.constants.Module.USER;
|
|||||||
import static de.srsoftware.umbrella.core.constants.Path.*;
|
import static de.srsoftware.umbrella.core.constants.Path.*;
|
||||||
import static de.srsoftware.umbrella.core.constants.Path.PROPERTY;
|
import static de.srsoftware.umbrella.core.constants.Path.PROPERTY;
|
||||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.*;
|
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.*;
|
||||||
|
import static de.srsoftware.umbrella.messagebus.MessageBus.messageBus;
|
||||||
import static de.srsoftware.umbrella.stock.Constants.*;
|
import static de.srsoftware.umbrella.stock.Constants.*;
|
||||||
import static java.lang.System.Logger.Level.WARNING;
|
import static java.lang.System.Logger.Level.WARNING;
|
||||||
import static java.util.Comparator.comparing;
|
import static java.util.Comparator.comparing;
|
||||||
@@ -26,12 +27,18 @@ import de.srsoftware.umbrella.core.*;
|
|||||||
import de.srsoftware.umbrella.core.api.Owner;
|
import de.srsoftware.umbrella.core.api.Owner;
|
||||||
import de.srsoftware.umbrella.core.api.StockService;
|
import de.srsoftware.umbrella.core.api.StockService;
|
||||||
import de.srsoftware.umbrella.core.constants.Field;
|
import de.srsoftware.umbrella.core.constants.Field;
|
||||||
|
import de.srsoftware.umbrella.core.constants.Module;
|
||||||
import de.srsoftware.umbrella.core.constants.Path;
|
import de.srsoftware.umbrella.core.constants.Path;
|
||||||
|
import de.srsoftware.umbrella.core.constants.Text;
|
||||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||||
import de.srsoftware.umbrella.core.model.*;
|
import de.srsoftware.umbrella.core.model.*;
|
||||||
import de.srsoftware.umbrella.core.model.Location;
|
import de.srsoftware.umbrella.core.model.Location;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import de.srsoftware.umbrella.messagebus.events.Event;
|
||||||
|
import de.srsoftware.umbrella.messagebus.events.ItemEvent;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
public class StockModule extends BaseHandler implements StockService {
|
public class StockModule extends BaseHandler implements StockService {
|
||||||
@@ -190,6 +197,7 @@ public class StockModule extends BaseHandler implements StockService {
|
|||||||
if (user.isEmpty()) return unauthorized(ex);
|
if (user.isEmpty()) return unauthorized(ex);
|
||||||
var head = path.pop();
|
var head = path.pop();
|
||||||
return switch (head) {
|
return switch (head) {
|
||||||
|
case Path.CLONE -> postClone(user.get(),ex);
|
||||||
case Path.ITEM -> postItem(user.get(), ex);
|
case Path.ITEM -> postItem(user.get(), ex);
|
||||||
case LIST -> postItemList(user.get(), path, ex);
|
case LIST -> postItemList(user.get(), path, ex);
|
||||||
case Path.LOCATION -> postLocation(user.get(),ex);
|
case Path.LOCATION -> postLocation(user.get(),ex);
|
||||||
@@ -285,7 +293,7 @@ public class StockModule extends BaseHandler implements StockService {
|
|||||||
var json = json(ex);
|
var json = json(ex);
|
||||||
if (!(json.get(ID) instanceof Number id)) throw missingField(ID);
|
if (!(json.get(ID) instanceof Number id)) throw missingField(ID);
|
||||||
json.remove(ID);
|
json.remove(ID);
|
||||||
|
LOG.log(WARNING,"Missing permission check in StockModule.patchItem()!");
|
||||||
var item = stockDb.loadItem(id.longValue());
|
var item = stockDb.loadItem(id.longValue());
|
||||||
item.patch(json);
|
item.patch(json);
|
||||||
return sendContent(ex,stockDb.save(item));
|
return sendContent(ex,stockDb.save(item));
|
||||||
@@ -336,6 +344,23 @@ public class StockModule extends BaseHandler implements StockService {
|
|||||||
return sendContent(ex,location);
|
return sendContent(ex,location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean postClone(UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||||
|
var json = json(ex);
|
||||||
|
if (!json.has(ID))throw missingField(ID);
|
||||||
|
if (!(json.get(ID) instanceof Number num)) throw invalidField(ID,Text.NUMBER);
|
||||||
|
long itemId = num.longValue();
|
||||||
|
var item = stockDb.loadItem(itemId);
|
||||||
|
stockDb.loadProperties(item);
|
||||||
|
var location = item.location().resolve();
|
||||||
|
var owner = location.owner().resolve();
|
||||||
|
if (!assigned(owner,user)) throw forbidden("You are not allowed to add items to \"{location}\"!", Text.LOCATION,location.name());
|
||||||
|
var newItem = new Item(0,owner,0,location,item.code(),item.name(),item.description());
|
||||||
|
for (var property : item.properties()) newItem.properties().add(property);
|
||||||
|
newItem = stockDb.save(newItem);
|
||||||
|
messageBus().dispatch(new ItemEvent(user, Module.STOCK, newItem, Event.EventType.CREATE));
|
||||||
|
return sendContent(ex,newItem);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean postItem(UmbrellaUser user, HttpExchange ex) throws IOException {
|
private boolean postItem(UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||||
var json = json(ex);
|
var json = json(ex);
|
||||||
if (!json.has(NAME) || !(json.get(NAME) instanceof String name)) throw missingField(NAME);
|
if (!json.has(NAME) || !(json.get(NAME) instanceof String name)) throw missingField(NAME);
|
||||||
@@ -345,8 +370,10 @@ public class StockModule extends BaseHandler implements StockService {
|
|||||||
var location = stockDb.loadLocation(locationData.getLong(ID));
|
var location = stockDb.loadLocation(locationData.getLong(ID));
|
||||||
var owner = location.owner().resolve();
|
var owner = location.owner().resolve();
|
||||||
if (!assigned(owner,user)) throw forbidden("You are not allowed to add items to {location}!", Field.LOCATION,location);
|
if (!assigned(owner,user)) throw forbidden("You are not allowed to add items to {location}!", Field.LOCATION,location);
|
||||||
var newItem = new Item(0,owner,0,location,code,name,description);
|
var newItem = stockDb.save(new Item(0,owner,0,location,code,name,description));
|
||||||
return sendContent(ex,stockDb.save(newItem));
|
messageBus().dispatch(new ItemEvent(user, Module.STOCK, newItem, Event.EventType.CREATE));
|
||||||
|
return sendContent(ex,newItem);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean postItemList(UmbrellaUser user, de.srsoftware.tools.Path path, HttpExchange ex) throws IOException {
|
private boolean postItemList(UmbrellaUser user, de.srsoftware.tools.Path path, HttpExchange ex) throws IOException {
|
||||||
@@ -395,6 +422,7 @@ public class StockModule extends BaseHandler implements StockService {
|
|||||||
if (!(itemData.get(ID) instanceof Number itemId)) throw missingField(ID);
|
if (!(itemData.get(ID) instanceof Number itemId)) throw missingField(ID);
|
||||||
if (!(json.get("add_prop") instanceof JSONObject propData)) throw missingField("add_prop");
|
if (!(json.get("add_prop") instanceof JSONObject propData)) throw missingField("add_prop");
|
||||||
if (!propData.has(VALUE)) throw missingField(VALUE);
|
if (!propData.has(VALUE)) throw missingField(VALUE);
|
||||||
|
LOG.log(WARNING,"Missing permission check in StockModule.postProperty()!");
|
||||||
var value = propData.get(VALUE);
|
var value = propData.get(VALUE);
|
||||||
if (value == null) throw missingField(VALUE);
|
if (value == null) throw missingField(VALUE);
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import static de.srsoftware.umbrella.core.ModuleRegistry.postBox;
|
|||||||
import static de.srsoftware.umbrella.core.ResponseCode.*;
|
import static de.srsoftware.umbrella.core.ResponseCode.*;
|
||||||
import static de.srsoftware.umbrella.core.ResponseCode.HTTP_SERVER_ERROR;
|
import static de.srsoftware.umbrella.core.ResponseCode.HTTP_SERVER_ERROR;
|
||||||
import static de.srsoftware.umbrella.core.Util.*;
|
import static de.srsoftware.umbrella.core.Util.*;
|
||||||
|
import static de.srsoftware.umbrella.core.constants.Constants.CONFIG_SESSION_DURATION;
|
||||||
import static de.srsoftware.umbrella.core.constants.Field.*;
|
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||||
import static de.srsoftware.umbrella.core.constants.Field.PASSWORD;
|
import static de.srsoftware.umbrella.core.constants.Field.PASSWORD;
|
||||||
import static de.srsoftware.umbrella.core.constants.Field.REDIRECT;
|
import static de.srsoftware.umbrella.core.constants.Field.REDIRECT;
|
||||||
@@ -88,9 +89,14 @@ public class UserModule extends BaseHandler implements UserService {
|
|||||||
public UserModule(Configuration config) throws UmbrellaException {
|
public UserModule(Configuration config) throws UmbrellaException {
|
||||||
super();
|
super();
|
||||||
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingConfig(CONFIG_DATABASE));
|
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingConfig(CONFIG_DATABASE));
|
||||||
|
var sqlite = new SqliteDB(connect(dbFile));
|
||||||
|
|
||||||
// may be splitted in separate db files later
|
// may be splitted in separate db files later
|
||||||
logins = new SqliteDB(connect(dbFile));
|
logins = sqlite;
|
||||||
users = new SqliteDB(connect(dbFile));
|
users = sqlite;
|
||||||
|
|
||||||
|
Optional<Number> sessionDuration = config.get(CONFIG_SESSION_DURATION);
|
||||||
|
sessionDuration.ifPresent(users::setSessionDuration);
|
||||||
ModuleRegistry.add(this);
|
ModuleRegistry.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,4 +41,6 @@ public interface UserDb {
|
|||||||
UmbrellaUser save(DbUser user) throws UmbrellaException;
|
UmbrellaUser save(DbUser user) throws UmbrellaException;
|
||||||
|
|
||||||
Map<Long,DbUser> search(String key);
|
Map<Long,DbUser> search(String key);
|
||||||
|
|
||||||
|
UserDb setSessionDuration(Number minutes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,12 +35,14 @@ import java.security.NoSuchAlgorithmException;
|
|||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class SqliteDB extends BaseDb implements LoginServiceDb, UserDb {
|
public class SqliteDB extends BaseDb implements LoginServiceDb, UserDb {
|
||||||
private static final System.Logger LOG = System.getLogger(SqliteDB.class.getSimpleName());
|
private static final System.Logger LOG = System.getLogger(SqliteDB.class.getSimpleName());
|
||||||
|
private static Duration sessionDuration = DEFAULT_SESSION_DURATION;
|
||||||
|
|
||||||
public SqliteDB(Connection conn){
|
public SqliteDB(Connection conn){
|
||||||
super(conn);
|
super(conn);
|
||||||
@@ -481,8 +483,15 @@ CREATE TABLE IF NOT EXISTS {0} (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDb setSessionDuration(Number minutes) {
|
||||||
|
LOG.log(INFO,"Session duration set to {} minutes",minutes);
|
||||||
|
sessionDuration = Duration.ofMinutes(minutes.longValue());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Instant then(){
|
public Instant then(){
|
||||||
return LocalDateTime.now().plus(DEFAULT_SESSION_DURATION).toInstant(UTC);
|
return LocalDateTime.now().plus(sessionDuration).toInstant(UTC);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ForeignLogin toForeignLogin(ResultSet rs) throws SQLException {
|
private ForeignLogin toForeignLogin(ResultSet rs) throws SQLException {
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ tr:hover .taglist .tag button {
|
|||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.code{
|
||||||
|
color: orangered;
|
||||||
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
color: black;
|
color: black;
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ tr:hover .taglist .tag button {
|
|||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.code{
|
||||||
|
color: chocolate;
|
||||||
|
}
|
||||||
|
|
||||||
.em {
|
.em {
|
||||||
background: rgba(255, 215, 0, 0.09);
|
background: rgba(255, 215, 0, 0.09);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -476,6 +476,16 @@ table{
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.properties{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.properties .clone{
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
.version > a{
|
.version > a{
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ tr:hover .taglist .tag button {
|
|||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.code{
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
color: black;
|
color: black;
|
||||||
|
|||||||
Reference in New Issue
Block a user