diff --git a/.env b/.env
index 0384e61..1c5d916 100644
--- a/.env
+++ b/.env
@@ -1,3 +1,5 @@
-VUE_APP_HOST=
VUE_APP_MN_CONFIG_PREFIX=/api/rest_j/v1/
VUE_APP_MN_CONFIG_SOCKET=/ws/api/entrance/connect
+VUE_APP_HOST=
+SERVER_HOST=http://192.168.9.180:9001
+PORT=8080
\ No newline at end of file
diff --git a/README.md b/README.md
index 68bf7ec..b6011aa 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ English | [Chinese](docs/zh_CN/README.md)
Scriptis is for interactive data analysis with script development(SQL, Pyspark, HiveQL), task submission(Spark, Hive), UDF, function, resource management and intelligent diagnosis.
-![运行时功能](docs/zh_CN/images/readme/running.gif)
+![running](docs/en_US/images/readme/running.gif)
## Features
@@ -30,11 +30,22 @@ Scriptis is for interactive data analysis with script development(SQL, Pyspark,
## QuickStart
-Read the Quick Start [Quick Start](/docs/en_US/ch3/Scriptis_Quick_Start.md)
+Read the Quick Start [Quick Start](docs/en_US/ch1/Front-end_deployment_documentation.md)
## Comparison with similar scheduler systems
+
![Comparison](/docs/en_US/images/readme/Comparison.png)
+## Documentations
+
+[Quick Start](docs/en_US/ch1/Front-end_deployment_documentation.md)
+
+[Quick Use](docs/en_US/ch3/Scriptis_Quick_Start.md)
+
+[User Manual](docs/en_US/ch4/Scriptis_Manual.md)
+
+[Compilation](docs/en_US/ch2/Compilation.md)
+
## Community
If you desire immediate response, please kindly raise issues to us or scan the below QR code by WeChat and QQ to join our group:
diff --git a/docs/en_US/ch1/Front-end_deployment_documentation.md b/docs/en_US/ch1/Front-end_deployment_documentation.md
index c754809..5fa0ac6 100644
--- a/docs/en_US/ch1/Front-end_deployment_documentation.md
+++ b/docs/en_US/ch1/Front-end_deployment_documentation.md
@@ -4,15 +4,15 @@ Scriptis is a data analysis tool based on Linkis. Before deploying Scriptis, you
1. Select the corresponding installation package to download.
-2. Unzip the downloaded installation package in the installation directory: unzip wedatasphere-scriptis-0.5.0-dist.zip.
+2. Unzip the downloaded installation package in the installation directory: unzip wedatasphere-scriptis-0.7.0-dist.zip.
## 2 Deploy
- There are two deployment methods, automated and manual deployment.
+ There are two deployment methods, automated and manual deployment.
### 2.1 Automated deployment
-Go to the frontend directory ```wedatasphere-scriptis``` and edit ```vi config.sh ``` to change the interface address of the frontend and backend port. backend port interface address is the gateway address of linkis.
+Go to the frontend directory ```wedatasphere-scriptis``` and edit ```vi config.sh ``` to change the interface address of the frontend and backend port. backend port interface address is the gateway address of linkis.
### (3) Modify and save the configuration file created above
@@ -29,7 +29,7 @@ scriptis_ipaddr=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(
After the modification, run the following command in the directory: ```sudo sh install.sh > install.log 2>&1```
-Next, you can access ```http://scriptis_ipaddr:scriptis_port``` directly via Chrome, scriptis_port is the port configured in config.sh and scriptis_ipaddr is the IP of the machine that used for installation.
+Next, you can access ```http://scriptis_ipaddr:scriptis_port``` directly via Chrome, scriptis_port is the port configured in config.sh and scriptis_ipaddr is the IP of the machine that used for installation.
If encounter access failure, please check install.log and find out the errors.
@@ -48,11 +48,11 @@ server {
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
- root /appcom/Install/scriptis/ROOT; # directory where package decompressed
+ root /appcom/Install/scriptis/ROOT; # directory where package decompressed
#in the fronted
index index.html index.html;
}
- location /ws {#webSocket configure spport
+ location /ws {#webSocket configure spport
proxy_pass http://192.168.xxx.xxx:9001;#IP port of the linkis gateway service
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@@ -84,11 +84,11 @@ server {
3. Copy the frontend package to the corresponding directory: ```/appcom/Install/scriptis/ROOT; # directory where package decompressed in the frontend```
4. Start service: ```sudo systemctl restart nginx```
-5. You can directly access ```http://nginx_ip:nginx_port``` via Chrome after execution.
+5. You can directly access ```http://nginx_ip:nginx_port``` via Chrome after execution.
## 3 FAQs
-(1) limitations on the size of files that being uploaded
+(1) limitations on the size of files that being uploaded
```
sudo vi /etc/nginx/nginx.conf
diff --git a/docs/en_US/ch2/Compilation.md b/docs/en_US/ch2/Compilation.md
new file mode 100644
index 0000000..e815e51
--- /dev/null
+++ b/docs/en_US/ch2/Compilation.md
@@ -0,0 +1,82 @@
+# Compilation
+
+## Getting Started
+
+### Prerequisites
+
+Install Node.js on your computer. Download Link: [http://nodejs.cn/download/](http://nodejs.cn/download/). Recommend using the latest stable version.
+
+**Only do this step at the first time.**
+
+### Installation
+
+Run the following commands in terminal:
+
+```
+git clone https://github.com/WeBankFinTech/Scriptis.git
+cd wds-ide
+npm install
+```
+
+ Commands explanation:
+
+1. Pull remote repository to local: `git clone https://github.com/WeBankFinTech/Scriptis.git`
+
+2. Change to the root directory of the project: `cd wds-ide`
+
+3. Install all dependencies required for the project: `npm install`
+
+**Only do this step at the first time.**
+
+### Configuration
+
+You need to make some configurations in your code, such as port address of backend server and socket address of backend server in .env.development file in root directory.
+
+```
+//prefix of Backend service
+VUE_APP_MN_CONFIG_PREFIX=/api/rest_j/v1/
+//prefix of websocket service
+VUE_APP_MN_CONFIG_SOCKET=/ws/api/entrance/connect
+//server host example http://yourIp:yourPort
+SERVER_HOST=
+//front end run port default 8080
+PORT=
+```
+
+You can refer to the official documentation of vue-cli for detailed explanation. [Modes and environment variables](https://cli.vuejs.org/guide/mode-and-env.html#modes)
+
+### Building project
+
+You can run the following command in terminal to build the project:
+
+```
+npm run build
+```
+
+A folder named "dist" would appear in your project's root directory if the command has run successfully and you can directly put "dist" to your static server.
+
+### How to run
+
+You would need to run the following command in terminal if you want to run project on your local browser and see corresponding effects after making changes to the code.
+
+```
+npm run serve
+```
+
+### FAQ
+
+#### Failed installation when running npm install
+
+Try to use Taobao npm mirror:
+
+```
+npm install -g cnpm --registry=https://registry.npm.taobao.org
+```
+
+Next, run the following command instead of npm install:
+
+```
+cnpm install
+```
+
+Note that you can still use `npm run serve` and `npm run build` to run and build project.
\ No newline at end of file
diff --git a/docs/en_US/images/readme/Comparison.png b/docs/en_US/images/readme/Comparison.png
index f1f6841..df3144c 100644
Binary files a/docs/en_US/images/readme/Comparison.png and b/docs/en_US/images/readme/Comparison.png differ
diff --git a/docs/en_US/images/readme/cs.gif b/docs/en_US/images/readme/cs.gif
index 7d3125e..d735e1b 100644
Binary files a/docs/en_US/images/readme/cs.gif and b/docs/en_US/images/readme/cs.gif differ
diff --git a/docs/en_US/images/readme/datasource.gif b/docs/en_US/images/readme/datasource.gif
index d592c7c..555a208 100644
Binary files a/docs/en_US/images/readme/datasource.gif and b/docs/en_US/images/readme/datasource.gif differ
diff --git a/docs/en_US/images/readme/results.gif b/docs/en_US/images/readme/results.gif
index 7bde948..cfef7ce 100644
Binary files a/docs/en_US/images/readme/results.gif and b/docs/en_US/images/readme/results.gif differ
diff --git a/docs/en_US/images/readme/running.gif b/docs/en_US/images/readme/running.gif
index eb868d1..9d310bc 100644
Binary files a/docs/en_US/images/readme/running.gif and b/docs/en_US/images/readme/running.gif differ
diff --git a/docs/en_US/images/readme/script.gif b/docs/en_US/images/readme/script.gif
index 13ba262..39b729d 100644
Binary files a/docs/en_US/images/readme/script.gif and b/docs/en_US/images/readme/script.gif differ
diff --git a/docs/en_US/images/readme/setup.gif b/docs/en_US/images/readme/setup.gif
index 4aee4c0..7515448 100644
Binary files a/docs/en_US/images/readme/setup.gif and b/docs/en_US/images/readme/setup.gif differ
diff --git "a/docs/zh_CN/ch1/\345\211\215\345\217\260\351\203\250\347\275\262\346\226\207\346\241\243.md" "b/docs/zh_CN/ch1/\345\211\215\345\217\260\351\203\250\347\275\262\346\226\207\346\241\243.md"
index c299352..cd5a68d 100644
--- "a/docs/zh_CN/ch1/\345\211\215\345\217\260\351\203\250\347\275\262\346\226\207\346\241\243.md"
+++ "b/docs/zh_CN/ch1/\345\211\215\345\217\260\351\203\250\347\275\262\346\226\207\346\241\243.md"
@@ -3,7 +3,7 @@ Scriptis是基于Linkis开发的数据分析工具,部署Scriptis前需要先
## 1、准备工作
1. 点击release 选择对应的安装包进行下载
-2. 将下载下来的安装包在安装目录进行解压:unzip wedatasphere-scriptis-0.5.0-dist.zip
+2. 将下载下来的安装包在安装目录进行解压:unzip wedatasphere-scriptis-0.7.0-dist.zip
## 2、部署
分为两种部署方式,自动化部署和手动部署
@@ -31,7 +31,7 @@ scriptis_ipaddr=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(
### 2.2 手动部署
1.安装Nginx:```sudo yum install nginx -y```
-2.修改配置文件:sudo vi /etc/nginx/conf.d/scriptis.conf
+2.修改配置文件:sudo vi /etc/nginx/conf.d/scriptis.conf
添加如下内容:
```
server {
diff --git "a/docs/zh_CN/ch2/\347\274\226\350\257\221\346\226\207\346\241\243.md" "b/docs/zh_CN/ch2/\347\274\226\350\257\221\346\226\207\346\241\243.md"
index c1aa830..0cadeb3 100644
--- "a/docs/zh_CN/ch2/\347\274\226\350\257\221\346\226\207\346\241\243.md"
+++ "b/docs/zh_CN/ch2/\347\274\226\350\257\221\346\226\207\346\241\243.md"
@@ -26,10 +26,13 @@ npm install
您需要在代码中进行一些配置,如后端接口地址,后端socket地址等,如根目录下的.env.development文件:
```
-// 后端接口地址
-VUE_APP_MN_CONFIG_PREFIX=http://yourIp:yourPort/yourPath
-// 后端socket地址
-VUE_APP_MN_CONFIG_SOCKET=/yourSocketPath
+//restful http接口版本路径前缀,linkis后端不改一般不需要改一般不需要改 通过代理访问
+VUE_APP_MN_CONFIG_PREFIX=/api/rest_j/v1/
+//restful websocket接口版本路径前缀,linkis后端不改一般不需要改一般不需要改
+VUE_APP_MN_CONFIG_SOCKET=/ws/api/entrance/connect
+//后端host 后端gateway服务
+SERVER_HOST=http://192.168.9.180:9001
+PORT= 前端本地调试端口
```
配置的具体解释可参考vue-cli官方文档:[环境变量和模式](https://cli.vuejs.org/zh/guide/mode-and-env.html#%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%92%8C%E6%A8%A1%E5%BC%8F)
@@ -53,20 +56,6 @@ npm run serve
在浏览器中(建议Chrome浏览器)通过链接访问应用:[http://localhost:8080/](http://localhost:8080/) .
当您使用该方式运行项目时,您对代码的改动产生的效果,会动态体现在浏览器上。
-**注意:因为项目采用前后端分离开发,所以在本地浏览器上运行时,需要对浏览器进行设置跨域才能访问后端接口:**
-
-比如chrome浏览器:
-windows系统下的配置方式:
-1. 关闭所有的chrome浏览器。
-2. 新建一个chrome快捷方式,右键“属性”,“快捷方式”选项卡里选择“目标”,添加 --args --disable-web-security --user-data-dir=C:\MyChromeDevUserData
-3. 通过快捷方式打开chrome浏览器
-mac系统下的配置方式:
-在终端命令行执行以下命令(需要替换路径中的yourname,若还不生效请检查您机器上MyChromeDevUserData文件夹的位置并将路径复制到下面指令的“--user-data-dir=”后面)
-
-```
-open -n /Applications/Google\ Chrome.app/ --args --disable-web-security --user-data-dir=/Users/yourname/MyChromeDevUserData/
-```
-
### 常见问题
diff --git a/docs/zh_CN/images/readme/cs.gif b/docs/zh_CN/images/readme/cs.gif
index 7d3125e..4df76a1 100644
Binary files a/docs/zh_CN/images/readme/cs.gif and b/docs/zh_CN/images/readme/cs.gif differ
diff --git a/docs/zh_CN/images/readme/datasource.gif b/docs/zh_CN/images/readme/datasource.gif
index d592c7c..eedea96 100644
Binary files a/docs/zh_CN/images/readme/datasource.gif and b/docs/zh_CN/images/readme/datasource.gif differ
diff --git a/docs/zh_CN/images/readme/results.gif b/docs/zh_CN/images/readme/results.gif
index 7bde948..c95943c 100644
Binary files a/docs/zh_CN/images/readme/results.gif and b/docs/zh_CN/images/readme/results.gif differ
diff --git a/docs/zh_CN/images/readme/running.gif b/docs/zh_CN/images/readme/running.gif
index eb868d1..81ff072 100644
Binary files a/docs/zh_CN/images/readme/running.gif and b/docs/zh_CN/images/readme/running.gif differ
diff --git a/docs/zh_CN/images/readme/script.gif b/docs/zh_CN/images/readme/script.gif
index 13ba262..a503694 100644
Binary files a/docs/zh_CN/images/readme/script.gif and b/docs/zh_CN/images/readme/script.gif differ
diff --git a/docs/zh_CN/images/readme/setup.gif b/docs/zh_CN/images/readme/setup.gif
index 4aee4c0..dabb635 100644
Binary files a/docs/zh_CN/images/readme/setup.gif and b/docs/zh_CN/images/readme/setup.gif differ
diff --git a/package.json b/package.json
index 1353103..050820e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "scriptis",
- "version": "0.5.0",
+ "version": "0.7.2",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
@@ -40,6 +40,7 @@
"eslint-config-google": "^0.13.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-vue": "^5.0.0",
+ "filemanager-webpack-plugin": "^2.0.5",
"monaco-editor-webpack-plugin": "^1.7.0",
"node-sass": "^4.9.0",
"sass-loader": "^7.1.0",
diff --git a/src/js/component/editor/editor.vue b/src/js/component/editor/editor.vue
index ac71ba4..6f44e38 100644
--- a/src/js/component/editor/editor.vue
+++ b/src/js/component/editor/editor.vue
@@ -9,7 +9,6 @@ import _ from 'lodash';
import { parser } from 'dt-sql-parser';
import storage from '@/js/helper/storage';
import highRiskGrammar from './highRiskGrammar';
-
const types = {
code: {
theme: 'defaultView',
@@ -51,8 +50,9 @@ export default {
editor: null,
editorModel: null,
decorations: null,
- parseErrorLine: 0,
isParserClose: false,
+ closeParser: null,
+ openParser: null,
};
},
computed: {
@@ -86,8 +86,10 @@ export default {
'value': function(newValue, oldValue) {
if (this.editor) {
this.$emit('on-operator');
- this.sqlParser(newValue);
- if (newValue == this.getValue()) {
+ if (!this.isParserClose) {
+ this.sqlParser(newValue);
+ }
+ if (newValue == this.getValue() ) {
return;
}
let readOnly = this.editor.getConfiguration().readOnly;
@@ -126,8 +128,9 @@ export default {
this.editor = monaco.editor.create(this.$el, this.currentConfig);
this.monaco = monaco;
this.editorModel = this.editor.getModel();
+ this.isParserClose = !!storage.get('isParserClose', 'local');
if (this.type !== 'log') {
- if (this.scriptType !== 'hdfsScript' && !this.readOnly) {
+ if (this.scriptType !== 'hdfsScript' && !this.readOnly ) {
this.addCommands();
this.addActions();
}
@@ -168,7 +171,6 @@ export default {
folded sections
for a certain model when it is connected to an editor instance.
Once the same model is connected to the same or a different editor instance, editor.restoreViewState can be used to restore the above listed state.
-
There are very many things that influence how rendering occurs:
the current theme
the current wrapping settings set on the editor
@@ -253,7 +255,6 @@ export default {
if (window.monaco) {
const monaco = window.monaco;
const vm = this;
-
this.editor.addAction({
id: 'editor.action.execute',
label: '运行脚本',
@@ -265,7 +266,6 @@ export default {
vm.$emit('on-run');
},
});
-
this.editor.addAction({
id: 'format',
label: '格式化',
@@ -277,7 +277,6 @@ export default {
editor.trigger('anyString', 'editor.action.formatDocument');
},
});
-
this.editor.addAction({
id: 'find',
label: '查找',
@@ -289,7 +288,6 @@ export default {
editor.trigger('find', 'actions.find');
},
});
-
this.editor.addAction({
id: 'replace',
label: '替换',
@@ -301,7 +299,6 @@ export default {
editor.trigger('findReplace', 'editor.action.startFindReplaceAction');
},
});
-
this.editor.addAction({
id: 'commentLine',
label: '行注释',
@@ -313,7 +310,6 @@ export default {
editor.trigger('commentLine', 'editor.action.commentLine');
},
});
-
this.editor.addAction({
id: 'paste',
label: '粘贴',
@@ -331,7 +327,6 @@ export default {
return null;
},
});
-
this.editor.addAction({
id: 'gotoLine',
label: '跳到指定行',
@@ -343,11 +338,10 @@ export default {
editor.trigger('gotoLine', 'editor.action.gotoLine');
},
});
-
if (this.language === 'hql') {
// 控制语法检查
- const closeParser = this.editor.createContextKey('closeParser', true);
- const openParser = this.editor.createContextKey('openParser', false);
+ this.closeParser = this.editor.createContextKey('closeParser', !this.isParserClose);
+ this.openParser = this.editor.createContextKey('openParser', this.isParserClose);
this.editor.addAction({
id: 'closeParser',
label: '关闭语法检查',
@@ -358,14 +352,14 @@ export default {
contextMenuGroupId: 'control',
contextMenuOrder: 2.0,
run(editor) {
+ storage.set('isParserClose', true, 'local');
vm.isParserClose = true;
// 控制右键菜单的显示
- openParser.set(true);
- closeParser.set(false);
+ vm.openParser.set(true);
+ vm.closeParser.set(false);
vm.sqlParser();
},
});
-
this.editor.addAction({
id: 'openParser',
label: '打开语法检查',
@@ -375,9 +369,10 @@ export default {
contextMenuGroupId: 'control',
contextMenuOrder: 2.1,
run(editor) {
+ storage.set('isParserClose', false, 'local');
vm.isParserClose = false;
- openParser.set(false);
- closeParser.set(true);
+ vm.openParser.set(false);
+ vm.closeParser.set(true);
vm.sqlParser();
},
});
@@ -385,18 +380,18 @@ export default {
}
},
sqlParser: _.debounce(function(value, cb) {
- const _this = this;
+ const vm = this;
let highRiskList = [];
- const lang = _this.language;
- const app = _this.application;
+ const lang = vm.language;
+ const app = vm.application;
if (lang === 'python' || (app === 'spark' && ['java', 'hql'].indexOf(lang) !== -1) || app === 'hive') {
// 高危语法的高亮
- highRiskList = _this.setHighRiskGrammar();
- const decora = _this.decorations || [];
+ highRiskList = vm.setHighRiskGrammar();
+ const decora = vm.decorations || [];
let isParseSuccess = true;
if (lang === 'hql') {
- const val = value || _this.value;
- const validParser = _this.isParserClose ? null : parser.parseSyntax(val, 'hive');
+ const val = value || vm.value;
+ const validParser = vm.isParserClose ? null : parser.parseSyntax(val, 'hive');
let newDecora = [];
if (validParser) {
isParseSuccess = false;
@@ -426,21 +421,12 @@ export default {
},
},
}];
- // 跳到指定行
- const line = validParser.loc.first_line;
- if (_this.parseErrorLine !== line) {
- _this.parseErrorLine = line;
- _this.editor.revealPositionInCenter({
- lineNumber: line,
- column: validParser.loc.first_column,
- });
- }
}
// 第一个参数是旧的,用于清空decorations
- _this.decorations = _this.editor.deltaDecorations(decora, newDecora.concat(highRiskList));
- _this.$emit('is-parse-success', isParseSuccess);
+ vm.decorations = vm.editor.deltaDecorations(decora, newDecora.concat(highRiskList));
+ vm.$emit('is-parse-success', isParseSuccess);
} else {
- _this.decorations = _this.editor.deltaDecorations(decora, highRiskList);
+ vm.decorations = vm.editor.deltaDecorations(decora, highRiskList);
}
if (cb) {
cb(isParseSuccess);
@@ -497,4 +483,4 @@ export default {
},
};
-
+
\ No newline at end of file
diff --git a/src/js/component/table/body.vue b/src/js/component/table/body.vue
index 5e18472..a96ecef 100644
--- a/src/js/component/table/body.vue
+++ b/src/js/component/table/body.vue
@@ -1,10 +1,10 @@
@@ -40,17 +40,14 @@ export default {
type: Array,
required: true,
},
-
estimatedItemSize: {
type: Number,
default: 30,
},
-
itemSizeGetter: {
type: Function,
},
},
-
data() {
return {
viewWidth: 0,
@@ -83,7 +80,7 @@ export default {
},
computed: {
contentWidth() {
- const { data, lastMeasuredIndex, estimatedItemSize } = this;
+ const {data, lastMeasuredIndex, estimatedItemSize} = this;
let itemCount = data.length;
if (lastMeasuredIndex >= 0) {
const lastMeasuredSizeAndOffset = this.getLastMeasuredSizeAndOffset();
@@ -96,11 +93,11 @@ export default {
watch: {
data: {
handler() {
- let { v, h } = this.cacheVH;
+ let {v, h} = this.cacheVH;
this.handleScroll(v, h);
},
deep: true,
- },
+ },
},
mounted() {
this.updateVisibleData();
@@ -108,7 +105,7 @@ export default {
},
methods: {
getItemSizeAndOffset(index) {
- const { lastMeasuredIndex, sizeAndOffsetCahce, data, itemSizeGetter } = this;
+ const {lastMeasuredIndex, sizeAndOffsetCahce, data, itemSizeGetter} = this;
if (lastMeasuredIndex >= index) {
return sizeAndOffsetCahce[index];
}
@@ -139,25 +136,21 @@ export default {
}
return sizeAndOffsetCahce[index];
},
-
getLastMeasuredSizeAndOffset() {
- return this.lastMeasuredIndex >= 0 ? this.sizeAndOffsetCahce[this.lastMeasuredIndex] : { offset: 0, size: 0 };
+ return this.lastMeasuredIndex >= 0 ? this.sizeAndOffsetCahce[this.lastMeasuredIndex] : {offset: 0, size: 0};
},
-
findNearestItemIndex(scrollLeft) {
- const { data } = this;
+ const {data} = this;
let total = 0;
for (let i = 0, j = data.length; i < j; i++) {
const size = this.getItemSizeAndOffset(i).size;
total += size;
- if (total >= scrollLeft || i === j - 1) {
+ if (total >= scrollLeft || i === j -1) {
return i;
}
}
-
return 0;
},
-
updateVisibleData(scrollLeft) {
let canScrollWidth = this.contentWidth - this.viewWidth;
scrollLeft = scrollLeft || 0;
@@ -168,13 +161,12 @@ export default {
const end = this.findNearestItemIndex(scrollLeft + (this.$el.clientWidth || 1400));
this.visibleData = this.data.slice(start, Math.min(end + 3, this.data.length));
this.startIndex = start;
- this.$refs.content.style.webkitTransform = `translate3d(${this.getItemSizeAndOffset(start).offset}px, 0, 0)`;
+ this.$refs.content.style.webkitTransform = `translate3d(${ this.getItemSizeAndOffset(start).offset }px, 0, 0)`;
},
-
handleScroll(v, h) {
- const { scrollLeft } = h;
- this.cacheVH = { v, h };
- this.$emit('on-scroll', { v, h });
+ const {scrollLeft} = h;
+ this.cacheVH = {v, h};
+ this.$emit('on-scroll', {v, h});
this.updateVisibleData(scrollLeft);
},
},
@@ -189,7 +181,6 @@ right: 0;
z-index: -1;
height: 100%;
}
-
.list-view-content {
display: flex;
left: 0;
@@ -198,7 +189,6 @@ top: 0;
position: absolute;
height: 100%;
}
-
.list-view-item {
height: 100%;
color: #666;
@@ -206,4 +196,4 @@ box-sizing: border-box;
flex-shrink: 0;
text-align: center;
}
-
+
\ No newline at end of file
diff --git a/src/js/component/table/expand.js b/src/js/component/table/expand.js
new file mode 100644
index 0000000..945a279
--- /dev/null
+++ b/src/js/component/table/expand.js
@@ -0,0 +1,21 @@
+export default {
+ name: 'TableExpand',
+ functional: true,
+ props: {
+ row: Object,
+ render: Function,
+ index: Number,
+ column: {
+ type: Object,
+ default: null,
+ },
+ },
+ render: (h, ctx) => {
+ const params = {
+ row: ctx.props.row,
+ index: ctx.props.index,
+ };
+ if (ctx.props.column) params.column = ctx.props.column;
+ return ctx.props.render(h, params);
+ },
+};
diff --git a/src/js/component/table/historyTable.vue b/src/js/component/table/historyTable.vue
index f5ae138..b3d941d 100644
--- a/src/js/component/table/historyTable.vue
+++ b/src/js/component/table/historyTable.vue
@@ -298,4 +298,4 @@ export default {
},
};
-
+
diff --git a/src/js/component/table/index.js b/src/js/component/table/index.js
index 3807510..05cfcb2 100644
--- a/src/js/component/table/index.js
+++ b/src/js/component/table/index.js
@@ -1,3 +1,7 @@
-import WeTable from './table.vue'
+import WeTable from './table.vue';
+import historyTable from './historyTable.vue';
-export default WeTable
+export default {
+ WeTable,
+ historyTable,
+};
diff --git a/src/js/component/table/index.scss b/src/js/component/table/index.scss
index 9d70c37..d34159d 100644
--- a/src/js/component/table/index.scss
+++ b/src/js/component/table/index.scss
@@ -92,12 +92,10 @@ $border-color : #e0e0e0;
border-bottom: 1px solid $border-color;
}
.we-column-item{
- height: 42px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
+ height: 67px;
border-bottom: 1px solid $border-color;
- padding: 12px 0 12px 10px;
+ padding: 6px;
+ word-break: break-all;
&.odd{
background: rgb(250, 250, 250)
}
@@ -108,4 +106,100 @@ $border-color : #e0e0e0;
color: red;
font-style: italic;
}
-}
\ No newline at end of file
+ .we-column-item-content {
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow-y: auto;
+ }
+}
+.hidden-div {
+ .hidden-div-item {
+ padding: 12px 10px 12px 10px;
+ word-break: break-all;
+ }
+}
+.we-table-wrap {
+ overflow: auto;
+ display: block;
+ .we-table {
+ border: 1px solid #dcdee2;
+ table-layout: fixed;
+ .we-table-thead {
+ background-color: #2d8cf0;
+ color: #fff;
+ .we-table-thead-cell {
+ border-right: 1px solid #dcdee2;
+ border-bottom: 1px solid #dcdee2;
+ min-width: 0;
+ height: 48px;
+ box-sizing: border-box;
+ text-align: left;
+ text-overflow: ellipsis;
+ vertical-align: middle;
+ }
+ }
+ .we-table-row {
+ height: 40px;
+ &:nth-child(2n) {
+ background-color: #f8f8f9;
+ }
+ &:hover {
+ background-color: #ebf7ff;
+ }
+ .we-table-row-cell {
+ border-right: 1px solid #dcdee2;
+ border-bottom: 1px solid #dcdee2;
+ min-width: 0;
+ height: 48px;
+ box-sizing: border-box;
+ text-align: left;
+ text-overflow: ellipsis;
+ vertical-align: middle;
+ .we-table-row-label {
+ line-height: 20px;
+ padding-left: 18px;
+ padding-right: 18px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: normal;
+ word-break: break-all;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ &.ellipsis {
+ text-align: left;
+ word-break: keep-all;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ .render-btn {
+ color: #515a6e;
+ background-color: transparent;
+ border-color: transparent;
+ padding: 1px 7px 2px;
+ font-size: 12px;
+ border-radius: 3px;
+ display: inline-block;
+ margin-bottom: 0;
+ font-weight: 400;
+ text-align: center;
+ cursor: pointer;
+ background-image: none;
+ border: 1px solid transparent;
+ white-space: nowrap;
+ border-radius: 4px;
+ transition: color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear;
+ &:hover {
+ color: #57a3f3;
+ background-color: #fff;
+ border-color: transparent;
+ text-decoration: none;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/js/component/table/list.vue b/src/js/component/table/list.vue
index eb0b7dc..719836f 100644
--- a/src/js/component/table/list.vue
+++ b/src/js/component/table/list.vue
@@ -20,7 +20,7 @@
class="we-column-item"
:class="{'null-text': content === 'NULL', 'active': contentIndex === activeRowIndex}"
@click.stop="columnItemClick(contentIndex)">
- {{ content }}
+ {{ content }}
@@ -46,12 +46,10 @@ export default {
type: Array,
required: true,
},
-
estimatedItemSize: {
type: Number,
default: 30,
},
-
itemSizeGetter: {
type: Function,
},
diff --git a/src/js/component/table/table.vue b/src/js/component/table/table.vue
index 4091743..75d80f6 100644
--- a/src/js/component/table/table.vue
+++ b/src/js/component/table/table.vue
@@ -34,16 +34,14 @@
diff --git a/src/js/module/fnSidebar/fnSidebar.vue b/src/js/module/fnSidebar/fnSidebar.vue
index 14a7b9b..a1aea68 100644
--- a/src/js/module/fnSidebar/fnSidebar.vue
+++ b/src/js/module/fnSidebar/fnSidebar.vue
@@ -180,7 +180,7 @@ export default {
created() {
this.initTreeData();
this.$nextTick(() => {
- api.fetch('/publicservice/authenticate').then((rst) => {
+ api.fetch('/udf/authenticate').then((rst) => {
this.isUdfManager = rst.isUDFManager;
});
});
@@ -191,7 +191,7 @@ export default {
const fnTree = storage.get(tmp, 'SESSION');
if (!fnTree || _.isEmpty(fnTree)) {
this.treeLoading = true;
- api.fetch('/publicservice/list', {
+ api.fetch('/udf/list', {
type: 'self',
treeId: -1,
category: this.FNTYPE,
@@ -222,7 +222,7 @@ export default {
benchCheck(...args) {
if (this.loading) return this.$Message.warning('请等待接口返回!');
const node = args[0].node.data;
- const url = `/publicservice/isload`;
+ const url = `/udf/isload`;
this.loading = true;
api.fetch(url, {
udfId: node.id,
@@ -252,7 +252,7 @@ export default {
let params = null;
let url = null;
if (!data.isLeaf) {
- url = '/publicservice/tree/add';
+ url = '/udf/tree/add';
params = {
parent: this.currentNode.data.id,
name: data.name,
@@ -261,7 +261,7 @@ export default {
};
this.calling(url, params, 'new', data.isLeaf);
} else {
- url = '/publicservice/add';
+ url = '/udf/add';
params = {
isShared: data.shared,
udfInfo: {
@@ -293,7 +293,7 @@ export default {
let params = null;
let url = null;
if (!data.isLeaf) {
- url = '/publicservice/tree/update';
+ url = '/udf/tree/update';
params = {
id: this.currentNode.data.id,
parent: this.currentNode.parent.data.id,
@@ -302,7 +302,7 @@ export default {
category: this.FNTYPE,
};
} else {
- url = '/publicservice/update';
+ url = '/udf/update';
params = {
isShared: data.shared,
udfInfo: {
@@ -413,12 +413,12 @@ export default {
let url;
let param;
if (this.currentNode.isLeaf) {
- url = `/publicservice/delete/${this.currentNode.data.id}`;
+ url = `/udf/delete/${this.currentNode.data.id}`;
param = {
isShared: this.currentNode.data.shared,
};
} else {
- url = `/publicservice/tree/delete/${this.currentNode.data.id}`;
+ url = `/udf/tree/delete/${this.currentNode.data.id}`;
param = {};
}
api.fetch(url, param, 'get').then((rst) => {
@@ -436,7 +436,7 @@ export default {
if (this.treeLoading) return this.$Message.warning('请等待接口返回!');
this.treeLoading = true;
const node = this.fnTree.find((item) => item.type === 'share');
- api.fetch('/publicservice/list', {
+ api.fetch('/udf/list', {
type: node.type,
treeId: node.id,
category: this.FNTYPE,
@@ -447,7 +447,7 @@ export default {
const params = {
udfName: this.currentNode.data.name,
};
- api.fetch('/publicservice/getSharedUsers', params).then((rst) => {
+ api.fetch('/udf/getSharedUsers', params).then((rst) => {
this.$refs.share.open({ tree: list, node: this.currentNode, isView: !flag, shareUser: rst.shareUsers.toString() });
});
}
@@ -481,7 +481,7 @@ export default {
useFormat: node.useFormat,
},
};
- api.fetch('/publicservice/shareUDF', params).then(() => {
+ api.fetch('/udf/shareUDF', params).then(() => {
this.loading = false;
this.$Message.success(`函数${this.currentNode.data.name}已共享成功!`);
this.refresh('edit');
@@ -495,7 +495,7 @@ export default {
udfName: this.currentNode.data.name,
sharedUsers: option.sharedUsers,
};
- api.fetch('/publicservice/updateSharedUsers', params).then(() => {
+ api.fetch('/udf/updateSharedUsers', params).then(() => {
this.loading = false;
this.$Message.success(`修改共享用户成功!`);
}).catch((err) => {
@@ -511,7 +511,7 @@ export default {
udfId: this.currentNode.data.id,
udfName: this.currentNode.data.name,
};
- api.fetch('/publicservice/setExpire', params).then((rst) => {
+ api.fetch('/udf/setExpire', params).then((rst) => {
this.currentNode.data.shared = false;
this.$Message.success('函数已设置为过期,请到共享函数中查看!');
});
@@ -564,7 +564,7 @@ export default {
// 请求文件夹数据
loadDataFn(node, cb) {
this.treeLoading = true;
- api.fetch('/publicservice/list', {
+ api.fetch('/udf/list', {
type: node.data.type,
treeId: node.data.id,
category: this.FNTYPE,
@@ -624,7 +624,7 @@ export default {
const parent = this.lookForChangeNode(id, this.fnTree, 'tree');
if (parent) {
this.treeLoading = true;
- api.fetch('/publicservice/list', {
+ api.fetch('/udf/list', {
type: parent.type,
treeId: parent.id,
category: this.FNTYPE,
diff --git a/src/js/module/fnSidebar/index.js b/src/js/module/fnSidebar/index.js
index 3c92a36..51db65f 100644
--- a/src/js/module/fnSidebar/index.js
+++ b/src/js/module/fnSidebar/index.js
@@ -6,7 +6,7 @@ export default {
data: {},
methods: {
getAllLoadedFunction(cb) {
- api.fetch(`/publicservice/all`).then((rst) => {
+ api.fetch(`/udf/all`).then((rst) => {
cb({
list: rst.udfTree.udfInfos,
isError: false,
diff --git a/src/js/module/footer/index.vue b/src/js/module/footer/index.vue
index 7da3cee..fe26068 100644
--- a/src/js/module/footer/index.vue
+++ b/src/js/module/footer/index.vue
@@ -38,7 +38,7 @@ export default {
},
methods: {
getRunningJob() {
- api.fetch('/publicservice/list', {
+ api.fetch('/jobhistory/list', {
pageSize: 100,
status: 'Running,Inited,Scheduled',
}, 'get').then((rst) => {
diff --git a/src/js/module/globalHistory/index.vue b/src/js/module/globalHistory/index.vue
index 04e5ac2..c96f87e 100644
--- a/src/js/module/globalHistory/index.vue
+++ b/src/js/module/globalHistory/index.vue
@@ -27,7 +27,7 @@
v-model="searchBar.proxyUser"
placeholder="请输入用户名搜索"
style="width:120px;"
- :readonly="isLogModuleShow">
+ :readonly="isLogModuleShow" />
s.rule.test(params.row.fileName));
const ext = match ? match.ext : '.hql';
if (!params.row.logPath) {
- await api.fetch(`/query/${params.row.taskID}/get`, 'get').then((rst) => {
+ await api.fetch(`/jobhistory/${params.row.taskID}/get`, 'get').then((rst) => {
params.row.logPath = rst.task.logPath;
});
}
const name = `history_item_${params.row.taskID}${ext}`;
const md5Id = util.md5(name);
- this.$router.push({path: '/', query: {
- id: md5Id,
- taskID: params.row.taskID,
- filename: name,
- filepath: '',
- saveAs: true,
- type: 'historyScript',
- code: params.row.executionCode,
- }});
+ this.$router.push({ path: '/',
+ query: {
+ id: md5Id,
+ taskID: params.row.taskID,
+ filename: name,
+ filepath: '',
+ saveAs: true,
+ type: 'historyScript',
+ code: params.row.executionCode,
+ } });
}
},
getLogs(jobId) {
- api.fetch(`/query/${jobId}/get`, 'get').then((res) => {
+ api.fetch(`/jobhistory/${jobId}/get`, 'get').then((res) => {
this.searchBar.lastId = Number(this.searchBar.id);
this.searchBar.id = jobId;
this.searchBar.lastProxyUser = this.searchBar.proxyUser;
@@ -402,7 +402,7 @@ export default {
const errCode = res.task.errCode ? '\n错误码:' + res.task.errCode : '';
const errDesc = res.task.errDesc ? '\n错误描述:' + res.task.errDesc : '';
const info = '未获取到日志!' + errCode + errDesc;
- this.logs = {all: info, error: '', warning: '', info: ''};
+ this.logs = { all: info, error: '', warning: '', info: '' };
this.fromLine = 1;
return;
}
@@ -412,7 +412,7 @@ export default {
}, 'get').then((rst) => {
this.isLoading = false;
if (rst) {
- const log = {all: '', error: '', warning: '', info: ''};
+ const log = { all: '', error: '', warning: '', info: '' };
const convertLogs = util.convertLog(rst.log);
Object.keys(convertLogs).forEach((key) => {
if (convertLogs[key]) {
@@ -471,7 +471,7 @@ export default {
changePage(page) {
this.isLoading = true;
const params = this.getParams(page);
- api.fetch('/publicservice/list', params, 'get').then((rst) => {
+ api.fetch('/jobhistory/list', params, 'get').then((rst) => {
this.isLoading = false;
this.list = rst.tasks;
this.pageSetting.current = page;
@@ -484,7 +484,7 @@ export default {
search() {
this.isLoading = true;
const params = this.getParams();
- api.fetch('/publicservice/list', params, 'get').then((rst) => {
+ api.fetch('/jobhistory/list', params, 'get').then((rst) => {
this.pageSetting.total = rst.totalPage;
this.isLoading = false;
this.list = rst.tasks;
diff --git a/src/js/module/globalHistory/log.vue b/src/js/module/globalHistory/log.vue
index bf83be6..239cc4c 100644
--- a/src/js/module/globalHistory/log.vue
+++ b/src/js/module/globalHistory/log.vue
@@ -153,5 +153,5 @@ export default {
},
};
-
diff --git a/src/js/module/globalValiable/index.js b/src/js/module/globalValiable/index.js
index 5493632..01aa6b6 100644
--- a/src/js/module/globalValiable/index.js
+++ b/src/js/module/globalValiable/index.js
@@ -7,7 +7,7 @@ export default {
},
methods: {
getGlobalVariable(cb) {
- api.fetch('/publicservice/listGlobalVariable', 'get').then((res) => {
+ api.fetch('/variable/listGlobalVariable', 'get').then((res) => {
cb({
list: res.globalVariables,
isError: false,
diff --git a/src/js/module/globalValiable/index.vue b/src/js/module/globalValiable/index.vue
index 1f080ac..6502e0c 100644
--- a/src/js/module/globalValiable/index.vue
+++ b/src/js/module/globalValiable/index.vue
@@ -126,7 +126,7 @@ export default {
},
methods: {
getGlobalValiableList() {
- api.fetch('/publicservice/listGlobalVariable', 'get').then((res) => {
+ api.fetch('/variable/listGlobalVariable', 'get').then((res) => {
this.formDynamic.items = res.globalVariables.map((item, index) => {
return Object.assign(item);
});
@@ -157,7 +157,7 @@ export default {
},
save() {
this.loading = true;
- api.fetch('/publicservice/saveGlobalVariable ', {
+ api.fetch('/variable/saveGlobalVariable ', {
globalVariables: this.formDynamic.items,
}).then((res) => {
this.loading = false;
diff --git a/src/js/module/hdfsSidebar/hdfsSidebar.vue b/src/js/module/hdfsSidebar/hdfsSidebar.vue
index ca150ba..a40f554 100644
--- a/src/js/module/hdfsSidebar/hdfsSidebar.vue
+++ b/src/js/module/hdfsSidebar/hdfsSidebar.vue
@@ -235,7 +235,7 @@ export default {
getRootPath(cb) {
this.rootPath = storage.get('hdfsRootPath', 'SESSION');
if (!this.rootPath) {
- api.fetch(`/publicservice/getUserRootPath`, {
+ api.fetch(`/filesystem/getUserRootPath`, {
pathType: 'hdfs',
}, 'get').then((rst) => {
if (rst.userHDFSRootPath) {
@@ -254,7 +254,7 @@ export default {
}
},
getTree(cb) {
- api.fetch(`/publicservice/getDirFileTrees`, {
+ api.fetch(`/filesystem/getDirFileTrees`, {
path: this.rootPath,
}, 'get')
.then((rst) => {
@@ -354,7 +354,7 @@ export default {
});
},
handleCreating(node, cb) {
- api.fetch('/publicservice/createNewDir', {
+ api.fetch('/filesystem/createNewDir', {
path: node.path,
}).then(() => {
cb(true);
@@ -363,7 +363,7 @@ export default {
});
},
rename(path, oldPath, cb) {
- api.fetch('/publicservice/rename', {
+ api.fetch('/filesystem/rename', {
oldDest: oldPath,
newDest: path,
}).then((rst) => {
@@ -386,7 +386,7 @@ export default {
cb(false);
return this.$Message.error(`文件${path}已经存在`);
}
- api.fetch('/publicservice/rename', {
+ api.fetch('/filesystem/rename', {
oldDest: args.node.path,
newDest: path,
}).then(() => {
@@ -435,7 +435,7 @@ export default {
const path = this.currentNode.data.path;
this.loading = true;
this.dispatch('Workbench:remove', path, () => {
- api.fetch('/publicservice/deleteDirOrFile', {
+ api.fetch('/filesystem/deleteDirOrFile', {
path,
}).then((rst) => {
this.$Message.success('删除成功');
@@ -481,7 +481,7 @@ export default {
},
loadDataFn(node, cb) {
this.treeLoading = true;
- api.fetch(`/publicservice/getDirFileTrees`, {
+ api.fetch(`/filesystem/getDirFileTrees`, {
path: node.data.path,
}, 'get')
.then((rst) => {
@@ -529,7 +529,7 @@ export default {
nodePath = path.slice(0, path.lastIndexOf('/'));
}
if (_.isEmpty(this.fileTree)) return this.initData();
- api.fetch(`/publicservice/getDirFileTrees`, {
+ api.fetch(`/filesystem/getDirFileTrees`, {
path: nodePath,
}, 'get')
.then((rst) => {
@@ -667,7 +667,7 @@ export default {
escapeQuotes = true;
quote = option.quote;
}
- const url = `/publicservice/formate?path=${option.exportPath}&encoding=${encoding}&fieldDelimiter=${fieldDelimiter}&hasHeader=${option.isHasHeader}&escapeQuotes=${escapeQuotes}"e=${quote}`;
+ const url = `/filesystem/formate?path=${option.exportPath}&encoding=${encoding}&fieldDelimiter=${fieldDelimiter}&hasHeader=${option.isHasHeader}&escapeQuotes=${escapeQuotes}"e=${quote}`;
api.fetch(url, {}, {
method: 'get',
timeout: '600000',
diff --git a/src/js/module/header/index.vue b/src/js/module/header/index.vue
index 9bfe357..2ece011 100644
--- a/src/js/module/header/index.vue
+++ b/src/js/module/header/index.vue
@@ -73,7 +73,7 @@ export default {
},
methods: {
init() {
- api.fetch('/publicservice/getBaseInfo', 'get').then((rst) => {
+ api.fetch('/application/getBaseInfo', 'get').then((rst) => {
if (!_.isEmpty(rst)) {
this.userName = rst.userInfo.basic.userName;
storage.set('baseInfo', rst);
diff --git a/src/js/module/logView/index.vue b/src/js/module/logView/index.vue
index 310fe39..0bbc9a3 100755
--- a/src/js/module/logView/index.vue
+++ b/src/js/module/logView/index.vue
@@ -52,7 +52,7 @@
-
diff --git a/src/js/module/resourceSimple/job.vue b/src/js/module/resourceSimple/job.vue
index d2258fa..04dd7bd 100644
--- a/src/js/module/resourceSimple/job.vue
+++ b/src/js/module/resourceSimple/job.vue
@@ -96,7 +96,7 @@ export default {
methods: {
getJobList() {
this.jobList = [];
- api.fetch('/publicservice/list', {
+ api.fetch('/jobhistory/list', {
pageSize: 100,
status: 'Running,Inited,Scheduled',
}, 'get').then((rst) => {
diff --git a/src/js/module/setting/setting.vue b/src/js/module/setting/setting.vue
index 587776c..ca37ccb 100644
--- a/src/js/module/setting/setting.vue
+++ b/src/js/module/setting/setting.vue
@@ -110,7 +110,7 @@ export default {
creator = IDE;
appName = type.slice(IDE.length + 1, type.length);
}
- api.fetch('/publicservice/getFullTreesByAppName', {
+ api.fetch('/configuration/getFullTreesByAppName', {
appName,
creator,
}, 'get').then((rst) => {
@@ -135,7 +135,7 @@ export default {
},
save() {
this.loading = true;
- api.fetch('/publicservice/saveFullTree', {
+ api.fetch('/configuration/saveFullTree', {
fullTree: this.fullTree,
}).then((rst) => {
this.getAppVariable(this.activeMenu);
diff --git a/src/js/module/workSidebar/workSidebar.vue b/src/js/module/workSidebar/workSidebar.vue
index 9f8db20..f421f6c 100644
--- a/src/js/module/workSidebar/workSidebar.vue
+++ b/src/js/module/workSidebar/workSidebar.vue
@@ -250,7 +250,7 @@ export default {
getRootPath(cb) {
this.rootPath = storage.get('shareRootPath', 'SESSION');
if (!this.rootPath) {
- api.fetch(`/publicservice/getUserRootPath`, {
+ api.fetch(`/filesystem/getUserRootPath`, {
pathType: 'file',
}, 'get').then((rst) => {
if (rst.userLocalRootPath) {
@@ -269,7 +269,7 @@ export default {
}
},
getTree(cb) {
- api.fetch(`/publicservice/getDirFileTrees`, {
+ api.fetch(`/filesystem/getDirFileTrees`, {
path: this.rootPath,
}, 'get')
.then((rst) => {
@@ -364,8 +364,8 @@ export default {
},
handleCreating(node, cb) {
const url = node.isLeaf
- ? '/publicservice/createNewFile'
- : '/publicservice/createNewDir';
+ ? '/filesystem/createNewFile'
+ : '/filesystem/createNewDir';
api.fetch(url, {
path: node.path,
}).then(() => {
@@ -375,7 +375,7 @@ export default {
});
},
rename(path, oldPath, cb) {
- api.fetch('/publicservice/rename', {
+ api.fetch('/filesystem/rename', {
oldDest: oldPath,
newDest: path,
}).then((rst) => {
@@ -398,7 +398,7 @@ export default {
cb(false);
return this.$Message.error(`文件${path}已经存在`);
}
- api.fetch('/publicservice/rename', {
+ api.fetch('/filesystem/rename', {
oldDest: args.node.path,
newDest: path,
}).then(() => {
@@ -450,7 +450,7 @@ export default {
// 否则调用接口,文件在后台删除,前台保存会报错!
if (flag === 'save' || flag === 'none') {
this.loading = true;
- api.fetch('/publicservice/deleteDirOrFile', {
+ api.fetch('/filesystem/deleteDirOrFile', {
path,
}).then((rst) => {
this.loading = false;
@@ -503,7 +503,7 @@ export default {
loadDataFn(node, cb) {
this.treeLoading = true;
api.fetch(
- `/publicservice/getDirFileTrees`, {
+ `/filesystem/getDirFileTrees`, {
path: node.data.path,
},
'get'
@@ -557,7 +557,7 @@ export default {
} else if (type === 'new' && path) {
nodePath = path.slice(0, path.lastIndexOf('/'));
}
- api.fetch(`/publicservice/getDirFileTrees`, {
+ api.fetch(`/filesystem/getDirFileTrees`, {
path: nodePath,
}, 'get').then((rst) => {
this.treeLoading = false;
@@ -707,7 +707,7 @@ export default {
// 没有children数据,请求加载目录数据之后展开目录,已加载数据则直接展开
if (needLoadDirs.length > 0) {
const loadDirPromises = needLoadDirs.map((path) => {
- return api.fetch(`/publicservice/getDirFileTrees`, {
+ return api.fetch(`/filesystem/getDirFileTrees`, {
path: path,
}, 'get').then((res) => res.dirFileTrees);
});
@@ -834,7 +834,7 @@ export default {
escapeQuotes = true;
quote = option.quote;
}
- const url = `/publicservice/formate?path=${option.exportPath}&encoding=${encoding}&fieldDelimiter=${fieldDelimiter}&hasHeader=${option.isHasHeader}&escapeQuotes=${escapeQuotes}"e=${quote}`;
+ const url = `/filesystem/formate?path=${option.exportPath}&encoding=${encoding}&fieldDelimiter=${fieldDelimiter}&hasHeader=${option.isHasHeader}&escapeQuotes=${escapeQuotes}"e=${quote}`;
api.fetch(url, {}, {
method: 'get',
timeout: '600000',
diff --git a/src/js/module/workbench/container.vue b/src/js/module/workbench/container.vue
index 5542d68..51cfb29 100644
--- a/src/js/module/workbench/container.vue
+++ b/src/js/module/workbench/container.vue
@@ -356,7 +356,7 @@ export default {
cb && cb(true);
},
'Workbench:checkExist'(option, cb) {
- api.fetch('/publicservice/isExist', {
+ api.fetch('/filesystem/isExist', {
path: option.path,
}, 'get').then((rst) => {
// 如果文件已存在,则返回false
@@ -381,7 +381,7 @@ export default {
}
const md5Path = util.md5(option.path);
const methodName = 'Workbench:add';
- api.fetch('/publicservice/openFile', {
+ api.fetch('/filesystem/openFile', {
path: option.path,
}, 'get').then((rst) => {
const ismodifyByOldTab = option.code && !rst.fileContent;
diff --git a/src/js/module/workbench/script/editor.vue b/src/js/module/workbench/script/editor.vue
index 7149ce9..d7c2b02 100644
--- a/src/js/module/workbench/script/editor.vue
+++ b/src/js/module/workbench/script/editor.vue
@@ -80,6 +80,7 @@
import module from '../index';
import setting from './setting.vue';
import api from '@/js/service/api';
+import storage from '@/js/helper/storage';
import _ from 'lodash';
export default {
components: {
@@ -118,7 +119,7 @@ export default {
watch: {
listenResource(val) {
if (!val) {
- api.fetch('/publicservice/list', {
+ api.fetch('/jobhistory/list', {
pageSize: 100,
status: 'Running,Inited,Scheduled',
}, 'get').then((rst) => {
@@ -139,6 +140,17 @@ export default {
this.$refs.editor.insertValueIntoEditor(args.value);
}
},
+ 'Workbench:setParseAction'(id) {
+ if (id === this.script.id) {
+ const editor = this.$refs.editor;
+ if (editor) {
+ const isParserClose = !!storage.get('isParserClose', 'local');
+ editor.isParserClose = isParserClose;
+ editor.closeParser && editor.closeParser.set(!isParserClose);
+ editor.openParser && editor.openParser.set(isParserClose);
+ }
+ }
+ },
undo() {
this.$refs.editor.undo();
},
@@ -162,13 +174,8 @@ export default {
this.loading = true;
this.$emit('on-run', selectCode, (status) => {
// status是start表示已经开始执行
- if (status === 'start') {
- this.loading = false;
- // 执行开始时,脚本的按钮设置为running状态
- this.script.running = true;
- }
- // 当抛出的为错误或者execute接口报错时,loading状态改为false,否则无法再次点击执行
- if (status === 'execute' || status === 'error') {
+ let list = ['execute', 'error', 'start', 'downgrade'];
+ if (list.indexOf(status) > -1) {
this.loading = false;
}
});
diff --git a/src/js/module/workbench/script/execute.js b/src/js/module/workbench/script/execute.js
index 1462940..6a27297 100644
--- a/src/js/module/workbench/script/execute.js
+++ b/src/js/module/workbench/script/execute.js
@@ -16,7 +16,7 @@ function Execute(data) {
this.progress = 0;
this.id = null;
this.status = null;
- // 仅/api/publicservice/${id}/get接口使用
+ // 仅/api/filesystem/${id}/get接口使用
this.taskID = null;
this.postType = data.data.postType || 'socket';
delete data.data.postType;
@@ -40,6 +40,7 @@ function Execute(data) {
});
this.on('execute:queryState', () => {
this.queryStatus({ isKill: false });
+ this.queryProgress();
});
this.on('stateEnd', () => {
this.getResultPath();
@@ -76,7 +77,7 @@ function Execute(data) {
if (execute.data.websocketTag === socketTag && data.method === method) {
// clearTimeout(execute.executeTimout);
timeoutCheck(execute);
- api.fetch('/publicservice/list', {
+ api.fetch('/jobhistory/list', {
pageSize: 100,
status: 'Running,Inited,Scheduled',
}, 'get').then((rst) => {
@@ -121,9 +122,6 @@ function Execute(data) {
});
this.on('downgrade', ({ data, execute }) => {
execute.postType = 'http';
- if (data) {
- execute.httpExecute();
- }
});
this.on('dataError', ({ data, execute }) => {
execute.run = false;
@@ -156,6 +154,9 @@ Execute.prototype.restore = function({ execID, taskID }) {
Execute.prototype.on = function(name, cb) {
this.event.$on(name, cb);
};
+Execute.prototype.off = function() {
+ this.event.$off();
+};
Execute.prototype.once = function(name, cb) {
this.event.$once(name, cb);
};
@@ -220,7 +221,7 @@ Execute.prototype.queryLog = function() {
Execute.prototype.getResultPath = function() {
this.trigger('steps', 'ResultLoading');
- api.fetch(`/publicservice/${this.taskID}/get`, 'get')
+ api.fetch(`/jobhistory/${this.taskID}/get`, 'get')
.then((rst) => {
this.resultsetInfo = rst.task;
this.trigger('querySuccess', {
@@ -239,7 +240,7 @@ Execute.prototype.getResultPath = function() {
Execute.prototype.getResultList = function() {
if (this.resultsetInfo && this.resultsetInfo.resultLocation) {
api.fetch(
- '/publicservice/getDirFileTrees', {
+ '/filesystem/getDirFileTrees', {
path: `${this.resultsetInfo.resultLocation}`,
},
'get'
@@ -272,7 +273,7 @@ Execute.prototype.getFirstResult = function() {
taskID: this.taskID,
status: this.status,
});
- const url = `/publicservice/openFile`;
+ const url = `/filesystem/openFile`;
const pageSize = 5000;
api.fetch(url, {
path: this.currentResultPath,
@@ -302,7 +303,7 @@ Execute.prototype.updateLastHistory = function(option, cb) {
failedReason: '',
});
}
- api.fetch(`/publicservice/${this.taskID}/get`, 'get')
+ api.fetch(`/jobhistory/${this.taskID}/get`, 'get')
.then((res) => {
const task = res.task;
if (cb) {
@@ -527,7 +528,7 @@ function setModelAndGetCode(execute, method) {
const model = method.slice(method.lastIndexOf('/') + 1, method.length);
if (model === 'backgroundservice') {
execute.model = 'background';
- api.fetch(`/publicservice/${execute.taskID}/get`, 'get').then((res) => {
+ api.fetch(`/jobhistory/${execute.taskID}/get`, 'get').then((res) => {
execute.executionCode = res.task.executionCode;
resolve(execute.executionCode);
}).catch((err) => {
diff --git a/src/js/module/workbench/script/history.vue b/src/js/module/workbench/script/history.vue
index 1aceee8..196c223 100644
--- a/src/js/module/workbench/script/history.vue
+++ b/src/js/module/workbench/script/history.vue
@@ -171,7 +171,7 @@ export default {
const match = supportModes.find((s) => s.rule.test(params.row.fileName));
const ext = match ? match.ext : '.hql';
if (!params.row.logPath) {
- await api.fetch(`/publicservice/${params.row.taskID}/get`, 'get').then((rst) => {
+ await api.fetch(`/jobhistory/${params.row.taskID}/get`, 'get').then((rst) => {
params.row.logPath = rst.task.logPath;
});
}
@@ -196,11 +196,11 @@ export default {
async downloadLog(params) {
const name = params.row.fileName + '__' + Date.now() + '.log';
if (!params.row.logPath) {
- await api.fetch(`/publicservice/${params.row.taskID}/get`, 'get').then((rst) => {
+ await api.fetch(`/jobhistory/${params.row.taskID}/get`, 'get').then((rst) => {
this.$set(params.row, 'logPath', rst.task.logPath);
});
}
- axios.post(module.data.API_PATH + 'publicservice/download', {
+ axios.post(module.data.API_PATH + 'filesystem/download', {
path: params.row.logPath,
}).then((rst) => {
const link = document.createElement('a');
diff --git a/src/js/module/workbench/script/historyScript.vue b/src/js/module/workbench/script/historyScript.vue
index 3d9aba9..7704d9f 100644
--- a/src/js/module/workbench/script/historyScript.vue
+++ b/src/js/module/workbench/script/historyScript.vue
@@ -137,7 +137,7 @@ export default {
this.scriptViewState = this.script.scriptViewState;
} else {
try {
- api.fetch(`/publicservice/${this.work.taskID}/get`, 'get').then((rst) => {
+ api.fetch(`/jobhistory/${this.work.taskID}/get`, 'get').then((rst) => {
const option = rst.task;
const supportedMode = _.find(this.getSupportModes(), (p) => p.rule.test(this.work.filename));
this.work.data = this.script = new HistoryScript(Object.assign(supportedMode, option, {
@@ -210,7 +210,7 @@ export default {
const hasResult = this.script.resultList[resultSet].hasOwnProperty('result');
if (!hasResult) {
const pageSize = 5000;
- const url = '/publicservice/openFile';
+ const url = '/filesystem/openFile';
api.fetch(url, {
path: resultPath,
pageSize,
@@ -258,7 +258,7 @@ export default {
}
},
async getLogs(option) {
- const url = `/publicservice/openLog`;
+ const url = `/filesystem/openLog`;
if (!option.logPath) {
this.script.log = { all: '', error: '', warning: '', info: '' };
this.script.logLine = 1;
@@ -284,7 +284,7 @@ export default {
});
},
async getResult(option) {
- const url1 = `/publicservice/getDirFileTrees`;
+ const url1 = `/filesystem/getDirFileTrees`;
await api.fetch(url1, {
path: option.resultLocation,
}, 'get').then((rst) => {
@@ -293,7 +293,7 @@ export default {
this.script.resultList = rst.dirFileTrees.children.sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10));
if (this.script.resultList.length) {
const currentResultPath = rst.dirFileTrees.children[0].path;
- const url2 = `/publicservice/openFile`;
+ const url2 = `/filesystem/openFile`;
api.fetch(url2, {
path: currentResultPath,
page: 1,
diff --git a/src/js/module/workbench/script/result.vue b/src/js/module/workbench/script/result.vue
index 8fafbef..551a2bb 100644
--- a/src/js/module/workbench/script/result.vue
+++ b/src/js/module/workbench/script/result.vue
@@ -110,12 +110,12 @@
+
diff --git a/src/js/module/workbench/script/script.vue b/src/js/module/workbench/script/script.vue
index 1ce076f..24ca048 100644
--- a/src/js/module/workbench/script/script.vue
+++ b/src/js/module/workbench/script/script.vue
@@ -119,6 +119,7 @@