Skip to content

Commit 13e2b87

Browse files
committed
chore: update docs
1 parent 32be9e6 commit 13e2b87

File tree

9 files changed

+120
-18
lines changed

9 files changed

+120
-18
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"hash": "ebd6f98a",
3-
"configHash": "b1d0d4c4",
4-
"lockfileHash": "3fcc71f5",
5-
"browserHash": "6c54baaf",
2+
"hash": "b808861e",
3+
"configHash": "9d8b04a4",
4+
"lockfileHash": "69cf18de",
5+
"browserHash": "005cb233",
66
"optimized": {
77
"vue": {
88
"src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
99
"file": "vue.js",
10-
"fileHash": "ca24bc65",
10+
"fileHash": "3a485d2a",
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": "eb890f1c",
16+
"fileHash": "04a34bdd",
1717
"needsInterop": false
1818
},
1919
"vitepress > @vueuse/core": {
2020
"src": "../../../../node_modules/@vueuse/core/index.mjs",
2121
"file": "vitepress___@vueuse_core.js",
22-
"fileHash": "b3100538",
22+
"fileHash": "118da02f",
2323
"needsInterop": false
2424
}
2525
},

docs/.vitepress/config.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ export default defineConfig({
2020
]
2121
}
2222
],*/
23-
sidebar:false,
23+
24+
25+
sidebar:{
26+
"/admininfo/":[
27+
{
28+
text:"AdminInfo",
29+
items:[
30+
{text:"Overview", link:"/admininfo/"},
31+
{text:"CustomActions",link:"/admininfo/custom-actions"}
32+
]
33+
}
34+
]
35+
},
36+
aside:false,
2437

2538
socialLinks: [
2639
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }

docs/admininfo/action-groups.md

Whitespace-only changes.

docs/admininfo/custom-actions.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Custom Actions
3+
---
4+
# Custom Actions
5+
ViUR defines Custom Actions as various ways to integrate interactive buttons into a handler.
6+
Since admin v4.9.0, the field **clientActions** can be used instead of **customActions** for defining actions.
7+
8+
The CustomAction definition is a dictionary that is mapped to an internal name, allowing it to be positioned under actions.
9+
10+
```python
11+
12+
def adminInfo(self):
13+
return {
14+
"name": "User",
15+
"actions" : ["mycustomaction"],
16+
"customActions": {
17+
"mycustomaction": {"name":"Test","action":"open","url":"https://www.viur.dev"}
18+
}
19+
}
20+
```
21+
22+
## Options
23+
24+
| Field | Description | Example |
25+
| --- | --- | --- |
26+
| name | Display name | `My Action` |
27+
| access | A list of access fields | `['root']` |
28+
| icon | Icon definition | [See adminInfo](/admininfo/) |
29+
| variant | Shoelace Button definition | [See Shoelace](https://serene-allen-537100.netlify.app/components/button/#variants) |
30+
| outline | Shoelace Button definition | [See Shoelace](https://serene-allen-537100.netlify.app/components/button/#outline-buttons) |
31+
| show_label | Allows displaying only the icon | `true` oder `false` |
32+
| 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 | --- |
42+
43+
## Supported Actions
44+
Depending on the requirements, one of the following actions can be defined.
45+
46+
### fetch
47+
Calls a URL specified under `url` within the project. The `fetch_method` is taken into account.
48+
If an skey is required, it can be passed as a query parameter using a placeholder — for example:
49+
<code v-pre>`/myendpoint?skey={{skey}}`</code>.
50+
51+
After a successful request, the `then` action is executed (if defined), and the `success` message is displayed (if defined).
52+
53+
### view
54+
The `view` action refers to admin URLs, all located under `/db/`.
55+
The current selection is passed along as context and also includes any parameters defined in the corresponding **CustomAction**.
56+
57+
### open
58+
The `open` action can be used to open a URL in a new browser window.
59+
60+
### route
61+
The `route` action is used to open a tab in the Admin interface at a specific path, for example: `/db/user/list`. Custom routes created through modifications to the Admin interface can also be accessed in this way.
62+
The `name` and `icon` can be overridden by the values defined in the corresponding **customAction**.
63+
64+
### component
65+
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.

docs/admininfo/edit-views.md

Whitespace-only changes.
Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,35 @@ The admin frontend evaluates the following properties:
1515
| --- | --- | --- | --- |
1616
| `name` | String | Display name of the module inside the UI. | `"User"` |
1717
| `handler` | `list`, `list.fluidpage.content`, `list.grouped`, `list.*`, `tree.simple.file`, `tree.node`, `tree.node.*`, `tree`, `tree.*`, `singleton`, `singleton.*` | Defines the handler component used to render the module. | `"list"` |
18-
| `icon` | `${iconName}`, `${library}___${iconName}`, `/static/*` | Icon identifier; may reference Shoelace libraries or `/static/` SVG assets. | `"gear"`, `"myicons___star"`, `/static/site/svgs/icons/star.svg` |
18+
| `icon` | `${iconName}`, `${library}___${iconName}`, `/static/*` | Icon identifier; may reference Shoelace libraries or `/static/` SVG assets. | `"gear"`, <br>`"myicons___star"`, <br>`/static/site/svgs/icons/star.svg` |
1919
| `columns` | `[String]` | Default column selection for list or tree handlers. | `["name","creationdate"]` |
2020
| `filter` | Dict | Permanent filter added to handler requests. | `{"orderby":"sortindex"}` |
2121
| `display` | `hidden`, `visible`, `group` | Controls sidebar visibility. `group` turns the entry into a container without its own view. | `"hidden"` |
2222
| `moduleGroup` | String | Assigns the module to an existing module group. | `"manage"` |
2323
| `sortIndex` | Integer | Lower values move the module higher in the sidebar; use steps of 10 for easier reordering. | `20` |
24-
| `preview` | String, Dict | Preview URL. Strings may contain placeholders; dictionaries expose multiple named links. | `/{{module}}/view/{{key}}` |
24+
| `preview` | String, Dict | Preview URL. Strings may contain placeholders; dictionaries expose multiple named links. | <code v-pre>`/{{module}}/view/{{key}}`</code> |
2525
| `disabledActions` | `[String]` | Actions that must be disabled for this module. | `["edit"]` |
2626
| `actions` | `[String]` | Additional built-in actions to expose. | `["filter"]` |
27-
| `customActions` | Dict | Map of action names to custom action definitions (see “Custom Actions”). | `{"name":"Test","action":"open","url":"https://www.viur.dev"}` |
28-
| `views` | `[Dict]` | Optional child views rendered beneath the module, often with dedicated filters. ||
29-
| `editViews` | `[Dict]` | Adds extra tabs to create/edit forms per key/value pair. ||
30-
| `actionGroups` | Dict | Groups actions into named sections in the UI. ||
27+
| `views` | `[Dict]` | Optional child views rendered beneath the module, often with dedicated filters. | - |
28+
| `customActions` | Dict | Map of action names to custom action definitions. | [Check the sidebar for details](/admininfo/custom-actions) |
29+
| `editViews` | `[Dict]` | Adds extra tabs to create/edit forms per key/value pair. | [Check the sidebar for details](/admininfo/edit-views) |
30+
| `actionGroups` | Dict | Groups actions into named sections in the UI. | [Check the sidebar for details](/admininfo/action-groups) |
31+
32+
33+
<style scoped>
34+
table td:nth-child(2),
35+
table th:nth-child(2) {
36+
width: 100px;
37+
}
38+
39+
table td:nth-child(3),
40+
table th:nth-child(3) {
41+
width: 400px;
42+
}
43+
44+
table td:nth-child(4),
45+
table th:nth-child(4) {
46+
max-width: 300px;
47+
overflow: hidden;
48+
}
49+
</style>

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ hero:
99
actions:
1010
- theme: brand
1111
text: Admininfo
12-
link: /admininfo
12+
link: /admininfo/
1313
- theme: alt
1414
text: API Examples
1515
link: /api-examples

package-lock.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
"@rollup/rollup-darwin-x64": "^4.31.0"
4242
},
4343
"devDependencies": {
44+
"@shikijs/langs": "^2.5.0",
45+
"@shikijs/themes": "^2.5.0",
4446
"eslint": "^9.4.0",
4547
"eslint-config-prettier": "^9.1.0",
4648
"eslint-plugin-prettier": "^5.1.3",

0 commit comments

Comments
 (0)