You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/11/11 15:12:17 UTC

[incubator-streampark] branch dev updated: [Fix] username len and fix role error (#2005)

This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new c86e7626a [Fix] username len and fix role error (#2005)
c86e7626a is described below

commit c86e7626a291063f8aa3f4ebd3a7eeba9511dd54
Author: WSZ <12...@qq.com>
AuthorDate: Fri Nov 11 23:12:11 2022 +0800

    [Fix] username len and fix role error (#2005)
    
    * [Fix] username len and fix role error
    
    * [Fix] lock file license header
    
    * [Fix] frontend workflow build script error
    
    * [Fix] passwordHelp translate error
    
    * [Fix] monaco editor border bug
    
    * [fix] remove lock.yarm npmrc,add setting method in readme
    
    * [Docs] update Readme content
---
 .github/workflows/frontend.yml                     |  1 -
 .../streampark-console-webapp/.gitignore           |  3 ++-
 .../streampark-console-webapp/.npmrc               | 23 ----------------------
 .../streampark-console-webapp/README.zh-CN.md      | 15 ++++++++++++++
 .../streampark-console-webapp/package.json         |  2 +-
 .../src/design/index.less                          | 12 ++++++++---
 .../src/locales/lang/en/system/user.ts             |  2 +-
 .../src/locales/lang/zh-CN/system/user.ts          |  2 +-
 .../src/views/flink/app/hooks/useAppTableAction.ts |  2 ++
 .../src/views/flink/app/styles/Detail.less         |  2 +-
 .../views/flink/project/components/ListItem.vue    |  3 ++-
 .../src/views/system/user/user.data.ts             |  4 ++--
 .../src/views/system/variable/View.vue             |  2 +-
 13 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml
index b02113dec..3acfa6fb6 100644
--- a/.github/workflows/frontend.yml
+++ b/.github/workflows/frontend.yml
@@ -55,5 +55,4 @@ jobs:
       - name: Compile and Build
         run: |
           npm i
-          npm run prepare
           npm run build
diff --git a/streampark-console/streampark-console-webapp/.gitignore b/streampark-console/streampark-console-webapp/.gitignore
index e2ef5adfe..ed3de54ac 100644
--- a/streampark-console/streampark-console-webapp/.gitignore
+++ b/streampark-console/streampark-console-webapp/.gitignore
@@ -27,4 +27,5 @@ pnpm-debug.log*
 *.sln
 *.sw?
 
-
+package-lock.json
+pnpm-lock.yaml
diff --git a/streampark-console/streampark-console-webapp/.npmrc b/streampark-console/streampark-console-webapp/.npmrc
deleted file mode 100644
index f2e7c0f9c..000000000
--- a/streampark-console/streampark-console-webapp/.npmrc
+++ /dev/null
@@ -1,23 +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
-#
-#    https://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.
-
-strict-peer-dependencies=false
-save-workspace-protocol = rolling
-registry = 'http://registry.npm.taobao.org'
-sass_binary_site='http://npm.taobao.org/mirrors/node-sass/'
-phantomjs_cdnurl='http://npm.taobao.org/mirrors/phantomjs'
-CHROMEDRIVER_CDNURL='http://npm.taobao.org/mirrors/chromedriver'
-electron_mirror='http://npm.taobao.org/mirrors/electron/'
-fsevents_binary_host_mirror='http://npm.taobao.org/mirrors/fsevents/'
diff --git a/streampark-console/streampark-console-webapp/README.zh-CN.md b/streampark-console/streampark-console-webapp/README.zh-CN.md
index af405fab4..5080506a2 100644
--- a/streampark-console/streampark-console-webapp/README.zh-CN.md
+++ b/streampark-console/streampark-console-webapp/README.zh-CN.md
@@ -49,6 +49,21 @@ Make stream processing easier
 
 webui 是用 Javascript 编写的。如果你没有 Node.js 开发环境,请[设置](https://nodejs.org/en/download/)它。需要的最低版本是 14.0。
 
+- 设置镜像源
+
+如果你遇到依赖下载缓慢需要配置 npm 镜像源,方法为在用户文件夹下找到 .npmrc 将以下内容写入
+
+```bash
+strict-peer-dependencies=false
+save-workspace-protocol = rolling
+registry = 'http://registry.npm.taobao.org'
+sass_binary_site='http://npm.taobao.org/mirrors/node-sass/'
+phantomjs_cdnurl='http://npm.taobao.org/mirrors/phantomjs'
+CHROMEDRIVER_CDNURL='http://npm.taobao.org/mirrors/chromedriver'
+electron_mirror='http://npm.taobao.org/mirrors/electron/'
+fsevents_binary_host_mirror='http://npm.taobao.org/mirrors/fsevents/'
+```
+
 - 安装依赖
 
 ```bash
diff --git a/streampark-console/streampark-console-webapp/package.json b/streampark-console/streampark-console-webapp/package.json
index 4a5e16569..296be7c4c 100644
--- a/streampark-console/streampark-console-webapp/package.json
+++ b/streampark-console/streampark-console-webapp/package.json
@@ -11,7 +11,7 @@
     "dev": "vite",
     "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
     "build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",
-    "build:no-cache": "pnpm clean:cache && npm run build",
+    "build:no-cache": "npm run clean:cache && npm run build",
     "report": "cross-env REPORT=true npm run build",
     "type:check": "vue-tsc --noEmit --skipLibCheck",
     "preview": "npm run build && vite preview",
diff --git a/streampark-console/streampark-console-webapp/src/design/index.less b/streampark-console/streampark-console-webapp/src/design/index.less
index 35209f0bf..36269b3af 100644
--- a/streampark-console/streampark-console-webapp/src/design/index.less
+++ b/streampark-console/streampark-console-webapp/src/design/index.less
@@ -19,14 +19,14 @@
 @import 'public.less';
 @import 'ant/index.less';
 @import './theme.less';
-@import "./nprogress.less";
-@import "./swal2.less";
+@import './nprogress.less';
+@import './swal2.less';
 
 input:-webkit-autofill {
   box-shadow: 0 0 0 1000px transparent inset !important;
 }
 
-[data-theme="dark"] input:-webkit-autofill {
+[data-theme='dark'] input:-webkit-autofill {
   box-shadow: none !important;
   -webkit-text-fill-color: #fff;
 }
@@ -101,3 +101,9 @@ span {
   font-size: 18px;
   font-weight: bold;
 }
+
+*,
+::before,
+::after {
+  border-color: @border-color-base !important;
+}
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/en/system/user.ts b/streampark-console/streampark-console-webapp/src/locales/lang/en/system/user.ts
index ed9d0f68b..03824f9a8 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/en/system/user.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/system/user.ts
@@ -30,7 +30,7 @@ export default {
     userName: 'User Name',
     required: 'username is required',
     min: 'username length cannot be less than 4 characters',
-    max: 'exceeds maximum length limit of 8 characters',
+    max: 'exceeds maximum length limit of 20 characters',
     exist: 'Sorry the username already exists',
     nickName: 'Nick Name',
     userType: 'User Type',
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/system/user.ts b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/system/user.ts
index bba652d1b..f053dd4c4 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/system/user.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/system/user.ts
@@ -39,7 +39,7 @@ export default {
     lastLoginTime: '最近登录时间',
     password: '密码',
     passwordRequire: '密码为必填项',
-    passwordHelp: '密码长度不能少于 8 个字符',
+    passwordHelp: '密码长度不能小于 8 个字符',
     email: '请输入有效的电子邮件地址',
     maxEmail: '超过 50 个字符的最大长度限制',
     create: '创建用户',
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts
index 7c45d8ab4..68be2546b 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts
@@ -70,12 +70,14 @@ export const useAppTableAction = (
       {
         tooltip: { title: t('flink.app.tableAction.launch') },
         ifShow: [-1, 1, 4].includes(record.launch) && record['optionState'] === 0,
+        auth: 'app:launch',
         icon: 'ant-design:cloud-upload-outlined',
         onClick: handleCheckLaunchApp.bind(null, record),
       },
       {
         tooltip: { title: t('flink.app.tableAction.launchDetail') },
         ifShow: [-1, 2].includes(record.launch) || record['optionState'] === 1,
+        auth: 'app:launch',
         icon: 'ant-design:container-outlined',
         onClick: () => openBuildDrawer(true, { appId: record.id }),
       },
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/styles/Detail.less b/streampark-console/streampark-console-webapp/src/views/flink/app/styles/Detail.less
index 6bc7c0bfb..e154a5d63 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/styles/Detail.less
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/styles/Detail.less
@@ -20,7 +20,7 @@
 }
 
 .syntax-true {
-  border: 1px solid #d9d9d9;
+  border: 1px solid @border-color-base;
 }
 
 .ant-tabs-nav .ant-tabs-tab-active {
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue b/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue
index 1066c20e7..5a186eae3 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue
@@ -96,7 +96,7 @@
           ok-text="Yes"
           @confirm="handleDelete"
         >
-          <a-button type="danger" shape="circle" style="margin-left: 8px">
+          <a-button type="danger" v-auth="'project:delete'" shape="circle" style="margin-left: 8px">
             <DeleteOutlined />
           </a-button>
         </a-popconfirm>
@@ -254,6 +254,7 @@
       padding-left: 0;
     }
   }
+
   .ant-tag {
     border-radius: 0;
     font-weight: 700;
diff --git a/streampark-console/streampark-console-webapp/src/views/system/user/user.data.ts b/streampark-console/streampark-console-webapp/src/views/system/user/user.data.ts
index fe858f226..980bad37f 100644
--- a/streampark-console/streampark-console-webapp/src/views/system/user/user.data.ts
+++ b/streampark-console/streampark-console-webapp/src/views/system/user/user.data.ts
@@ -89,10 +89,10 @@ export const formSchema = (formType: string): FormSchema[] => {
       rules: [
         { required: isCreate, message: t('system.user.form.required') },
         { min: 4, message: t('system.user.form.min') },
-        { max: 8, message: t('system.user.form.max') },
+        { max: 20, message: t('system.user.form.max') },
         {
           validator: async (_, value) => {
-            if (!isCreate || !value || value.length < 4 || value.length > 8) {
+            if (!isCreate || !value || value.length < 4 || value.length > 20) {
               return Promise.resolve();
             }
             const res = await checkUserName({ username: value });
diff --git a/streampark-console/streampark-console-webapp/src/views/system/variable/View.vue b/streampark-console/streampark-console-webapp/src/views/system/variable/View.vue
index a964abaaf..390424f7d 100644
--- a/streampark-console/streampark-console-webapp/src/views/system/variable/View.vue
+++ b/streampark-console/streampark-console-webapp/src/views/system/variable/View.vue
@@ -50,7 +50,7 @@
                 icon: 'ant-design:delete-outlined',
                 color: 'error',
                 tooltip: t('system.variable.deleteVariable'),
-                auth: 'team:delete',
+                auth: 'variable:delete',
                 popConfirm: {
                   title: t('system.variable.deletePopConfirm'),
                   confirm: handleDelete.bind(null, record),