lupine.api 1.1.45 → 1.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,320 +1,31 @@
1
- import { bindGlobalStyle, CssProps, RefProps, VNode, MenuItemProps, clearCookie } from 'lupine.components';
2
- import { NestMenuItemProps, MenuSidebar, ThemeSelector, TabsHookProps, TabsPageProps, Tabs } from 'lupine.components';
1
+ import { bindGlobalStyle, CssProps, RefProps, clearCookie, TabsPageProps, getRenderPageProps } from 'lupine.components';
2
+ import { MenuSidebar, ThemeSelector, TabsHookProps, Tabs } from 'lupine.components';
3
3
  import { adminCss } from './admin-css';
4
- import { CreateTablesPage, RunSqlPage } from './admin-db';
5
- import { TableListPage } from './admin-table-list';
6
- import { adminFrameProps } from './admin-frame-props';
7
- import { AdminMenuPage } from './admin-menu-list';
8
- import { TestThemesPage } from './admin-test-themes';
9
- import { AdminPagePage } from './admin-page-list';
10
- import { AdminPerformancePage } from './admin-performance';
11
- import { AdminReleasePage } from './admin-release';
12
- import { AdminTestAnimationsPage } from './admin-test-animations';
13
- import { AdminTestEditPage } from './admin-test-edit';
14
- import { AdminResourcesPage } from './admin-resources';
15
- import { AdminTokensPage } from './admin-tokens';
16
- import { TestComponentPage } from './admin-test-component';
17
- import { AdminConfigPage } from './admin-config';
18
- import { AdminAboutPage } from './admin-about';
19
- import { AdminShellPage } from './admin-shell';
4
+ import { adminFrameHelper } from './admin-frame-helper';
20
5
 
21
- const chineseMenuText: { text: string; zh: string }[] = [
22
- { text: 'Contents', zh: '内容管理' },
23
- { text: 'Menu List', zh: '菜单列表' },
24
- { text: 'Page List', zh: '页面列表' },
25
- { text: 'Process List', zh: '流程列表' },
26
-
27
- { text: 'DB', zh: '数据库' },
28
- { text: 'Table List', zh: '表' },
29
- { text: 'Create Tables', zh: '创建表' },
30
- { text: 'Run SQL', zh: '运行 SQL' },
31
-
32
- { text: 'Test', zh: '测试' },
33
- { text: 'Test Themes', zh: '测试主题' },
34
- { text: 'Test Component', zh: '测试组件' },
35
- { text: 'Test Animations', zh: '测试动画' },
36
- { text: 'Test Edit', zh: '测试编辑' },
37
-
38
- { text: 'Access', zh: '管理服务器' },
39
- { text: 'Release', zh: '发布' },
40
- { text: 'Tokens', zh: '管理令牌' },
41
-
42
- { text: 'Server Info', zh: '服务器信息' },
43
- { text: 'Resources', zh: '管理资源' },
44
- { text: 'Config', zh: '管理配置' },
45
- { text: 'Shell', zh: '命令终端' },
46
- { text: 'Server Info', zh: '服务器信息' },
47
- { text: 'Performance', zh: '性能' },
48
-
49
- { text: 'Help', zh: '帮助' },
50
- { text: 'About', zh: '关于' },
51
- ];
52
- const translateMenuToChinese = (text: string) => {
53
- const menuItem = chineseMenuText.find((item) => item.text === text);
54
- return menuItem ? menuItem.zh : text;
6
+ type AdminPanelProps = {
7
+ title?: string;
8
+ css?: CssProps;
9
+ refUpdate: TabsHookProps;
10
+ };
11
+ const AdminPanel = (props: AdminPanelProps) => {
12
+ const css: CssProps = {
13
+ height: '100%',
14
+ };
15
+ const pages: TabsPageProps[] = [];
16
+ return (
17
+ <div css={css}>
18
+ <Tabs pages={pages} hook={props.refUpdate} pagePadding='8px'></Tabs>
19
+ </div>
20
+ );
55
21
  };
56
-
57
- export class AdminFrameHelper {
58
- consoleTitle = 'Welcome to Admin Panel';
59
- getConsoleTitle() {
60
- return this.consoleTitle;
61
- }
62
- setConsoleTitle(title: string) {
63
- this.consoleTitle = title;
64
- }
65
-
66
- adminTopMenu: NestMenuItemProps[] = [
67
- // { text: 'Top', url: '/admin' },
68
- {
69
- id: 'contents',
70
- text: 'Contents',
71
- url: '',
72
- // hide: true,
73
- items: [
74
- {
75
- id: 'menu-list',
76
- text: 'Menu List',
77
- url: '',
78
- // hide: true,
79
- js: () => this.addPanel('Menu', AdminMenuPage()),
80
- },
81
- {
82
- id: 'page-list',
83
- text: 'Page List',
84
- url: '',
85
- js: () => this.addPanel('Page', AdminPagePage()),
86
- },
87
- {
88
- id: 'process-list',
89
- text: 'Process List',
90
- url: '',
91
- js: () => this.addPanel('Process', <div>new Process</div>),
92
- },
93
- ],
94
- },
95
- // { text: 'menu2', url: '/st_did.l--liangbufan.gunanguanvqingguandeng.html' },
96
- // {
97
- // text: 'Admin',
98
- // url: '',
99
- // items: [{ text: 'Users', url: '/admin/users' }],
100
- // },
101
- {
102
- id: 'db',
103
- text: 'DB',
104
- url: '',
105
- items: [
106
- {
107
- id: 'table-list',
108
- text: 'Table List',
109
- url: '',
110
- js: () => this.addPanel('Table List', TableListPage()),
111
- },
112
- {
113
- id: 'create-tables',
114
- text: 'Create Tables',
115
- url: '',
116
- js: () => this.addPanel('Create Tables', CreateTablesPage()),
117
- },
118
- {
119
- id: 'run-sql',
120
- text: 'Run SQL',
121
- url: '',
122
- js: () => this.addPanel('Run SQL', RunSqlPage()),
123
- },
124
- ],
125
- },
126
- {
127
- id: 'test',
128
- text: 'Test',
129
- url: '',
130
- items: [
131
- {
132
- id: 'test-themes',
133
- text: 'Test Themes',
134
- url: '',
135
- js: () => this.addPanel('Test Themes', TestThemesPage()),
136
- },
137
- {
138
- id: 'test-component',
139
- text: 'Test Component',
140
- url: '',
141
- js: () => this.addPanel('Test Component', TestComponentPage()),
142
- },
143
- {
144
- id: 'test-animations',
145
- text: 'Test Animations',
146
- url: '',
147
- js: () => this.addPanel('Test Animations', AdminTestAnimationsPage()),
148
- },
149
- {
150
- id: 'test-edit',
151
- text: 'Test Edit',
152
- url: '',
153
- js: () => this.addPanel('Test Edit', AdminTestEditPage()),
154
- },
155
- ],
156
- },
157
-
158
- {
159
- id: 'access',
160
- text: 'Access',
161
- url: '',
162
- items: [
163
- {
164
- id: 'release',
165
- text: 'Release',
166
- url: '',
167
- js: () => this.addPanel('Release', AdminReleasePage()),
168
- },
169
- {
170
- id: 'tokens',
171
- text: 'Tokens',
172
- url: '',
173
- js: () => this.addPanel('Tokens', AdminTokensPage()),
174
- },
175
- ],
176
- },
177
-
178
- {
179
- id: 'server-info',
180
- text: 'Server Info',
181
- url: '',
182
- items: [
183
- {
184
- id: 'performance',
185
- text: 'Performance',
186
- url: '',
187
- js: () => this.addPanel('Performance', AdminPerformancePage()),
188
- },
189
- {
190
- id: 'resources',
191
- text: 'Resources',
192
- url: '',
193
- js: () => this.addPanel('Resources', AdminResourcesPage()),
194
- },
195
- {
196
- id: 'config',
197
- text: 'Config',
198
- url: '',
199
- js: () => this.addPanel('Config', AdminConfigPage()),
200
- },
201
- {
202
- id: 'shell',
203
- text: 'Shell',
204
- url: '',
205
- js: () => this.addPanel('Shell', AdminShellPage()),
206
- },
207
- ],
208
- },
209
- {
210
- id: 'help',
211
- text: 'Help',
212
- url: '',
213
- items: [
214
- {
215
- id: 'about',
216
- text: 'About',
217
- url: '',
218
- js: () => this.addPanel('About', AdminAboutPage()),
219
- },
220
- ],
221
- },
222
- ];
223
-
224
- hookBeforeShowMenu?: (adminTopMenu: NestMenuItemProps[]) => NestMenuItemProps[];
225
- // Set a hook to modify the admin top menu dynamically before it is shown
226
- setHookBeforeShowMenu(hook: (adminTopMenu: NestMenuItemProps[]) => NestMenuItemProps[]) {
227
- this.hookBeforeShowMenu = hook;
228
- }
229
- getAdminTopMenu() {
230
- if (this.hookBeforeShowMenu) {
231
- return this.hookBeforeShowMenu(this.adminTopMenu);
232
- }
233
- return this.adminTopMenu;
234
- }
235
- setAdminTopMenu(adminTopMenu: NestMenuItemProps[]) {
236
- this.adminTopMenu = adminTopMenu;
237
- }
238
- setChineseAdminTopMenu() {
239
- this.adminTopMenu.forEach((item) => {
240
- item.text = translateMenuToChinese(item.text);
241
- item.items?.forEach((subItem) => {
242
- subItem.text = translateMenuToChinese(subItem.text);
243
- });
244
- });
245
- }
246
-
247
- mobileMenuMaxWidth = '700px';
248
- setMobileMenuMaxWidth(maxWidth: string) {
249
- this.mobileMenuMaxWidth = maxWidth;
250
- }
251
- getMobileMenuMaxWidth() {
252
- return this.mobileMenuMaxWidth;
253
- }
254
-
255
- insertMenuItem(item: NestMenuItemProps[], beforeMenuId?: string) {
256
- let index = -1;
257
- if (beforeMenuId) {
258
- index = this.adminTopMenu.findIndex((m) => m.id === beforeMenuId);
259
- }
260
- if (index !== -1) {
261
- this.adminTopMenu.splice(index, 0, ...item);
262
- } else {
263
- this.adminTopMenu.push(...item);
264
- }
265
- }
266
- insertSubMenuItem(item: MenuItemProps[], beforeMenuId: string, beforeSubMenuId?: string) {
267
- const index = this.adminTopMenu.findIndex((m) => m.id === beforeMenuId);
268
- if (index !== -1) {
269
- const subMenu = this.adminTopMenu[index].items || [];
270
- const subIndex = subMenu.findIndex((s) => s.id === beforeSubMenuId);
271
- if (subIndex !== -1) {
272
- subMenu.splice(subIndex, 0, ...item);
273
- } else {
274
- subMenu.push(...item);
275
- }
276
- // this.adminTopMenu[index].items = subMenu;
277
- }
278
- }
279
- getMenuItem(menuId: string): NestMenuItemProps | null {
280
- const index = this.adminTopMenu.findIndex((m) => m.id === menuId);
281
- if (index !== -1) {
282
- return this.adminTopMenu[index];
283
- }
284
- return null;
285
- }
286
- getSubMenuItem(menuId: string, subMenuId: string): MenuItemProps | null {
287
- const index = this.adminTopMenu.findIndex((m) => m.id === menuId);
288
- if (index !== -1) {
289
- const subMenu = this.adminTopMenu[index].items || [];
290
- const subIndex = subMenu.findIndex((s) => s.id === subMenuId);
291
- if (subIndex !== -1) {
292
- return subMenu[subIndex];
293
- }
294
- }
295
- return null;
296
- }
297
-
298
- refUpdate = adminFrameProps.tabsHook;
299
- async addPanel(title: string, page: VNode) {
300
- if (adminFrameProps.tabsHook.getCount!() > adminFrameProps.maxTabsCount) {
301
- alert('You are opening too many pages');
302
- return;
303
- }
304
- if (adminFrameProps.tabsHook.findAndActivate!(title)) {
305
- return;
306
- }
307
- await adminFrameProps.tabsHook.newPage!(title, page);
308
- }
309
- }
310
- export const adminFrameHelper = /* @__PURE__ */ new AdminFrameHelper();
311
22
 
312
23
  export type AdminFrameProps = {
313
24
  title?: string;
314
25
  css?: CssProps;
315
26
  };
316
27
  export const AdminFrame = (props: AdminFrameProps) => {
317
- const refUpdate = adminFrameProps.tabsHook;
28
+ const refUpdate = adminFrameHelper.getTabsHook();
318
29
  const maxWidthMobileMenu = adminFrameHelper.getMobileMenuMaxWidth();
319
30
  const css: CssProps = {
320
31
  backgroundColor: 'var(--primary-bg-color)',
@@ -395,9 +106,11 @@ export const AdminFrame = (props: AdminFrameProps) => {
395
106
  },
396
107
  ...props.css,
397
108
  };
398
- const onLogoutClick = () => {
109
+ const onLogoutClick = async () => {
399
110
  clearCookie('_token_dev', '/');
400
- window.location.href = '/admin';
111
+ await adminFrameHelper.getAppAdminHookLogout()?.();
112
+ await getRenderPageProps().renderPageFunctions.fetchData('/api/admin/logout');
113
+ window.location.href = '/admin_dev';
401
114
  };
402
115
 
403
116
  bindGlobalStyle('admin-frame-box', css);
@@ -416,6 +129,7 @@ export const AdminFrame = (props: AdminFrameProps) => {
416
129
  color='var(--sidebar-color)'
417
130
  backgroundColor='var(--sidebar-bg-color)'
418
131
  mobileMenu={true}
132
+ isDevAdmin={adminFrameHelper.getIsDevAdmin()}
419
133
  ></MenuSidebar>
420
134
  <div class='top-logo'>Lupine.Dev</div>
421
135
  <div class='top-title'>{props.title}</div>
@@ -438,6 +152,7 @@ export const AdminFrame = (props: AdminFrameProps) => {
438
152
  color='var(--sidebar-color)'
439
153
  backgroundColor='var(--sidebar-bg-color)'
440
154
  desktopMenu={true}
155
+ isDevAdmin={adminFrameHelper.getIsDevAdmin()}
441
156
  ></MenuSidebar>
442
157
  </div>
443
158
  <div class='body-content'>
@@ -447,20 +162,3 @@ export const AdminFrame = (props: AdminFrameProps) => {
447
162
  </div>
448
163
  );
449
164
  };
450
-
451
- export type AdminPanelProps = {
452
- title?: string;
453
- css?: CssProps;
454
- refUpdate: TabsHookProps;
455
- };
456
- export const AdminPanel = (props: AdminPanelProps) => {
457
- const css: CssProps = {
458
- height: '100%',
459
- };
460
- const pages: TabsPageProps[] = [];
461
- return (
462
- <div css={css}>
463
- <Tabs pages={pages} hook={props.refUpdate} pagePadding='8px'></Tabs>
464
- </div>
465
- );
466
- };
@@ -1,8 +1,9 @@
1
1
  import { PageProps, PageRouter, DomUtils, Redirect } from 'lupine.components';
2
- import { AdminFrame } from './admin-frame';
2
+ import { adminFrameHelper } from './admin-frame-helper';
3
3
  import { AdminLoginPage } from './admin-login';
4
4
  import { AdminMenuSinglePage } from './admin-menu-list';
5
5
  import { AdminDesignPage } from './design/admin-design';
6
+ import { AdminFrame } from './admin-frame';
6
7
 
7
8
  const fetchAuth = async (props: PageProps) => {
8
9
  const data = await props.renderPageFunctions.fetchData('/api/admin/auth');
@@ -12,7 +13,7 @@ const fetchAuth = async (props: PageProps) => {
12
13
  export const checkAuth = async (props: PageProps) => {
13
14
  if (typeof document === 'undefined') {
14
15
  // no ssr for admin pages
15
- return await BlankPage(props);
16
+ return <div></div>;
16
17
  }
17
18
 
18
19
  const json = await fetchAuth(props);
@@ -20,6 +21,7 @@ export const checkAuth = async (props: PageProps) => {
20
21
  if ((typeof json === 'undefined' || !json.result) && props.url !== '/admin_dev/login') {
21
22
  return Redirect({ url: '/admin_dev/login' });
22
23
  }
24
+ adminFrameHelper.setIsDevAdmin(true);
23
25
  return null;
24
26
  };
25
27
 
@@ -28,7 +30,7 @@ export const checkAuth = async (props: PageProps) => {
28
30
 
29
31
  // if (typeof document === 'undefined') {
30
32
  // // no ssr for admin pages
31
- // return await BlankPage(props);
33
+ // return <div></div>;
32
34
  // }
33
35
 
34
36
  // const json = await fetchAuth(props);
@@ -51,11 +53,8 @@ export const AdminIndexPage = async (props: PageProps) => {
51
53
  return <AdminFrame title='Welcome...' />;
52
54
  };
53
55
 
54
- export const BlankPage = async (props: PageProps) => {
55
- return <div></div>;
56
- };
57
-
58
56
  const devAdminPageRouter = new PageRouter();
57
+ // need to be override for app and dev admins
59
58
  devAdminPageRouter.setFilter(checkAuth);
60
59
 
61
60
  devAdminPageRouter.use('/menu', AdminMenuSinglePage);
@@ -1,5 +1,14 @@
1
- import { CssProps, PageProps, webEnv, DomUtils, NotificationColor, NotificationMessage, setCookie } from 'lupine.components';
1
+ import {
2
+ CssProps,
3
+ PageProps,
4
+ webEnv,
5
+ NotificationColor,
6
+ NotificationMessage,
7
+ setCookie,
8
+ RefProps,
9
+ } from 'lupine.components';
2
10
  import { adminCss } from './admin-css';
11
+ import { adminFrameHelper } from './admin-frame-helper';
3
12
 
4
13
  const fetchLogin = async (props: PageProps, username: string, password: string) => {
5
14
  const data = await props.renderPageFunctions.fetchData('/api/admin/auth', {
@@ -17,78 +26,81 @@ export const AdminLoginPage = async (props: PageProps) => {
17
26
  width: '100%',
18
27
  minHeight: '100%',
19
28
  overflowY: 'auto',
20
- '.top-header': {
29
+ '.&header': {
21
30
  padding: '50px 0',
22
31
  margin: 'auto',
23
32
  fontSize: '200%',
24
33
  },
25
- '.top-content': {
34
+ '.&content': {
26
35
  flex: '1',
27
36
  padding: '8px 16px',
28
37
  margin: 'auto',
29
- '.login-button, .login-tip': {
38
+ '.&button, .&tip': {
30
39
  justifyContent: 'center',
31
40
  },
32
- '.login-button button': {
41
+ '.&button button': {
33
42
  width: '80%',
34
43
  fontSize: '150%',
35
44
  height: '40px',
36
45
  },
37
- '.login-tip': {
46
+ '.&tip': {
38
47
  color: 'gray',
39
48
  fontSize: '90%',
40
49
  },
41
- '.label': {
50
+ '.&label': {
42
51
  width: '100px',
43
52
  },
44
53
  '.row-box': {
45
54
  marginBottom: '8px',
46
55
  },
47
56
  },
48
- '.top-footer': {
57
+ '.&footer': {
49
58
  padding: '16px 16px 4px 16px',
50
59
  margin: 'auto',
51
60
  },
52
61
  };
53
62
 
54
63
  const onLogin = async () => {
55
- const auth = await fetchLogin(props, DomUtils.getValue('.u-name')!, DomUtils.getValue('.u-pass')!);
64
+ const auth = await fetchLogin(props, ref.$('.&name')!.value, ref.$('.&pass')!.value);
56
65
  console.log('====auth', auth);
57
66
  if (!auth || auth.status !== 'ok') {
58
67
  NotificationMessage.sendMessage((auth && auth.message) || 'Login failed', NotificationColor.Error);
59
68
  }
60
- if (auth.result) {
61
- setCookie('_token_dev', auth.result, 30, '/');
69
+ if (auth.devLogin) {
70
+ setCookie('_token_dev', auth.devLogin, 30, '/');
62
71
  window.location.href = '/admin_dev';
63
72
  }
73
+ const appAdminHookCheckLogin = adminFrameHelper.getAppAdminHookCheckLogin();
74
+ if (appAdminHookCheckLogin) {
75
+ if (await appAdminHookCheckLogin(auth)) {
76
+ window.location.href = '/admin_dev';
77
+ }
78
+ }
64
79
  };
80
+ const ref: RefProps = {};
65
81
  return (
66
- <div css={css} class='admin-login'>
67
- <div class='top-header'>
68
- <div class='top-title'>Site Management (Lupine.JS 1.0)</div>
82
+ <div ref={ref} css={css} class='admin-login'>
83
+ <div class='&header'>
84
+ <div class='&title'>Site Management (Lupine.JS 1.0)</div>
69
85
  </div>
70
- <div class='top-content'>
86
+ <div class='&content'>
71
87
  <div class='row-box'>
72
- <div class='label'>Username:</div>
73
- <div>
74
- <input class='input-base u-name' type='text' />
75
- </div>
88
+ <div class='&label'>Username:</div>
89
+ <input class='input-base &name' type='text' />
76
90
  </div>
77
91
  <div class='row-box'>
78
- <div class='label'>Password:</div>
79
- <div>
80
- <input class='input-base u-pass' type='password' />
81
- </div>
92
+ <div class='&label'>Password:</div>
93
+ <input class='input-base &pass' type='password' />
82
94
  </div>
83
- <div class='row-box login-button'>
95
+ <div class='row-box &button'>
84
96
  <button onClick={() => onLogin()} class='button-base'>
85
97
  Login
86
98
  </button>
87
99
  </div>
88
- <div class='row-box login-tip'>* Login after using the system.</div>
100
+ <div class='row-box &tip'>* Login after using the system.</div>
89
101
  </div>
90
- <div class='top-footer'>
91
- Copyright© 2023-2024 Lupine.JS{' '}
102
+ <div class='&footer'>
103
+ Copyright© 2023-2025 Lupine.JS{' '}
92
104
  <a href={`http://localhost:${webEnv('API_PORT', 11080)}/`} target='_blank'>
93
105
  http://localhost:{webEnv('API_PORT', 11080)}/
94
106
  </a>
@@ -1,7 +1,7 @@
1
1
  import { CssProps, PageProps, RefProps, getRenderPageProps, NotificationMessage } from 'lupine.components';
2
2
  import { AdminTableData } from './admin-table-data';
3
- import { adminFrameProps } from './admin-frame-props';
4
3
  import { AdminMenuEditPage } from './admin-menu-edit';
4
+ import { adminFrameHelper } from './admin-frame-helper';
5
5
 
6
6
  const tableName = '$__s_menu';
7
7
  const fetchTableDelete = async (tableName: string, id: string) => {
@@ -14,7 +14,7 @@ export const AdminMenuSinglePage = async (props: PageProps) => {
14
14
  };
15
15
 
16
16
  export const AdminMenuPage = () => {
17
- const refUpdate = adminFrameProps.tabsHook;
17
+ const refUpdate = adminFrameHelper.getTabsHook();
18
18
  const onDelete = async (rowData: any) => {
19
19
  if (!confirm(`Are you really Deleting ${rowData['menuid']}?`)) {
20
20
  return;
@@ -26,7 +26,7 @@ export const AdminMenuPage = () => {
26
26
  };
27
27
 
28
28
  const onEdit = async (rowData: any) => {
29
- if (refUpdate?.getCount && refUpdate.getCount() > adminFrameProps.maxTabsCount) {
29
+ if (refUpdate?.getCount && refUpdate.getCount() > adminFrameHelper.getMaxTabsCount()) {
30
30
  alert('You are opening too many pages');
31
31
  return;
32
32
  }
@@ -57,7 +57,7 @@ export const AdminMenuPage = () => {
57
57
  }, 500);
58
58
  };
59
59
  const onNewMenu = async () => {
60
- if (refUpdate?.getCount && refUpdate.getCount() > adminFrameProps.maxTabsCount) {
60
+ if (refUpdate?.getCount && refUpdate.getCount() > adminFrameHelper.getMaxTabsCount()) {
61
61
  alert('You are opening too many pages');
62
62
  return;
63
63
  }
@@ -1,7 +1,7 @@
1
1
  import { CssProps, RefProps, getRenderPageProps, NotificationMessage } from 'lupine.components';
2
2
  import { AdminTableData } from './admin-table-data';
3
- import { adminFrameProps } from './admin-frame-props';
4
3
  import { AdminPageEditPage } from './admin-page-edit';
4
+ import { adminFrameHelper } from './admin-frame-helper';
5
5
 
6
6
  const tableName = '$__s_page';
7
7
  const fetchTableDelete = async (tableName: string, id: string) => {
@@ -10,7 +10,7 @@ const fetchTableDelete = async (tableName: string, id: string) => {
10
10
  };
11
11
 
12
12
  export const AdminPagePage = () => {
13
- const refUpdate = adminFrameProps.tabsHook;
13
+ const refUpdate = adminFrameHelper.getTabsHook();
14
14
  const onDelete = async (rowData: any) => {
15
15
  if (!confirm(`Are you really Deleting ${rowData['menuid']}?`)) {
16
16
  return;
@@ -22,7 +22,7 @@ export const AdminPagePage = () => {
22
22
  };
23
23
 
24
24
  const onEdit = async (rowData: any) => {
25
- if (refUpdate?.getCount && refUpdate.getCount() > adminFrameProps.maxTabsCount) {
25
+ if (refUpdate?.getCount && refUpdate.getCount() > adminFrameHelper.getMaxTabsCount()) {
26
26
  alert('You are opening too many pages');
27
27
  return;
28
28
  }
@@ -53,7 +53,7 @@ export const AdminPagePage = () => {
53
53
  }, 500);
54
54
  };
55
55
  const onNewPage = async () => {
56
- if (refUpdate?.getCount && refUpdate.getCount() > adminFrameProps.maxTabsCount) {
56
+ if (refUpdate?.getCount && refUpdate.getCount() > adminFrameHelper.getMaxTabsCount()) {
57
57
  alert('You are opening too many pages');
58
58
  return;
59
59
  }