# ovirt-client-windows **Repository Path**: zero_wangdu/ovirt-client-windows ## Basic Information - **Project Name**: ovirt-client-windows - **Description**: oVirt开源客户端 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-21 - **Last Updated**: 2022-06-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 开源 OVIRT 客户端 ## 快速使用 ```shell script 1. 直接下载 ovirt-client-win.zip 压缩包 2. 解压, 进入目录 : ovirt-client-win/ 3. 双击运行可执行文件 : ovirt-client.exe ``` ## 安装运行 ```shell script 1. 安装nodejs 搜索 nodejs 官网下载安装包 http://nodejs.cn/download/ 2. 克隆程序代码 git clone https://www.xxxx.git cd electron-vue-nodejs 3. 安装依赖 npm install 或 cnpm install 4. 运行 如果运行起来没有界面, 是`node`版本太高可以看下面的解决方法 npm run dev ``` ## 打包 ```shell script 1. 使用管理员权限运行 cmd 2. 安装依赖 # 要使用 npm 或 yarn 安装程序依赖包 # 使用 cnpm 安装依赖有些包有些不同, 导致打包失败 cd electron-vue-nodejs/ yarn install yarn run build 3. 执行打包脚本 等待运行结束后, 进入 build 目录, 其中有一个可执行文件 4. 运行程序 双击可执行文件 : ovirt-client.exe 小问题 : 在 build 过程中会向github网站下载依赖zip包, 一般回导致失败网络连接超时,导致打包失败, 在下面有解决方法 ``` ------ ## 运行和打包问题 ### Webpack ReferenceError: process is not defined 高版本的 node,大于 12 的版本时候。使用 electron-vue 项目时候会报错! 修改 .electron-vue/webpack.renderer.config.js 和 webpack.web.config.js 如下: - webpack.web.config.js ```javascript new HtmlWebpackPlugin({ filename: 'index.html', template: path.resolve(__dirname, '../src/index.ejs'), # 只要粘贴这个函数就行 templateParameters(compilation, assets, options) { return { compilation: compilation, webpack: compilation.getStats().toJson(), webpackConfig: compilation.options, htmlWebpackPlugin: { files: assets, options: options }, process, }; }, minify: { collapseWhitespace: true, removeAttributeQuotes: true, removeComments: true }, nodeModules: false }), ``` - webpack.render.config.js ```javascript new HtmlWebpackPlugin({ filename: 'index.html', template: path.resolve(__dirname, '../src/index.ejs'), minify: { collapseWhitespace: true, removeAttributeQuotes: true, removeComments: true }, # 只要粘贴这个函数就行 templateParameters(compilation, assets, options) { return { compilation: compilation, webpack: compilation.getStats().toJson(), webpackConfig: compilation.options, htmlWebpackPlugin: { files: assets, options: options }, process, }; }, nodeModules: process.env.NODE_ENV !== 'production' ? path.resolve(__dirname, '../node_modules') : false }), ``` ### 在 build 过程中, 下载 github 网站的依赖包超时问题 ```shell script 解决在windows下的问题 在项目中有 `packagelib/electron-v2.0.18-win32-x64.zip` 文件 将此文件放入 `C:\Users\Administrator\AppData\Local\electron\Cache` electron缓存目录,解决下载慢问题 如果是其它文件, 同上. 将下载的文件 url 拷贝出来, 在浏览器或迅雷下载器中下载下来, 放入缓存目录 ```