mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 11:34:05 +08:00
update files
This commit is contained in:
parent
09c9b8268e
commit
5950b48276
@ -49,6 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-project-configure">
|
<div class="ui-project-configure">
|
||||||
|
<div class="ui-submit-tips">项目已经存在</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label>项目名称:</label>
|
<label>项目名称:</label>
|
||||||
|
@ -389,6 +389,7 @@ header [class*=" icon-"] {
|
|||||||
.ui-project-terminal,
|
.ui-project-terminal,
|
||||||
.ui-project-configure {
|
.ui-project-configure {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding: 30px 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: calc(100% - 39px);
|
height: calc(100% - 39px);
|
||||||
border-top: 1px dashed #ccc;
|
border-top: 1px dashed #ccc;
|
||||||
@ -406,7 +407,6 @@ header [class*=" icon-"] {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.ui-project-configure ul {
|
.ui-project-configure ul {
|
||||||
padding: 30px 0;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -461,3 +461,8 @@ header [class*=" icon-"] {
|
|||||||
margin-top: -11px;
|
margin-top: -11px;
|
||||||
margin-left: -5px;
|
margin-left: -5px;
|
||||||
}
|
}
|
||||||
|
.ui-submit-tips {
|
||||||
|
color: #f00;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0 0 15px;
|
||||||
|
}
|
||||||
|
@ -11,6 +11,7 @@ require('../components/app-configure');
|
|||||||
require('../components/window-control');
|
require('../components/window-control');
|
||||||
require('../components/app-nav');
|
require('../components/app-nav');
|
||||||
require('../components/directory');
|
require('../components/directory');
|
||||||
|
require('../components/project-base');
|
||||||
require('../components/dynamic-item');
|
require('../components/dynamic-item');
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function (){
|
window.addEventListener('DOMContentLoaded', function (){
|
||||||
@ -18,11 +19,11 @@ window.addEventListener('DOMContentLoaded', function (){
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
data: {
|
data: {
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
configure: {}
|
configure: { projects: [] }
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
'save-configure': function (){
|
'save-configure': function (){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -16,23 +16,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-popup-content">
|
<div class="ui-popup-content">
|
||||||
<form>
|
<div v-show="submitError" class="ui-submit-tips">{{ submitError }}</div>
|
||||||
|
<form @submit.prevent="addProject">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li is="project-base" :name.sync="name" :path.sync="path"></li>
|
||||||
<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">
|
<li class="ui-popup-control">
|
||||||
<input type="submit" class="ui-button" value="确定"/>
|
<input type="submit" class="ui-button" value="确定"/>
|
||||||
<input @click="popupToggle" type="button" class="ui-button ui-button-orange" value="取消"/>
|
<input @click="popupToggle" type="button" class="ui-button ui-button-orange" value="取消"/>
|
||||||
|
@ -20,6 +20,10 @@ module.exports = Vue.component('app-configure', {
|
|||||||
},
|
},
|
||||||
data: function (){
|
data: function (){
|
||||||
return {
|
return {
|
||||||
|
name: '',
|
||||||
|
path: '',
|
||||||
|
_cached: {},
|
||||||
|
submitError: '',
|
||||||
popup: false
|
popup: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -29,9 +33,34 @@ module.exports = Vue.component('app-configure', {
|
|||||||
},
|
},
|
||||||
popupToggle: function (){
|
popupToggle: function (){
|
||||||
this.popup = !this.popup;
|
this.popup = !this.popup;
|
||||||
|
|
||||||
|
if (!this.popup) {
|
||||||
|
this.submitError = '';
|
||||||
|
this.$broadcast('clean-error');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
addProject: function (){
|
addProject: function (){
|
||||||
|
this.$broadcast('submit');
|
||||||
|
|
||||||
|
if (this.name && this.path) {
|
||||||
|
if (this.$data._cached[this.name]) {
|
||||||
|
this.submitError = '项目已存在';
|
||||||
|
} else {
|
||||||
|
this.popup = false;
|
||||||
|
this.configure.projects.push({ name: this.name, path: this.path });
|
||||||
|
this.$data._cached[this.name] = true;
|
||||||
|
|
||||||
|
// clean imput
|
||||||
|
this.name = '';
|
||||||
|
this.path = '';
|
||||||
|
this.submitError = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created: function (){
|
||||||
|
this.configure.projects.forEach(function (project){
|
||||||
|
this.$data._cached[project.name] = true;
|
||||||
|
}, this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -82,6 +82,12 @@ module.exports = Vue.component('dynamic-item', {
|
|||||||
delete this.$data._cached[item.name];
|
delete this.$data._cached[item.name];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
events: {
|
||||||
|
'clean-error': function (){
|
||||||
|
this.nameError = '';
|
||||||
|
this.valueError = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
created: function (){
|
created: function (){
|
||||||
this.items.forEach(function (item){
|
this.items.forEach(function (item){
|
||||||
this.$data._cached[item.name] = true;
|
this.$data._cached[item.name] = true;
|
||||||
|
@ -8,7 +8,7 @@ var fs = require('fs');
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var Vue = require('../../vue/vue');
|
var Vue = require('../../vue/vue');
|
||||||
|
|
||||||
module.exports = Vue.component('app-configure', {
|
module.exports = Vue.component('project-base', {
|
||||||
template: fs.readFileSync(path.join(__dirname, 'project-base.html')).toString(),
|
template: fs.readFileSync(path.join(__dirname, 'project-base.html')).toString(),
|
||||||
props: {
|
props: {
|
||||||
name: {
|
name: {
|
||||||
@ -28,7 +28,16 @@ module.exports = Vue.component('app-configure', {
|
|||||||
pathError: ''
|
pathError: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
focus: function (key){
|
||||||
|
this[key] = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
events: {
|
events: {
|
||||||
|
'clean-error': function (){
|
||||||
|
this.nameError = '';
|
||||||
|
this.pathError = '';
|
||||||
|
},
|
||||||
'submit': function (){
|
'submit': function (){
|
||||||
this.name = this.name.trim();
|
this.name = this.name.trim();
|
||||||
this.path = this.path.trim();
|
this.path = this.path.trim();
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
<div class="ui-project-setting">
|
||||||
|
<form>
|
||||||
|
<div class="ui-control-bar fn-clear">
|
||||||
|
<div class="fn-right">
|
||||||
|
<input type="submit" class="ui-button" value="确认"/>
|
||||||
|
<input type="button" class="ui-button ui-button-orange" value="取消"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ui-project-configure">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>项目名称:</label>
|
||||||
|
<input type="text" placeholder="项目名称"/>
|
||||||
|
</li>
|
||||||
|
<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>
|
||||||
|
</li>
|
||||||
|
<li id="add-cmd" class="ui-sub-item">
|
||||||
|
<label>项目命令:</label>
|
||||||
|
<dynamic-item name-label="名称" value-label="命令"></dynamic-item>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user