update files

This commit is contained in:
nuintun 2015-11-23 12:20:53 +08:00
parent 2727398d3a
commit 469ebd9744
8 changed files with 60 additions and 46 deletions

View File

@ -16,31 +16,7 @@
<app-nav :configure.sync="configure" :active-index.sync="activeIndex"></app-nav>
</nav>
<main class="ui-project-main fn-right">
<div class="ui-project-stage fn-hide">
<div class="ui-control-bar fn-clear">
<div class="ui-control-operate fn-left">
<a title="删除项目" href="javascript:;"><i class="icon-trash"></i></a>
<a title="设置项目" href="javascript:;"><i class="icon-gear"></i></a>
</div>
<div class="fn-right">
<ul class="ui-command fn-clear">
<li><a href="javascript:;"><i class="icon-play"></i>命令1</a></li>
<li><a href="javascript:;"><i class="icon-stop"></i>命令2</a></li>
<li><a href="javascript:;"><i class="icon-play"></i>命令3</a></li>
<li class="ui-command-more">
<a href="javascript:;">更多&nbsp;<i class="icon-expand"></i></a>
<ul class="ui-command-popup fn-hide">
<li><a href="javascript:;"><i class="icon-play"></i>命令4</a></li>
<li><a href="javascript:;"><i class="icon-stop"></i>命令5</a></li>
<li><a href="javascript:;"><i class="icon-play"></i>命令6</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="ui-project-terminal"></div>
</div>
<project-configure :active-index.once="activeIndex" :projects.sync="configure.projects" unique-projects.sync="{}"></project-configure>
<app-main :active-index="activeIndex" :projects.sync="configure.projects" :unique-projects.sync="uniqueProjects"></app-main>
</main>
</body>
</html>

View File

@ -10,10 +10,7 @@ var Vue = require('../vue/vue');
require('../components/app-configure');
require('../components/window-control');
require('../components/app-nav');
require('../components/directory');
require('../components/project-base');
require('../components/dynamic-item');
require('../components/project-configure');
require('../components/app-main');
window.addEventListener('DOMContentLoaded', function (){
function normalize(configure){

View File

@ -9,6 +9,8 @@ var path = require('path');
var ipc = require('ipc-renderer');
var Vue = require('../../vue/vue');
require('../project-base');
module.exports = Vue.component('app-configure', {
template: fs.readFileSync(path.join(__dirname, 'app-configure.html')).toString(),
props: {

View File

@ -1,4 +1,4 @@
<project-configure></project-configure>
<project-configure :project.sync="project"></project-configure>
<div class="ui-project-stage fn-hide">
<div class="ui-control-bar fn-clear">
<div class="ui-control-operate fn-left">

View File

@ -1,3 +1,51 @@
/**
* Created by nuintun on 2015/11/20.
*/
var fs = require('fs');
var path = require('path');
var ipc = require('ipc-renderer');
var Vue = require('../../vue/vue');
require('../project-configure');
module.exports = Vue.component('app-main', {
template: fs.readFileSync(path.join(__dirname, 'app-main.html')).toString(),
props: {
activeIndex: {
type: Number,
required: true
},
projects: {
type: Array,
twoWay: true,
required: true
},
uniqueProjects: {
type: Object,
twoWay: true,
required: true
}
},
computed: {
project: function (){
var project = this.projects[this.activeIndex] || {
name: '',
path: '',
env: [],
command: []
};
if (!project.env) {
project.env = [];
}
if (!project.command) {
project.command = [];
}
return project;
}
}
});

View File

@ -8,6 +8,8 @@ var fs = require('fs');
var path = require('path');
var Vue = require('../../vue/vue');
require('../directory');
module.exports = Vue.component('project-base', {
template: fs.readFileSync(path.join(__dirname, 'project-base.html')).toString(),
props: {

View File

@ -9,27 +9,16 @@ var path = require('path');
var ipc = require('ipc-renderer');
var Vue = require('../../vue/vue');
require('../project-base');
require('../dynamic-item');
module.exports = Vue.component('project-configure', {
template: fs.readFileSync(path.join(__dirname, 'project-configure.html')).toString(),
props: {
activeIndex: {
type: Number,
required: true
},
projects: {
project: {
type: Object,
twoWay: true,
required: true
},
uniqueProjects: {
type: Object,
twoWay: true,
required: true
}
},
computed: {
project: function (){
return this.projects[this.activeIndex] || { name: '', path: '', env: [], command: [] };
}
},
methods: {

View File

@ -1,5 +1,5 @@
<div class="ui-project-setting">
<form @sumbit.prevent="edit">
<form @submit.prevent="edit">
<div class="ui-control-bar fn-clear">
<div class="fn-right">
<input type="submit" class="ui-button" value="确认"/>