Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gnuhpc committed Jun 29, 2019
0 parents commit 5399c9a
Show file tree
Hide file tree
Showing 222 changed files with 37,486 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Kafka-zk-restapi-UI

<b>Kafka-zk-restapi-UI</b> : A web application for Kafka-zk-rest-api [Kafka-zk-restapi](https://github.com/gnuhpc/Kafka-zk-restapi)
## How to Run the application

### Download Kafka-zk-restapi-UI project code and Kafka-zk-restapi project code.
git clone https://github.com/gnuhpc/Kafka-zk-restapi.git

git clone https://github.com/gnuhpc/Kafka-zk-restapi-UI.git

### Start up Kafka-zk-restapi
For a detailed explanation on how to start Kafka-zk-restapi, check out the [Kafka-zk-restapi](https://github.com/gnuhpc/Kafka-zk-restapi)

### Start up Kafka-zk-restapi-UI
cd Kafka-zk-restapi-UI

### Install dependencies
npm install

### Modify configs in config/index.js
1. Modify target to the real Kafka-zk-restapi application address:
proxyTable: {
'/kafkaRes/paas-kafka': {
target:'http://localhost:8121',
changeOrigin: true,
pathRewrite: {
'^/kafkaRes/paas-kafka': ''
}
}
},
2. Modify host and port of this application:
host: 'localhost', // can be overwritten by process.env.HOST
port: 8088

### Run the application
npm run dev

### Access web project
http://localhost:8088

## ScreenShots
![KafkaDashboard](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/KafkaDashboard.png)
![TopicManage](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/TopicManage.png)
![TopicPartitionView](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/TopicPartitionView.png)
![ConsumersGetByTopic](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/ConsumersGetByTopic.png)
![ManualReassignPartitions](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/ManualReassignPartitions.png)
![MessageView](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/MessageView.png)
![SchemaView](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/SchemaView.png)
![ConsumerGroup](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/ConsumerGroup.png)
![TopicsGetByGroup](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/TopicsGetByGroup.png)
![ConsumersGetByGroupAndTopic](https://github.com/tinawenqiao/Kafka-zk-restapi-UI/blob/master/screenshots/ConsumersGetByGroupAndTopic.png)

41 changes: 41 additions & 0 deletions build/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict'
require('./check-versions')()

process.env.NODE_ENV = 'production'

const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')

const spinner = ora('building for production...')
spinner.start()

rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')

if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}

console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
54 changes: 54 additions & 0 deletions build/check-versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')

function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}

const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]

if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}

module.exports = function () {
const warnings = []

for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]

if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}

if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()

for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}

console.log()
process.exit(1)
}
}
Binary file added build/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions build/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')

exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory

return path.posix.join(assetsSubDirectory, _path)
}

exports.cssLoaders = function (options) {
options = options || {}

const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}

const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}

// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]

if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}

// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}

// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}

// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)

for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}

return output
}

exports.createNotifierCallback = () => {
const notifier = require('node-notifier')

return (severity, errors) => {
if (severity !== 'error') return

const error = errors[0]
const filename = error.file && error.file.split('!').pop()

notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
22 changes: 22 additions & 0 deletions build/vue-loader.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap

module.exports = {
loaders: utils.cssLoaders({
sourceMap: sourceMapEnabled,
extract: isProduction
}),
cssSourceMap: sourceMapEnabled,
cacheBusting: config.dev.cacheBusting,
transformToRequire: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
95 changes: 95 additions & 0 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
var webpack = require('webpack')
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')


function resolve (dir) {
return path.join(__dirname, '..', dir)
}



module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
// app: './src/main.js',
// app: ["../node_modules/babel-polyfill/dist/polyfill.js","./src/main.js"]
app: ["babel-polyfill","./src/main.js"]
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
// 'scss_vars':'@/styles/vars.scss',
// 'excel':path.resolve(_dirname,'../src/excel'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
},
plugins:[
// new webpack.optimize.CommonsChunkPlugin('common.js'),
new webpack.ProvidePlugin({
jQuery:'jquery',
$:'jquery'
})
]
}
Loading

0 comments on commit 5399c9a

Please sign in to comment.