From 5eb3190bd23483f0170d29552480c5e3e88a72aa Mon Sep 17 00:00:00 2001 From: zhaochongyu Date: Thu, 13 May 2021 16:33:34 +0800 Subject: [PATCH 1/3] features updating --- index.html | 2 +- src/api/homeTable.js | 3 +- src/components/Dialogs/Dialogs.vue | 198 ++++++++++++------ src/components/HomeTable/HomeTable.vue | 33 ++- .../Layout/Operations/Operations.vue | 44 ++-- 5 files changed, 188 insertions(+), 92 deletions(-) diff --git a/index.html b/index.html index c954583..5fbbb9d 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - HA-VUE + openUnicorn HA
diff --git a/src/api/homeTable.js b/src/api/homeTable.js index 15b7976..c162755 100644 --- a/src/api/homeTable.js +++ b/src/api/homeTable.js @@ -141,11 +141,10 @@ export function standbyAction(url) { } -export function runAction(url, data) { +export function runAction(url) { return request({ url, method: 'put', - data }) diff --git a/src/components/Dialogs/Dialogs.vue b/src/components/Dialogs/Dialogs.vue index ffc22d1..b5e0259 100644 --- a/src/components/Dialogs/Dialogs.vue +++ b/src/components/Dialogs/Dialogs.vue @@ -5,12 +5,17 @@ :visible.sync="isVisible" width="700px" :before-close="closeDialog" + v-if="isRouterShow" >
{{ title }}
- + - - + 刷新 - + { - if(_this.chosenItem.running_node.indexOf(item.id) == -1) { - _this.migrateNodes.push(item.id) + _this.nodeLists.forEach((item) => { + if (_this.chosenItem.running_node.indexOf(item.id) == -1) { + _this.migrateNodes.push(item.id); } - }) + }); _this.disableMigrateDialog = true; - } else { let req = "/resources/" + this.chosenItem.id + "/" + action; easyRequest(req).then(() => { @@ -583,14 +587,13 @@ export default { for (const key in _this.rscLocation) { location[key] = _this.rscLocation[key]; if (_this.rscLocation[key].length == 0) { - continue - } else if(_this.rscLocation[key].length >= 1) { + continue; + } else if (_this.rscLocation[key].length >= 1) { location.node_level.push({ level: key, node: _this.rscLocation[key], }); } else { - } } @@ -647,7 +650,10 @@ export default { period: "", to_node: "", }; - this.disableMigrateDialog = false + this.disableMigrateDialog = false; + }, + cleanSelets() { + this.$emit("clear"); }, }, }; -- Gitee From 6ed00e5b58a1ed7592588ca5085104c0e383af1c Mon Sep 17 00:00:00 2001 From: Feelsgoodagain Date: Fri, 14 May 2021 14:52:51 +0800 Subject: [PATCH 2/3] update README.md. --- README.md | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 175 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 06e9a29..ba2b791 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,183 @@ -# HA-WEB +## HA-web介绍 -> HA-WEB-VUE +HA-web:Linux 高可用集群Web提供一套基于BS架构对集群资源统一配置和管理的界面。 该管理界面直观易用,可以实时监控所有集群节点的运行状态,能对集群资源进行规则设置、添加、启动、停止、修改、删除等常规操作。 跨平台支持Chrome、IE、Firefox常用浏览器。 -## Build Setup +## 一、安装HA-web开发环境 -``` bash -# install dependencies -npm install +### 1、安装node.js环境: -# serve with hot reload at localhost:8080 -npm run dev +#### Windows环境: -# build for production with minification -npm run build +#### 方法一:使用Windows安装包(.msi) + +下载地址:[https://nodejs.org/en/download/](http://nodejs.org/en/download/) + +安装步骤: + +步骤 1 : 双击下载后的安装包 + +步骤 2 : 点击Run(运行) + +步骤 3 : 勾选接受协议选项,点击 next + +步骤 4 : Node.js默认安装目录为 "C:\Program Files\nodejs\" , 你可以修改目录,并点击 next + +步骤 5 : 点击树形图标来选择你需要的安装模式 , 然后点击下一步 next + +步骤 6 :点击 Install(安装) 开始安装Node.js。 + +检测PATH环境变量是否配置了Node.js,点击开始=》运行=》输入"cmd" => 输入命令"path",输出如下结果: + +```bash +PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32; +C:\Program Files\nodejs\;C:\Users\rg\AppData\Roaming\npm +``` +检查Node.js版本 + +```bash +C:\> node --version +v14.16.0 +$ npm -v +6.14.11 +``` +#### 方法二:使用Windows二进制文件安装(.exe) + +下载地址:[https://nodejs.org/en/download/](http://nodejs.org/en/download/) + +32 位安装包下载地址 : [http://nodejs.org/dist/v0.10.26/node.exe](http://nodejs.org/dist/v0.10.26/node.exe) + +64 位安装包下载地址 : [http://nodejs.org/dist/v0.10.26/x64/node.exe](http://nodejs.org/dist/v0.10.26/x64/node.exe) + +安装步骤: + +步骤 1 : 双击下载后的安装包Node.exe + +步骤 2 : 点击Run(运行) + +检查Node.js版本 + +```bash +C:\> cd download +C:\download> node --version +v14.16.0 +$ npm -v +6.14.11 + + +``` +#### Linux环境: + +#### 方法一:直接使用已编译好的包(.msi)** + +下载地址:[https://nodejs.org/en/download/](http://nodejs.org/en/download/) + +``` + +$ wget https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz // 下载 +$ tar xf node-v10.9.0-linux-x64.tar.xz // 解压 +$ cd node-v10.9.0-linux-x64/ // 进入解压目录 +$ ./bin/node -v // 执行node命令 查看版本 +v14.16.0 +$ npm -v +6.14.11 +``` + + +解压文件的 bin 目录下包含了 node、npm 等命令,可以使用 ln 命令来设置软连接: + + +``` + +$ ln -s /usr/software/nodejs/bin/npm /usr/local/bin/ +$ ln -s /usr/software/nodejs/bin/node /usr/local/bin/ -# build for production and view the bundle analyzer report -npm run build --report ``` -For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). +#### 方法二: 源码安装 Node.js(以CentOS为例)** + +下载地址:[https://nodejs.org/en/download/](http://nodejs.org/en/download/) + +下载Binaries包(以x86为例) + +安装步骤: + +步骤 1 : 解压安装包 + + +``` +$ tar -xvf node-v10.16.0-linux-x64.tar.xz +$ cd /usr/local/ +$ mv /var/ftp/pub/node-v10.16.0-linux-64 ./ +$ mv node-v10.16.0.0-linux-64/ nodejs + +``` + + +步骤 2 : 添加node.js至全局命令 + +``` +$ ln -s /usr/local/nodejs/bin/npm /usr/local/bin/ +$ ln -s /usr/local/nodejs/bin/node /usr/local/bin/ +``` + + +查看nodejs是否安装成功 + +``` +$ node -v +v14.16.0 +$ npm -v +6.14.11 +``` + + +### 2、下载源码: + + +```bash + +$ git clone https://gitee.com/openeuler/A-Tune.git + +``` +### 3、安装node_modules依赖: + + +```bash +$ cd ha-web/ +$ npm install +``` +如果依赖下载安装缓慢可以尝试更换国内源: + +```bash +$ npm install --registry https://registry.npm.taobao.org +``` +## 二、部署HA-web开发环境 + +### 1.热更新方式在本地部署开发环境 + +```bash +$ npm run dev +``` +### 2.打包依赖生成生产环境 +```bash +$ npm run build +``` + + +### 3.将打包后的资源放入ha-api的静态资源文件夹 +```bash + +$ cd ha-web +$ mv dist/index.html dist/static/ +$ scp -r dist/* root@:/root/ha-api/views/static/ +``` + +注:打包后的资源文件在dist目录下,请将index.html文件放入static文件夹并将资源复制到目标ha-api服务器的静态资源文件夹后重启ha-api服务 +ha-api部署方法等详细信息请参考ha-api项目的[README](https://gitee.com/openeuler/ha-api/blob/master/README.md)文件 + + +三、如何贡献 +---------- +如果您有意愿参与到项目开发贡献中,需要先签署[CLA](https://openeuler.org/en/cla.html),我们期待着您的加入与贡献。 + +如果您有任何疑问、意见或建议,请通过[HA-web issues](https://gitee.com/openeuler/ha-web/issues) 提交issues,我们会尽快回复。 \ No newline at end of file -- Gitee From 29ded706f0716cbbbbba03fed1df5d542184ba7f Mon Sep 17 00:00:00 2001 From: zhaochongyu Date: Fri, 14 May 2021 15:51:19 +0800 Subject: [PATCH 3/3] log download updata --- src/components/Logs/Logs.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Logs/Logs.vue b/src/components/Logs/Logs.vue index dc2d3db..270948a 100644 --- a/src/components/Logs/Logs.vue +++ b/src/components/Logs/Logs.vue @@ -27,7 +27,7 @@ export default { let aLink = document.createElement("a"); let evt = document.createEvent("MouseEvents"); evt.initEvent("click", false, true); - aLink.href = "kylinha-log-ha1-20210506111701.tar"; + aLink.href = res.data.data.filepath; aLink.dispatchEvent(evt); return Promise.resolve(); }); -- Gitee