Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create deploy.yml #248

Merged
merged 12 commits into from
Oct 26, 2022
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: dashboard Deploy

on:
pull_request:
push:
branches:
- master

jobs:
build_and_deploy_job:
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
-
name: Checkout Code
uses: actions/checkout@v2
with:
submodules: recursive
-
name: Setup Node
uses: actions/setup-node@v2.4.0
with:
node-version: "16"
-
name: Setup Dependencies
run: yarn install
-
name: Build Site
run: npm run build
-
name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
publish_branch: dist
publish_dir: ./dist

19 changes: 15 additions & 4 deletions src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ body,
.plug-content-wrap {
padding: 24px
}
.open{

.open {
color: #14c974;
}
.close{

.close {
color: #ff586d;
}
.ant-btn-danger{

.ant-btn-danger {
background: #f5222d !important;
color: #fff !important;
}
Expand All @@ -57,13 +60,15 @@ ol {
:global(.edit) {
cursor: pointer;
color: @primary-color;

&:hover {
color: @primary-color;
}
}

:global(.searchblock) {
display: flex !important;

button {
margin-left: 30px;
}
Expand All @@ -84,12 +89,16 @@ ol {
justify-content: space-between;
line-height: 40px;
padding: 0 20px;
border-radius: 5px;
box-shadow: 1px 2px 2px rgba(191, 189, 189, 0.5);
height: 40px;
background: #fff;

h3 {
font-size: 16px;
overflow: hidden;
}

button {
margin-top: 4px;
}
Expand All @@ -109,7 +118,9 @@ body {
:global {
.ant-spin-container {
overflow: visible !important;
box-shadow: 1px 2px 2px rgba(191, 189, 189, 0.5);
}

.global-spin {
width: 100%;
margin: 40px 0 !important;
Expand All @@ -135,4 +146,4 @@ body {
.ant-modal {
max-width: calc(100vw - 32px);
}
}
}
56 changes: 28 additions & 28 deletions src/routes/Plugin/Common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ export default class Common extends Component {

componentDidMount() {
const { dispatch, plugins } = this.props;
const { selectorPage,selectorPageSize} = this.state;
const { selectorPage, selectorPageSize } = this.state;
if (plugins && plugins.length > 0) {
this.getAllSelectors(selectorPage,selectorPageSize, plugins);
this.getAllSelectors(selectorPage, selectorPageSize, plugins);
} else {
dispatch({
type: "global/fetchPlugins",
payload: {
callback: pluginList => {
this.getAllSelectors(selectorPage,selectorPageSize, pluginList);
this.getAllSelectors(selectorPage, selectorPageSize, pluginList);
}
}
});
Expand All @@ -66,21 +66,21 @@ export default class Common extends Component {
componentDidUpdate(prevProps) {
const preId = prevProps.match.params.id;
const newId = this.props.match.params.id;
const {selectorPage,selectorPageSize} = this.state;
const { selectorPage, selectorPageSize } = this.state;
if (newId !== preId) {
const { dispatch } = this.props;
dispatch({
type: "common/resetData"
});

if (prevProps.plugins && prevProps.plugins.length > 0) {
this.getAllSelectors(selectorPage,selectorPageSize, prevProps.plugins);
this.getAllSelectors(selectorPage, selectorPageSize, prevProps.plugins);
} else {
dispatch({
type: "global/fetchPlugins",
payload: {
callback: pluginList => {
this.getAllSelectors(selectorPage,selectorPageSize, pluginList);
this.getAllSelectors(selectorPage, selectorPageSize, pluginList);
}
}
});
Expand Down Expand Up @@ -112,7 +112,7 @@ export default class Common extends Component {
});
};

getAllRules = (page,pageSize) => {
getAllRules = (page, pageSize) => {
const { dispatch, currentSelector } = this.props;
const { ruleName } = this.state;
const selectorId = currentSelector ? currentSelector.id : "";
Expand Down Expand Up @@ -163,12 +163,12 @@ export default class Common extends Component {

searchSelector = () => {
const { plugins } = this.props;
const {selectorPage,selectorPageSize} = this.state;
this.getAllSelectors(selectorPage,selectorPageSize, plugins);
const { selectorPage, selectorPageSize } = this.state;
this.getAllSelectors(selectorPage, selectorPageSize, plugins);
};

addSelector = () => {
const { selectorPage,selectorPageSize } = this.state;
const { selectorPage, selectorPageSize } = this.state;
const { dispatch, plugins } = this.props;
let name = this.props.match.params ? this.props.match.params.id : "";
const plugin = this.getPlugin(plugins, name);
Expand Down Expand Up @@ -203,12 +203,12 @@ export default class Common extends Component {

searchRule = () => {
this.setState({ rulePage: 1 });
const {rulePageSize } = this.state;
this.getAllRules(1,rulePageSize);
const { rulePageSize } = this.state;
this.getAllRules(1, rulePageSize);
};

addRule = () => {
const { rulePage,rulePageSize, pluginId } = this.state;
const { rulePage, rulePageSize, pluginId } = this.state;
const { dispatch, currentSelector, plugins } = this.props;
let name = this.props.match.params ? this.props.match.params.id : "";
const plugin = this.getPlugin(plugins, name);
Expand Down Expand Up @@ -249,7 +249,7 @@ export default class Common extends Component {

editSelector = record => {
const { dispatch, plugins } = this.props;
const { selectorPage,selectorPageSize } = this.state;
const { selectorPage, selectorPageSize } = this.state;
let name = this.props.match.params ? this.props.match.params.id : "";
const plugin = this.getPlugin(plugins, name);
const { id: pluginId, config } = plugin;
Expand Down Expand Up @@ -295,7 +295,7 @@ export default class Common extends Component {

deleteSelector = record => {
const { dispatch, plugins } = this.props;
const { selectorPage,selectorPageSize } = this.state;
const { selectorPage, selectorPageSize } = this.state;
let name = this.props.match.params ? this.props.match.params.id : "";
const pluginId = this.getPluginId(plugins, name);
dispatch({
Expand All @@ -314,25 +314,25 @@ export default class Common extends Component {
pageSelectorChange = page => {
this.setState({ selectorPage: page });
const { plugins } = this.props;
const {selectorPageSize} = this.state;
this.getAllSelectors(page,selectorPageSize, plugins);
const { selectorPageSize } = this.state;
this.getAllSelectors(page, selectorPageSize, plugins);
};

pageSelectorChangeSize = (currentPage,pageSize) => {
pageSelectorChangeSize = (currentPage, pageSize) => {
const { plugins } = this.props;
this.setState({ selectorPage: 1, selectorPageSize: pageSize});
this.setState({ selectorPage: 1, selectorPageSize: pageSize });
this.getAllSelectors(1, pageSize, plugins);
};

pageRuleChange = page => {
this.setState({ rulePage: page});
this.setState({ rulePage: page });
const { rulePageSize } = this.state;
this.getAllRules(page,rulePageSize);
this.getAllRules(page, rulePageSize);
};

pageRuleChangeSize = (currentPage,pageSize) => {
this.setState({rulePage: 1, rulePageSize: pageSize});
this.getAllRules(1,pageSize);
pageRuleChangeSize = (currentPage, pageSize) => {
this.setState({ rulePage: 1, rulePageSize: pageSize });
this.getAllRules(1, pageSize);
};

// select
Expand All @@ -358,7 +358,7 @@ export default class Common extends Component {

editRule = record => {
const { dispatch, currentSelector, plugins } = this.props;
const { rulePage,rulePageSize, pluginId } = this.state;
const { rulePage, rulePageSize, pluginId } = this.state;
let name = this.props.match.params ? this.props.match.params.id : "";
const plugin = this.getPlugin(plugins, name);
const { config } = plugin;
Expand Down Expand Up @@ -407,7 +407,7 @@ export default class Common extends Component {

deleteRule = record => {
const { dispatch, currentSelector, ruleList } = this.props;
const { rulePage,rulePageSize } = this.state;
const { rulePage, rulePageSize } = this.state;
const currentPage =
rulePage > 1 && ruleList.length === 1 ? rulePage - 1 : rulePage;
dispatch({
Expand Down Expand Up @@ -616,12 +616,12 @@ export default class Common extends Component {
<Row gutter={20}>
<Col span={8}>
<div className="table-header">
<h3>{getIntlContent("SHENYU.PLUGIN.SELECTOR.LIST.TITLE")}</h3>
<h3 style={{ overflow: "visible" }}>{getIntlContent("SHENYU.PLUGIN.SELECTOR.LIST.TITLE")}</h3>
<div className={styles.headerSearch}>
<AuthButton perms={`plugin:${name}Selector:query`}>
<Search
className={styles.search}
style={{ maxWidth: "50%" }}
style={{ width: "130px" }}
placeholder={getIntlContent(
"SHENYU.PLUGIN.SEARCH.SELECTOR.NAME"
)}
Expand Down
Loading