mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-26 21:13:15 +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);
|
setLeftOffTop(null);
|
||||||
setNoMoreDataTop(false);
|
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 = () => {
|
ws.current.onopen = () => {
|
||||||
setWsConnection(WsConnectionStatus.Connected);
|
setWsConnection(WsConnectionStatus.Connected);
|
||||||
ws.current.send(query);
|
ws.current.send(query);
|
||||||
|
@@ -7,6 +7,7 @@ import spinner from "../assets/spinner.svg";
|
|||||||
import {useCommonStyles} from "../../helpers/commonStyle";
|
import {useCommonStyles} from "../../helpers/commonStyle";
|
||||||
import {toast} from "react-toastify";
|
import {toast} from "react-toastify";
|
||||||
import SelectList from "../UI/SelectList";
|
import SelectList from "../UI/SelectList";
|
||||||
|
import { adminUsername } from "../../consts";
|
||||||
|
|
||||||
interface SettingsModalProps {
|
interface SettingsModalProps {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
@@ -59,7 +60,7 @@ export const SettingsModal: React.FC<SettingsModalProps> = ({isOpen, onClose, is
|
|||||||
name: "default",
|
name: "default",
|
||||||
namespaces: checkedNamespacesKeys
|
namespaces: checkedNamespacesKeys
|
||||||
}
|
}
|
||||||
await api.createWorkspace(defaultWorkspace);
|
await api.createWorkspace(defaultWorkspace,adminUsername);
|
||||||
onClose();
|
onClose();
|
||||||
toast.success("Saved successfully");
|
toast.success("Saved successfully");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@@ -115,8 +115,12 @@ export default class Api {
|
|||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
createWorkspace = async(workspaceData) =>{
|
createWorkspace = async(workspaceData,linkUser) =>{
|
||||||
const response = await this.client.post(`/workspace`,workspaceData);
|
let path = `/workspace`;
|
||||||
|
if(linkUser){
|
||||||
|
path = `/workspace?linkUser=${linkUser}`;
|
||||||
|
}
|
||||||
|
const response = await this.client.post(path,workspaceData);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +135,7 @@ export default class Api {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getNamespaces = async() =>{
|
getNamespaces = async() =>{
|
||||||
const response = await this.client.get(`/config/namespaces`);
|
const response = await this.client.get(`/kube/namespaces`);
|
||||||
return response.data;
|
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) => {
|
setupAdminUser = async (password) => {
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
|
Reference in New Issue
Block a user