![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
create-dfxk-admin-app
Advanced tools
npx create-dfxk-admin-app my-app
cd my-app
npm start
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
Then open http://localhost:8000 to see your app. When you’re ready to deploy to production, create a minified bundle with npm run build.
├── Dockerfile docker镜像构建文件
├── README.md
├── docker-compose.yml docker-compose配置示例
├── pm2.json 生产环境pm2配置
├── proxy.config.js 开发环境api代理配置
├── public
│ └── index.html
├── server 生成环境前端代理服务
│ ├── package.json
│ └── server.js
├── src 源代码
│ ├── app.less 公共样式
│ ├── components 组件库
│ ├── containers 容器(渲染层)
│ │ └── package.json
│ ├── custom.d.ts 自定义typescript定义文件
│ ├── entry.config.ts 入口配置
│ ├── models model(数据层)
│ │ ├── index.tsx 在这里加载非异步的model
│ │ └── package.json
│ └── util 工具库
│ └── package.json
├── .adminrc.js dfxk-admin-build-dev配置
├── .webpackrc.js webpack配置
├── .gitlab-ci.yml gitlab ci配置
├── tsconfig.json typescript配置
└── tslint.json tslint配置
主要开发集中在 containers
和 models
里面,通常一个页面由一个容器和一个model组成。
containers
下的文件结构要跟路由一致
路由:
/system/user
容器目录:
├── containers
│ └── System
│ └── User
│ ├── EditUser /system/user的子页面
│ │ └── index.tsx
└── └── index.tsx
/System/User/index.tsx
示例:
import * as React from 'react';
import BasicComponent from 'dfxk-admin-tools/lib/components/BasicComponent';
import { injectNormal } from 'dfxk-admin-tools/lib/util/inject';
import model, { UserState } from 'models/system/user';
export interface UserProps {
data: UserState;
dataActions: typeof model.actions;
dataApiActions: typeof model.apiActions;
}
class User extends BasicComponent<UserProps, any> {
render() {
return (
<div>
User
</div>
);
}
}
export default injectNormal(User, {
data: require('models/system/user'),
});
model
是action、saga和reducer的集合,使用 tt-admin-tools 提供的工具快速创建。
npx tt-admin-tools model /system/user
user model 示例:
import model{ ApiConfig } from '@dfxk/luna/model';
export let keys = {
changeName: 'changeName',
};
export let apis = {
getName: 'getName',
};
export let apiConfigs: ApiConfig[] = [{
path: '/getName',
actionName: apis.getName,
}];
export interface UserState {
loading: boolean;
}
const userModel = model<typeof keys, typeof apis>({
modelName: 'user',
actionKeys: keys,
api: {
basePath: '/api',
config: apiConfigs,
},
reducer: ({ apiActionNames, createReducer }) => {
return createReducer<UserState, any>({
[apiActionNames.getName.request](state, action) {
return {
...state,
loading: true,
};
},
[apiActionNames.getName.success](state, action) {
return {
...state,
loading: false,
};
},
[apiActionNames.getName.error](state, action) {
return {
...state,
loading: false,
};
},
}, {
loading: false,
});
},
sagas: (m) => {
return [];
},
});
export default userModel;
FAQs
create a admin app
The npm package create-dfxk-admin-app receives a total of 0 weekly downloads. As such, create-dfxk-admin-app popularity was classified as not popular.
We found that create-dfxk-admin-app demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.