Browse Source

Merge remote-tracking branch 'origin/dev' into dev

module/projects
Stephan Richter 4 weeks ago
parent
commit
f0384191d5
  1. 50
      backend/src/main/java/de/srsoftware/umbrella/backend/Application.java
  2. 12
      frontend/src/routes/project/View.svelte
  3. 3
      user/src/main/java/de/srsoftware/umbrella/user/sqlite/SqliteDB.java

50
backend/src/main/java/de/srsoftware/umbrella/backend/Application.java

@ -3,6 +3,7 @@ package de.srsoftware.umbrella.backend; @@ -3,6 +3,7 @@ package de.srsoftware.umbrella.backend;
import static de.srsoftware.umbrella.core.Constants.*;
import static de.srsoftware.umbrella.core.Util.mapLogLevel;
import static java.lang.System.Logger.Level.ERROR;
import static java.lang.System.Logger.Level.INFO;
import com.sun.net.httpserver.HttpServer;
@ -59,29 +60,32 @@ public class Application { @@ -59,29 +60,32 @@ public class Application {
config.get("umbrella.plantuml").map(Object::toString).map(File::new).filter(File::exists).ifPresent(Util::setPlantUmlJar);
var server = HttpServer.create(new InetSocketAddress(port), 0);
new Translations().bindPath("/api/translations").on(server);
new MessageSystem(config);
new UserModule(config).bindPath("/api/user").on(server);
new TagModule(config).bindPath("/api/tags").on(server);
new BookmarkApi(config).bindPath("/api/bookmark").on(server);
new CompanyModule(config).bindPath("/api/company").on(server);
new CompanyLegacy(config).bindPath("/legacy/company").on(server);
new DocumentApi(config).bindPath("/api/document").on(server);
new ItemApi(config).bindPath("/api/items").on(server);
new UserLegacy(config).bindPath("/legacy/user").on(server);
new NotesLegacy(config).bindPath("/legacy/notes").on(server);
new MarkdownApi().bindPath("/api/markdown").on(server);
new NoteModule(config).bindPath("/api/notes").on(server);
new ProjectModule(config).bindPath("/api/project").on(server);
new ProjectLegacy(config).bindPath("/legacy/project").on(server);
new TaskModule(config).bindPath("/api/task").on(server);
new TaskLegacy().bindPath("/legacy/task").on(server);
new TimeModule(config).bindPath("/api/time").on(server);
new WebHandler().bindPath("/").on(server);
new WikiModule(config).bindPath("/api/wiki").on(server);
new FileModule(config).bindPath("/api/files").on(server);
try {
new Translations().bindPath("/api/translations").on(server);
new MessageSystem(config);
new UserModule(config).bindPath("/api/user").on(server);
new TagModule(config).bindPath("/api/tags").on(server);
new BookmarkApi(config).bindPath("/api/bookmark").on(server);
new CompanyModule(config).bindPath("/api/company").on(server);
new CompanyLegacy(config).bindPath("/legacy/company").on(server);
new DocumentApi(config).bindPath("/api/document").on(server);
new ItemApi(config).bindPath("/api/items").on(server);
new UserLegacy(config).bindPath("/legacy/user").on(server);
new NotesLegacy(config).bindPath("/legacy/notes").on(server);
new MarkdownApi().bindPath("/api/markdown").on(server);
new NoteModule(config).bindPath("/api/notes").on(server);
new ProjectModule(config).bindPath("/api/project").on(server);
new ProjectLegacy(config).bindPath("/legacy/project").on(server);
new TaskModule(config).bindPath("/api/task").on(server);
new TaskLegacy().bindPath("/legacy/task").on(server);
new TimeModule(config).bindPath("/api/time").on(server);
new WebHandler().bindPath("/").on(server);
new WikiModule(config).bindPath("/api/wiki").on(server);
new FileModule(config).bindPath("/api/files").on(server);
} catch (Exception e) {
LOG.log(ERROR,"Startup failed",e);
System.exit(-1);
}
server.setExecutor(Executors.newFixedThreadPool(threads));
server.start();
LOG.log(INFO,"Started web server at port {0}",port);

12
frontend/src/routes/project/View.svelte

@ -154,6 +154,14 @@ @@ -154,6 +154,14 @@
loadTasks();
}
function showFiles(e){
window.open(`/files/project/${id}`, '_blank').focus();
}
function showTimes(e){
window.open(`/time?project=${id}`, '_blank').focus();
}
onMount(loadProject);
</script>
@ -183,9 +191,9 @@ @@ -183,9 +191,9 @@
{/if}
<div>{t('context')}</div>
<div>
<button>{t('files')}</button>
<button onclick={showFiles}>{t('files')}</button>
<button>{t('models')}</button>
<button>{t('times')}</button>
<button onclick={showTimes}>{t('times')}</button>
</div>
{#if showSettings}
<div>{t('extended_settings')}</div>

3
user/src/main/java/de/srsoftware/umbrella/user/sqlite/SqliteDB.java

@ -34,13 +34,10 @@ import java.util.*; @@ -34,13 +34,10 @@ import java.util.*;
public class SqliteDB extends BaseDb implements LoginServiceDb, UserDb {
private static final System.Logger LOG = System.getLogger(SqliteDB.class.getSimpleName());
private static final int INITIAL_DB_VERSION = 4;
public SqliteDB(Connection conn){
super(conn);
}
private void createLoginServiceTables() {
var createTable = """
CREATE TABLE IF NOT EXISTS {0} (

Loading…
Cancel
Save