Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/assets/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
width: 100%;
}

.top-border {
border-top: 1px solid #e1e4e8
}

.bottom-border {
border-bottom: 1px solid #e1e4e8
}

.bottom-border-large {
border-bottom: 3px solid #BDBDBD
}

.left-border {
border-left: 1px solid #e1e4e8
}
Expand Down Expand Up @@ -42,6 +50,11 @@
display: flex;
}

.v-subheader-thin {
padding: 0;
height: auto !important;
}

@-moz-keyframes loader {
from {
transform: rotate(0);
Expand Down
13 changes: 13 additions & 0 deletions src/components/Common/TextBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<v-text-field
solo
dense
:disabled="disable"
:readonly="readonly"
v-model="adaptor"
:rules="rules"
Expand Down Expand Up @@ -39,6 +40,11 @@ export default {
required: false,
default: false
},
disable: {
type: Boolean,
required: false,
default: false
},
rules: {
type: Array,
default() {
Expand Down Expand Up @@ -120,11 +126,18 @@ export default {
.input-focus {
background-color: white !important;
border: 1px solid #64B5F6 !important;
-webkit-box-shadow: inset 0 1px 0 rgba(180, 206, 241, 1) !important;
box-shadow: 0 0 6px rgb(180, 206, 241, 1) !important;
}

.v-text-field__details {
margin-bottom: 0 !important;
}

.v-input--is-disabled {
.v-input__slot {
border: 1px solid #BDBDBD !important;
}
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
<script>
import CodeMirror from 'codemirror'
import 'codemirror/mode/yaml/yaml'
import "codemirror/mode/javascript/javascript"

export default {
name: 'KubeConfigEditor',
name: 'DataEditor',
props: {
/**
* Ex: {
* content: {
* data: 'xxx',
* }
* }
*/
model: {
type: Object,
value: {
type: String,
required: true
},
mode: {
type: String,
required: true
},
isReadOnly: {
Expand All @@ -30,23 +28,29 @@ export default {
return {
CodeMirror,
instance: null,
adaptor: this.value
}
},
mounted() {
this.instance = CodeMirror.fromTextArea(this.$refs.codemirror, {
lineNumbers: true,
mode: 'yaml',
mode: this.mode,
theme: 'base16-light',
tabSize: 2,
readOnly: this.isReadOnly
})

this.instance.getDoc().setValue(this.model.content.data)
this.instance.getDoc().setValue(this.adaptor)
this.instance.on('change', this.onChange)
},
watch: {
adaptor(val) {
this.$emit('input', val)
}
},
methods: {
onChange(instance, data) {
this.model.content.data = instance.getValue()
this.adaptor = instance.getValue()
}
}
}
Expand Down
17 changes: 16 additions & 1 deletion src/i18n/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,14 @@ export default {
secret: '秘钥管理',
config: '配置管理',
plugin: '插件',
system: '系统设置'
system: '系统设置',
trigger: '触发器'
},

common: {
name_required: '请输入名称',
name_size: '名称长度应当在 2 - 20 字符',
name_rule: '名称只允许 a-z, A-Z, 0-9, _, -',
},

profile: {
Expand All @@ -174,6 +181,14 @@ export default {

hint: {
agent_disabled: '提示: 主机已禁用'
},

trigger: {
name: '触发器名称',
event: '触发事件',
category: '触发种类',
email_settings: '邮件通知配置',
webhook_settings: 'Webhook 配置'
}
},

Expand Down
22 changes: 15 additions & 7 deletions src/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ export default {
settings: {
li: {
profile: 'Profile',
users: 'User',
security: 'Security',
agent: 'Agent',
secret: 'Secret',
config: 'Config',
plugin: 'Plugin',
system: 'System'
users: 'Users',
agent: 'Agents',
secret: 'Secrets',
config: 'Configs',
plugin: 'Plugins',
system: 'System',
trigger: 'Triggers'
},

profile: {
Expand All @@ -176,6 +176,14 @@ export default {

hint: {
agent_disabled: 'Hint: The host is disabled'
},

trigger: {
name: 'Trigger name',
event: 'Event',
category: 'Category',
email_settings: 'Email Settings',
webhook_settings: 'Webhook Settings'
}
},

Expand Down
27 changes: 27 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import SettingsConfigNew from '@/view/Settings/Config/New'
import SettingsConfigEdit from '@/view/Settings/Config/Edit'

import SettingsPluginHome from '@/view/Settings/Plugin/Index'

import SettingsTriggerHome from '@/view/Settings/Trigger/Index'
import SettingsTriggerNew from '@/view/Settings/Trigger/New'
import SettingsTriggerEdit from '@/view/Settings/Trigger/Edit'

import SettingsSystemHome from '@/view/Settings/System/Index'

Vue.use(Router)
Expand Down Expand Up @@ -166,6 +171,7 @@ export default new Router({
props: true
},

// config settings
{
path: 'configs',
name: 'SettingsConfigHome',
Expand All @@ -184,11 +190,32 @@ export default new Router({
props: true
},

// plugin settings
{
path: 'plugins',
name: 'PluginSettingsHome',
component: SettingsPluginHome
},

// trigger settings
{
path: 'triggers',
name: 'SettingsTriggerHome',
component: SettingsTriggerHome
},
{
path: 'triggers/new',
name: 'SettingsTriggerNew',
component: SettingsTriggerNew
},
{
path: 'triggers/edit',
name: 'SettingsTriggerEdit',
component: SettingsTriggerEdit,
props: true
},

// system settings
{
path: 'system',
name: 'SystemSettingsHome',
Expand Down
12 changes: 10 additions & 2 deletions src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export default {
steps: {
get: 'steps/get',
update: 'steps/update',
getTasks: 'steps/getTasks',
updateTasks: 'steps/updateTasks',
},
logs: {
push: 'logs/push',
Expand Down Expand Up @@ -100,10 +98,20 @@ export default {
saveSmtp: 'configs/saveSmtp',
saveText: 'configs/saveText',
list: 'configs/list',
listSmtp: 'configs/listSmtp',
get: 'configs/get',
delete: 'configs/delete'
},

triggers: {
saveEmail: 'triggers/saveEmail',
saveWebhook: 'triggers/saveWebhook',
list: 'triggers/list',
get: 'triggers/get',
delete: 'triggers/delete',
deliveries: 'triggers/deliveries'
},

users: {
hasDefault: 'users/hasDefault',
createDefault: 'users/createDefault',
Expand Down
4 changes: 3 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Store as PluginStore } from './module/plugins'
import { Store as ConfigStore } from './module/configs'
import { Store as TtyStore } from './module/tty'
import { Store as SettingStore } from './module/settings'
import { Store as TriggerStore } from './module/triggers'

Vue.use(Vuex)

Expand All @@ -37,7 +38,8 @@ const store = new Vuex.Store({
'plugins': PluginStore,
'configs': ConfigStore,
'tty': TtyStore,
'settings': SettingStore
'settings': SettingStore,
'triggers': TriggerStore
}
})

Expand Down
10 changes: 8 additions & 2 deletions src/store/module/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ const mutations = {
}

const actions = {
list({commit}) {
http.get('configs', (list) => {
async list({commit}) {
await http.get('configs', (list) => {
commit('list', list)
})
},

async listSmtp({commit}) {
await http.get('configs?category=SMTP', (list) => {
commit('list', list)
})
},
Expand Down
1 change: 0 additions & 1 deletion src/store/module/jobs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import http from '../http'
import {browserDownload} from '../util'
import vars from '../../util/vars'

const emptyFunc = () => {
}
Expand Down
Loading