Browse Source

changed default storage file, styled permission buttons

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
sqlite
Stephan Richter 3 months ago
parent
commit
7ae4da4d8f
  1. 2
      de.srsoftware.oidc.app/src/main/java/de/srsoftware/oidc/app/Application.java
  2. 8
      de.srsoftware.oidc.web/src/main/resources/en/scripts/users.js
  3. 12
      de.srsoftware.oidc.web/src/main/resources/en/style.css
  4. 2
      de.srsoftware.oidc.web/src/main/resources/en/users.html

2
de.srsoftware.oidc.app/src/main/java/de/srsoftware/oidc/app/Application.java

@ -51,7 +51,7 @@ public class Application { @@ -51,7 +51,7 @@ public class Application {
public static void main(String[] args) throws Exception {
var argMap = map(args);
Optional<Path> basePath = argMap.get(BASE_PATH) instanceof Path p ? Optional.of(p) : empty();
var storageFile = (argMap.get(CONFIG_PATH) instanceof Path p ? p : configDir(APP_NAME).resolve("config.json")).toFile();
var storageFile = (argMap.get(CONFIG_PATH) instanceof Path p ? p : configDir(APP_NAME).resolve("data.json")).toFile();
var keyDir = storageFile.getParentFile().toPath().resolve("keys");
var passwordHasher = new UuidHasher();
var firstHash = passwordHasher.hash(FIRST_USER_PASS, FIRST_UUID);

8
de.srsoftware.oidc.web/src/main/resources/en/scripts/users.js

@ -54,10 +54,10 @@ function handleUsers(response){ @@ -54,10 +54,10 @@ function handleUsers(response){
<td>${u.email}</td>
<td>${id}</td>
<td style="display: none" class="permissions">
<button onclick="editPermission('${id}','MANAGE_CLIENTS',${manage.clients})">${manage.clients ?'-':'+'} Manage Clients</button>
<button onclick="editPermission('${id}','MANAGE_PERMISSIONS',${manage.perms})">${manage.perms ?'-':'+'} Manage Permissions</button>
<button onclick="editPermission('${id}','MANAGE_SMTP',${manage.smtp})">${manage.smtp ?'-':'+'} Manage SMTP</button>
<button onclick="editPermission('${id}','MANAGE_USERS',${manage.users})">${manage.users ?'-':'+'} Manage Users</button>
<button onclick="editPermission('${id}','MANAGE_CLIENTS',${manage.clients})">${manage.clients ?'-':'+'} <span>Manage</span> Clients</button>
<button onclick="editPermission('${id}','MANAGE_PERMISSIONS',${manage.perms})">${manage.perms ?'-':'+'} <span>Manage</span> Permissions</button>
<button onclick="editPermission('${id}','MANAGE_SMTP',${manage.smtp})">${manage.smtp ?'-':'+'} <span>Manage</span> SMTP</button>
<button onclick="editPermission('${id}','MANAGE_USERS',${manage.users})">${manage.users ?'-':'+'} <span>Manage</span> Users</button>
</td>
<td>
<button type="button" onclick="reset_password('${id}')" id="reset-${id}">Reset password</button>

12
de.srsoftware.oidc.web/src/main/resources/en/style.css

@ -158,4 +158,16 @@ ul{ @@ -158,4 +158,16 @@ ul{
transform: skewY(20deg);
transform-origin: 100% 100%;
}
}
.permissions button{
background: orange;
color: black;
}
.permissions button span{
display: none;
}
.permissions button:hover span{
display: initial;
}

2
de.srsoftware.oidc.web/src/main/resources/en/users.html

@ -35,6 +35,8 @@ @@ -35,6 +35,8 @@
</td>
<td>
<input value="" type="password" id="pw" placeholder="password" autocomplete="new-password" />
</td>
<td>
<input value="" type="password" id="pw2" placeholder="repeat password" autocomplete="repeat-password" />
</td>
<td>

Loading…
Cancel
Save