mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 12:51:40 +02:00
Rework initial commit
- moved frontend configuration api to new subrouter for compatibility
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
let roles = [];
|
||||
|
||||
function getUserList() {
|
||||
fetch("/api/users/?via-ldap=false¬-just-user=true")
|
||||
fetch("/config/users/?via-ldap=false¬-just-user=true")
|
||||
.then((res) => res.json())
|
||||
.then((usersRaw) => {
|
||||
users = usersRaw;
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
function getValidRoles() {
|
||||
fetch("/api/roles/")
|
||||
fetch("/config/roles/")
|
||||
.then((res) => res.json())
|
||||
.then((rolesRaw) => {
|
||||
roles = rolesRaw;
|
||||
|
@@ -283,7 +283,7 @@
|
||||
<form
|
||||
id="line-width-form"
|
||||
method="post"
|
||||
action="/api/configuration/"
|
||||
action="/config/configuration/"
|
||||
class="card-body"
|
||||
on:submit|preventDefault={() =>
|
||||
handleSettingSubmit("#line-width-form", "lw")}
|
||||
@@ -329,7 +329,7 @@
|
||||
<form
|
||||
id="plots-per-row-form"
|
||||
method="post"
|
||||
action="/api/configuration/"
|
||||
action="/config/configuration/"
|
||||
class="card-body"
|
||||
on:submit|preventDefault={() =>
|
||||
handleSettingSubmit("#plots-per-row-form", "ppr")}
|
||||
@@ -375,7 +375,7 @@
|
||||
<form
|
||||
id="backgrounds-form"
|
||||
method="post"
|
||||
action="/api/configuration/"
|
||||
action="/config/configuration/"
|
||||
class="card-body"
|
||||
on:submit|preventDefault={() =>
|
||||
handleSettingSubmit("#backgrounds-form", "bg")}
|
||||
@@ -429,7 +429,7 @@
|
||||
<form
|
||||
id="paging-form"
|
||||
method="post"
|
||||
action="/api/configuration/"
|
||||
action="/config/configuration/"
|
||||
class="card-body"
|
||||
on:submit|preventDefault={() =>
|
||||
handleSettingSubmit("#paging-form", "pag")}
|
||||
@@ -485,7 +485,7 @@
|
||||
<form
|
||||
id="colorscheme-form"
|
||||
method="post"
|
||||
action="/api/configuration/"
|
||||
action="/config/configuration/"
|
||||
class="card-body"
|
||||
>
|
||||
<!-- Svelte 'class' directive only on DOMs directly, normal 'class="xxx"' does not work, so style-array it is. -->
|
||||
|
@@ -48,7 +48,7 @@
|
||||
<form
|
||||
id="create-user-form"
|
||||
method="post"
|
||||
action="/api/users/"
|
||||
action="/config/users/"
|
||||
class="card-body"
|
||||
on:submit|preventDefault={handleUserSubmit}
|
||||
>
|
||||
|
@@ -22,7 +22,7 @@
|
||||
formData.append("add-project", project);
|
||||
|
||||
try {
|
||||
const res = await fetch(`/api/user/${username}`, {
|
||||
const res = await fetch(`/config/user/${username}`, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
@@ -54,7 +54,7 @@
|
||||
formData.append("remove-project", project);
|
||||
|
||||
try {
|
||||
const res = await fetch(`/api/user/${username}`, {
|
||||
const res = await fetch(`/config/user/${username}`, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
|
@@ -24,7 +24,7 @@
|
||||
formData.append("add-role", role);
|
||||
|
||||
try {
|
||||
const res = await fetch(`/api/user/${username}`, {
|
||||
const res = await fetch(`/config/user/${username}`, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
@@ -56,7 +56,7 @@
|
||||
formData.append("remove-role", role);
|
||||
|
||||
try {
|
||||
const res = await fetch(`/api/user/${username}`, {
|
||||
const res = await fetch(`/config/user/${username}`, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
|
@@ -20,7 +20,7 @@
|
||||
if (confirm("Are you sure?")) {
|
||||
let formData = new FormData();
|
||||
formData.append("username", username);
|
||||
fetch("/api/users/", { method: "DELETE", body: formData }).then((res) => {
|
||||
fetch("/config/users/", { method: "DELETE", body: formData }).then((res) => {
|
||||
if (res.status == 200) {
|
||||
reloadUserList();
|
||||
} else {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
let jwt = "";
|
||||
|
||||
function getUserJwt(username) {
|
||||
fetch(`/api/jwt/?username=${username}`)
|
||||
fetch(`/config/jwt/?username=${username}`)
|
||||
.then((res) => res.text())
|
||||
.then((text) => {
|
||||
jwt = text;
|
||||
|
Reference in New Issue
Block a user