Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/webui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const GetDefaultLayout = (meResponse: any) => {
)
.then((res) => {
setLayout(res?.data)
SetDefaultLayout(res?.data?.layout_config,meResponse)
// SetDefaultLayout(res?.data?.layout_config,meResponse)
setLayoutLoading(false)
})
.catch((err) => {
Expand Down
19 changes: 19 additions & 0 deletions services/webui/src/components/Layout/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,25 @@ export default function Sidebar({ currentPage }: ISidebar) {
count: undefined,
error: false,
},
{
name: 'Tasks',
icon: RiShieldCheckLine,
page: 'task',
children: [
{
name: 'Task',
page: 'tasks',
icon: RiShieldCheckLine,
isPreview: false,
},

],

isPreview: false,
isLoading: false,
count: undefined,
error: false,
},

{
name: 'All Incidents',
Expand Down
60 changes: 39 additions & 21 deletions services/webui/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,35 +237,50 @@ export default function Layout({ children, onScroll, scrollRef }: IProps) {
}
}
if (path.includes('incidents')) {
if(path.includes('controls')){
if (url.length > 3) {

temp.push({
text: 'Control summary',
href: '/incidents/controls',
})
temp.push({
text: 'Control Detail',
href: path,
if (path.includes('controls')) {
if (url.length > 3) {
temp.push({
text: 'Control summary',
href: '/incidents/controls',
})
temp.push({
text: 'Control Detail',
href: path,
})
} else {
temp.push({
text: 'Control summary',
href: '/incidents/controls',
})
}
}
if (path.includes('resources')) {
return temp.push({
text: 'Resource Incident',
href: '/incidents/resources',
})
} else {
temp.push({
text: 'Control summary',
href: '/incidents/controls',
text: 'Incidents',
href: '/incidents',
})
}
}
if(path.includes('resources')){
return temp.push({
text: 'Resource Incident',
href: '/incidents/resources',
})

}
if (path.includes('tasks')) {
if (url.length > 2) {
temp.push({
text: 'Tasks',
href: '/tasks',
})
temp.push({
text: 'Task Detail',
href: path,
})
}
else{
temp.push({
text: 'Incidents',
href: '/incidents',
text: 'Tasks',
href: '/tasks',
})
}
}
Expand Down Expand Up @@ -325,6 +340,9 @@ export default function Layout({ children, onScroll, scrollRef }: IProps) {
}
return '/incidents'
}
else if (path.includes('tasks')){
return '/tasks'
}

return ''
}
Expand Down
10 changes: 8 additions & 2 deletions services/webui/src/components/widgets/WidgetLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ export default function WidgetLayout({
useEffect(() => {
if (layout) {
// add to ietms
setItems(layout?.layout_config)
console.log(layout,"layout")
if (layout?.widgets){
setItems(layout?.widgets)

} else{
setItems([])
}
}
}, [layout])
const GetComponent = (name: string, props: any) => {
Expand Down Expand Up @@ -284,7 +290,7 @@ export default function WidgetLayout({
return
}
const newItem = {
id: `${selectedAddItem}-${items.length}`,
id: `${selectedAddItem}-${items?.length}`,
data: {
componentId: selectedAddItem,
props: widgetProps,
Expand Down
10 changes: 9 additions & 1 deletion services/webui/src/pages/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function Overview() {
const [me, setMe] = useAtom(meAtom)
const [layout, setLayout] = useAtom(LayoutAtom)
const [layouts, setLayouts] = useState<any>([layout])
const [tabId,setTabId] = useState<any>(layout?.id)

const [password, setPassword] = useState<any>({
current: '',
Expand Down Expand Up @@ -280,6 +281,11 @@ const {
setLayouts(temp)
setLayout(temp)
}
useEffect(()=>{
setLayouts([layout])
setTabId(layout?.id)
},[layout])
console.log(tabId)
return (
<>
<Modal
Expand Down Expand Up @@ -474,7 +480,9 @@ const {
)}
</Modal>

<Tabs tabs={getTabItems()} />
<Tabs
activeTabId={tabId}
tabs={getTabItems()} />
</>
)
}
Loading