@akinon/ui-shell-dev 1.3.5 → 1.3.6
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.
- package/dist/assets/{index-CDUI6TEB.js → index-CNgx52S6.js} +80 -62
- package/dist/favicon.svg +3 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/public/favicon.svg +3 -0
- package/src/components/Navigation.tsx +5 -3
- package/src/components/PluginTestPage.tsx +4 -8
- package/src/components/WelcomePage.tsx +403 -68
- package/src/providers.tsx +10 -11
- package/src/server/dev-server.mjs +32 -13
- package/src/server/dev-server.ts +32 -13
- package/src/types.ts +6 -4
- package/src/utils/navigation.tsx +26 -5
|
@@ -140,7 +140,12 @@ export class ShellDevServer {
|
|
|
140
140
|
console.log(
|
|
141
141
|
`🚀 Shell development server running on http://localhost:${this.config.shell.port}`
|
|
142
142
|
);
|
|
143
|
-
|
|
143
|
+
if (this.config.apps && this.config.apps.length > 0) {
|
|
144
|
+
console.log(`📱 Applications configured:`);
|
|
145
|
+
this.config.apps.forEach((app, index) => {
|
|
146
|
+
console.log(` ${index + 1}. ${app.name} (${app.type}) at ${app.url}`);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
144
149
|
console.log(`🎨 Theme: ${this.config.shell.theme}`);
|
|
145
150
|
console.log(`🔍 Server bound to 0.0.0.0:${this.config.shell.port}`);
|
|
146
151
|
});
|
|
@@ -185,19 +190,33 @@ export class ShellDevServer {
|
|
|
185
190
|
res.json(this.config);
|
|
186
191
|
});
|
|
187
192
|
|
|
188
|
-
//
|
|
189
|
-
this.app.get('/api/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
193
|
+
// Apps health check endpoint (for development)
|
|
194
|
+
this.app.get('/api/apps/health', async (req, res) => {
|
|
195
|
+
const results = [];
|
|
196
|
+
|
|
197
|
+
if (this.config.apps && this.config.apps.length > 0) {
|
|
198
|
+
for (const app of this.config.apps) {
|
|
199
|
+
try {
|
|
200
|
+
const response = await fetch(`${app.url}/api/health`);
|
|
201
|
+
const data = await response.json();
|
|
202
|
+
results.push({
|
|
203
|
+
name: app.name,
|
|
204
|
+
url: app.url,
|
|
205
|
+
status: 'ok',
|
|
206
|
+
data
|
|
207
|
+
});
|
|
208
|
+
} catch (error) {
|
|
209
|
+
results.push({
|
|
210
|
+
name: app.name,
|
|
211
|
+
url: app.url,
|
|
212
|
+
status: 'error',
|
|
213
|
+
error: error.message
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
200
217
|
}
|
|
218
|
+
|
|
219
|
+
res.json({ apps: results, shell: { status: 'ok' } });
|
|
201
220
|
});
|
|
202
221
|
}
|
|
203
222
|
}
|
package/src/server/dev-server.ts
CHANGED
|
@@ -87,7 +87,12 @@ export class ShellDevServer {
|
|
|
87
87
|
console.log(
|
|
88
88
|
`🚀 Shell development server running on http://localhost:${this.config.shell.port}`
|
|
89
89
|
);
|
|
90
|
-
|
|
90
|
+
if (this.config.apps && this.config.apps.length > 0) {
|
|
91
|
+
console.log(`📱 Applications configured:`);
|
|
92
|
+
this.config.apps.forEach((app, index) => {
|
|
93
|
+
console.log(` ${index + 1}. ${app.name} (${app.type}) at ${app.url}`);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
91
96
|
console.log(`🎨 Theme: ${this.config.shell.theme}`);
|
|
92
97
|
});
|
|
93
98
|
|
|
@@ -124,19 +129,33 @@ export class ShellDevServer {
|
|
|
124
129
|
res.json(this.config);
|
|
125
130
|
});
|
|
126
131
|
|
|
127
|
-
//
|
|
128
|
-
this.app.get('/api/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
// Apps health check endpoint (for development)
|
|
133
|
+
this.app.get('/api/apps/health', async (req, res) => {
|
|
134
|
+
const results = [];
|
|
135
|
+
|
|
136
|
+
if (this.config.apps && this.config.apps.length > 0) {
|
|
137
|
+
for (const app of this.config.apps) {
|
|
138
|
+
try {
|
|
139
|
+
const response = await fetch(`${app.url}/api/health`);
|
|
140
|
+
const data = await response.json();
|
|
141
|
+
results.push({
|
|
142
|
+
name: app.name,
|
|
143
|
+
url: app.url,
|
|
144
|
+
status: 'ok',
|
|
145
|
+
data
|
|
146
|
+
});
|
|
147
|
+
} catch (error) {
|
|
148
|
+
results.push({
|
|
149
|
+
name: app.name,
|
|
150
|
+
url: app.url,
|
|
151
|
+
status: 'error',
|
|
152
|
+
error: error.message
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
139
156
|
}
|
|
157
|
+
|
|
158
|
+
res.json({ apps: results, shell: { status: 'ok' } });
|
|
140
159
|
});
|
|
141
160
|
}
|
|
142
161
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
export interface ShellConfig {
|
|
2
|
-
|
|
2
|
+
apps: Array<{
|
|
3
3
|
url: string;
|
|
4
4
|
path: string;
|
|
5
5
|
name: string;
|
|
6
|
-
type: '
|
|
7
|
-
|
|
6
|
+
type: 'full_page' | 'plugin';
|
|
7
|
+
navTitle?: string; // Optional navigation title for full_page apps
|
|
8
|
+
}>;
|
|
8
9
|
shell: {
|
|
9
10
|
port: number;
|
|
10
11
|
theme: 'omnitron' | 'seller-center' | 'minimal';
|
|
11
12
|
title: string;
|
|
12
13
|
};
|
|
13
|
-
sidebar
|
|
14
|
+
sidebar?: {
|
|
14
15
|
items: SidebarItem[];
|
|
15
16
|
};
|
|
17
|
+
data?: Record<string, any>;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export interface SidebarItem {
|
package/src/utils/navigation.tsx
CHANGED
|
@@ -8,16 +8,31 @@ const STATIC_NAVIGATION_ITEMS: TMenuItemType[] = [
|
|
|
8
8
|
icon: 'dashboard'
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
key: '/
|
|
12
|
-
label: '
|
|
13
|
-
icon: '
|
|
11
|
+
key: '/products-and-catalogs',
|
|
12
|
+
label: 'Products & Catalogs',
|
|
13
|
+
icon: 'fiyatlistesi',
|
|
14
14
|
disabled: true
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
key: '/orders',
|
|
18
|
+
label: 'Orders',
|
|
19
|
+
icon: 'siparis',
|
|
20
|
+
disabled: true
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const STATIC_NAVIGATION_ITEMS_BOTTOM: TMenuItemType[] = [
|
|
16
25
|
{
|
|
17
26
|
key: '/placeholder-2',
|
|
18
27
|
label: 'Help & Support',
|
|
19
28
|
icon: 'bilgilendirme_servis',
|
|
20
29
|
disabled: true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: '/placeholder-1',
|
|
33
|
+
label: 'Settings',
|
|
34
|
+
icon: 'ayarlar',
|
|
35
|
+
disabled: true
|
|
21
36
|
}
|
|
22
37
|
];
|
|
23
38
|
|
|
@@ -33,6 +48,10 @@ export const getStaticNavigationItems = () => {
|
|
|
33
48
|
return STATIC_NAVIGATION_ITEMS;
|
|
34
49
|
};
|
|
35
50
|
|
|
51
|
+
export const getStaticNavigationItemsBottom = () => {
|
|
52
|
+
return STATIC_NAVIGATION_ITEMS_BOTTOM;
|
|
53
|
+
};
|
|
54
|
+
|
|
36
55
|
export const getFullpageNavigationItems = (
|
|
37
56
|
apps: RegisteredApp[],
|
|
38
57
|
configs: Map<number, any>
|
|
@@ -60,6 +79,8 @@ export const getFullpageNavigationItems = (
|
|
|
60
79
|
});
|
|
61
80
|
};
|
|
62
81
|
|
|
63
|
-
export const getPluginNavigationItems = () => {
|
|
64
|
-
|
|
82
|
+
export const getPluginNavigationItems = (apps: RegisteredApp[]) => {
|
|
83
|
+
// Only show plugin test page if there are plugin type apps
|
|
84
|
+
const hasPluginApps = apps.some(app => app.type === 'plugin');
|
|
85
|
+
return hasPluginApps ? PLUGIN_NAVIGATION_ITEMS : [];
|
|
65
86
|
};
|