Prechádzať zdrojové kódy

:fire: 废弃的前端

visuddhinanda 2 rokov pred
rodič
commit
ef8b91ca4d

+ 0 - 16
dashboard/.editorconfig

@@ -1,16 +0,0 @@
-# http://editorconfig.org
-root = true
-
-[*]
-indent_style = space
-indent_size = 2
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[*.md]
-trim_trailing_whitespace = false
-
-[Makefile]
-indent_style = tab

+ 0 - 20
dashboard/.gitignore

@@ -1,20 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/npm-debug.log*
-/yarn-error.log
-/yarn.lock
-/package-lock.json
-
-# production
-/dist
-
-# misc
-.DS_Store
-
-# umi
-/src/.umi
-/src/.umi-production
-/src/.umi-test
-/.env.local

+ 0 - 8
dashboard/.prettierignore

@@ -1,8 +0,0 @@
-**/*.md
-**/*.svg
-**/*.ejs
-**/*.html
-package.json
-.umi
-.umi-production
-.umi-test

+ 0 - 11
dashboard/.prettierrc

@@ -1,11 +0,0 @@
-{
-  "singleQuote": true,
-  "trailingComma": "all",
-  "printWidth": 80,
-  "overrides": [
-    {
-      "files": ".prettierrc",
-      "options": { "parser": "json" }
-    }
-  ]
-}

+ 0 - 10
dashboard/.umirc.ts

@@ -1,10 +0,0 @@
-import { defineConfig } from 'umi';
-
-export default defineConfig({
-	nodeModulesTransform: {
-		type: 'none',
-	},
-	base: '/',
-	fastRefresh: {},
-
-});

+ 0 - 63
dashboard/README.md

@@ -1,63 +0,0 @@
-# Usage
-
-```bash
-cd dashboard
-# install dependencies
-yarn install
-# start the dev server: http://localhost:8000/my/
-yarn start
-```
-
-## Getting Started in **7** days
-
-### Day 1: Prepare
-
-- [TypeScript for JavaScript Programmers](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
-- [Install ubuntu@wls(ONLY For Windows User)](https://ubuntu.com/wsl)
-- [Start continer](../docker)
-- 在`tmux`内练习如下命令
-
-  ```text
-  Ctrl+b %
-  Ctrl+b "
-  Ctrl+b up/down/left/right
-  ```
-
-- Start backend & frontend server
-
-### Day 2: Router & Component
-
-- 浏览器打开: `http://localhost:8000/my/demo`
-- 路由跳转(history vs Link) **pages/demo/index.tsx**
-- 组件复用: **components/demo.ts**
-- 路由参数: **pages/demo/[id]/show.tsx**
-
-### Day 3: Form
-
-- [Form](https://ant.design/components/form/), OnChange/OnSubmit events, Set/Get field value, Validator
-- [Input](https://ant.design/components/input/)
-- [Radio](https://ant.design/components/radio/)
-- [Select](https://ant.design/components/select/)
-- [Switch](https://ant.design/components/switch/)
-- [Time picker](https://ant.design/components/time-picker/)
-- [Date picker](https://ant.design/components/date-picker/)
-- [Checkbox](https://ant.design/components/checkbox/)
-- [Popconfirm](https://ant.design/components/popconfirm/)
-
-### Day 4: 常见组件
-
-- [Table](https://ant.design/components/table/#header)
-- [Menu](https://ant.design/components/menu/#header)
-- [Layout](https://ant.design/components/layout/)
-- [Grid](https://ant.design/components/grid/)
-- [Pagination](https://ant.design/components/pagination/)
-- [Message](https://ant.design/components/message/)
-- [Notification](https://ant.design/components/notification/)
-
-### Day 5: State & Fetch
-
-- Work with http rest api
-
-### Day 6: Auth
-
-### Day 7

+ 0 - 0
dashboard/mock/.gitkeep


+ 0 - 39
dashboard/package.json

@@ -1,39 +0,0 @@
-{
-  "private": true,
-  "scripts": {
-    "start": "umi dev",
-    "build": "umi build",
-    "postinstall": "umi generate tmp",
-    "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
-    "test": "umi-test",
-    "test:coverage": "umi-test --coverage"
-  },
-  "gitHooks": {
-    "pre-commit": "lint-staged"
-  },
-  "lint-staged": {
-    "*.{js,jsx,less,md,json}": [
-      "prettier --write"
-    ],
-    "*.ts?(x)": [
-      "prettier --parser=typescript --write"
-    ]
-  },
-  "dependencies": {
-    "@ant-design/pro-layout": "^6.5.0",
-    "@umijs/preset-react": "1.x",
-    "lua-in-js": "^2.2.0",
-    "umi": "^3.4.25"
-  },
-  "devDependencies": {
-    "@types/react": "^17.0.0",
-    "@types/react-dom": "^17.0.0",
-    "@umijs/test": "^3.4.25",
-    "lint-staged": "^10.0.7",
-    "prettier": "^2.2.0",
-    "react": "17.x",
-    "react-dom": "17.x",
-    "typescript": "^4.1.2",
-    "yorkie": "^2.0.0"
-  }
-}

+ 0 - 49
dashboard/src/components/chapterlistitem.tsx

@@ -1,49 +0,0 @@
-import {Link} from 'umi';
-import { Breadcrumb} from "antd";
-import { WarningOutlined,LoadingOutlined  } from '@ant-design/icons';
-import { Col, Row } from 'antd';
-
-type IWidgetChapterListItem ={
-	title: string,
-	path:string,
-	summary:string,
-	url:string,
-	like:number,
-	hit:number,
-	favorite:number,
-	watch:number,
-	created_at:string,
-	updated_at:string,
-  }
-  
-  export const ChapterListItem = (item: IWidgetChapterListItem) => {
-	let routes = new Array;
-	for (const iterator of JSON.parse(item.path)) {
-		routes.push({
-			path:'/app/article/?view=chapter&book='+iterator.book+'&par='+iterator.paragraph,
-			breadcrumbName:iterator.title,
-		}) ;
-	}
-	function itemRender(route,params,routes,paths){
-		return (
-			<Link to={route.path}>{route.breadcrumbName}</Link>
-		)
-	}
-	return (
-	  <div>
-		<Row>
-			<Col xs={24} xl={14}><Link to={item.url}>{item.title}</Link></Col>
-			<Col xs={0} xl={10}>点赞(1)</Col>
-		</Row>
-		<Row>
-			<Col xs={24} xl={0}>点赞(1)</Col>
-			<Col xs={0} xl={0}></Col>
-		</Row>
-		<Row>
-			<Col xs={24} xl={0}><Breadcrumb itemRender={itemRender} routes={routes} /></Col>
-			<Col xs={0} xl={0}></Col>
-		</Row>
-		<div>{item.summary}</div>
-	  </div>
-	);
-  }

+ 0 - 103
dashboard/src/components/demo.tsx

@@ -1,103 +0,0 @@
-import {Link} from 'umi';
-import { Alert } from 'antd';
-import { Input } from 'antd';
-import { WarningOutlined,LoadingOutlined  } from '@ant-design/icons';
-
-type IWidget1Props ={
-  message: String
-}
-
-export const Widget1 = ({message}: IWidget1Props) => {
-  return (
-    <div>
-      bla bla bla
-      <Alert message={message} type="success" />
-    </div>
-  );
-}
-
-export const Widget2 = ({}) => {
-  return (
-    <div>
-      bla bla bla
-      <Alert message="Widget 2" type="error" />
-    </div>
-  );
-}
-
-type IWidgetCourseInfo ={
-  title: string,
-  course_id:number,
-  teacher_name:string,
-}
-
-export const WidgetCourseInfo = (course: IWidgetCourseInfo) => {
-  return (
-    <div>
-      课程名称
-      <Alert message={course.title} type="success" />
-      课程id:{course.course_id}<br />
-      授课教师:{course.teacher_name}<br />
-    </div>
-  );
-}
-
-type IWidgetArticle ={
-  text: string
-}
-export const WidgetCourseContent = (course: IWidgetArticle) => {
-  return (
-    <div>
-      <h2>课程内容</h2>
-      <WidgetWikiPaliArticle text={course.text} />
-    </div>
-  );
-}
-
-
-export const WidgetWikiPaliArticle = (content: IWidgetArticle) => {
-  return (
-    <div>
-      <p>wikipali article content</p>
-      {content.text}
-    </div>
-  );
-}
-
-export const WidgetWikiPaliArticleEdit = (content: IWidgetArticle) => {
-  const onChange = e => {
-    console.log('Change:', e.target.value);
-  };
-
-  const { TextArea } = Input;
-  return (
-    <div>
-      <p>wikipali article content edit</p>
-      <TextArea autoSize showCount maxLength={500} defaultValue={content.text} onChange={onChange} />
-    </div>
-  );
-}
-
-type IWidgetCommitMessage ={
-  message: string,
-  successful:boolean,
-  time:number,
-}
-
-export const WidgetCommitNofifiction = (message: IWidgetCommitMessage) => {
-        if(message.successful){
-          return (
-            <span>
-              <LoadingOutlined />{message.time}{message.message}
-            </span>
-          );          
-        }
-        else{
-          return (
-            <span>
-              <WarningOutlined />{message.time}{message.message}
-            </span>
-          );
-        } 
-
-}

+ 0 - 13
dashboard/src/pages/404.tsx

@@ -1,13 +0,0 @@
-
-
-type IProps = {
-
-}
-
-export default ({}: IProps) => {
-  return (
-    <div>
-      <h1>Not found</h1>
-    </div>
-  );
-}

+ 0 - 31
dashboard/src/pages/[username]/index.tsx

@@ -1,31 +0,0 @@
-import React from 'react';
-import { Affix, Layout, Menu, Breadcrumb, Table, Tag, Space, Pagination, message, notification, Anchor, List, Avatar } from "antd";
-import { Row, Col } from "antd";
-import { UserOutlined, LaptopOutlined, NotificationOutlined } from "@ant-design/icons";
-import { Footer } from "antd/lib/layout/layout";
-import { useState } from 'react';
-import { MessageOutlined, LikeOutlined, StarOutlined } from '@ant-design/icons';
-import { Link, history } from 'umi';
-
-const { Header, Content, Sider } = Layout;
-
-export default ({ match }) => {
-	return (
-
-		<Layout>
-			<Layout>
-				<h1>welcome to  {match.params.username} zone</h1>
-			</Layout>
-			<Header className="header">
-				<Menu theme="dark" mode="horizontal" defaultSelectedKeys={['1']}>
-					<Menu.Item key="1" >首页</Menu.Item>
-					<Menu.Item key="2" onClick={() => history.push('/' + match.params.username + '/translation')}>译文</Menu.Item>
-					<Menu.Item key="3" onClick={() => history.push('/' + match.params.username + '/course')}>课程</Menu.Item>
-					<Menu.Item key="4" onClick={() => history.push('/' + match.params.username + '/article')}>文集</Menu.Item>
-				</Menu>
-			</Header>
-
-		</Layout>
-
-	)
-}

+ 0 - 139
dashboard/src/pages/[username]/translation/index.tsx

@@ -1,139 +0,0 @@
-import React, { useEffect } from 'react';
-import { Affix, Layout, Menu, Breadcrumb, Table, Tag, Space, Pagination, message, notification, Anchor, List, Avatar } from "antd";
-import { Row, Col } from "antd";
-import { UserOutlined, LaptopOutlined, NotificationOutlined } from "@ant-design/icons";
-import { Footer } from "antd/lib/layout/layout";
-import { useState } from 'react';
-import { MessageOutlined, LikeOutlined, StarOutlined } from '@ant-design/icons';
-import { Link, history } from 'umi';
-import { ChapterListItem } from '@/components/chapterlistitem'
-
-const { SubMenu } = Menu;
-const { Header, Content, Sider } = Layout;
-
-const it = [
-	{ lable: 'menu1', key: 'menu1' }
-];
-const items = [
-	{
-		label: '经藏',
-		key: 'sutta',
-		tag: 'sutta',
-		children: [
-			{ label: '长部', key: 'sutta-digha', tag: 'sutta,digha' },
-			{ label: '中部', key: 'sutta-majjima', tag: 'sutta,majjima' },
-		]
-	},
-	{
-		label: '律藏',
-		key: 'vinaya',
-		tag: 'vinaya',
-		children: [
-			{ label: '大分别', key: 'vinaya-maha', tag: 'sutta,digha' },
-			{ label: '比库尼分别', key: 'vinaya-bhikkhuni', tag: 'sutta,majjima' },
-		]
-	},
-]
-
-export default ({ match }) => {
-	const [tableData, setTableData] = useState();
-
-
-	function getTableData() {
-		let url = 'http://127.0.0.1:8000/api/v2/progress?view=studio&name=' + match.params.username;
-		fetch(url)
-			.then(function (response) {
-				console.log("ajex:", response);
-				return response.json();
-			})
-			.then(function (myJson) {
-				console.log("ajex", myJson.data);
-				for (let iterator of myJson.data.rows) {
-					if (iterator.title == '') {
-						iterator.title = iterator.toc;
-					}
-					iterator.description = iterator.summary;
-					iterator.href = "/app/article/?view=chapter&book=" + iterator.book + "&par=" + iterator.para + '&channel=' + iterator.channel_id;
-					iterator.avatar = 'https://joeschmoe.io/api/v1/random';
-				}
-				setTableData(myJson.data.rows);
-			});
-	}
-	window.onload = function () {
-		getTableData();
-	}
-	return (
-		<Layout>
-			<Layout>
-				<h1>welcome to  {match.params.username} zone</h1>
-			</Layout>
-			<Header className="header">
-				<Menu theme="dark" mode="horizontal" defaultSelectedKeys={['2']}>
-					<Menu.Item key="1" onClick={() => history.push('/' + match.params.username)}>首页</Menu.Item>
-					<Menu.Item key="2" >译文</Menu.Item>
-					<Menu.Item key="3" onClick={() => history.push('/' + match.params.username + '/course')}>课程</Menu.Item>
-					<Menu.Item key="4">文集</Menu.Item>
-				</Menu>
-			</Header>
-			<Layout onClick={getTableData}>
-				<Affix offsetTop={0}>
-					<Sider
-						className="site-layout-background"
-						breakpoint="lg"
-						collapsedWidth="0"
-						onBreakpoint={broken => {
-							console.log(broken);
-						}}
-						onCollapse={(collapsed, type) => {
-							console.log(collapsed, type);
-						}}
-					>
-						<Menu
-							mode="inline"
-							defaultSelectedKeys={['1']}
-							defaultOpenKeys={['sub1']}
-							style={{ height: '100%', borderRight: 0 }}
-							items={items}
-						/>
-
-					</Sider>
-				</Affix>
-
-				<List
-					itemLayout="vertical"
-					size="large"
-					pagination={{
-						pageSize: 10,
-					}}
-					dataSource={tableData}
-					renderItem={item => (
-						<List.Item>
-							<ChapterListItem
-								title={item.title}
-								summary={item.summary}
-								path={item.path}
-								url={item.href}
-							/>
-						</List.Item>
-					)
-					}
-					footer={
-						<div>
-							<b>ant design</b> footer part
-						</div>
-					}
-				/>
-
-				<Affix offsetTop={0}>
-					<Sider
-						className="site-layout-background"
-						breakpoint="lg"
-						collapsedWidth="0"
-					>
-					</Sider>
-				</Affix>
-			</Layout>
-		</Layout>
-
-	)
-}

+ 0 - 37
dashboard/src/pages/demo/course/[id]/edit.tsx

@@ -1,37 +0,0 @@
-import {Link} from 'umi';
-import {Modal, Button ,Space} from 'antd';
-import { ExclamationCircleOutlined } from '@ant-design/icons';
-
-
-import {WidgetCourseInfo,WidgetWikiPaliArticleEdit} from '@/components/demo'
-
-
-export default ({match}) => {
-  function confirm() {
-    Modal.confirm({
-      title: '存盘',
-      icon: <ExclamationCircleOutlined />,
-      content: '保存所做的修改吗?',
-      okText: '确认',
-      cancelText: '取消',
-    });
-  }
-
-  return (
-    <div>
-      <h1>Edit item page by id {match.params.id}</h1>
-      <Link to="/demo">网站主页</Link>
-      &nbsp;
-      <Link to="/demo/day-2">课程主页</Link>
-      <h1>课程名称 {match.params.id}</h1>
-      <Space>
-        <Button type="primary" onClick={confirm}>保存</Button>
-        <Button >还原</Button>        
-      </Space>
-      
-      <WidgetCourseInfo title="转法轮经" course_id={match.params.id} teacher_name="悟贡西亚多" />
-      <WidgetWikiPaliArticleEdit text="转法轮经内容 转法轮经内容 转法轮经内容 转法轮经内容"  />
-
-    </div>
-  );
-}

+ 0 - 20
dashboard/src/pages/demo/course/[id]/show.tsx

@@ -1,20 +0,0 @@
-import {Link,history} from 'umi';
-import {Button} from 'antd';
-
-import {WidgetCourseInfo,WidgetCourseContent} from '@/components/demo'
-
-export default ({match}) => {
-
-  return (
-    <div>
-      <Link to="/demo">网站主页</Link>
-      &nbsp;
-      <Link to="/demo/day-2">课程主页</Link>
-      <h1>课程名称 {match.params.id}</h1>
-      <Button type="primary" onClick={()=>history.push('/demo/course/'+match.params.id+'/edit')}>编辑</Button>
-
-      <WidgetCourseInfo title="转法轮经" course_id={match.params.id} teacher_name="悟贡西亚多" />
-      <WidgetCourseContent text="转法轮经内容 转法轮经内容 转法轮经内容 转法轮经内容"  />
-    </div>
-  )
-}

+ 0 - 16
dashboard/src/pages/demo/course/index.tsx

@@ -1,16 +0,0 @@
-import {Link} from 'umi';
-
-type IProps = {
-
-}
-
-export default ({}: IProps) => {
-  return (
-    <div>
-      <h1>List items page</h1>
-      <Link to="/demo">Go home</Link>
-      &nbsp;
-      <Link to="/demo/course">课程主页</Link>
-    </div>
-  );
-}

+ 0 - 113
dashboard/src/pages/demo/day-1.tsx

@@ -1,113 +0,0 @@
-import {Link, history} from 'umi';
-import {Button} from 'antd';
-
-type IProps = {
-
-}
-
-export default ({}: IProps) => {
-    let helloworld: string;
-helloworld="name";
-
-interface User{
-    name: string;
-    id: number;
-}
-class UserAccount{
-    name: string;
-    id: number;
-    constructor(name:string,id:number){
-        this.name = name;
-        this.id=id;
-    }
-}
-const user: User={
-    name:"Hayes",
-    id:0,
-}
-
-const user1: User = new UserAccount("Hayes",0);
-
-console.log("user:"+user.name);
-
-function getAdminUser():User{
-    let user: User={
-        name:"admin",
-        id:0,
-    }
-    return user;
-}
-function deleteUser(user:User){
-
-}
-
-type MyBool = true | false;
-type WindowStates = "open" | "closed" | "minimized";
-type LockStates = "locked" | "unlocked";
-type PositiveOddNumberUnderTen = 1|3|5|7|9;
-
-function getLength(obj:string|string[]){
-    return obj.length;
-
-}
-
-function wrapInArray(obj:string|string[]){
-    if(typeof obj === "string"){
-        return [obj];
-    }
-    else{
-        return obj;
-    }
-}
-
-type StringArray= Array<string>;
-type NumberArray=Array<number>;
-type ObjectWithNameArray=Array<{name:string}>;
-
-interface Backpack<Type>{
-    add:(obj:Type)=>void;
-    get:()=>Type;
-}
-/*
-declare const backpack: Backpack<string>;
-backpack.add("22");
-*/
-interface Point {
-    x:number;
-    y:number;
-}
-function logPoint(p:Point){
-    console.log(`x=${p.x},y=${p.y}`);
-}
-const point = {x:2,y:3};
-logPoint(point);
-
-const point3 = {x:3,y:4,z:5};
-logPoint(point3);
-
-class VirtualPoint{
-    x:number;
-    y:number;
-    constructor(x:number,y:number){
-        this.x=x;
-        this.y=y;
-    }
-}
-const newPoint = new VirtualPoint(20,30);
-logPoint(newPoint);
-
-  return (
-    <div>
-      <h1>Demo home page</h1>
-      <div>
-        <Link to="/demo/items">List items</Link>
-        &nbsp;
-        <Link to="/demo/items/1/show">Show items 1</Link>
-        &nbsp;
-        <Link to="/demo/items/2/show">Show items 2</Link>
-        &nbsp;
-        <Button onClick={()=>history.push('/demo/items/333/edit')}>Edit items 333</Button>
-      </div>
-    </div>
-  );
-}

+ 0 - 24
dashboard/src/pages/demo/day-2.tsx

@@ -1,24 +0,0 @@
-import {Link, history} from 'umi';
-import {Button} from 'antd';
-
-type IProps = {
-
-}
-
-export default ({}: IProps) => {
-  return (
-    <div>
-      <h1>Wikipali Rebuild Day-2</h1>
-      <div>
-          <div><Link to="/demo/course">全部课程</Link></div>
-          <div>最新课程</div>
-         <ul>         
-          <li><Link to="/demo/course/1/show">课程1</Link></li>
-          <li><Link to="/demo/course/2/show">课程2</Link></li>
-          <li><Link to="/demo/course/3/show">课程3</Link></li>
-          <li><Link to="/demo/course/4/show">课程4</Link></li>
-        </ul>
-      </div>
-    </div>
-  );
-}

+ 0 - 238
dashboard/src/pages/demo/day-3.tsx

@@ -1,238 +0,0 @@
-import React,{useState} from 'react';
-import { Table,Form, Input, Button, Select,Radio,Switch,DatePicker,Popconfirm,message,Space,Checkbox } from 'antd';
-import { CloseOutlined,CheckOutlined } from '@ant-design/icons';
-
-const {Option}=Select;
-
-
-
-export default () => {
-    const [form] = Form.useForm();
-
-    const onUsernameChange=(value:any)=>{
-        console.log("username:",value);
-    }
-    const onGerderChange =(value:string)=>{
-        switch(value){
-            case 'male':
-                form.setFieldsValue({note:'hi,man!'});
-                return;
-            case 'female':
-                form.setFieldsValue({note:'hi,lady!'});
-                return;
-            case 'other':
-                form.setFieldsValue({note:"hi there!"});
-                return;
-        }
-    }
-  //表单完成
-  const onFinish = (values: any) => {
-    console.log('Success:', values);
-    const pwd1=form.getFieldValue("password");
-    const pwd2=form.getFieldValue("password2");
-    if(pwd1.length<6){
-        console.log("长度过短");
-    }
-    else if(pwd1!=pwd2){
-        console.log("两次密码不相同");
-    }
-  };
-
-  //填充表单
-  const onFill=()=>{
-    form.setFieldsValue({username:"wikipali"});
-    form.setFieldsValue({password:""});
-    form.setFieldsValue({password2:""});
-  }
-  //失败
-  const onFinishFailed = (errorInfo: any) => {
-    console.log('Failed:', errorInfo);
-  };
-  //提交表单
-  const onSubmit=()=>{
-    console.log("form:",form);
-    getTableData(form.getFieldValue("username"));
-
-  }
-  const validatePassword=(rule,value,callback)=>{
-    console.log(value);
-    const pwd1=form.getFieldValue("password");
-    if(value && value!==pwd1){
-      callback("两次输入不一致");
-    }
-    else{
-      callback();
-    }
-  }
-
-  const [valueLang,setValueLang] = React.useState(1);
-  const onChangeLang = e =>{
-    console.log('radio lang checked',e.target.value);
-    setValueLang(e.target.value);
-
-  }
-
-  function onChangeDate(value,dateString){
-    console.log("selectd time",value);
-    console.log('formatted selected time:',dateString);
-  }
-  function onOkDate(value){
-    console.log('onOk:',value);
-  }
-  function confirm(){
-    message.info('clicked on yes.');
-  }
-  function onChangeCheckbox(e){
-    console.log("checked:",e.target.checked);
-  }
-  //表头
-const columns = [
-	{
-		title: 'Id',
-		dataIndex: 'id',
-		key: 'id',
-		render: text => <a>{text}</a>,
-	},
-	{
-		title: 'name',
-		dataIndex: 'name',
-		key: 'name',
-	},
-	{
-		title: "gender",
-		dataIndex: 'gender',
-		key: 'gender',
-	},
-  {
-		title: "email",
-		dataIndex: 'email',
-		key: 'email',
-	}
-]
-function getTableData(name:string){
-  fetch('https://gorest.co.in/public-api/users?name='+name)
-    .then(function (response) {
-      console.log("ajex:", response);
-      return response.json();
-    })
-    .then(function (myJson) {
-      console.log("ajex",myJson.data);
-      setTableData(myJson.data);
-    });		
-}  
-const [tableData, setTableData] = useState();
-  return (
-    <div>
-      <Table dataSource={tableData} columns={columns} />
-    <Form
-    form={form}
-      name="control-hooks"
-      labelCol={{ span: 8 }}
-      wrapperCol={{ span: 16 }}
-      initialValues={{ remember: true }}
-      onFinish={onFinish}
-      onFinishFailed={onFinishFailed}
-      onSubmitCapture={onSubmit}
-    >
-    <Form.Item
-        label="note"
-        name="note"
-      >
-        <Input />
-      </Form.Item>
-
-      <Form.Item
-        label="用户名"
-        name="username"
-        initialValue="haha"
-        rules={[{ required: true, message: "Please input your '${name}'!" }]}
-      >
-        <Input onChange={onUsernameChange} />
-      </Form.Item>
-
-      <Form.Item
-        label="密码"
-        name="password"
-        rules={[
-          { required: true, message: 'Please input your password!' },
-          { min: 6, message: '不能少于六个字符' },
-          { whitespace: false, message: '不能包含空格' }
-        ]}
-      >
-        <Input.Password />
-      </Form.Item>
-      <Form.Item
-        label="重复密码"
-        name="password2"
-        validateTrigger="onBlue"
-        dependencies={['password']}
-        rules={[
-          { required: true, message: 'Please input your password!' },
-           /*
-          {
-            validator:validatePassword
-          }
-         */
-          
-         ({getFieldValue})=>({
-           validator(_,value){
-             if(!value || getFieldValue('password')===value){
-               return Promise.resolve();
-             }
-             return Promise.reject(new Error('两次密码不匹配'));
-           }
-         })
-         
-        ]}
-      >
-
-
-        <Input.Password />
-      </Form.Item>
-
-  <Form.Item name="gender" label="性别" >
-      <Select
-      placeholder="Select a option and change input text above"
-      onChange={onGerderChange}
-      allowClear
-      >
-          <Option value="male">男</Option>
-          <Option value="female">女</Option>
-          <Option value="other">其他</Option>
-      </Select>
-  </Form.Item>
-  <Form.Item name="lang" label="界面语言">
-    {
-      
-    }
-    <Radio.Group onChange={onChangeLang} value={valueLang}>
-        <Radio value={'en'}>英文</Radio>
-        <Radio value={'zh-hans'}>简体中文</Radio>
-        <Radio value={'zh-hant'}>繁体中文</Radio>
-    </Radio.Group>
-  </Form.Item>
-  <Form.Item name="datetime" label="开始时间">
-    <DatePicker showTime onChange={onChangeDate} onOk={onOkDate}/>
-  </Form.Item>
-  <Form.Item name="org_text" label="显示原文">
-    <Switch checkedChildren={<CheckOutlined />} unCheckedChildren={<CloseOutlined />} defaultChecked />
-  </Form.Item>
-  <Form.Item name="checkbox" label="checkbox">
-    <Checkbox onChange={onChangeCheckbox}>checkbox</Checkbox>
-  </Form.Item>
-      <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
-        <Button type="primary" htmlType="submit">
-          提交
-        </Button>
-        <Popconfirm placement="top" title="清空吗?" onConfirm={confirm} okText="是" cancelText="否">
-          <Button type="link" htmlType="button" onClick={onFill}>清空</Button>
-        </Popconfirm>
-        
-      </Form.Item>
-    </Form>
-
-          
-    </div>
-
-  );
-};

+ 0 - 263
dashboard/src/pages/demo/day-4.tsx

@@ -1,263 +0,0 @@
-import React from 'react';
-import { Affix, Layout, Menu, Breadcrumb, Table, Tag, Space, Pagination, message, notification, Anchor, List, Avatar } from "antd";
-import { Row, Col } from "antd";
-import { UserOutlined, LaptopOutlined, NotificationOutlined } from "@ant-design/icons";
-import { Footer } from "antd/lib/layout/layout";
-import { useState } from 'react';
-import { WidgetCommitNofifiction } from '@/components/demo'
-import { MessageOutlined, LikeOutlined, StarOutlined } from '@ant-design/icons';
-
-
-const { SubMenu } = Menu;
-const { Header, Content, Sider } = Layout;
-const { Link } = Anchor;
-
-message.config({
-	maxCount: 4
-});
-
-const data = [
-	{
-		title: '梵网经',
-	},
-	{
-		title: '沙门果经',
-	},
-	{
-		title: '盐块经',
-	},
-	{
-		title: '根修习经',
-	},
-];
-
-const listData = [];
-for (let i = 0; i < 23; i++) {
-	listData.push({
-		href: 'https://ant.design',
-		title: `ant design part ${i}`,
-		avatar: 'https://joeschmoe.io/api/v1/random',
-		description:
-			'Ant Design, a design language for background applications, is refined by Ant UED Team.',
-		content:
-			'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
-	});
-}
-
-const IconText = ({ icon, text }) => (
-	<Space>
-		{React.createElement(icon)}
-		{text}
-	</Space>
-);
-
-function handleClick(e) {
-	console.log('click', e);
-	ntfOpen(e.key);
-}
-function pageChange(page: number, pagesize?: number | undefined) {
-	message.info("page:" + page);
-	if (pagesize) {
-		message.error("pagesize:" + pagesize);
-	}
-}
-function ntfOpen(msg: string) {
-	const args = {
-		message: "title",
-		description: msg,
-		duration: 5,
-	};
-	notification.open(args);
-
-}
-export default () => {
-	const [top, setTop] = useState(0);
-	const [bottom, setBottom] = useState(10);
-	const [commitStatus, setcommitStatus] = useState(false);
-	const [commitTime, setcommitTime] = useState(0);
-	const [commitMsg, setcommitMsg] = useState("失败");
-
-	const [tableData, setTableData] = useState();
-
-
-	function getTableData(e) {
-		//let url='https://gorest.co.in/public-api/posts';
-		let url = 'http://127.0.0.1:8000/api/v2/progress?view=tag';
-		fetch(url)
-			.then(function (response) {
-				console.log("ajex:", response);
-				return response.json();
-			})
-			.then(function (myJson) {
-				console.log("ajex", myJson.data);
-				for (let iterator of myJson.data.rows) {
-					if (iterator.title == '') {
-						iterator.title = iterator.toc;
-					}
-					iterator.description = iterator.toc;
-					iterator.href = "http://127.0.0.1:8000/app/article/?view=chapter&book=" + iterator.book + "&par=" + iterator.para + '&channel=' + iterator.channel_id;
-					iterator.avatar = 'https://joeschmoe.io/api/v1/random';
-				}
-				setTableData(myJson.data.rows);
-			});
-	}
-	function pageChange(page: number, pagesize?: number | undefined) {
-		setcommitTime(page);
-		message.info("page:" + page);
-		if (pagesize) {
-			message.error("pagesize:" + pagesize);
-		}
-	}
-
-	return (
-		<Layout>
-			<Header className="header">
-				<div className="logo" />
-
-				<Menu onClick={handleClick} theme="dark" mode="horizontal" defaultSelectedKeys={['1']}>
-					<Menu.Item key="0">
-						<WidgetCommitNofifiction time={commitTime} message={commitMsg} successful={commitStatus} />
-					</Menu.Item>
-					<Menu.Item key="1" >圣典</Menu.Item>
-					<Menu.Item key="2">课程</Menu.Item>
-					<Menu.Item key="3">字典</Menu.Item>
-					<Menu.Item key="3">文集</Menu.Item>
-					<SubMenu key="submenu" icon={<UserOutlined />} title="更多">
-						<Menu.ItemGroup title="group1">
-							<Menu.Item key="4">option1</Menu.Item>
-							<Menu.Item key="5">option2</Menu.Item>
-							<Menu.Item key="6">option3</Menu.Item>
-						</Menu.ItemGroup>
-						<Menu.ItemGroup title="group2">
-							<Menu.Item key="7">option1</Menu.Item>
-							<Menu.Item key="8">option2</Menu.Item>
-							<Menu.Item key="9">option3</Menu.Item>
-						</Menu.ItemGroup>
-					</SubMenu>
-				</Menu>
-			</Header>
-			
-			<Layout>
-				<Affix offsetTop={top}>
-					<Sider
-						className="site-layout-background"
-						breakpoint="lg"
-						collapsedWidth="0"
-						onBreakpoint={broken => {
-							console.log(broken);
-						}}
-						onCollapse={(collapsed, type) => {
-							console.log(collapsed, type);
-						}}
-					>
-						<Menu
-							mode="inline"
-							defaultSelectedKeys={['1']}
-							defaultOpenKeys={['sub1']}
-							style={{ height: '100%', borderRight: 0 }}
-							onClick={getTableData}
-						>
-							<SubMenu key="sutta" icon={<UserOutlined />} title="经藏">
-								<Menu.Item key="dn">长部</Menu.Item>
-								<Menu.Item key="mn">中部</Menu.Item>
-								<Menu.Item key="sn">相应部</Menu.Item>
-								<Menu.Item key="an">增支部</Menu.Item>
-								<Menu.Item key="kn">小部</Menu.Item>
-							</SubMenu>
-							<SubMenu key="vinaya" icon={<UserOutlined />} title="律藏">
-								<Menu.Item key="6">分别</Menu.Item>
-								<Menu.Item key="7">篇章</Menu.Item>
-								<Menu.Item key="8">附录</Menu.Item>
-							</SubMenu>
-							<SubMenu key="abhidhamma" icon={<UserOutlined />} title="阿毗达摩藏">
-								<Menu.Item key="9">法集论</Menu.Item>
-								<Menu.Item key="10">option2</Menu.Item>
-								<Menu.Item key="11">option3</Menu.Item>
-								<Menu.Item key="12">option4</Menu.Item>
-							</SubMenu>
-							<SubMenu key="others" icon={<UserOutlined />} title="其他">
-								<Menu.Item key="9">法集论</Menu.Item>
-								<Menu.Item key="10">option2</Menu.Item>
-								<Menu.Item key="11">option3</Menu.Item>
-								<Menu.Item key="12">option4</Menu.Item>
-							</SubMenu>
-						</Menu>
-					</Sider>
-				</Affix>
-
-				<Layout style={{ padding: '0 24px 24px' }}>
-					<Breadcrumb style={{ padding: '0 24px 24px' }}>
-						<Breadcrumb.Item>全部</Breadcrumb.Item>
-						<Breadcrumb.Item>经藏</Breadcrumb.Item>
-						<Breadcrumb.Item>长部</Breadcrumb.Item>
-						<Breadcrumb.Item>……</Breadcrumb.Item>
-					</Breadcrumb>
-					<Content
-						className="site-layout-background"
-						style={{
-							padding: 24,
-							margin: 0,
-							minHeight: 280,
-							width: "100%",
-							overflowX: "auto",
-						}}>
-						<List
-							itemLayout="vertical"
-							size="large"
-							pagination={{
-								onChange: page => {
-									console.log(page);
-								},
-								pageSize: 10,
-							}}
-							dataSource={tableData}
-							footer={
-								<div>
-									<b>ant design</b> footer part
-								</div>
-							}
-
-						/>
-					</Content>
-				</Layout>
-				<Affix offsetTop={top}>
-					<Sider
-						className="site-layout-background"
-						breakpoint="lg"
-						collapsedWidth="0"
-					>
-						<List
-							header={<div>本周最新</div>}
-							itemLayout="horizontal"
-							dataSource={data}
-							renderItem={item => (
-								<List.Item>
-									<List.Item.Meta
-										avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
-										title={<a href="https://ant.design">{item.title}</a>}
-										description="Ant Design, a design language for background applications, is refined by Ant UED Team"
-									/>
-								</List.Item>
-							)}
-						/>
-					</Sider>
-				</Affix>
-			</Layout>
-
-			<Footer>
-				<Row>
-					<Col span={4}>col1</Col>
-					<Col span={16}>col2</Col>
-					<Col span={4}>col3</Col>
-				</Row>
-				<Row>
-					<Col xs={4} md={5} xl={4}> col4</Col>
-					<Col xs={20} md={14} xl={16}> col5 </Col>
-					<Col xs={0} md={5} xl={4}> col6 </Col>
-				</Row>
-			</Footer>
-		</Layout>
-	);
-
-}
-

+ 0 - 38
dashboard/src/pages/demo/day-5.json

@@ -1,38 +0,0 @@
-[
-  {
-    "key": "1",
-    "name": "name1",
-    "age": 32,
-    "adress": "西湖南路"
-  },
-  {
-    "key": "2",
-    "name": "name2",
-    "age": 34,
-    "adress": "西湖公园"
-  },
-  {
-    "key": "3",
-    "name": "name1",
-    "age": 32,
-    "adress": "西湖南路"
-  },
-  {
-    "key": "4",
-    "name": "name2",
-    "age": 34,
-    "adress": "西湖公园"
-  },
-  {
-    "key": "5",
-    "name": "name1",
-    "age": 32,
-    "adress": "西湖南路"
-  },
-  {
-    "key": "6",
-    "name": "name2",
-    "age": 34,
-    "adress": "西湖公园"
-  }
-]

+ 0 - 24
dashboard/src/pages/demo/day-5.tsx

@@ -1,24 +0,0 @@
-import React from 'react';
-import {
-	BasicLayoutProps,
-	Settings as LayoutSettings,
-} from '@ant-design/pro-layout';
-export const layout = ({
-	initialState,
-}: {
-	initialState: { settings?: LayoutSettings; currentUser?: API.CurrentUser };
-}): BasicLayoutProps => {
-	return {
-		rightContentRender: () => <RightContent />,
-		footerRender: () => <Footer />,
-		onPageChange: () => {
-			const { currentUser } = initialState;
-			const { location } = history;
-			if (!currentUser && location.pathname != '/user/login') {
-				history.push('/user/login');
-			}
-		},
-		menuHeaderRender: undefined,
-		...initialState?.settings,
-	};
-};

+ 0 - 0
dashboard/src/pages/demo/day-6.tsx


+ 0 - 23
dashboard/src/pages/demo/index.tsx

@@ -1,23 +0,0 @@
-import {Link, history} from 'umi';
-import {Button} from 'antd';
-
-type IProps = {
-
-}
-
-export default ({}: IProps) => {
-  return (
-    <div>
-      <h1>Demo home page</h1>
-      <div>
-        <Link to="/demo/items">List items</Link>
-        &nbsp;
-        <Link to="/demo/items/1/show">Show items 1</Link>
-        &nbsp;
-        <Link to="/demo/items/2/show">Show items 2</Link>
-        &nbsp;
-        <Button onClick={()=>history.push('/demo/items/333/edit')}>Edit items 333</Button>
-      </div>
-    </div>
-  );
-}

+ 0 - 14
dashboard/src/pages/demo/items/[id]/edit.tsx

@@ -1,14 +0,0 @@
-import {Link} from 'umi';
-
-import {Widget1, Widget2} from '@/components/demo'
-
-export default ({match}) => {
-  return (
-    <div>
-      <h1>Edit item page by id {match.params.id}</h1>
-      <Link to="/demo">Go home</Link>
-      <Widget1 message={"edit page " + match.params.id}/>
-      <Widget2/>
-    </div>
-  );
-}

+ 0 - 14
dashboard/src/pages/demo/items/[id]/show.tsx

@@ -1,14 +0,0 @@
-import {Link} from 'umi';
-
-import {Widget1, Widget2} from '@/components/demo'
-
-export default ({match}) => {
-  return (
-    <div>
-      <h1>Show item page {match.params.id}</h1>
-      <Link to="/demo">Go home</Link>
-      <Widget1 message={"show page " + match.params.id}/>
-      <Widget2/>
-    </div>
-  )
-}

+ 0 - 14
dashboard/src/pages/demo/items/index.tsx

@@ -1,14 +0,0 @@
-import {Link} from 'umi';
-
-type IProps = {
-
-}
-
-export default ({}: IProps) => {
-  return (
-    <div>
-      <h1>List items page</h1>
-      <Link to="/demo">Go home</Link>
-    </div>
-  );
-}

+ 0 - 10
dashboard/src/pages/index.tsx

@@ -1,10 +0,0 @@
-
-
-export default function IndexPage(props) {
-	console.log(props.location)
-	return (
-		<div>
-			<h1>Page index</h1>
-		</div>
-	);
-}

+ 0 - 36
dashboard/tsconfig.json

@@ -1,36 +0,0 @@
-{
-  "compilerOptions": {
-    "target": "esnext",
-    "module": "esnext",
-    "moduleResolution": "node",
-    "importHelpers": true,
-    "jsx": "react-jsx",
-    "esModuleInterop": true,
-    "sourceMap": true,
-    "baseUrl": "./",
-    "strict": true,
-    "paths": {
-      "@/*": ["src/*"],
-      "@@/*": ["src/.umi/*"]
-    },
-    "allowSyntheticDefaultImports": true
-  },
-  "include": [
-    "mock/**/*",
-    "src/**/*",
-    "config/**/*",
-    ".umirc.ts",
-    "typings.d.ts"
-  ],
-  "exclude": [
-    "node_modules",
-    "lib",
-    "es",
-    "dist",
-    "typings",
-    "**/__test__",
-    "test",
-    "docs",
-    "tests"
-  ]
-}

+ 0 - 10
dashboard/typings.d.ts

@@ -1,10 +0,0 @@
-declare module '*.css';
-declare module '*.less';
-declare module '*.png';
-declare module '*.svg' {
-  export function ReactComponent(
-    props: React.SVGProps<SVGSVGElement>,
-  ): React.ReactElement;
-  const url: string;
-  export default url;
-}