Update client side. fix previous errors
parent
056c41000d
commit
c853e21cd9
|
@ -0,0 +1,7 @@
|
||||||
|
services:
|
||||||
|
client:
|
||||||
|
build: .
|
||||||
|
image: 10.2.101.91:5000/mp_update_client:latest
|
||||||
|
platform: linux/amd64
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
|
@ -1,6 +1,7 @@
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: false
|
reactStrictMode: false,
|
||||||
|
output: "standalone"
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
"graphql": "^16.9.0",
|
"graphql": "^16.9.0",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"next": "14.2.5",
|
"next": "14.2.5",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
"react-dom": "^18"
|
"react-dom": "^18"
|
||||||
|
|
|
@ -5,6 +5,7 @@ import Title from "@/components/my/application/title"
|
||||||
import AddUpdate from "@/components/my/application/addUpdateModal";
|
import AddUpdate from "@/components/my/application/addUpdateModal";
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
import AppService from "@/services/appService";
|
import AppService from "@/services/appService";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ const ApplicationPage = ({params: { appId }}) => {
|
||||||
<AddUpdate appId={appData.id}/>
|
<AddUpdate appId={appData.id}/>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<UpdationTable dataSource={appData.versions} />
|
<UpdationTable dataSource={_.sortBy(appData.versions, (o) => -o.versionCode)} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {useEffect, useState} from "react";
|
||||||
import CreateAppModal from "@/components/my/createAppModal";
|
import CreateAppModal from "@/components/my/createAppModal";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import AppService from "@/services/appService";
|
import AppService from "@/services/appService";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
|
||||||
const MyPage = () => {
|
const MyPage = () => {
|
||||||
|
@ -47,13 +48,15 @@ const MyPage = () => {
|
||||||
<Table dataSource={apps} loading={isLoading}>
|
<Table dataSource={apps} loading={isLoading}>
|
||||||
<Table.Column title={"Приложение"} dataIndex={"appName"}/>
|
<Table.Column title={"Приложение"} dataIndex={"appName"}/>
|
||||||
<Table.Column title={"Описание"} dataIndex={"description"}/>
|
<Table.Column title={"Описание"} dataIndex={"description"}/>
|
||||||
<Table.Column title={"Последняя версия"} render={(d) => <span>{d.versions[0].id}</span>}/>
|
<Table.Column title={"Последняя версия"} render={(d) => <span>{_.last(d.versions).id}</span>}/>
|
||||||
<Table.Column render={(d) => {
|
<Table.Column render={(d) => {
|
||||||
return <Button onClick={() => {
|
return <Button onClick={() => {
|
||||||
router.push(`/my/application/${d.id}`)
|
router.push(`/my/application/${d.id}`)
|
||||||
}}>Изменить</Button>
|
}}>Изменить</Button>
|
||||||
}
|
}
|
||||||
}></Table.Column>
|
}></Table.Column>
|
||||||
|
<Table.Column render={(d) => <Button type={"default"}>Удалить</Button>}></Table.Column>
|
||||||
|
|
||||||
</Table>
|
</Table>
|
||||||
<CreateAppModal isOpen={isCreateAppModalOpened} handleCancel={handleCancelCreateAppModal}/>
|
<CreateAppModal isOpen={isCreateAppModalOpened} handleCancel={handleCancelCreateAppModal}/>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -11,6 +11,7 @@ export default function UpdationTable({dataSource}) {
|
||||||
<Table.Column title={"Описание"} dataIndex={"description"}/>
|
<Table.Column title={"Описание"} dataIndex={"description"}/>
|
||||||
<Table.Column title={"Код Версии"} dataIndex={"versionCode"}/>
|
<Table.Column title={"Код Версии"} dataIndex={"versionCode"}/>
|
||||||
<Table.Column title={"Ссылка"} dataIndex={"link"} render={(e) => <a href={e}><Button type={"link"}>Скачать</Button></a> }/>
|
<Table.Column title={"Ссылка"} dataIndex={"link"} render={(e) => <a href={e}><Button type={"link"}>Скачать</Button></a> }/>
|
||||||
|
<Table.Column render={(d) => <Button type={"default"}>Удалить</Button>}></Table.Column>
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,12 +7,11 @@ import AppService from "@/services/appService";
|
||||||
|
|
||||||
const CreateAppModal = ({isOpen, handleCancel}) => {
|
const CreateAppModal = ({isOpen, handleCancel}) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const [isTitleFocused, setIsTitleFocused] = useState(false)
|
const [appName, setAppName] = useState("")
|
||||||
const [appName, setAppName] = useState("Название приложения")
|
|
||||||
const [appVersion, setAppVersion] = useState("")
|
const [appVersion, setAppVersion] = useState("")
|
||||||
const [appDescription, setAppDescription] = useState("")
|
const [appDescription, setAppDescription] = useState("")
|
||||||
const [link, setLink] = useState()
|
const [link, setLink] = useState("")
|
||||||
const [appId, setAppId] = useState()
|
const [appId, setAppId] = useState("")
|
||||||
|
|
||||||
const [progressUpload, setProgressUpload] = useState(0)
|
const [progressUpload, setProgressUpload] = useState(0)
|
||||||
|
|
||||||
|
@ -39,17 +38,18 @@ const CreateAppModal = ({isOpen, handleCancel}) => {
|
||||||
})}
|
})}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
width={"50%"}
|
width={"50%"}
|
||||||
|
okButtonProps={{disabled: link === "" || appName === "" || appVersion === "" || appDescription === ""}}
|
||||||
>
|
>
|
||||||
|
|
||||||
<Typography.Title className={"pb-6"} level={4}>Создание приложения</Typography.Title>
|
<Typography.Title className={"pb-6"} level={4}>Создание приложения</Typography.Title>
|
||||||
<Divider className={"!mt-0"}/>
|
<Divider className={"!mt-0"}/>
|
||||||
|
|
||||||
<Form>
|
<Form>
|
||||||
<Form.Item required name={"name"}>
|
<Form.Item required name={"name"} label={"Название приложения"}>
|
||||||
<Typography.Title level={5} className={isTitleFocused ? "hidden": "inline"} onClick={() => setIsTitleFocused(true)}>{appName}</Typography.Title>
|
<Input value={appName} onChange={e => setAppName(e.target.value)}/>
|
||||||
<Input value={appName} onChange={e => setAppName(e.target.value)} className={isTitleFocused ? "inline": "!hidden"} />
|
|
||||||
<Button type={"primary"} onClick={() => setIsTitleFocused(false)} className={isTitleFocused ? "inline mt-4": "!hidden"} >Сохранить</Button>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
|
||||||
<Row className={"items-center"}>
|
<Row className={"items-center"}>
|
||||||
|
|
||||||
<Col span={11} className={"mr-4"}>
|
<Col span={11} className={"mr-4"}>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
export const BASE_URL = "http://localhost:8001/api"
|
export const BASE_URL = "http://10.2.101.91:8005/api"
|
||||||
|
|
||||||
const $instance = axios.create({
|
const $instance = axios.create({
|
||||||
baseURL: BASE_URL
|
baseURL: BASE_URL
|
||||||
|
|
Loading…
Reference in New Issue