You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/10/21 01:25:45 UTC
[apisix-dashboard] branch master updated: feat: improve frontend's
codes (#574)
This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new b074f24 feat: improve frontend's codes (#574)
b074f24 is described below
commit b074f24e6bcba963bdc8ae2c39dc3ad56112b870
Author: 琚致远 <ju...@apache.org>
AuthorDate: Wed Oct 21 09:25:37 2020 +0800
feat: improve frontend's codes (#574)
* feat(doc): added tips
* feat: remove unused files
* feat: remove unused codes
* fix: typo in makefile
---
Makefile | 2 +-
README.md | 2 ++
README.zh-CN.md | 2 ++
package.json | 2 +-
src/services/login.ts | 36 ------------------------------------
src/services/user.ts | 10 ----------
src/transforms/global.ts | 42 ------------------------------------------
7 files changed, 6 insertions(+), 90 deletions(-)
diff --git a/Makefile b/Makefile
index d366e44..c55fedb 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@
# limitations under the License.
#
-### license-check: Check apisix-dashboard source code for Apache License
+### license-check: Check apisix-dashboard source codes for Apache License
.PHONY: license-check
license-check:
ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")
diff --git a/README.md b/README.md
index 4394d4c..f919cfc 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,8 @@ English | [简体中文](./README.zh-CN.md)
# Apache APISIX Dashboard
+_Please Note: This branch is still under development, please DO NOT use this branch currently._
+
Dashboard for [Apache APISIX](https://github.com/apache/apisix)
[Online Demo](http://139.217.190.60/), Username/Password: `admin`.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 022fe28..443b12e 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -21,6 +21,8 @@
# Apache APISIX 仪表盘
+_注意:当前分支仍在开发中,当前请勿使用。_
+
[Apache APISIX](https://github.com/apache/apisix-dashboard) 的仪表盘
[在线演示](http://139.217.190.60/),账户密码:`admin`。
diff --git a/package.json b/package.json
index 8cd5576..b3c86d5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "apisix-dashboard",
- "version": "1.5.4",
+ "version": "1.6.1",
"private": true,
"description": "Dashboard for Apache APISIX",
"scripts": {
diff --git a/src/services/login.ts b/src/services/login.ts
deleted file mode 100644
index 41fb5d2..0000000
--- a/src/services/login.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-export interface LoginParamsType {
- userName: string;
- password: string;
- mobile: string;
- captcha: string;
-}
-
-export async function fakeAccountLogin(): Promise<API.LoginStateType> {
- // NOTE: APISIX doesn‘t support user login currently, we return fake data directly.
- return Promise.resolve({
- name: 'APISIX User',
- avatar:
- 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmlld0JveD0iMCAwIDUwMCA1MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogIDxkZWZzPg0KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iaWQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjI1MTE5LjgiIHkxPSIxMTA1Mi41IiB4Mj0iMjE3MjUuNyIgeTI9IjIxNTUxLjciIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMC4wMjgwOTUsIDAsIDAsIDAuMDI4MDk1LCAtNDkyLjg2NzA5NiwgLTE0NC43Njk4MjEpIj4NCiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29 [...]
- userid: '00000001',
- notifyCount: 12,
- unreadCount: 11,
- access: 'admin',
- status: 'ok',
- });
-}
diff --git a/src/services/user.ts b/src/services/user.ts
index 1929036..ae8c23f 100644
--- a/src/services/user.ts
+++ b/src/services/user.ts
@@ -14,14 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { request } from 'umi';
-
import logo from '@/assets/logo.svg';
-export async function query() {
- return request<API.CurrentUser[]>('/api/users');
-}
-
export async function queryCurrent(): Promise<API.CurrentUser> {
return Promise.resolve({
name: 'APISIX User',
@@ -30,7 +24,3 @@ export async function queryCurrent(): Promise<API.CurrentUser> {
access: 'admin',
});
}
-
-export async function queryNotices(): Promise<any> {
- return request<{ data: API.NoticeIconData[] }>('/api/notices');
-}
diff --git a/src/transforms/global.ts b/src/transforms/global.ts
deleted file mode 100644
index 86f1834..0000000
--- a/src/transforms/global.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-type ActionType = 'get' | 'set' | 'delete' | 'create';
-
-interface Node<T> {
- createdIndex: number;
- key: string;
- modifiedIndex: number;
- value: T;
-}
-
-export interface ListItem<T> extends Node<T> {
- displayKey: string;
- id?: number;
-}
-
-/**
- * Transform data from fetch target item.
- */
-export const transformFetchItemData = <T>(data: { node: Node<T>; action: ActionType }) => {
- const result = data.node.key.match(/\/([0-9]+)/);
- if (result) {
- const [, key] = result;
- /* eslint no-param-reassign: ["error", { "props": false }] */
- data.node.key = key;
- }
- return data.node;
-};