Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ build

/compose/**/*.log
/compose/**/nginx.pid
/compose/etcd_data
/compose/etcd_data
manager-api
conf.json
conf.json-e
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,26 @@

# Table of Contents

- [1.5.0](#150)
- [1.0.0](#100)

# 1.5.0

This release mainly refactors the dashboard.

### Core

- Integrate with Ant Design Pro. [#263](https://github.com/apache/apisix-dashboard/pull/263)
- Added Manager API support to process logics between APISIX and Dashboard.
- Added Metrics/Route/SSL/Upstream/Consumer module.

## 1.0.0

This release is mainly to build some basic panels and resolve License issue.

### Core

- Dashboard initial. [#1](https://github.com/apache/incubator-apisix-dashboard/pull/1)
- Dashboard initial. [#1](https://github.com/apache/apisix-dashboard/pull/1)
- Resolve licence issues.
- Remove unused files from the Dashboard boilerplate.
- Support panel to list, create and modify Route, Consumer, Service, SSL and Upstream.
Expand Down
65 changes: 0 additions & 65 deletions README-dashboard.md

This file was deleted.

70 changes: 66 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,77 @@
# limitations under the License.
#
-->

# Apache APISIX Dashboard

Dashboard for [Apache APISIX](https://github.com/apache/apisix-dashboard)

## Deploy with Docker (currently)
## Deploy with Docker

Please refer to [Deploy with Docker README](./compose/README.md)

## More
## Deploy Manually

### Clone the project

```sh
$ git clone https://github.com/apache/apisix-dashboard.git

$ cd apisix-dashboard
```

### Build the manager-api

The `manager-api` is used to provide APIs for Dashboard, just like a bridge between the Apache APISIX and the Dashboard. Here are the steps to build it manually:

1. We need `MySQL/Golang` to be preinstalled.

```sh
# e.g Initialization for MySQL
$ mysql –uroot –p123456
> source ./api/script/db/schema.sql
```

2. Start the Apache APISIX.

[Please follow this guide](https://github.com/apache/apisix#configure-and-installation)

3. Check environment variables

According to your local deployment environment, check the environment variables in `./api/run/run.sh`, modify the environment variables if needed.

4. Build

```sh
$ cd api && go build -o ../manager-api . && cd ..
```

5. Run

```sh
$ sh ./api/run/run.sh &
```

### Build the Dashboard

This project is initialized with [Ant Design Pro](https://pro.ant.design). The following are some quick guides for how to use.

1. Make sure you have `Node.js(version 8.10.0+)/Nginx` installed on your machine.
2. Install [yarn](https://yarnpkg.com/).
3. Install dependencies:

```sh
$ yarn install
```

4. Build

```sh
$ yarn build
```

5. The bundled files are under `/dist` folder if the step 4 is successful, then We recommend using `nginx` to handle those files: just move them to nginx's default html folder, then visit `http://127.0.0.1` in your browser. The default Setting page would be shown, and you should set the API field to the manager api's address, e.g `http://127.0.0.1:8080/apisix/admin` .

## Other

1. More infomation about the frontend Dashboard, please refer to [README for Dashboard](./README-dashboard.md)
2. If you need the dashboard built with Vue.js, please refer to [master-vue](https://github.com/apache/apisix-dashboard/tree/master-vue).
1. If you need the elder dashboard which is built with Vue.js, please refer to [master-vue](https://github.com/apache/apisix-dashboard/tree/master-vue).
6 changes: 3 additions & 3 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

# manager-api

This is a back-end project that the dashboard depends on, implemented through golang.
This is a backend project which the dashboard depends on, implemented by Golang.

## configuration and install
## Installation

[Install Doc](run/build.md)
[Please refer to the doc](../README.md)
12 changes: 6 additions & 6 deletions api/conf/conf.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"conf":{
"mysql":{
"conf": {
"mysql": {
"address": "127.0.0.1:3306",
"user": "root",
"password": "123456",
"maxConns": 50,
"maxIdleConns": 25,
"maxLifeTime": 10
},
"syslog":{
"host": "localhost"
"syslog": {
"host": "127.0.0.1"
},
"apisix":{
"apisix": {
"base_url": "http://127.0.0.1:9080/apisix/admin",
"api_key": "edd1c9f034335f136f87ad84b625c8f1"
}
}
}
}
52 changes: 0 additions & 52 deletions api/run/build.md

This file was deleted.

30 changes: 22 additions & 8 deletions api/run/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,34 @@
#

pwd=`pwd`

cp ${pwd}/api/conf.json ${pwd}/conf.json

export MYSQL_SERVER_ADDRESS="127.0.0.1:3306"
export MYSQL_USER=root
export MYSQL_PASSWORD=123456
export SYSLOG_HOST=127.0.0.1
export APISIX_BASE_URL="http://127.0.0.1:9080/apisix/admin"
export APISIX_API_KEY="edd1c9f034335f136f87ad84b625c8f1"
export ENV=prod

sed -i -e "s%#mysqlAddress#%`echo $MYSQL_SERVER_ADDRESS`%g" ${pwd}/conf.json
sed -i -e "s%#mysqlUser#%`echo $MYSQL_USER`%g" ${pwd}/conf.json
sed -i -e "s%#mysqlPWD#%`echo $MYSQL_PASSWORD`%g" ${pwd}/conf.json
sed -i -e "s%#syslogAddress#%`echo $SYSLOG_HOST`%g" ${pwd}/conf.json
sed -i -e "s%#apisixBaseUrl#%`echo $APISIX_BASE_URL`%g" ${pwd}/conf.json
sed -i -e "s%#apisixApiKey#%`echo $APISIX_API_KEY`%g" ${pwd}/conf.json

if [[ "$unamestr" == 'Darwin' ]]; then
sed -i '' -e "s%#mysqlAddress#%`echo $MYSQL_SERVER_ADDRESS`%g" ${pwd}/conf.json
sed -i '' -e "s%#mysqlUser#%`echo $MYSQL_USER`%g" ${pwd}/conf.json
sed -i '' -e "s%#mysqlPWD#%`echo $MYSQL_PASSWORD`%g" ${pwd}/conf.json
sed -i '' -e "s%#syslogAddress#%`echo $SYSLOG_HOST`%g" ${pwd}/conf.json
sed -i '' -e "s%#apisixBaseUrl#%`echo $APISIX_BASE_URL`%g" ${pwd}/conf.json
sed -i '' -e "s%#apisixApiKey#%`echo $APISIX_API_KEY`%g" ${pwd}/conf.json
else
sed -i -e "s%#mysqlAddress#%`echo $MYSQL_SERVER_ADDRESS`%g" ${pwd}/conf.json
sed -i -e "s%#mysqlUser#%`echo $MYSQL_USER`%g" ${pwd}/conf.json
sed -i -e "s%#mysqlPWD#%`echo $MYSQL_PASSWORD`%g" ${pwd}/conf.json
sed -i -e "s%#syslogAddress#%`echo $SYSLOG_HOST`%g" ${pwd}/conf.json
sed -i -e "s%#apisixBaseUrl#%`echo $APISIX_BASE_URL`%g" ${pwd}/conf.json
sed -i -e "s%#apisixApiKey#%`echo $APISIX_API_KEY`%g" ${pwd}/conf.json
fi


cp ${pwd}/conf.json ${pwd}/api/conf/conf.json

exec ./manager-api

50 changes: 1 addition & 49 deletions compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,4 @@
#
-->

## Deploy

```sh
$ cd apisix-dashboard/compose
$ sh gen-config-yaml.sh

# For most users in China, please use some proxy services like https://www.daocloud.io/mirror to speed up your Docker images pulling.
$ docker-compose -p dashboard up -d
```

## Usage

### 1. login dashboard

Visit `http://127.0.0.1/dashboard/` in the browser, Enter `http://127.0.0.1:8080/apisix/admin` into the first input box, this is the backend management service address

![login](pics/login.png)

now, click `save`.

### 2. If you want to display the grafana metric dashboard, please fill in the grafana shared link as follows

1.get grafana shared link

Visit `http://127.0.0.1:3000/?search=open&orgId=1`

![login](pics/grafana_1.png)

click `Apache APISIX` dashboard, and you can see the page as follow

![login](pics/grafana_2.png)

click the button `shard dashboard` on the right of `Apache APISIX`

![login](pics/grafana_3.png)

copy the link, and then return to dashboard on the step 1

![login](pics/grafana_4.png)

click metric on the left, and then the config button

Paste shared link

![login](pics/grafana_5.png)

save, and you can see the metrics

![login](pics/grafana_6.png)
This folder stores the `docker-compose` file for `manager-api`.
Binary file removed compose/pics/grafana_1.png
Binary file not shown.
Binary file removed compose/pics/grafana_2.png
Binary file not shown.
Binary file removed compose/pics/grafana_3.png
Binary file not shown.
Binary file removed compose/pics/grafana_4.png
Binary file not shown.
Binary file removed compose/pics/grafana_5.png
Binary file not shown.
Binary file removed compose/pics/grafana_6.png
Binary file not shown.
Binary file removed compose/pics/login.png
Binary file not shown.