diff --git a/package.json b/package.json index 17bf56e6..9056ca65 100644 --- a/package.json +++ b/package.json @@ -4,32 +4,33 @@ "private": true, "homepage": "http://privoce.rustchat.com", "dependencies": { - "@babel/core": "^7.17.0", + "@babel/core": "^7.17.5", "@metamask/onboarding": "^1.0.1", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.4", - "@reduxjs/toolkit": "^1.7.2", + "@reduxjs/toolkit": "^1.8.0", "@rtk-query/codegen-openapi": "^1.0.0-alpha.1", "@svgr/webpack": "^6.2.1", "@tippyjs/react": "^4.2.6", "animate.css": "^4.1.1", - "axios": "^0.25.0", + "axios": "^0.26.0", "babel-loader": "^8.2.3", "babel-plugin-named-asset-import": "^0.3.8", "babel-preset-react-app": "^10.0.1", "bfj": "^7.0.2", - "browserslist": "^4.19.1", + "browserslist": "^4.19.3", "camelcase": "^6.3.0", "case-sensitive-paths-webpack-plugin": "^2.4.0", "css-loader": "^6.6.0", "css-minimizer-webpack-plugin": "^3.4.1", - "dayjs": "^1.10.7", + "dayjs": "^1.10.8", "dotenv": "^16.0.0", "dotenv-expand": "^8.0.1", "emoji-mart": "^3.0.1", - "eslint": "^8.8.0", + "eslint": "^8.10.0", "event-source-polyfill": "^1.0.25", "file-loader": "^6.2.0", - "fs-extra": "^10.0.0", + "firebase": "^9.6.7", + "fs-extra": "^10.0.1", "html-webpack-plugin": "^5.5.0", "linkify-it": "^3.0.3", "mini-css-extract-plugin": "^2.5.3", @@ -57,10 +58,10 @@ "styled-reset": "^4.3.4", "terser-webpack-plugin": "^5.3.1", "tippy.js": "^6.3.7", - "webpack": "^5.68.0", + "webpack": "^5.69.1", "webpack-dev-server": "^4.7.4", "webpack-manifest-plugin": "^4.1.1", - "workbox-webpack-plugin": "^6.4.2" + "workbox-webpack-plugin": "^6.5.0" }, "scripts": { "start": "node scripts/start.js", @@ -87,21 +88,21 @@ ] }, "devDependencies": { - "@commitlint/cli": "^16.1.0", - "@commitlint/config-conventional": "^16.0.0", + "@commitlint/cli": "^16.2.1", + "@commitlint/config-conventional": "^16.2.1", "autoprefixer": "^10.4.2", - "eslint-config-prettier": "^8.3.0", + "eslint-config-prettier": "^8.4.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-react": "^7.28.0", + "eslint-plugin-react": "^7.29.2", "eslint-plugin-react-hooks": "^4.3.0", "gh-pages": "^3.2.3", "husky": "^7.0.4", - "lint-staged": "^12.3.3", - "postcss": "^8.4.6", + "lint-staged": "^12.3.4", + "postcss": "^8.4.7", "postcss-flexbugs-fixes": "^5.0.2", "postcss-loader": "^6.2.1", - "postcss-preset-env": "^7.3.1", + "postcss-preset-env": "^7.4.1", "prettier": "^2.5.1" } } diff --git a/src/app/config.js b/src/app/config.js index 79e03d25..b58d3d97 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -1,5 +1,5 @@ // const BASE_URL = `${location.origin}/api`; -const BASE_URL = `https://privoce.rustchat.com/api`; +const BASE_URL = `https://dev.rustchat.com/api`; // const BASE_URL = `https://rustchat.net/api`; export const ContentTypes = { text: "text/plain", diff --git a/src/app/services/auth.js b/src/app/services/auth.js index 96157a71..5f41dae4 100644 --- a/src/app/services/auth.js +++ b/src/app/services/auth.js @@ -33,11 +33,12 @@ export const authApi = createApi({ }), // 获取openid getOpenid: builder.mutation({ - query: ({ issuer_url }) => ({ + query: ({ issuer_url, redirect_uri }) => ({ url: "/token/openid/authorize", method: "POST", body: { issuer_url, + redirect_uri, }, }), }), diff --git a/src/app/services/server.js b/src/app/services/server.js index a833b80b..f8c49901 100644 --- a/src/app/services/server.js +++ b/src/app/services/server.js @@ -20,6 +20,36 @@ export const serverApi = createApi({ return data; }, }), + getFirebaseConfig: builder.query({ + query: () => ({ url: `admin/fcm/config` }), + }), + updateFirebaseConfig: builder.mutation({ + query: (data) => ({ + url: `admin/fcm/config`, + method: "POST", + body: data, + }), + }), + getAgoraConfig: builder.query({ + query: () => ({ url: `admin/agora/config` }), + }), + updateAgoraConfig: builder.mutation({ + query: (data) => ({ + url: `admin/agora/config`, + method: "POST", + body: data, + }), + }), + getSMTPConfig: builder.query({ + query: () => ({ url: `admin/smtp/config` }), + }), + updateSMTPConfig: builder.mutation({ + query: (data) => ({ + url: `admin/smtp/config`, + method: "POST", + body: data, + }), + }), updateLogo: builder.mutation({ query: (data) => ({ headers: { @@ -33,7 +63,7 @@ export const serverApi = createApi({ updateServer: builder.mutation({ query: (data) => ({ url: `admin/system/organization`, - method: "PUT", + method: "POST", body: data, }), }), @@ -41,6 +71,12 @@ export const serverApi = createApi({ }); export const { + useUpdateFirebaseConfigMutation, + useGetFirebaseConfigQuery, + useGetSMTPConfigQuery, + useUpdateSMTPConfigMutation, + useGetAgoraConfigQuery, + useUpdateAgoraConfigMutation, useGetServerQuery, useUpdateServerMutation, useUpdateLogoMutation, diff --git a/src/common/component/ChannelModal/index.js b/src/common/component/ChannelModal/index.js index c8ce6d1d..aa8aa570 100644 --- a/src/common/component/ChannelModal/index.js +++ b/src/common/component/ChannelModal/index.js @@ -3,11 +3,12 @@ import toast from "react-hot-toast"; import { useNavigate } from "react-router-dom"; import { useSelector, useDispatch } from "react-redux"; import Modal from "../Modal"; -import Button from "../StyledButton"; +import Button from "../styled/Button"; import ChannelIcon from "../ChannelIcon"; import Contact from "../Contact"; import StyledWrapper from "./styled"; -import StyledCheckbox from "../../component/StyledCheckbox"; +import StyledToggle from "../../component/styled/Toggle"; +import StyledCheckbox from "../../component/styled/Checkbox"; import useFilteredUsers from "../../hook/useFilteredUsers"; import { addChannel } from "../../../app/slices/channels"; @@ -141,13 +142,10 @@ export default function ChannelModal({ personal = false, closeModal }) { {
Private Channel -
} diff --git a/src/common/component/ChannelSetting/DeleteConfirmModal.js b/src/common/component/ChannelSetting/DeleteConfirmModal.js index 3fa19168..4bc0bc8d 100644 --- a/src/common/component/ChannelSetting/DeleteConfirmModal.js +++ b/src/common/component/ChannelSetting/DeleteConfirmModal.js @@ -9,7 +9,7 @@ import { deleteChannel } from "../../../app/slices/channels"; import Modal from "../Modal"; // import BASE_URL from "../../app/config"; import { useLazyRemoveChannelQuery } from "../../../app/services/channel"; -import Button from "../StyledButton"; +import Button from "../styled/Button"; const StyledConfirm = styled.div` padding: 32px; filter: drop-shadow(0px 25px 50px rgba(31, 41, 55, 0.25)); diff --git a/src/common/component/ChannelSetting/Overview.js b/src/common/component/ChannelSetting/Overview.js index aa0e1a8d..1d335851 100644 --- a/src/common/component/ChannelSetting/Overview.js +++ b/src/common/component/ChannelSetting/Overview.js @@ -6,8 +6,9 @@ import { useGetChannelQuery, useUpdateChannelMutation, } from "../../../app/services/channel"; -import Input from "../StyledInput"; -import Textarea from "../StyledTextarea"; +import Input from "../styled/Input"; +import Label from "../styled/Label"; +import Textarea from "../styled/Textarea"; import SaveTip from "../SaveTip"; const StyledWrapper = styled.div` position: relative; @@ -27,12 +28,6 @@ const StyledWrapper = styled.div` flex-direction: column; align-items: flex-start; gap: 8px; - label { - font-weight: 500; - font-size: 14px; - line-height: 20px; - color: #6b7280; - } .name { padding-left: 36px; background: url(https://static.nicegoodthings.com/project/rustchat/icon.hash.svg); @@ -94,7 +89,7 @@ export default function Overview({ id = 0 }) {
- +
- +