Skip to content

Commit

Permalink
Merge pull request #335 from snetsystems/dev-1.2.0
Browse files Browse the repository at this point in the history
Dev 1.2.0
  • Loading branch information
snetsystems authored Dec 17, 2021
2 parents 5607d3d + 2e725d5 commit 42290cd
Show file tree
Hide file tree
Showing 43 changed files with 7,821 additions and 390 deletions.
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"-u=oncue:<port>",
"-u=vsphere:on",
"-u=aws:on",
"-u=k8s:on",
"-u=ipmi-secret-key:<Seed key using for the encryption of ipmi password>",
"-c=./cloudhub-canned/",
"--protoboards-path=./cloudhub-protoboards/",
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 1.1.1
VERSION = 1.2.0
ifeq ($(OS), Windows_NT)
GOBINDATA := $(shell go-bindata.exe --version 2>nil)
else
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ You should use [Forked **Snetsystems/salt**](https://github.com/snetsystems/salt
- Optionable Addon features.
- **_VMWare_ Infrastructure** Viewer.
- via **_VSphere_** API and **_Salt_**
- **_K8s Infrastructure_** Diagram & Viewer. (Pending in dev-k8s branch)
- **_K8s Infrastructure_** Diagram & Viewer.
- via customized `Salt Kuberetes` Module.
- **_AWS_** Instances Monitoring.
- SWAN Router & SDPlex(Oncue) Features.
Expand All @@ -54,6 +54,7 @@ You should use [Forked **Snetsystems/salt**](https://github.com/snetsystems/salt
<img src="./docs/images/infrastructure.png"/>
<img src="./docs/images/topology_map.png"/>
<img src="./docs/images/VMWare.png"/>
<img src="./docs/images/k8s.png"/>
<img src="./docs/images/AWS_01.png"/>
<img src="./docs/images/AWS_02.png"/>
<img src="./docs/images/AWS_03.png"/>
Expand Down
8 changes: 4 additions & 4 deletions backend/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ type Server struct {
KapacitorUsername string `long:"kapacitor-username" description:"Username of your Kapacitor instance" env:"KAPACITOR_USERNAME"`
KapacitorPassword string `long:"kapacitor-password" description:"Password of your Kapacitor instance" env:"KAPACITOR_PASSWORD"`

AddonURLs map[string]string `short:"u" long:"addon-url" description:"Support addon is [salt, swan, oncue, ipmi-secret-key]. Actually, this is a key-value extensional options, Not only url But for everywhere to be used the key-value extensional options. Multiple URL can be added by using multiple of the same flag with different 'name:url' values, or as an environment variable with comma-separated 'name:url' values. E.g. via flags: '--addon-url=salt:{url} --addon-url=swan:{url} --addon-url=ipmi-secret-key:{seed key}'. E.g. via environment variable: 'export ADDON_URL=salt:{url},swan:{url}'" env:"ADDON_URL" env-delim:","`
AddonTokens map[string]string `short:"k" long:"addon-tokens" description:"Support addon is [salt, swan]. API tokens to be used to the client for a request to addon API servers. Multiple tokens can be added by using multiple of the same flag with different 'name:token' values, or as an environment variable with comma-separated 'name:token' values. E.g. via flags: '--addon-tokens=salt:{token} --addon-tokens=swan:{token}'. E.g. via environment variable: 'export ADDON_TOKENS=salt:{token},swan:{token}'" env:"ADDON_TOKENS" env-delim:","`
AddonURLs map[string]string `short:"u" long:"addon-url" description:"Support addon is [salt, aws, k8s, swan, oncue, ipmi-secret-key]. Actually, this is a key-value extensional options, Not only url But for everywhere to be used the key-value extensional options. Multiple values can be added by using multiple of the same flag with different 'name:{value}', or as an environment variable with comma-separated 'name:{value}'. E.g. via flags: '-u=salt:{url} -u=aws:on[off] -u=k8s:on[off] -u=swan:{url} -u=oncue:{port number} -u=ipmi-secret-key:{seed key}'. E.g. via environment variable: 'export ADDON_URL=salt:{url},swan:{url}'" env:"ADDON_URL" env-delim:","`
AddonTokens map[string]string `short:"k" long:"addon-tokens" description:"The token associated with addon [salt, swan]. E.g. via flags: '-k=salt:{token} -k=swan:{token}'. E.g. via environment variable: 'export ADDON_TOKENS=salt:{token},swan:{token}'" env:"ADDON_TOKENS" env-delim:","`

Develop bool `short:"d" long:"develop" description:"Run server in develop mode."`
BoltPath string `short:"b" long:"bolt-path" description:"Full path to boltDB file (e.g. './cloudhub-v1.db')" env:"BOLT_PATH" default:"cloudhub-v1.db"`
Expand Down Expand Up @@ -125,8 +125,8 @@ type Server struct {

LoginAuthType string `long:"login-auth-type" description:"Login auth type (mix, oauth, basic)" env:"LOGIN_AUTH_TYPE" default:"oauth"`

PasswordPolicy string `long:"password-policy" description:"Password validity rules" env:"PASSWORD_POLICY"`
PasswordPolicyMessage string `long:"password-policy-message" description:"Password validity rule description" env:"PASSWORD_POLICY_MESSAGE"`
PasswordPolicy string `long:"password-policy" description:"Regular expression to validate password strength" env:"PASSWORD_POLICY"`
PasswordPolicyMessage string `long:"password-policy-message" description:"The description about password-policy set" env:"PASSWORD_POLICY_MESSAGE"`

MailSubject string `long:"mail-subject" description:"Mail subject" env:"MAIL_SUBJECT"`
MailBodyMessage string `long:"mail-body-message" description:"Mail body message" env:"MAIL_BODY_MESSAGE"`
Expand Down
Binary file added docs/images/k8s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.1.1",
"version": "1.2.0",
"private": true,
"description": "This is CloudHub's User interface made in React & Typescript",
"author": "Jack Kim",
Expand Down Expand Up @@ -40,16 +40,16 @@
"@types/react-dnd-html5-backend": "^2.1.9",
"@types/react-dom": "^16.0.7",
"@types/react-onclickoutside": "^6.7.3",
"@types/react-resizable": "^1.7.3",
"@types/react-router": "^3.0.15",
"@types/react-router-redux": "4",
"@types/react-resizable": "^1.7.3",
"@types/react-virtualized": "^9.18.3",
"@types/redux": "^3.3.1",
"@types/redux-auth-wrapper": "^2.0.9",
"@types/text-encoding": "^0.0.32",
"@types/uuid": "^3.4.3",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"@types/redux": "^3.3.1",
"autoprefixer": "^6.3.1",
"babel-core": "^7.0.0-bridge",
"babel-eslint": "^10.0.1",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/addon/128t/reusable/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Libraries
import React from 'react'
import React, {CSSProperties} from 'react'
import classnames from 'classnames'
import chroma from 'chroma-js'

Expand Down Expand Up @@ -143,8 +143,8 @@ export const ErrorState = (): JSX.Element => (
</div>
)

export const NoHostsState = (): JSX.Element => (
<div className="generic-empty-state">
export const NoHostsState = ({style}: {style?: CSSProperties}): JSX.Element => (
<div className="generic-empty-state" style={style}>
<h4>No Data.</h4>
</div>
)
Expand Down
60 changes: 14 additions & 46 deletions frontend/src/agent_admin/containers/AgentConfiguration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ interface State {
isPluginModalVisible: boolean
}
interface Plugin {
inoutType: string
name: string
isActivity: boolean
}
Expand Down Expand Up @@ -309,10 +310,12 @@ export class AgentConfiguration extends PureComponent<Props, State> {
outputPlugin.shift()

const inputPluginList = _.map(inputPlugin, input => ({
inoutType: 'IN',
name: input,
isActivity: false,
}))
const outputPluginList = _.map(outputPlugin, output => ({
inoutType: 'OUT',
name: output,
isActivity: false,
}))
Expand Down Expand Up @@ -826,48 +829,27 @@ export class AgentConfiguration extends PureComponent<Props, State> {
saltMasterToken,
getRunnerSaltCmdTelegraf,
} = this.props
const {inputPluginList, outputPluginList, searchTerm} = this.state
const {idx, name, inoutkind} = _thisProps
const {inputPluginList, outputPluginList} = this.state
const {name, inoutkind} = _thisProps

this.setState({
isPluginModalVisible: true,
focusedMeasure: name,
description: '',
})

const sortedInputPlugin = this.getSortedPlugin(
inputPluginList,
searchTerm,
'name',
SortDirection.ASC
)

const sortedOutputPlugin = this.getSortedPlugin(
outputPluginList,
searchTerm,
'name',
SortDirection.ASC
)

const mapInputPlugin = sortedInputPlugin.map(m => {
m.isActivity = false
const mapInputPlugin = inputPluginList.map(m => {
if (m.inoutType === inoutkind && m.name === name) m.isActivity = true
else m.isActivity = false
return m
})

const mapOutputPlugin = sortedOutputPlugin.map(m => {
m.isActivity = false
const mapOutputPlugin = outputPluginList.map(m => {
if (m.inoutType === inoutkind && m.name === name) m.isActivity = true
else m.isActivity = false
return m
})

if (inoutkind === 'IN') {
mapInputPlugin[idx].isActivity === false
? (mapInputPlugin[idx].isActivity = true)
: (mapInputPlugin[idx].isActivity = false)
} else {
mapOutputPlugin[idx].isActivity === false
? (mapOutputPlugin[idx].isActivity = true)
: (mapOutputPlugin[idx].isActivity = false)
}
try {
const {data} = await getRunnerSaltCmdTelegraf(
saltMasterUrl,
Expand All @@ -885,28 +867,14 @@ export class AgentConfiguration extends PureComponent<Props, State> {
}

private handlePluginClose = (): void => {
const {inputPluginList, outputPluginList, searchTerm} = this.state

const sortedInputPlugin = this.getSortedPlugin(
inputPluginList,
searchTerm,
'name',
SortDirection.ASC
)

const sortedOutputPlugin = this.getSortedPlugin(
outputPluginList,
searchTerm,
'name',
SortDirection.ASC
)
const {inputPluginList, outputPluginList} = this.state

const mapInputPlugin = sortedInputPlugin.map(m => {
const mapInputPlugin = inputPluginList.map(m => {
m.isActivity = false
return m
})

const mapOutputPlugin = sortedOutputPlugin.map(m => {
const mapOutputPlugin = outputPluginList.map(m => {
m.isActivity = false
return m
})
Expand Down
14 changes: 8 additions & 6 deletions frontend/src/external/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
modeInfluxQLReadOnly,
modeMarkdown,
modeAgentConf,
modeYaml,
modeLogger,
} from 'src/shared/constants/codeMirrorModes'
import 'codemirror/addon/hint/show-hint'
Expand All @@ -13,13 +14,13 @@ import modeXML from 'codemirror/mode/xml/xml'
/* eslint-disable */
const CodeMirror = require('codemirror')

CodeMirror.defineSimpleMode = function(name, states) {
CodeMirror.defineMode(name, function(config) {
CodeMirror.defineSimpleMode = function (name, states) {
CodeMirror.defineMode(name, function (config) {
return CodeMirror.simpleMode(config, states)
})
}

CodeMirror.simpleMode = function(config, states) {
CodeMirror.simpleMode = function (config, states) {
ensureState(states, 'start')
const states_ = {},
meta = states.meta || {}
Expand Down Expand Up @@ -95,7 +96,7 @@ CodeMirror.simpleMode = function(config, states) {
return mode
}

CodeMirror.defineOption('placeholder', '', function(cm, val, old) {
CodeMirror.defineOption('placeholder', '', function (cm, val, old) {
var prev = old && old != CodeMirror.Init
if (val && !prev) {
cm.on('blur', onBlur)
Expand Down Expand Up @@ -201,7 +202,7 @@ function Rule(data, states) {
}

function tokenFunction(states, config) {
return function(stream, state) {
return function (stream, state) {
if (state.pending) {
const pend = state.pending.shift()
if (state.pending.length === 0) {
Expand Down Expand Up @@ -346,7 +347,7 @@ function indexOf(val, arr) {
}

function indentFunction(states, meta) {
return function(state, textAfter, line) {
return function (state, textAfter, line) {
if (state.local && state.local.mode.indent) {
return state.local.mode.indent(state.localState, textAfter, line)
}
Expand Down Expand Up @@ -390,4 +391,5 @@ CodeMirror.defineSimpleMode('influxQLReadOnly', modeInfluxQLReadOnly)
CodeMirror.defineSimpleMode('markdown', modeMarkdown)
CodeMirror.defineSimpleMode('agentConf', modeAgentConf)
CodeMirror.defineSimpleMode('logger', modeLogger)
CodeMirror.defineSimpleMode('yaml', modeYaml)
CodeMirror.defineMode(('xml', modeXML))
Loading

0 comments on commit 42290cd

Please sign in to comment.