payload-wordpress-migrator 0.0.22
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/LICENSE +21 -0
- package/README.md +586 -0
- package/dist/components/BeforeDashboardClient.d.ts +14 -0
- package/dist/components/BeforeDashboardClient.js +225 -0
- package/dist/components/BeforeDashboardClient.js.map +1 -0
- package/dist/components/BeforeDashboardClient.module.css +175 -0
- package/dist/components/BeforeDashboardServer.d.ts +1 -0
- package/dist/components/BeforeDashboardServer.js +29 -0
- package/dist/components/BeforeDashboardServer.js.map +1 -0
- package/dist/components/ContentTypeSelect.d.ts +4 -0
- package/dist/components/ContentTypeSelect.js +147 -0
- package/dist/components/ContentTypeSelect.js.map +1 -0
- package/dist/components/FieldMappingConfiguration.d.ts +5 -0
- package/dist/components/FieldMappingConfiguration.js +361 -0
- package/dist/components/FieldMappingConfiguration.js.map +1 -0
- package/dist/components/FieldMappingConfiguration.module.css +75 -0
- package/dist/components/MigrationDashboardClient.d.ts +6 -0
- package/dist/components/MigrationDashboardClient.js +49 -0
- package/dist/components/MigrationDashboardClient.js.map +1 -0
- package/dist/components/MigrationDashboardClient.module.css +749 -0
- package/dist/components/SimpleFieldMapping.d.ts +5 -0
- package/dist/components/SimpleFieldMapping.js +437 -0
- package/dist/components/SimpleFieldMapping.js.map +1 -0
- package/dist/components/dashboard/JobActionButtons.d.ts +8 -0
- package/dist/components/dashboard/JobActionButtons.js +91 -0
- package/dist/components/dashboard/JobActionButtons.js.map +1 -0
- package/dist/components/dashboard/JobsTable.d.ts +6 -0
- package/dist/components/dashboard/JobsTable.js +86 -0
- package/dist/components/dashboard/JobsTable.js.map +1 -0
- package/dist/components/dashboard/LogViewer.d.ts +3 -0
- package/dist/components/dashboard/LogViewer.js +35 -0
- package/dist/components/dashboard/LogViewer.js.map +1 -0
- package/dist/components/dashboard/SiteConfigPanel.d.ts +12 -0
- package/dist/components/dashboard/SiteConfigPanel.js +205 -0
- package/dist/components/dashboard/SiteConfigPanel.js.map +1 -0
- package/dist/components/dashboard/StatsOverview.d.ts +5 -0
- package/dist/components/dashboard/StatsOverview.js +72 -0
- package/dist/components/dashboard/StatsOverview.js.map +1 -0
- package/dist/components/dashboard/index.d.ts +7 -0
- package/dist/components/dashboard/index.js +7 -0
- package/dist/components/dashboard/index.js.map +1 -0
- package/dist/components/dashboard/types.d.ts +46 -0
- package/dist/components/dashboard/types.js +2 -0
- package/dist/components/dashboard/types.js.map +1 -0
- package/dist/components/dashboard/useMigrationDashboard.d.ts +15 -0
- package/dist/components/dashboard/useMigrationDashboard.js +584 -0
- package/dist/components/dashboard/useMigrationDashboard.js.map +1 -0
- package/dist/exports/client.d.ts +4 -0
- package/dist/exports/client.js +5 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +2 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +443 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/content/blocks.d.ts +6 -0
- package/dist/utils/content/blocks.js +93 -0
- package/dist/utils/content/blocks.js.map +1 -0
- package/dist/utils/content/fieldMapping.d.ts +9 -0
- package/dist/utils/content/fieldMapping.js +218 -0
- package/dist/utils/content/fieldMapping.js.map +1 -0
- package/dist/utils/content/index.d.ts +4 -0
- package/dist/utils/content/index.js +4 -0
- package/dist/utils/content/index.js.map +1 -0
- package/dist/utils/content/transformer.d.ts +5 -0
- package/dist/utils/content/transformer.js +323 -0
- package/dist/utils/content/transformer.js.map +1 -0
- package/dist/utils/endpoints/handlers.d.ts +9 -0
- package/dist/utils/endpoints/handlers.js +201 -0
- package/dist/utils/endpoints/handlers.js.map +1 -0
- package/dist/utils/endpoints/index.d.ts +2 -0
- package/dist/utils/endpoints/index.js +2 -0
- package/dist/utils/endpoints/index.js.map +1 -0
- package/dist/utils/fields/analyzer.d.ts +7 -0
- package/dist/utils/fields/analyzer.js +502 -0
- package/dist/utils/fields/analyzer.js.map +1 -0
- package/dist/utils/fields/index.d.ts +2 -0
- package/dist/utils/fields/index.js +2 -0
- package/dist/utils/fields/index.js.map +1 -0
- package/dist/utils/helpers/auth.d.ts +9 -0
- package/dist/utils/helpers/auth.js +50 -0
- package/dist/utils/helpers/auth.js.map +1 -0
- package/dist/utils/helpers/cache.d.ts +11 -0
- package/dist/utils/helpers/cache.js +47 -0
- package/dist/utils/helpers/cache.js.map +1 -0
- package/dist/utils/helpers/concurrency.d.ts +2 -0
- package/dist/utils/helpers/concurrency.js +26 -0
- package/dist/utils/helpers/concurrency.js.map +1 -0
- package/dist/utils/helpers/index.d.ts +8 -0
- package/dist/utils/helpers/index.js +8 -0
- package/dist/utils/helpers/index.js.map +1 -0
- package/dist/utils/helpers/objectHelpers.d.ts +3 -0
- package/dist/utils/helpers/objectHelpers.js +22 -0
- package/dist/utils/helpers/objectHelpers.js.map +1 -0
- package/dist/utils/helpers/rateLimiter.d.ts +10 -0
- package/dist/utils/helpers/rateLimiter.js +29 -0
- package/dist/utils/helpers/rateLimiter.js.map +1 -0
- package/dist/utils/helpers/responses.d.ts +3 -0
- package/dist/utils/helpers/responses.js +23 -0
- package/dist/utils/helpers/responses.js.map +1 -0
- package/dist/utils/helpers/wpHelpers.d.ts +6 -0
- package/dist/utils/helpers/wpHelpers.js +29 -0
- package/dist/utils/helpers/wpHelpers.js.map +1 -0
- package/dist/utils/lexical/constants.d.ts +37 -0
- package/dist/utils/lexical/constants.js +58 -0
- package/dist/utils/lexical/constants.js.map +1 -0
- package/dist/utils/lexical/htmlParser.d.ts +20 -0
- package/dist/utils/lexical/htmlParser.js +253 -0
- package/dist/utils/lexical/htmlParser.js.map +1 -0
- package/dist/utils/lexical/htmlToLexicalConverter.d.ts +55 -0
- package/dist/utils/lexical/htmlToLexicalConverter.js +999 -0
- package/dist/utils/lexical/htmlToLexicalConverter.js.map +1 -0
- package/dist/utils/lexical/index.d.ts +5 -0
- package/dist/utils/lexical/index.js +4 -0
- package/dist/utils/lexical/index.js.map +1 -0
- package/dist/utils/lexical/nodeFactories.d.ts +21 -0
- package/dist/utils/lexical/nodeFactories.js +91 -0
- package/dist/utils/lexical/nodeFactories.js.map +1 -0
- package/dist/utils/lexical/preprocessor.d.ts +4 -0
- package/dist/utils/lexical/preprocessor.js +302 -0
- package/dist/utils/lexical/preprocessor.js.map +1 -0
- package/dist/utils/media/download.d.ts +7 -0
- package/dist/utils/media/download.js +85 -0
- package/dist/utils/media/download.js.map +1 -0
- package/dist/utils/media/extraction.d.ts +12 -0
- package/dist/utils/media/extraction.js +58 -0
- package/dist/utils/media/extraction.js.map +1 -0
- package/dist/utils/media/import.d.ts +7 -0
- package/dist/utils/media/import.js +146 -0
- package/dist/utils/media/import.js.map +1 -0
- package/dist/utils/media/index.d.ts +6 -0
- package/dist/utils/media/index.js +6 -0
- package/dist/utils/media/index.js.map +1 -0
- package/dist/utils/media/upload.d.ts +4 -0
- package/dist/utils/media/upload.js +46 -0
- package/dist/utils/media/upload.js.map +1 -0
- package/dist/utils/media/validation.d.ts +8 -0
- package/dist/utils/media/validation.js +60 -0
- package/dist/utils/media/validation.js.map +1 -0
- package/dist/utils/migration/index.d.ts +3 -0
- package/dist/utils/migration/index.js +3 -0
- package/dist/utils/migration/index.js.map +1 -0
- package/dist/utils/migration/jobCrud.d.ts +4 -0
- package/dist/utils/migration/jobCrud.js +380 -0
- package/dist/utils/migration/jobCrud.js.map +1 -0
- package/dist/utils/migration/orchestrator.d.ts +5 -0
- package/dist/utils/migration/orchestrator.js +756 -0
- package/dist/utils/migration/orchestrator.js.map +1 -0
- package/dist/utils/types.d.ts +201 -0
- package/dist/utils/types.js +14 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/wordpress/client.d.ts +61 -0
- package/dist/utils/wordpress/client.js +365 -0
- package/dist/utils/wordpress/client.js.map +1 -0
- package/dist/utils/wordpress/index.d.ts +2 -0
- package/dist/utils/wordpress/index.js +2 -0
- package/dist/utils/wordpress/index.js.map +1 -0
- package/dist/utils/wordpressApi.d.ts +11 -0
- package/dist/utils/wordpressApi.js +25 -0
- package/dist/utils/wordpressApi.js.map +1 -0
- package/package.json +155 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { JobActionButtons } from './JobActionButtons.js';
|
|
4
|
+
import styles from '../MigrationDashboardClient.module.css';
|
|
5
|
+
|
|
6
|
+
const JobsTable = ({ jobs, loading, onJobAction })=>{
|
|
7
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
8
|
+
className: styles.recentJobs,
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ jsx("h3", {
|
|
11
|
+
children: "Recent Migration Jobs"
|
|
12
|
+
}),
|
|
13
|
+
/*#__PURE__*/ jsx("div", {
|
|
14
|
+
className: styles.jobsTable,
|
|
15
|
+
children: /*#__PURE__*/ jsxs("table", {
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx("thead", {
|
|
18
|
+
children: /*#__PURE__*/ jsxs("tr", {
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ jsx("th", {
|
|
21
|
+
children: "Job Name"
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx("th", {
|
|
24
|
+
children: "Status"
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ jsx("th", {
|
|
27
|
+
children: "Items"
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ jsx("th", {
|
|
30
|
+
children: "Success Rate"
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ jsx("th", {
|
|
33
|
+
children: "Actions"
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsx("tbody", {
|
|
39
|
+
children: jobs?.map((job)=>{
|
|
40
|
+
const successRate = job.progress.processedItems > 0 ? job.progress.successfulItems / job.progress.processedItems * 100 : 0;
|
|
41
|
+
return /*#__PURE__*/ jsxs("tr", {
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ jsx("td", {
|
|
44
|
+
children: job.jobName
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ jsx("td", {
|
|
47
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
48
|
+
className: `${styles.statusBadge} ${styles[job.status]}`,
|
|
49
|
+
children: job.status
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ jsxs("td", {
|
|
53
|
+
children: [
|
|
54
|
+
job.progress.processedItems,
|
|
55
|
+
"/",
|
|
56
|
+
job.progress.totalItems
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ jsxs("td", {
|
|
60
|
+
children: [
|
|
61
|
+
successRate.toFixed(1),
|
|
62
|
+
"%"
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ jsx("td", {
|
|
66
|
+
children: /*#__PURE__*/ jsx(JobActionButtons, {
|
|
67
|
+
jobId: job.id,
|
|
68
|
+
loading: loading,
|
|
69
|
+
onAction: onJobAction,
|
|
70
|
+
status: job.status,
|
|
71
|
+
successRate: successRate
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
}, job.id);
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export { JobsTable };
|
|
86
|
+
//# sourceMappingURL=JobsTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JobsTable.js","sources":["../../../src/components/dashboard/JobsTable.tsx"],"sourcesContent":["'use client'\n\nimport { JobActionButtons } from './JobActionButtons'\nimport type { JobActionType, MigrationSummary } from './types'\n\nimport styles from '../MigrationDashboardClient.module.css'\n\nexport const JobsTable = ({\n jobs,\n loading,\n onJobAction,\n}: {\n jobs: MigrationSummary['recentJobs']\n loading: boolean\n onJobAction: (action: JobActionType, jobId: string) => Promise<void>\n}) => {\n return (\n <div className={styles.recentJobs}>\n <h3>Recent Migration Jobs</h3>\n <div className={styles.jobsTable}>\n <table>\n <thead>\n <tr>\n <th>Job Name</th>\n <th>Status</th>\n <th>Items</th>\n <th>Success Rate</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {jobs?.map((job) => {\n const successRate =\n job.progress.processedItems > 0\n ? (job.progress.successfulItems / job.progress.processedItems) * 100\n : 0\n\n return (\n <tr key={job.id}>\n <td>{job.jobName}</td>\n <td>\n <span className={`${styles.statusBadge} ${styles[job.status]}`}>\n {job.status}\n </span>\n </td>\n <td>\n {job.progress.processedItems}/{job.progress.totalItems}\n </td>\n <td>{successRate.toFixed(1)}%</td>\n <td>\n <JobActionButtons\n jobId={job.id}\n loading={loading}\n onAction={onJobAction}\n status={job.status}\n successRate={successRate}\n />\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n </div>\n )\n}\n"],"names":["className","jobs","job","successRate","jobId","status"],"mappings":";;;;;AAOO;AASL;AACOA;;;AACC;;;AACCA;AACH;;;AAEI;;;AACM;;;AACA;;;AACA;;;AACA;;;AACA;;;;;;AAILC;AACC;AAKA;;;AAESC;;;AAEH;;AACGA;;;;;;AAI0B;;;;;;AAE1BC;AAAuB;;;;AAE1B;AACEC;;;AAGAC;;;;;AAhBGH;AAsBb;;;;;;;AAMZ;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import styles from '../MigrationDashboardClient.module.css';
|
|
4
|
+
|
|
5
|
+
const LogViewer = ({ logs })=>{
|
|
6
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
7
|
+
className: styles.migrationLogs,
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx("div", {
|
|
10
|
+
style: {
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
display: 'flex',
|
|
13
|
+
justifyContent: 'space-between',
|
|
14
|
+
marginBottom: '10px'
|
|
15
|
+
},
|
|
16
|
+
children: /*#__PURE__*/ jsx("h3", {
|
|
17
|
+
children: "Migration Logs"
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
/*#__PURE__*/ jsx("div", {
|
|
21
|
+
className: styles.logsContainer,
|
|
22
|
+
children: /*#__PURE__*/ jsx("textarea", {
|
|
23
|
+
className: styles.logsTextarea,
|
|
24
|
+
placeholder: "Migration logs will appear here...",
|
|
25
|
+
readOnly: true,
|
|
26
|
+
rows: 10,
|
|
27
|
+
value: logs.join('\n')
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { LogViewer };
|
|
35
|
+
//# sourceMappingURL=LogViewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogViewer.js","sources":["../../../src/components/dashboard/LogViewer.tsx"],"sourcesContent":["'use client'\n\nimport styles from '../MigrationDashboardClient.module.css'\n\nexport const LogViewer = ({ logs }: { logs: string[] }) => {\n return (\n <div className={styles.migrationLogs}>\n <div\n style={{\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n marginBottom: '10px',\n }}\n >\n <h3>Migration Logs</h3>\n </div>\n <div className={styles.logsContainer}>\n <textarea\n className={styles.logsTextarea}\n placeholder=\"Migration logs will appear here...\"\n readOnly\n rows={10}\n value={logs.join('\\n')}\n />\n </div>\n </div>\n )\n}\n"],"names":["className"],"mappings":";;;;AAIO;AACL;AACOA;;;;;;;;AAOD;AAEA;AAAI;;;;AAEDA;AACH;AACEA;;;;;;;;;AASV;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SiteConfigState, WordPressSiteConfig } from './types';
|
|
2
|
+
export declare const SiteConfigPanel: ({ configState, loading, onCancel, onConfigChange, onEdit, onSave, onToggle, showSiteConfig, siteConfig, }: {
|
|
3
|
+
configState: SiteConfigState;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
onConfigChange: (field: keyof WordPressSiteConfig, value: string) => void;
|
|
7
|
+
onEdit: () => void;
|
|
8
|
+
onSave: () => void;
|
|
9
|
+
onToggle: () => void;
|
|
10
|
+
showSiteConfig: boolean;
|
|
11
|
+
siteConfig: WordPressSiteConfig;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import styles from '../MigrationDashboardClient.module.css';
|
|
4
|
+
|
|
5
|
+
const SiteConfigPanel = ({ configState, loading, onCancel, onConfigChange, onEdit, onSave, onToggle, showSiteConfig, siteConfig })=>{
|
|
6
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
7
|
+
className: styles.siteConfigSection,
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsxs("div", {
|
|
10
|
+
className: styles.siteConfigHeader,
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx("h2", {
|
|
13
|
+
children: "WordPress Site Configuration"
|
|
14
|
+
}),
|
|
15
|
+
/*#__PURE__*/ jsx("button", {
|
|
16
|
+
className: styles.toggleButton,
|
|
17
|
+
onClick: onToggle,
|
|
18
|
+
children: showSiteConfig ? 'Hide Configuration' : 'Show Configuration'
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
}),
|
|
22
|
+
showSiteConfig && /*#__PURE__*/ jsxs("div", {
|
|
23
|
+
className: styles.siteConfigForm,
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ jsxs("div", {
|
|
26
|
+
className: styles.formGrid,
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ jsxs("div", {
|
|
29
|
+
className: styles.formGroup,
|
|
30
|
+
children: [
|
|
31
|
+
/*#__PURE__*/ jsx("label", {
|
|
32
|
+
htmlFor: "siteName",
|
|
33
|
+
children: "Site Name"
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ jsx("input", {
|
|
36
|
+
disabled: !configState.isEditing,
|
|
37
|
+
id: "siteName",
|
|
38
|
+
onChange: (e)=>onConfigChange('siteName', e.target.value),
|
|
39
|
+
placeholder: "My WordPress Site",
|
|
40
|
+
type: "text",
|
|
41
|
+
value: siteConfig.siteName
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ jsxs("div", {
|
|
46
|
+
className: styles.formGroup,
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ jsx("label", {
|
|
49
|
+
htmlFor: "wpSiteUrl",
|
|
50
|
+
children: "WordPress Site URL"
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ jsx("input", {
|
|
53
|
+
disabled: !configState.isEditing,
|
|
54
|
+
id: "wpSiteUrl",
|
|
55
|
+
onChange: (e)=>onConfigChange('wpSiteUrl', e.target.value),
|
|
56
|
+
placeholder: "https://example.com",
|
|
57
|
+
type: "url",
|
|
58
|
+
value: siteConfig.wpSiteUrl
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ jsx("small", {
|
|
61
|
+
children: "Base URL of your WordPress site"
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ jsxs("div", {
|
|
66
|
+
className: styles.formGroup,
|
|
67
|
+
children: [
|
|
68
|
+
/*#__PURE__*/ jsx("label", {
|
|
69
|
+
htmlFor: "wpUsername",
|
|
70
|
+
children: "WordPress Username"
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ jsx("input", {
|
|
73
|
+
disabled: !configState.isEditing,
|
|
74
|
+
id: "wpUsername",
|
|
75
|
+
onChange: (e)=>onConfigChange('wpUsername', e.target.value),
|
|
76
|
+
placeholder: "admin",
|
|
77
|
+
type: "text",
|
|
78
|
+
value: siteConfig.wpUsername
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ jsxs("div", {
|
|
83
|
+
className: styles.formGroup,
|
|
84
|
+
children: [
|
|
85
|
+
/*#__PURE__*/ jsx("label", {
|
|
86
|
+
htmlFor: "wpPassword",
|
|
87
|
+
children: "Application Password"
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ jsx("input", {
|
|
90
|
+
disabled: !configState.isEditing,
|
|
91
|
+
id: "wpPassword",
|
|
92
|
+
onChange: (e)=>onConfigChange('wpPassword', e.target.value),
|
|
93
|
+
placeholder: "xxxx xxxx xxxx xxxx",
|
|
94
|
+
type: "password",
|
|
95
|
+
value: siteConfig.wpPassword
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ jsx("small", {
|
|
98
|
+
children: "WordPress Application Password for REST API access"
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ jsxs("div", {
|
|
105
|
+
className: styles.configActions,
|
|
106
|
+
children: [
|
|
107
|
+
/*#__PURE__*/ jsx("div", {
|
|
108
|
+
className: styles.connectionStatus,
|
|
109
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
110
|
+
className: styles.statusIndicator,
|
|
111
|
+
children: [
|
|
112
|
+
/*#__PURE__*/ jsx("span", {
|
|
113
|
+
className: `${styles.statusDot} ${styles[siteConfig.connectionStatus]}`
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ jsxs("span", {
|
|
116
|
+
className: styles.statusText,
|
|
117
|
+
children: [
|
|
118
|
+
siteConfig.connectionStatus === 'not-scanned' && 'Not Scanned',
|
|
119
|
+
siteConfig.connectionStatus === 'scanned' && siteConfig.discoveredContent && siteConfig.discoveredContent.length > 0 && /*#__PURE__*/ jsxs("div", {
|
|
120
|
+
className: styles.discoveredContent,
|
|
121
|
+
children: [
|
|
122
|
+
/*#__PURE__*/ jsxs("div", {
|
|
123
|
+
className: styles.discoveredHeader,
|
|
124
|
+
children: [
|
|
125
|
+
/*#__PURE__*/ jsxs("h4", {
|
|
126
|
+
children: [
|
|
127
|
+
"Available Content (",
|
|
128
|
+
siteConfig.totalItems,
|
|
129
|
+
" total items)"
|
|
130
|
+
]
|
|
131
|
+
}),
|
|
132
|
+
/*#__PURE__*/ jsx("small", {
|
|
133
|
+
children: "Ready for migration"
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ jsx("div", {
|
|
138
|
+
className: styles.contentList,
|
|
139
|
+
children: siteConfig.discoveredContent.map((content)=>/*#__PURE__*/ jsxs("div", {
|
|
140
|
+
className: styles.contentItem,
|
|
141
|
+
children: [
|
|
142
|
+
/*#__PURE__*/ jsxs("span", {
|
|
143
|
+
className: styles.contentLabel,
|
|
144
|
+
children: [
|
|
145
|
+
content.label,
|
|
146
|
+
":"
|
|
147
|
+
]
|
|
148
|
+
}),
|
|
149
|
+
/*#__PURE__*/ jsxs("span", {
|
|
150
|
+
className: styles.contentCount,
|
|
151
|
+
children: [
|
|
152
|
+
content.count,
|
|
153
|
+
" items"
|
|
154
|
+
]
|
|
155
|
+
}),
|
|
156
|
+
content.custom && /*#__PURE__*/ jsx("span", {
|
|
157
|
+
className: styles.customBadge,
|
|
158
|
+
children: "Custom"
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}, content.type))
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
}),
|
|
165
|
+
siteConfig.connectionStatus === 'scanned' && 'Content Discovered',
|
|
166
|
+
siteConfig.connectionStatus === 'failed' && 'Scan Failed'
|
|
167
|
+
]
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
})
|
|
171
|
+
}),
|
|
172
|
+
/*#__PURE__*/ jsx("div", {
|
|
173
|
+
className: styles.formActions,
|
|
174
|
+
children: configState.isEditing ? /*#__PURE__*/ jsxs(Fragment, {
|
|
175
|
+
children: [
|
|
176
|
+
/*#__PURE__*/ jsx("button", {
|
|
177
|
+
className: styles.saveButton,
|
|
178
|
+
disabled: loading,
|
|
179
|
+
onClick: onSave,
|
|
180
|
+
children: "Save Configuration"
|
|
181
|
+
}),
|
|
182
|
+
configState.isSaved && /*#__PURE__*/ jsx("button", {
|
|
183
|
+
className: styles.cancelButton,
|
|
184
|
+
disabled: loading,
|
|
185
|
+
onClick: onCancel,
|
|
186
|
+
children: "Cancel"
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
}) : /*#__PURE__*/ jsx("button", {
|
|
190
|
+
className: styles.editButton,
|
|
191
|
+
disabled: loading,
|
|
192
|
+
onClick: onEdit,
|
|
193
|
+
children: "Edit Configuration"
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export { SiteConfigPanel };
|
|
205
|
+
//# sourceMappingURL=SiteConfigPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteConfigPanel.js","sources":["../../../src/components/dashboard/SiteConfigPanel.tsx"],"sourcesContent":["'use client'\n\nimport type { SiteConfigState, WordPressSiteConfig } from './types'\n\nimport styles from '../MigrationDashboardClient.module.css'\n\nexport const SiteConfigPanel = ({\n configState,\n loading,\n onCancel,\n onConfigChange,\n onEdit,\n onSave,\n onToggle,\n showSiteConfig,\n siteConfig,\n}: {\n configState: SiteConfigState\n loading: boolean\n onCancel: () => void\n onConfigChange: (field: keyof WordPressSiteConfig, value: string) => void\n onEdit: () => void\n onSave: () => void\n onToggle: () => void\n showSiteConfig: boolean\n siteConfig: WordPressSiteConfig\n}) => {\n return (\n <div className={styles.siteConfigSection}>\n <div className={styles.siteConfigHeader}>\n <h2>WordPress Site Configuration</h2>\n <button className={styles.toggleButton} onClick={onToggle}>\n {showSiteConfig ? 'Hide Configuration' : 'Show Configuration'}\n </button>\n </div>\n\n {showSiteConfig && (\n <div className={styles.siteConfigForm}>\n <div className={styles.formGrid}>\n <div className={styles.formGroup}>\n <label htmlFor=\"siteName\">Site Name</label>\n <input\n disabled={!configState.isEditing}\n id=\"siteName\"\n onChange={(e) => onConfigChange('siteName', e.target.value)}\n placeholder=\"My WordPress Site\"\n type=\"text\"\n value={siteConfig.siteName}\n />\n </div>\n\n <div className={styles.formGroup}>\n <label htmlFor=\"wpSiteUrl\">WordPress Site URL</label>\n <input\n disabled={!configState.isEditing}\n id=\"wpSiteUrl\"\n onChange={(e) => onConfigChange('wpSiteUrl', e.target.value)}\n placeholder=\"https://example.com\"\n type=\"url\"\n value={siteConfig.wpSiteUrl}\n />\n <small>Base URL of your WordPress site</small>\n </div>\n\n <div className={styles.formGroup}>\n <label htmlFor=\"wpUsername\">WordPress Username</label>\n <input\n disabled={!configState.isEditing}\n id=\"wpUsername\"\n onChange={(e) => onConfigChange('wpUsername', e.target.value)}\n placeholder=\"admin\"\n type=\"text\"\n value={siteConfig.wpUsername}\n />\n </div>\n\n <div className={styles.formGroup}>\n <label htmlFor=\"wpPassword\">Application Password</label>\n <input\n disabled={!configState.isEditing}\n id=\"wpPassword\"\n onChange={(e) => onConfigChange('wpPassword', e.target.value)}\n placeholder=\"xxxx xxxx xxxx xxxx\"\n type=\"password\"\n value={siteConfig.wpPassword}\n />\n <small>WordPress Application Password for REST API access</small>\n </div>\n </div>\n\n <div className={styles.configActions}>\n <div className={styles.connectionStatus}>\n <div className={styles.statusIndicator}>\n <span className={`${styles.statusDot} ${styles[siteConfig.connectionStatus]}`} />\n <span className={styles.statusText}>\n {siteConfig.connectionStatus === 'not-scanned' && 'Not Scanned'}\n {siteConfig.connectionStatus === 'scanned' &&\n siteConfig.discoveredContent &&\n siteConfig.discoveredContent.length > 0 && (\n <div className={styles.discoveredContent}>\n <div className={styles.discoveredHeader}>\n <h4>Available Content ({siteConfig.totalItems} total items)</h4>\n <small>Ready for migration</small>\n </div>\n <div className={styles.contentList}>\n {siteConfig.discoveredContent.map((content) => (\n <div className={styles.contentItem} key={content.type}>\n <span className={styles.contentLabel}>{content.label}:</span>\n <span className={styles.contentCount}>{content.count} items</span>\n {content.custom && (\n <span className={styles.customBadge}>Custom</span>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n {siteConfig.connectionStatus === 'scanned' && 'Content Discovered'}\n {siteConfig.connectionStatus === 'failed' && 'Scan Failed'}\n </span>\n </div>\n </div>\n\n <div className={styles.formActions}>\n {configState.isEditing ? (\n <>\n <button\n className={styles.saveButton}\n disabled={loading}\n onClick={onSave}\n >\n Save Configuration\n </button>\n {configState.isSaved && (\n <button\n className={styles.cancelButton}\n disabled={loading}\n onClick={onCancel}\n >\n Cancel\n </button>\n )}\n </>\n ) : (\n <button\n className={styles.editButton}\n disabled={loading}\n onClick={onEdit}\n >\n Edit Configuration\n </button>\n )}\n </div>\n </div>\n </div>\n )}\n </div>\n )\n}\n"],"names":["className","showSiteConfig","onChange","value","siteConfig","content","configState"],"mappings":";;;;AAMO;AAqBL;AACOA;;;AACEA;;;AACC;;;AACIA;;AACLC;;;;AAIJA;AACMD;;;AACEA;;;AACEA;;;;AACuB;;;;;AAIxBE;;;AAGAC;;;;;AAICH;;;;AACwB;;;;;AAIzBE;;;AAGAC;;;AAEK;;;;;AAGJH;;;;AACyB;;;;;AAI1BE;;;AAGAC;;;;;AAICH;;;;AACyB;;;;;AAI1BE;;;AAGAC;;;AAEK;;;;;;;AAINH;;;AACEA;AACH;AAAKA;;;;;;AAEGA;;;AAEHI;AAGQJ;;;AACEA;;;;AACC;AAAoBI;AAAsB;;;;AACvC;;;;;AAEJJ;AACFI;AACMJ;;;AACGA;;AAAiCK;AAAc;;;;AAC/CL;;AAAiCK;AAAc;;;;AAE7CL;AAA+B;;;AAJAK;;;;;;;;;;;;AAiBpDL;AACFM;;;AAGKN;;;AAGD;;;AAKGA;;;AAGD;;;;AAOHA;;;AAGD;;;;;;;;;AAUjB;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import styles from '../MigrationDashboardClient.module.css';
|
|
4
|
+
|
|
5
|
+
const StatsOverview = ({ siteConfig, summary })=>{
|
|
6
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
7
|
+
className: styles.statsGrid,
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsxs("div", {
|
|
10
|
+
className: styles.statCard,
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx("h3", {
|
|
13
|
+
children: "Site Configured"
|
|
14
|
+
}),
|
|
15
|
+
/*#__PURE__*/ jsx("p", {
|
|
16
|
+
className: styles.statValue,
|
|
17
|
+
children: siteConfig.connectionStatus !== 'scanned' && '✗ No'
|
|
18
|
+
}),
|
|
19
|
+
siteConfig.connectionStatus === 'scanned' && siteConfig.discoveredContent && /*#__PURE__*/ jsxs("small", {
|
|
20
|
+
className: styles.statDetail,
|
|
21
|
+
children: [
|
|
22
|
+
siteConfig.discoveredContent.length,
|
|
23
|
+
" content types",
|
|
24
|
+
/*#__PURE__*/ jsx("br", {}),
|
|
25
|
+
siteConfig.totalItems,
|
|
26
|
+
" items"
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ jsxs("div", {
|
|
32
|
+
className: styles.statCard,
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ jsx("h3", {
|
|
35
|
+
children: "Total Jobs"
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ jsx("p", {
|
|
38
|
+
className: styles.statValue,
|
|
39
|
+
children: summary.totalJobs || 0
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ jsxs("div", {
|
|
44
|
+
className: styles.statCard,
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ jsx("h3", {
|
|
47
|
+
children: "Active Jobs"
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ jsx("p", {
|
|
50
|
+
className: `${styles.statValue} ${(summary.activeJobs || 0) > 0 ? styles.active : ''}`,
|
|
51
|
+
children: summary.activeJobs || 0
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ jsxs("div", {
|
|
56
|
+
className: styles.statCard,
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ jsx("h3", {
|
|
59
|
+
children: "Items Migrated"
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ jsx("p", {
|
|
62
|
+
className: styles.statValue,
|
|
63
|
+
children: (summary.totalItemsMigrated || 0).toLocaleString()
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { StatsOverview };
|
|
72
|
+
//# sourceMappingURL=StatsOverview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatsOverview.js","sources":["../../../src/components/dashboard/StatsOverview.tsx"],"sourcesContent":["'use client'\n\nimport type { MigrationSummary, WordPressSiteConfig } from './types'\n\nimport styles from '../MigrationDashboardClient.module.css'\n\nexport const StatsOverview = ({\n siteConfig,\n summary,\n}: {\n siteConfig: WordPressSiteConfig\n summary: MigrationSummary\n}) => {\n return (\n <div className={styles.statsGrid}>\n <div className={styles.statCard}>\n <h3>Site Configured</h3>\n <p className={styles.statValue}>{siteConfig.connectionStatus !== 'scanned' && '✗ No'}</p>\n {siteConfig.connectionStatus === 'scanned' && siteConfig.discoveredContent && (\n <small className={styles.statDetail}>\n {siteConfig.discoveredContent.length} content types\n <br />\n {siteConfig.totalItems} items\n </small>\n )}\n </div>\n <div className={styles.statCard}>\n <h3>Total Jobs</h3>\n <p className={styles.statValue}>{summary.totalJobs || 0}</p>\n </div>\n <div className={styles.statCard}>\n <h3>Active Jobs</h3>\n <p\n className={`${styles.statValue} ${(summary.activeJobs || 0) > 0 ? styles.active : ''}`}\n >\n {summary.activeJobs || 0}\n </p>\n </div>\n <div className={styles.statCard}>\n <h3>Items Migrated</h3>\n <p className={styles.statValue}>{(summary.totalItemsMigrated || 0).toLocaleString()}</p>\n </div>\n </div>\n )\n}\n"],"names":["className","siteConfig","summary"],"mappings":";;;;;AAaE;AACOA;;;AACEA;;;AACC;;;AACDA;;;AACFC;AACQD;;;AACgC;;AAEpCC;AAAsB;;;;;;AAIxBD;;;AACC;;;AACDA;AAA8BE;;;;;AAE9BF;;;AACC;;;AAEFA;AAECE;;;;;AAGAF;;;AACC;;;AACDA;AAA8B;;;;;;AAIzC;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { JobActionButtons } from './JobActionButtons';
|
|
2
|
+
export { JobsTable } from './JobsTable';
|
|
3
|
+
export { LogViewer } from './LogViewer';
|
|
4
|
+
export { SiteConfigPanel } from './SiteConfigPanel';
|
|
5
|
+
export { StatsOverview } from './StatsOverview';
|
|
6
|
+
export { useMigrationDashboard } from './useMigrationDashboard';
|
|
7
|
+
export type { ContentType, JobActionType, MigrationSummary, SiteConfigState, WordPressSiteConfig, } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { JobActionButtons } from './JobActionButtons.js';
|
|
2
|
+
export { JobsTable } from './JobsTable.js';
|
|
3
|
+
export { LogViewer } from './LogViewer.js';
|
|
4
|
+
export { SiteConfigPanel } from './SiteConfigPanel.js';
|
|
5
|
+
export { StatsOverview } from './StatsOverview.js';
|
|
6
|
+
export { useMigrationDashboard } from './useMigrationDashboard.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type MigrationSummary = {
|
|
2
|
+
activeJobs: number;
|
|
3
|
+
completedJobs: number;
|
|
4
|
+
recentJobs: Array<{
|
|
5
|
+
createdAt: string;
|
|
6
|
+
id: string;
|
|
7
|
+
jobName: string;
|
|
8
|
+
progress: {
|
|
9
|
+
processedItems: number;
|
|
10
|
+
successfulItems: number;
|
|
11
|
+
totalItems: number;
|
|
12
|
+
};
|
|
13
|
+
status: string;
|
|
14
|
+
}>;
|
|
15
|
+
recentLogs?: Array<{
|
|
16
|
+
jobName: string;
|
|
17
|
+
level: string;
|
|
18
|
+
message: string;
|
|
19
|
+
timestamp: Date;
|
|
20
|
+
}>;
|
|
21
|
+
totalItemsMigrated: number;
|
|
22
|
+
totalJobs: number;
|
|
23
|
+
totalSites: number;
|
|
24
|
+
};
|
|
25
|
+
export type ContentType = {
|
|
26
|
+
available: boolean;
|
|
27
|
+
count: number;
|
|
28
|
+
custom?: boolean;
|
|
29
|
+
label: string;
|
|
30
|
+
restBase?: string;
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
export type WordPressSiteConfig = {
|
|
34
|
+
connectionStatus: 'failed' | 'not-scanned' | 'scanned' | 'scanning';
|
|
35
|
+
discoveredContent?: ContentType[];
|
|
36
|
+
siteName: string;
|
|
37
|
+
totalItems?: number;
|
|
38
|
+
wpPassword: string;
|
|
39
|
+
wpSiteUrl: string;
|
|
40
|
+
wpUsername: string;
|
|
41
|
+
};
|
|
42
|
+
export type SiteConfigState = {
|
|
43
|
+
isEditing: boolean;
|
|
44
|
+
isSaved: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type JobActionType = 'pause' | 'restart' | 'resume' | 'retry' | 'rollback' | 'start' | 'update';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JobActionType, MigrationSummary, SiteConfigState, WordPressSiteConfig } from './types';
|
|
2
|
+
export declare const useMigrationDashboard: (initialSummary: MigrationSummary) => {
|
|
3
|
+
configState: SiteConfigState;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
showSiteConfig: boolean;
|
|
6
|
+
siteConfig: WordPressSiteConfig;
|
|
7
|
+
summary: MigrationSummary;
|
|
8
|
+
handleCancelEdit: () => void;
|
|
9
|
+
handleEditConfig: () => void;
|
|
10
|
+
handleSaveConfig: () => Promise<void>;
|
|
11
|
+
handleSiteConfigChange: (field: keyof WordPressSiteConfig, value: string) => void;
|
|
12
|
+
setShowSiteConfig: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
13
|
+
handleJobAction: (action: JobActionType, jobId: string) => Promise<void>;
|
|
14
|
+
getAllLogs: () => string[];
|
|
15
|
+
};
|