rename menu => treemenu

This commit is contained in:
chfhtw
2026-06-25 16:46:18 +02:00
parent e27e64414a
commit 4a283ebf5d
5 changed files with 15 additions and 15 deletions
@@ -24,7 +24,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
* Provides data to the ajax get calls about menues
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Menu extends FHCAPI_Controller
class Treemenu extends FHCAPI_Controller
{
public function __construct()
{
@@ -19,7 +19,7 @@ export default {
get(config, path = '') {
return {
method: 'get',
url: '/api/frontend/v1/menu/' + config + '/' + path
url: '/api/frontend/v1/treemenu/' + config + '/' + path
};
},
// TODO(chris): handle favorites per config
@@ -1,14 +1,14 @@
import MenuEntry from './Menu/Entry.js';
import TreemenuEntry from './Treemenu/Entry.js';
import dragClick from '../../directives/dragClick.js';
import ApiMenu from '../../api/factory/menu.js';
import ApiTreemenu from '../../api/factory/treemenu.js';
export default {
components: {
PvTreetable: primevue.treetable,
PvColumn: primevue.column,
MenuEntry
TreemenuEntry
},
directives: {
dragClick
@@ -96,7 +96,7 @@ export default {
this.loading = true;
return this.$api
.call(ApiMenu.get(this.config, node.data.path))
.call(ApiTreemenu.get(this.config, node.data.path))
.then(result => {
const subNodes = result.data.map(this.mapResultToTreeData);
const realNode = this.findNodeByKey(node.key);
@@ -224,7 +224,7 @@ export default {
filterFav() {
this.favorites.on = !this.favorites.on;
this.$api
.call(ApiMenu.favorites.set(
.call(ApiTreemenu.favorites.set(
JSON.stringify(this.favorites)
));
},
@@ -238,7 +238,7 @@ export default {
}
this.$api
.call(ApiMenu.favorites.set(
.call(ApiTreemenu.favorites.set(
JSON.stringify(this.favorites)
));
},
@@ -261,7 +261,7 @@ export default {
},
mounted() {
this.$api
.call(ApiMenu.get(this.config))
.call(ApiTreemenu.get(this.config))
.then(result => {
this.nodes = result.data.map(el => {
el.root = true;
@@ -273,7 +273,7 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiMenu.favorites.get())
.call(ApiTreemenu.favorites.get())
.then(result => {
if (result.data) {
this.favorites = JSON.parse(result.data);
@@ -316,7 +316,7 @@ export default {
</div>
</template>
<template #body="{ node }">
<menu-entry
<treemenu-entry
:node="node"
:data-tree-item-key="node.key"
v-drag-click="() => toggleTreeNode(node)"
@@ -41,7 +41,7 @@ export default {
},
template: /* html */`
<span
class="menu-entry d-flex align-items-center w-100 h-100"
class="treemenu-entry d-flex align-items-center w-100 h-100"
:title="title"
v-drop:[dropConfig]="(evt, data) => $emit('drop', { drop: node.data, drag: data })"
>
@@ -1,11 +1,11 @@
import BaseMenu from '../../Base/Menu.js';
import BaseTreemenu from '../../Base/Treemenu.js';
import ApiStvGroups from '../../../api/factory/stv/group.js';
import ApiStvDetails from '../../../api/factory/stv/details.js';
export default {
components: {
BaseMenu
BaseTreemenu
},
inject: {
$reloadList: {
@@ -83,7 +83,7 @@ export default {
},
template: /* html */`
<div class="overflow-auto" tabindex="-1">
<base-menu
<base-treemenu
ref="menu"
config="stv"
:preselected-key="preselectedKey"