mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 03:14:07 +08:00
update files
This commit is contained in:
parent
05a99b46ac
commit
09c9b8268e
@ -157,7 +157,7 @@ AppConfigure.prototype = {
|
||||
|
||||
this.create();
|
||||
|
||||
ipc.on('app-configure', function (event, command){
|
||||
ipc.on('app-configure', function (event, command, configure){
|
||||
switch (command) {
|
||||
case 'import':
|
||||
context.import(function (configure){
|
||||
@ -185,11 +185,11 @@ AppConfigure.prototype = {
|
||||
});
|
||||
});
|
||||
break;
|
||||
case 'add':
|
||||
context.save(function (configure){
|
||||
|
||||
}, function (configure){
|
||||
|
||||
case 'save':
|
||||
context.save(configure, function (){
|
||||
this.showMessageBox('保存成功!', { type: 'info' });
|
||||
}, function (){
|
||||
this.showMessageBox('保存失败!');
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
10
index.html
10
index.html
@ -54,9 +54,17 @@
|
||||
<label>项目名称:</label>
|
||||
<input type="text" placeholder="项目名称"/>
|
||||
</li>
|
||||
<li id="open-dir">
|
||||
<li class="ui-item-error">
|
||||
<label class="fn-invisible">     </label>
|
||||
<span><i class="icon-expand"></i>项目名称不能为空</span>
|
||||
</li>
|
||||
<li>
|
||||
<directory label="项目路径"></directory>
|
||||
</li>
|
||||
<li class="ui-item-error">
|
||||
<label class="fn-invisible">     </label>
|
||||
<span><i class="icon-expand"></i>项目路径不能为空</span>
|
||||
</li>
|
||||
<li id="add-env" class="ui-sub-item">
|
||||
<label>环境变量:</label>
|
||||
<dynamic-item name-label="变量名" value-label="变量值"></dynamic-item>
|
||||
|
@ -420,15 +420,22 @@ header [class*=" icon-"] {
|
||||
.ui-sub-item ul {
|
||||
padding: 0;
|
||||
}
|
||||
.ui-sub-item .ui-action-bar {
|
||||
.ui-sub-item .ui-item-add {
|
||||
margin: 0;
|
||||
}
|
||||
.ui-sub-item span,
|
||||
.ui-item-error span {
|
||||
line-height: 25px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.ui-sub-item span {
|
||||
width: 192px;
|
||||
line-height: 25px;
|
||||
border-bottom: 1px dotted #ccc;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.ui-item-error span {
|
||||
color: #f00;
|
||||
border-bottom: none;
|
||||
}
|
||||
.ui-sub-item .icon-trash {
|
||||
cursor: pointer;
|
||||
@ -441,12 +448,12 @@ header [class*=" icon-"] {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ui-sub-item .ui-item-error {
|
||||
margin: 10px 0 0;
|
||||
.ui-popup-content .ui-item-error,
|
||||
.ui-project-configure .ui-item-error {
|
||||
margin: 10px 0;
|
||||
}
|
||||
.ui-item-error span {
|
||||
color: #f00;
|
||||
border-bottom-color: #f00;
|
||||
.ui-sub-item .ui-item-error {
|
||||
margin: 15px 0 -10px;
|
||||
}
|
||||
.ui-item-error .icon-expand {
|
||||
position: absolute;
|
||||
|
@ -19,6 +19,11 @@ window.addEventListener('DOMContentLoaded', function (){
|
||||
data: {
|
||||
activeIndex: 0,
|
||||
configure: {}
|
||||
},
|
||||
events: {
|
||||
'save-configure': function (){
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div class="fn-left">
|
||||
<a @click="appConfigure('save', configure)" title="添加项目" class="ui-project-add" href="javascript:;">
|
||||
<a @click="popupToggle" title="添加项目" class="ui-project-add" href="javascript:;">
|
||||
<i class="icon-plus"></i>
|
||||
<i class="icon-expand"></i>
|
||||
</a>
|
||||
@ -10,7 +10,7 @@
|
||||
<i class="icon-export"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-popup fn-hide">
|
||||
<div v-show="popup" class="ui-popup">
|
||||
<div class="ui-popup-arrow">
|
||||
<em></em>
|
||||
<span></span>
|
||||
@ -22,12 +22,20 @@
|
||||
<label>项目名称:</label>
|
||||
<input type="text" placeholder="项目名称"/>
|
||||
</li>
|
||||
<li class="ui-item-error">
|
||||
<label class="fn-invisible">项目名称:</label>
|
||||
<span><i class="icon-expand"></i>asdasdasdsa</span>
|
||||
</li>
|
||||
<li id="popup-open-dir">
|
||||
<directory label="项目路径"></directory>
|
||||
</li>
|
||||
<li class="ui-item-error">
|
||||
<label class="fn-invisible">项目名称:</label>
|
||||
<span><i class="icon-expand"></i>asdasdasdsa</span>
|
||||
</li>
|
||||
<li class="ui-popup-control">
|
||||
<input type="submit" class="ui-button" value="确定"/>
|
||||
<input type="button" class="ui-button ui-button-orange" value="取消"/>
|
||||
<input @click="popupToggle" type="button" class="ui-button ui-button-orange" value="取消"/>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -18,9 +18,20 @@ module.exports = Vue.component('app-configure', {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data: function (){
|
||||
return {
|
||||
popup: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
appConfigure: function (command, configure){
|
||||
ipc.send('app-configure', command, configure);
|
||||
},
|
||||
popupToggle: function (){
|
||||
this.popup = !this.popup;
|
||||
},
|
||||
addProject: function (){
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ module.exports = Vue.component('directory', {
|
||||
},
|
||||
path: {
|
||||
type: String,
|
||||
twoWay: true,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
|
@ -4,7 +4,7 @@
|
||||
<span :title="item.value">{{ item.value }}</span>
|
||||
<i @click="remove(index)" title="删除" class="icon-trash"></i>
|
||||
</li>
|
||||
<li class="ui-action-bar">
|
||||
<li class="ui-item-add">
|
||||
<input type="text" :placeholder="nameLabel" v-model="name" lazy @focus="focus('nameError')"/>
|
||||
<input type="text" :placeholder="valueLabel" v-model="value" lazy @focus="focus('valueError')"/>
|
||||
<input type="button" class="ui-button" @click="add" value="添加"/>
|
||||
|
49
static/js/components/project-base/index.js
Normal file
49
static/js/components/project-base/index.js
Normal file
@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/20.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var Vue = require('../../vue/vue');
|
||||
|
||||
module.exports = Vue.component('app-configure', {
|
||||
template: fs.readFileSync(path.join(__dirname, 'project-base.html')).toString(),
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
twoWay: true,
|
||||
default: ''
|
||||
},
|
||||
path: {
|
||||
type: String,
|
||||
twoWay: true,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data: function (){
|
||||
return {
|
||||
nameError: '',
|
||||
pathError: ''
|
||||
};
|
||||
},
|
||||
events: {
|
||||
'submit': function (){
|
||||
this.name = this.name.trim();
|
||||
this.path = this.path.trim();
|
||||
|
||||
if (this.name) {
|
||||
this.nameError = '';
|
||||
} else {
|
||||
this.nameError = '项目名称不能为空';
|
||||
}
|
||||
|
||||
if (this.path) {
|
||||
this.pathError = '';
|
||||
} else {
|
||||
this.pathError = '项目路径不能为空';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
15
static/js/components/project-base/project-base.html
Normal file
15
static/js/components/project-base/project-base.html
Normal file
@ -0,0 +1,15 @@
|
||||
<li>
|
||||
<label>项目名称:</label>
|
||||
<input type="text" v-model="name" placeholder="项目名称"/>
|
||||
</li>
|
||||
<li v-show="nameError" class="ui-item-error">
|
||||
<label class="fn-invisible">     </label>
|
||||
<span><i class="icon-expand"></i>{{ nameError }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<directory label="项目路径" :path.sync="path"></directory>
|
||||
</li>
|
||||
<li v-show="pathError" class="ui-item-error">
|
||||
<label class="fn-invisible">     </label>
|
||||
<span><i class="icon-expand"></i>{{ pathError }}</span>
|
||||
</li>
|
Loading…
x
Reference in New Issue
Block a user