Skip to content

Commit

Permalink
Frontend improvements (#218)
Browse files Browse the repository at this point in the history
* .

* updated helper class

* added shikijs

* removed highlightjs

* updated markdown component

* refactor

* new pakcages

---------

Co-authored-by: Davide Di Modica <webmaster.ddm@gmail.com>
  • Loading branch information
taylorwalton and Linko91 authored May 20, 2024
1 parent 33bc811 commit dbd1b49
Show file tree
Hide file tree
Showing 20 changed files with 206 additions and 283 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"redoc",
"rushstack",
"Shiki",
"shikijs",
"signin",
"Socfortress",
"sparkline",
Expand Down
3 changes: 2 additions & 1 deletion backend/app/agents/services/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@


async def fetch_wazuh_agents() -> WazuhAgentsList:
"""Fetch agents from Wazuh service.
"""
Fetch agents from Wazuh service.
This function retrieves a list of agents from the Wazuh service.
It calls the `collect_wazuh_agents` function from the `wazuh_services` module
Expand Down
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="it">
<html lang="en">
<head>
<meta name="robots" content="noindex, nofollow" />

Expand Down
167 changes: 30 additions & 137 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@fontsource/lexend": "^5.0.20",
"@fontsource/public-sans": "^5.0.18",
"@popperjs/core": "^2.11.8",
"@shikijs/markdown-it": "^1.6.0",
"@vueuse/components": "^10.9.0",
"@vueuse/core": "^10.9.0",
"apexcharts": "^3.49.1",
Expand All @@ -54,14 +55,13 @@
"jose": "^5.3.0",
"js-md5": "^0.8.3",
"lodash": "^4.17.21",
"markdown-it-highlightjs": "^4.1.0",
"mitt": "^3.0.1",
"naive-ui": "^2.38.2",
"password-validator": "^5.3.0",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
"secure-ls": "^1.2.6",
"shiki": "^1.5.2",
"shiki": "^1.6.0",
"validator": "^13.12.0",
"vue": "^3.4.27",
"vue-advanced-cropper": "^2.8.8",
Expand All @@ -84,8 +84,6 @@
"@types/inquirer": "^9.0.7",
"@types/jsdom": "^21.1.6",
"@types/lodash": "^4.17.4",
"@types/markdown-it": "^14.1.1",
"@types/markdown-it-highlightjs": "^3.3.4",
"@types/node": "^20.12.12",
"@types/validator": "^13.11.10",
"@vitejs/plugin-vue": "^5.0.4",
Expand Down Expand Up @@ -124,4 +122,4 @@
"engines": {
"node": ">=18.0.0"
}
}
}
14 changes: 9 additions & 5 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ const layoutComponents = {
Blank
}
const mainStore = useMainStore()
const themeStore = useThemeStore()
const authStore = useAuthStore()
const forceLayout = ref<Layout | null>(null)
const forceRefresh = computed<number>(() => useMainStore().forceRefresh)
const layout = computed<Layout>(() => useThemeStore().layout)
const forceRefresh = computed<number>(() => mainStore.forceRefresh)
const layout = computed<Layout>(() => themeStore.layout)
const layoutComponent = computed<Component>(() => layoutComponents[forceLayout.value || layout.value])
const routerTransition = computed<RouterTransition>(() => useThemeStore().routerTransition)
const themeName = computed<ThemeName>(() => useThemeStore().themeName)
const isLogged = computed(() => useAuthStore().isLogged)
const routerTransition = computed<RouterTransition>(() => themeStore.routerTransition)
const themeName = computed<ThemeName>(() => themeStore.themeName)
const isLogged = computed(() => authStore.isLogged)
function checkForcedLayout(route: RouteLocationNormalized) {
if (route.meta?.forceLayout) {
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/assets/scss/helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
}
}

.code-bg-transparent {
code {
background-color: transparent;
}
}

.item-appear {
&.item-appear-bottom {
animation: item-fade-bottom 0.3s forwards;
Expand Down
Loading

0 comments on commit dbd1b49

Please sign in to comment.