feat(pkg): Add hda-cms-extension
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,2 +1,9 @@
|
||||
node_modules
|
||||
dist
|
||||
|
||||
# Playwright
|
||||
.playwright/
|
||||
playwright/
|
||||
test-results/
|
||||
playwright-report/
|
||||
blob-report/
|
||||
|
||||
1
cog.toml
1
cog.toml
@@ -37,3 +37,4 @@ authors = [
|
||||
[bump_profiles]
|
||||
|
||||
[packages]
|
||||
hda-cms-extension = { path = "packages/hda-cms-extension" }
|
||||
|
||||
45
packages/hda-cms-extension/package.json
Normal file
45
packages/hda-cms-extension/package.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@tabshift/hda-cms-extension",
|
||||
"description": "CMS exension of Haus der Akademien",
|
||||
"icon": "extension",
|
||||
"version": "1.0.0",
|
||||
"keywords": [
|
||||
"directus",
|
||||
"directus-extension",
|
||||
"directus-extension-bundle"
|
||||
],
|
||||
"type": "module",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"directus:extension": {
|
||||
"type": "bundle",
|
||||
"path": {
|
||||
"app": "dist/app.js",
|
||||
"api": "dist/api.js"
|
||||
},
|
||||
"entries": [
|
||||
{
|
||||
"type": "operation",
|
||||
"name": "Antrago FTP Import",
|
||||
"source": {
|
||||
"app": "src/antrago-ftp-import/app.ts",
|
||||
"api": "src/antrago-ftp-import/api.ts"
|
||||
}
|
||||
}
|
||||
],
|
||||
"host": "^10.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "directus-extension build",
|
||||
"dev": "directus-extension build -w --no-minify",
|
||||
"link": "directus-extension link",
|
||||
"add": "directus-extension add"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@directus/extensions-sdk": "13.0.1",
|
||||
"@types/node": "^22.13.4",
|
||||
"@tabshift/typescript-config": "latest",
|
||||
"typescript": "^5.7.3"
|
||||
}
|
||||
}
|
||||
12
packages/hda-cms-extension/src/antrago-ftp-import/api.ts
Normal file
12
packages/hda-cms-extension/src/antrago-ftp-import/api.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { defineOperationApi } from '@directus/extensions-sdk';
|
||||
|
||||
type Options = {
|
||||
text: string;
|
||||
};
|
||||
|
||||
export default defineOperationApi<Options>({
|
||||
id: 'custom',
|
||||
handler: ({ text }) => {
|
||||
console.log(text);
|
||||
},
|
||||
});
|
||||
52
packages/hda-cms-extension/src/antrago-ftp-import/app.ts
Normal file
52
packages/hda-cms-extension/src/antrago-ftp-import/app.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { defineOperationApp } from '@directus/extensions-sdk'
|
||||
import { i18n } from '@app:lang'
|
||||
import deLang from './i18n/de-DE.json'
|
||||
import enLang from './i18n/en-US.json'
|
||||
|
||||
i18n.global.mergeLocaleMessage('en-US', { directusextensionshda: { ...enLang } })
|
||||
i18n.global.mergeLocaleMessage('de-DE', { directusextensionshda: { ...deLang } })
|
||||
|
||||
export default defineOperationApp({
|
||||
id: 'tabshift-hda-antrago-import',
|
||||
name: '$t:directusextensionshda.name',
|
||||
icon: 'settings_system_daydream',
|
||||
description: '$t:directusextensionshda.description',
|
||||
overview: ({ ftp_server, ftp_user }) => [
|
||||
{
|
||||
label: 'FTP',
|
||||
text: `${ftp_user}@${ftp_server}`
|
||||
}
|
||||
],
|
||||
options: [
|
||||
{
|
||||
field: 'ftp_server',
|
||||
name: '$t:directusextensionshda.options.ftpserver.name',
|
||||
type: 'string',
|
||||
meta: {
|
||||
width: 'full',
|
||||
interface: 'input'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'ftp_user',
|
||||
name: '$t:directusextensionshda.options.ftpuser.name',
|
||||
type: 'string',
|
||||
meta: {
|
||||
width: 'half',
|
||||
interface: 'input'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'ftp_password',
|
||||
name: '$t:directusextensionshda.options.ftppassword.name',
|
||||
type: 'string',
|
||||
meta: {
|
||||
width: 'half',
|
||||
interface: 'input',
|
||||
options: {
|
||||
masked: true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "Antrago FTP Importierer",
|
||||
"description": "Importiert Antrago Seminare vom FTP server.",
|
||||
"options": {
|
||||
"ftpserver": {
|
||||
"name": "FTP Server"
|
||||
},
|
||||
"ftpuser": {
|
||||
"name": "FTP Benutzername"
|
||||
},
|
||||
"ftppassword": {
|
||||
"name": "FTP Passwort"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "Antrago FTP Importer",
|
||||
"description": "Import Antrago data from FTP server.",
|
||||
"options": {
|
||||
"ftpserver": {
|
||||
"name": "FTP Server"
|
||||
},
|
||||
"ftpuser": {
|
||||
"name": "FTP Username"
|
||||
},
|
||||
"ftppassword": {
|
||||
"name": "FTP Password"
|
||||
}
|
||||
}
|
||||
}
|
||||
5
packages/hda-cms-extension/src/antrago-ftp-import/shims.d.ts
vendored
Normal file
5
packages/hda-cms-extension/src/antrago-ftp-import/shims.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
declare module '*.vue' {
|
||||
import { DefineComponent } from 'vue';
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
10
packages/hda-cms-extension/tsconfig.json
Normal file
10
packages/hda-cms-extension/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "@tabshift/typescript-config/base.json",
|
||||
"exclude": ["tests", "**/*.spec.ts", "node_modules"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
3636
pnpm-lock.yaml
generated
3636
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user