Skip to content

Commit 6dd9290

Browse files
committed
feat: added base for docs
1 parent 13e2b87 commit 6dd9290

File tree

11 files changed

+192
-46
lines changed

11 files changed

+192
-46
lines changed

.github/workflows/docs.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy Docu
4+
5+
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
8+
push:
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
36+
# with:
37+
# version: 9 # Not needed if you've set "packageManager" in package.json
38+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
39+
- name: Setup Node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: 22
43+
cache: npm # or pnpm / yarn
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
- name: Install dependencies
47+
run: npm ci # or pnpm install / yarn install / bun install
48+
- name: Build with VitePress
49+
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: docs/.vitepress/dist
54+
55+
# Deployment job
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
needs: build
61+
runs-on: ubuntu-latest
62+
name: Deploy
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

docs/.vitepress/cache/deps/_metadata.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"hash": "b808861e",
3-
"configHash": "9d8b04a4",
2+
"hash": "216e4a8e",
3+
"configHash": "b1d0d4c4",
44
"lockfileHash": "69cf18de",
5-
"browserHash": "005cb233",
5+
"browserHash": "ece5baa6",
66
"optimized": {
77
"vue": {
88
"src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
99
"file": "vue.js",
10-
"fileHash": "3a485d2a",
10+
"fileHash": "ddb93633",
1111
"needsInterop": false
1212
},
1313
"vitepress > @vue/devtools-api": {
1414
"src": "../../../../node_modules/vitepress/node_modules/@vue/devtools-api/dist/index.js",
1515
"file": "vitepress___@vue_devtools-api.js",
16-
"fileHash": "04a34bdd",
16+
"fileHash": "20761289",
1717
"needsInterop": false
1818
},
1919
"vitepress > @vueuse/core": {
2020
"src": "../../../../node_modules/@vueuse/core/index.mjs",
2121
"file": "vitepress___@vueuse_core.js",
22-
"fileHash": "118da02f",
22+
"fileHash": "01c5c635",
2323
"needsInterop": false
2424
}
2525
},

docs/.vitepress/config.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig } from "vitepress"
22

33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
55
title: "Viur Administration",
66
description: "The administration interface for Viur 3 systems",
7+
head: [["link", { rel: "icon", href: "/logo.png" }]],
78
themeConfig: {
89
// https://vitepress.dev/reference/default-theme-config
10+
logo: "/logo.svg",
911
nav: [
10-
{ text: 'Home', link: '/' },
11-
{ text: 'Examples', link: '/markdown-examples' }
12+
{ text: "Home", link: "/" },
13+
{ text: "AdminInfo", link: "/admininfo/" },
1214
],
1315

1416
/*sidebar: [
@@ -21,22 +23,22 @@ export default defineConfig({
2123
}
2224
],*/
2325

24-
25-
sidebar:{
26-
"/admininfo/":[
26+
sidebar: {
27+
"/admininfo/": [
2728
{
28-
text:"AdminInfo",
29-
items:[
30-
{text:"Overview", link:"/admininfo/"},
31-
{text:"CustomActions",link:"/admininfo/custom-actions"}
32-
]
33-
}
34-
]
29+
text: "AdminInfo",
30+
items: [
31+
{ text: "Overview", link: "/admininfo/" },
32+
{ text: "CustomActions", link: "/admininfo/custom-actions" },
33+
{ text: "EditViews", link: "/admininfo/edit-views" },
34+
{ text: "ActionGroups", link: "/admininfo/action-groups" },
35+
{ text: "Treekinds", link: "/admininfo/treekinds" },
36+
],
37+
},
38+
],
3539
},
36-
aside:false,
40+
aside: false,
3741

38-
socialLinks: [
39-
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
40-
]
41-
}
42+
socialLinks: [{ icon: "github", link: "https://github.com/viur-framework/vi-admin" }],
43+
},
4244
})

docs/admininfo/action-groups.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: ActionGroups
3+
---
4+
# Action Groups
5+
6+
A handler can contain multiple actions, which may cause the top bar in the handler to become cluttered.
7+
To improve clarity, **ActionGroups** can be defined - these group multiple actions into a dropdown menu.
8+
A group is marked with a **":" prefix** under **actions** and is positioned in the top bar just like any other action.
9+
10+
11+
```python
12+
adminInfo = {
13+
"actions": [":usermanage"],
14+
"actionGroups": {
15+
"usermanage": {
16+
"name" : "Manage",
17+
"icon" : "gear",
18+
"actions": [
19+
"trigger_kick",
20+
"trigger_takeover"
21+
],
22+
}
23+
}
24+
}
25+
26+
27+
```

docs/admininfo/custom-actions.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ def adminInfo(self):
3030
| outline | Shoelace Button definition | [See Shoelace](https://serene-allen-537100.netlify.app/components/button/#outline-buttons) |
3131
| show_label | Allows displaying only the icon | `true` oder `false` |
3232
| action | Must be one of the following values: `fetch`,`view`,`open`,`route`,`component`,`action` | [See below](#supported-actions) |
33-
| fetch_method | POST | --- |
34-
| url | --- | --- |
35-
| params | --- | --- |
36-
| target | `popup` | --- |
37-
| enabled | `True` or Logics expression for selections | --- |
38-
| additionalEvalData | --- | --- |
39-
| then | `reload-module` or `reload-vi` | --- |
40-
| confirm | Enabled if defined a Confirm Popup with the defined text | --- |
41-
| success | Success Message | --- |
33+
| url | External or internal URL, or a route within the Admin interface. | `/user/view/self` |
34+
| params | **Params** are used with the `view` action to pass additional parameters to the handler. | <code v-pre>`{'rootNode':"{{key}}"}`</code> |
35+
| target | Displays the action form in a popup instead of a tab. | `popup` |
36+
| fetch_method | Send action from as POST instead of GET | `POST` |
37+
| enabled | Defines when the button is active. | `True` or Logics expression for selections |
38+
| additionalEvalData | Additional data provided to the logics expressions to determine whether a button is enabled or disabled. | --- |
39+
| then | Performs a module reload or vi reload after the action is executed. | `reload-module` or `reload-vi` |
40+
| confirm | Enabled if defined a Confirm Popup with the defined text | `Are you sure?` |
41+
| success | Success Message | `Action was Successful` |
4242

4343
## Supported Actions
4444
Depending on the requirements, one of the following actions can be defined.
@@ -63,4 +63,8 @@ The `name` and `icon` can be overridden by the values defined in the correspondi
6363

6464
### component
6565
A component previously defined in an Admin modification can be used as a complete replacement for the button.
66-
The component must include a prop named info, which receives the full customAction definition as its value.
66+
The component must include a prop named info, which receives the full customAction definition as its value.
67+
68+
### action
69+
Allows a form action to be displayed either as a popup or within a tab.
70+
`@viur_selected_keys` is included in the context when the action is executed.

docs/admininfo/edit-views.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: EditViews
3+
---
4+
# Edit Views
5+
6+
ViUR can model complex, interconnected data structures through **relations**.
7+
To display entries that reference the currently opened document, so-called **EditViews** can be defined within a form.
8+
For example, when editing a user, an EditView can display all **ToDos** associated with that specific user.
9+
10+
11+
```python
12+
adminInfo ={
13+
editViews:{
14+
"name": "User Todos",
15+
"module": "todo",
16+
"context": "user.dest.key",
17+
"disabledActions": [],
18+
"columns": ["name","status"]
19+
}
20+
}
21+
22+
```

docs/admininfo/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Admin Info
44

55
# Admin Info
66

7-
Administrative metadata for the Viur admin UI is aggregated via `/vi/config`.
8-
Within the `modules` payload each module exposes its own admin definition.
7+
The administrative metadata for the Viur Admin user interface is delivered via `/vi/config`.
8+
Within the module payload, each module provides its own admin definition.
99

1010
An admin definition only requires `name` and `handler` to be valid.
1111

@@ -28,6 +28,7 @@ The admin frontend evaluates the following properties:
2828
| `customActions` | Dict | Map of action names to custom action definitions. | [Check the sidebar for details](/admininfo/custom-actions) |
2929
| `editViews` | `[Dict]` | Adds extra tabs to create/edit forms per key/value pair. | [Check the sidebar for details](/admininfo/edit-views) |
3030
| `actionGroups` | Dict | Groups actions into named sections in the UI. | [Check the sidebar for details](/admininfo/action-groups) |
31+
| `kinds` | Dict | Defines icons, name, and nesting behavior for trees. | [Check the sidebar for details](/admininfo/treekinds) |
3132

3233

3334
<style scoped>

docs/admininfo/treekinds.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Treekinds
3+
---
4+
# Tree kinds
5+
6+
Der Tree handler bietet nodes und leafs. Die Standard definition bietet die möglichkeit beliebige nodes zu schachteln und mit leafs zu bestücken. Zusätzlich können name und icon nach belieben angepasst werden. Sollte im Skeleton ein feld kind definiert worden sein, kann über node.{kind} verwendet werden. Auf diese Weise können manche nodes nur in einander geschahtelt werden wenn es logisch sinnd macht. z.B. Etagen in Gebäude.
7+
8+
```python
9+
adminInfo = {
10+
"kinds": {
11+
node: { icon: "folder", name: "Folder", allowedChildren: ["leaf", "node"] },
12+
leaf: {
13+
icon: "file-earmark",
14+
name: "File",
15+
allowedChildren: null,
16+
}
17+
}
18+
}
19+
20+
```

docs/index.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ hero:
66
name: "Viur Administration"
77
text: ""
88
tagline: The administration interface for Viur 3 systems
9+
image:
10+
src: /logo.svg
11+
alt: ViUR Administration
912
actions:
1013
- theme: brand
1114
text: Admininfo
1215
link: /admininfo/
13-
- theme: alt
14-
text: API Examples
15-
link: /api-examples
16+
#- theme: alt
17+
# text: API Examples
18+
# link: /api-examples
1619

17-
features:
18-
- title: Feature A
19-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20-
- title: Feature B
21-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22-
- title: Feature C
23-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20+
#features:
21+
# - title: Feature A
22+
# details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
23+
# - title: Feature B
24+
# details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
25+
# - title: Feature C
26+
# details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
2427
---
2528

docs/logo.png

253 KB
Loading

0 commit comments

Comments
 (0)