Skip to content

Commit

Permalink
#326 add malewicz files
Browse files Browse the repository at this point in the history
  • Loading branch information
mgramin committed May 26, 2019
1 parent 1dd86e8 commit 43169e8
Show file tree
Hide file tree
Showing 41 changed files with 1,788 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/malewicz/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
9 changes: 9 additions & 0 deletions src/main/malewicz/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
5 changes: 5 additions & 0 deletions src/main/malewicz/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
29 changes: 29 additions & 0 deletions src/main/malewicz/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// https://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
17 changes: 17 additions & 0 deletions src/main/malewicz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
10 changes: 10 additions & 0 deletions src/main/malewicz/.postcssrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
10 changes: 10 additions & 0 deletions src/main/malewicz/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js
node_js:
- "stable"
script:
- echo "skipping tests"
- docker build -t mgramin/malewicz .

after_success:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push mgramin/malewicz
21 changes: 21 additions & 0 deletions src/main/malewicz/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 sql-boot

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 36 additions & 0 deletions src/main/malewicz/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# malewicz

A hackable GUI SQL-manager written on SQL itself

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1b7fb7abccda4a16a4f698f40d3bd4dc)](https://app.codacy.com/app/mgramin/malewicz?utm_source=github.com&utm_medium=referral&utm_content=sql-boot/malewicz&utm_campaign=Badge_Grade_Dashboard)
[![Build Status](https://travis-ci.org/sql-boot/malewicz.svg?branch=master)](https://travis-ci.org/sql-boot/malewicz)

:warning: This project is in early stage of development and is currently available only as a demo (online or local) based on [simple Oracle sql-scripts](https://github.com/sql-boot/sql-boot-oracle).

Backend powered by [sql-boot](https://github.com/sql-boot/sql-boot)

### Try online demo

- [oracle/table/scott](http://217.73.63.31:8080/#/oracle/table/scott) - show all tables in "scott" schema for "oracle" database (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/schema/table/README.md) SQL-query)
- [oracle/table/oracle/table/scott?page=1,2](http://217.73.63.31:8080/#/oracle/table/scott?page=1,2) - show all tables in "scott" schema with pagination (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/schema/table/README.md) SQL-query)
- [oracle/table/scott.emp](http://217.73.63.31:8080/#/oracle/table/scott.emp) - show "scott.emp" table (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/schema/table/README.md) SQL-query)
- [oracle/table/scott.dept](http://217.73.63.31:8080/#/oracle/table/scott.dept) - show "scott.dept" table (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/schema/table/README.md) SQL-query)
- [oracle/column/scott.emp](http://217.73.63.31:8080/#/oracle/column/scott.emp) - show all column for table "scott.emp" (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/schema/table/column/README.md) SQL-query)


- [oracle/active_session](http://217.73.63.31:8080/#/oracle/active_session/) - show active sessions (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/instance/active_session/README.md) SQL-query)
- [oracle/table_size_rating](http://217.73.63.31:8080/#/oracle/table_size_rating) - show tables size (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/storage/tablespace/table_size_rating/README.md) SQL-query)
- [oracle/locks](http://217.73.63.31:8080/#/oracle/locks) - show object locks (base on [this](https://github.com/sql-boot/sql-boot-oracle/blob/master/database/instance/locks/README.md) SQL-query)


### Try local demo

1. Run demo
```bash
git clone https://github.com/sql-boot/malewicz.git
cd malewicz
docker-compose up -d --build
http://localhost:8080
```

2. Go to the sql-boot/conf/sql-boot-oracle and play with scripts
41 changes: 41 additions & 0 deletions src/main/malewicz/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 src/main/malewicz/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 src/main/malewicz/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 src/main/malewicz/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 src/main/malewicz/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'
}
}
Loading

0 comments on commit 43169e8

Please sign in to comment.