MCPcopy
hub / github.com/dqzboy/Docker-Proxy / getMenuItems

Method getMenuItems

hubcmdui/services/configServiceDB.js:191–206  ·  view source on GitHub ↗

* 获取菜单项配置

()

Source from the content-addressed store, hash-verified

189 * 获取菜单项配置
190 */
191 async getMenuItems() {
192 try {
193 const menuItems = await database.all(
194 'SELECT text, link, new_tab, sort_order, enabled FROM menu_items WHERE enabled = 1 ORDER BY sort_order'
195 );
196
197 return menuItems.map(item => ({
198 text: item.text,
199 link: item.link,
200 newTab: Boolean(item.new_tab)
201 }));
202 } catch (error) {
203 logger.error('获取菜单项失败:', error);
204 return [];
205 }
206 }
207
208 /**
209 * 保存菜单项配置

Callers 1

config.jsFile · 0.80

Calls 1

allMethod · 0.80

Tested by

no test coverage detected