@nextjs-cms-plugins/cpanel-dashboard 0.1.1 → 0.1.3
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/client/DashboardPage.d.ts +1 -15
- package/dist/client/DashboardPage.d.ts.map +1 -1
- package/dist/client/DashboardPage.js +3 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +2 -2
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +12 -0
- package/package.json +5 -5
- package/dist/client.d.ts +0 -19
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -5
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
cpanelDashboard?: {
|
|
3
|
-
getData: {
|
|
4
|
-
useQuery: () => {
|
|
5
|
-
data?: any;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
isError?: boolean;
|
|
8
|
-
error?: unknown;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare const CpanelDashboardPage: ({ trpc }: {
|
|
14
|
-
trpc: TrpcLike;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const CpanelDashboardPage: () => import("react/jsx-runtime").JSX.Element;
|
|
16
2
|
export default CpanelDashboardPage;
|
|
17
3
|
//# sourceMappingURL=DashboardPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../src/client/DashboardPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../src/client/DashboardPage.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,mBAAmB,+CAoF/B,CAAA;AAUD,eAAe,mBAAmB,CAAA"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import getString from 'nextjs-cms/translations';
|
|
4
4
|
import { humanReadableFileSize } from 'nextjs-cms/utils';
|
|
5
|
-
|
|
5
|
+
import { trpc as trpcClient } from 'nextjs-cms/api/trpc/client';
|
|
6
|
+
export const CpanelDashboardPage = () => {
|
|
7
|
+
const trpc = trpcClient;
|
|
6
8
|
const query = trpc?.cpanelDashboard?.getData.useQuery;
|
|
7
9
|
const { data, isLoading, isError, error } = query ? query() : { isLoading: true, isError: true, error: null };
|
|
8
10
|
if (!query) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { cpanelDashboardRouter } from './router.js';
|
|
3
|
-
export declare function createPlugin(): CMSPlugin;
|
|
4
|
-
export { cpanelDashboardRouter };
|
|
1
|
+
export declare function createPlugin(): import("nextjs-cms/plugins").CMSPluginSingleRoute;
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,sDAc3B"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { definePlugin } from 'nextjs-cms/plugins';
|
|
1
2
|
import { cpanelDashboardRouter } from './router.js';
|
|
2
3
|
export function createPlugin() {
|
|
3
|
-
return {
|
|
4
|
-
|
|
4
|
+
return definePlugin({
|
|
5
|
+
title: 'cPanel Dashboard',
|
|
6
|
+
name: 'plugin_cpanel_dashboard',
|
|
7
|
+
registryName: 'cpanel-dashboard',
|
|
5
8
|
router: cpanelDashboardRouter,
|
|
6
9
|
routes: [
|
|
7
10
|
{
|
|
8
|
-
path: '/dashboard',
|
|
9
|
-
title: 'Dashboard',
|
|
11
|
+
path: '/cpanel-dashboard',
|
|
12
|
+
title: 'cPanel Dashboard',
|
|
10
13
|
icon: 'home',
|
|
11
|
-
component: 'cpanelDashboard',
|
|
12
14
|
},
|
|
13
15
|
],
|
|
14
|
-
};
|
|
16
|
+
});
|
|
15
17
|
}
|
|
16
|
-
export { cpanelDashboardRouter };
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;gBAmDW,CAAC;iBAA2B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BxE,CAAA"}
|
package/dist/router.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TRPCError } from '@trpc/server';
|
|
2
2
|
import getString from 'nextjs-cms/translations';
|
|
3
3
|
import { CpanelAPI } from 'nextjs-cms/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { pluginProcedure, router } from 'nextjs-cms/api/trpc';
|
|
5
5
|
export const cpanelDashboardRouter = router({
|
|
6
|
-
getData:
|
|
6
|
+
getData: pluginProcedure('plugin_cpanel_dashboard').query(async ({ ctx }) => {
|
|
7
7
|
if (!process.env.CPANEL_USER || !process.env.CPANEL_PASSWORD || !process.env.CPANEL_DOMAIN) {
|
|
8
8
|
throw new TRPCError({
|
|
9
9
|
code: 'BAD_REQUEST',
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.tsx"],"names":[],"mappings":"AAGA,wBAA8B,qBAAqB,qDAkBlD"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { api, HydrateClient } from 'nextjs-cms/api/trpc/server';
|
|
3
|
+
import { CpanelDashboardPage } from './client/DashboardPage.js';
|
|
4
|
+
export default async function CpanelDashboardServer() {
|
|
5
|
+
const helpers = api;
|
|
6
|
+
const prefetch = helpers.cpanelDashboard?.getData?.prefetch;
|
|
7
|
+
if (!prefetch) {
|
|
8
|
+
throw new Error('[cpanel-dashboard] Missing cpanelDashboard.getData prefetch helper.');
|
|
9
|
+
}
|
|
10
|
+
await prefetch();
|
|
11
|
+
return (_jsx(HydrateClient, { children: _jsx(CpanelDashboardPage, {}) }));
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextjs-cms-plugins/cpanel-dashboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
-
"./
|
|
13
|
-
"types": "./dist/
|
|
14
|
-
"default": "./dist/
|
|
12
|
+
"./server": {
|
|
13
|
+
"types": "./dist/server.d.ts",
|
|
14
|
+
"default": "./dist/server.js"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "19.0.0",
|
|
28
28
|
"react-dom": "19.0.0",
|
|
29
|
-
"nextjs-cms": "0.5.
|
|
29
|
+
"nextjs-cms": "0.5.70"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "~19.0.0",
|
package/dist/client.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CpanelDashboardPage } from './client/DashboardPage.js';
|
|
2
|
-
export declare const components: {
|
|
3
|
-
cpanelDashboard: ({ trpc }: {
|
|
4
|
-
trpc: {
|
|
5
|
-
cpanelDashboard?: {
|
|
6
|
-
getData: {
|
|
7
|
-
useQuery: () => {
|
|
8
|
-
data?: any;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
isError?: boolean;
|
|
11
|
-
error?: unknown;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
};
|
|
18
|
-
export { CpanelDashboardPage };
|
|
19
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,eAAO,MAAM,UAAU;;;;;;4BAKuE,CAAC;;+BAAgE,CAAC;6BAA+B,CAAC;;;;;;CAH/L,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|