mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-26 13:04:13 +00:00
Merge remote-tracking branch 'origin/feature/ui/TRA-4192_workspace_management' into origin/ui/TRA-4204_user_managment
This commit is contained in:
@@ -116,7 +116,11 @@ export const TrafficPage: React.FC<TrafficPageProps> = ({setAnalyzeStatus}) => {
|
||||
setLeftOffTop(null);
|
||||
setNoMoreDataTop(false);
|
||||
}
|
||||
ws.current = new WebSocket(MizuWebsocketURL);
|
||||
let websocketUrl = MizuWebsocketURL;
|
||||
if (api.token) {
|
||||
websocketUrl += `?sessionToken=${api.token}`;
|
||||
}
|
||||
ws.current = new WebSocket(websocketUrl);
|
||||
ws.current.onopen = () => {
|
||||
setWsConnection(WsConnectionStatus.Connected);
|
||||
ws.current.send(query);
|
||||
|
@@ -7,6 +7,7 @@ import spinner from "../assets/spinner.svg";
|
||||
import {useCommonStyles} from "../../helpers/commonStyle";
|
||||
import {toast} from "react-toastify";
|
||||
import SelectList from "../UI/SelectList";
|
||||
import { adminUsername } from "../../consts";
|
||||
|
||||
interface SettingsModalProps {
|
||||
isOpen: boolean
|
||||
@@ -59,7 +60,7 @@ export const SettingsModal: React.FC<SettingsModalProps> = ({isOpen, onClose, is
|
||||
name: "default",
|
||||
namespaces: checkedNamespacesKeys
|
||||
}
|
||||
await api.createWorkspace(defaultWorkspace);
|
||||
await api.createWorkspace(defaultWorkspace,adminUsername);
|
||||
onClose();
|
||||
toast.success("Saved successfully");
|
||||
} catch (e) {
|
||||
|
@@ -115,8 +115,12 @@ export default class Api {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
createWorkspace = async(workspaceData) =>{
|
||||
const response = await this.client.post(`/workspace`,workspaceData);
|
||||
createWorkspace = async(workspaceData,linkUser) =>{
|
||||
let path = `/workspace`;
|
||||
if(linkUser){
|
||||
path = `/workspace?linkUser=${linkUser}`;
|
||||
}
|
||||
const response = await this.client.post(path,workspaceData);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -131,7 +135,7 @@ export default class Api {
|
||||
}
|
||||
|
||||
getNamespaces = async() =>{
|
||||
const response = await this.client.get(`/config/namespaces`);
|
||||
const response = await this.client.get(`/kube/namespaces`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -225,27 +229,6 @@ export default class Api {
|
||||
}
|
||||
}
|
||||
|
||||
// register = async (username, password) => {
|
||||
// const form = new FormData();
|
||||
// form.append('username', username);
|
||||
// form.append('password', password);
|
||||
|
||||
// try {
|
||||
// const response = await this.client.post(`/user/register`, form);
|
||||
// this.persistToken(response.data.token);
|
||||
// return response;
|
||||
// } catch (e) {
|
||||
// if (e.response.status === 400) {
|
||||
// const error = {
|
||||
// 'type': FormValidationErrorType,
|
||||
// 'messages': e.response.data
|
||||
// };
|
||||
// throw error;
|
||||
// } else {
|
||||
// throw e;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
setupAdminUser = async (password) => {
|
||||
const form = new FormData();
|
||||
|
Reference in New Issue
Block a user