Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
hailiang-wang committed Sep 1, 2015
2 parents 15f79bb + 5f3d5b4 commit d7f388f
Show file tree
Hide file tree
Showing 354 changed files with 31,671 additions and 4,752 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ npm-debug.log
*.swp
*.swo
client/app/config.js
lyman/
server/public/sampleapps/ionic-client/www/lib
server/public/sampleapps/nodejs-backend/austack-variables.json
server/public/sampleapps/nodejs-backend/node_modules
.env
2 changes: 1 addition & 1 deletion .jsbeautifyrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"indent_size": 2,
"max_preserve_newlines": 2,
"preserve_newlines": true,
"unformatted": ["a", "sub", "sup", "b", "i", "u"],
"unformatted": ["a", "span", "img", "code", "pre", "sub", "sup", "em", "strong", "b", "i", "u", "strike", "big", "small", "pre", "h1", "h2", "h3", "h4", "h5", "h6"], // List of tags that should not be reformatted
"wrap_line_length": 0
},
"css": {
Expand Down
1 change: 1 addition & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client/app/components/hljs/*
10 changes: 8 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
// JASMINE
"describe": false,
"it": false,
"saveAs": false,
"FileReader": false,
"Blob": false,
"before": false,
"beforeEach": false,
"after": false,
Expand All @@ -51,9 +54,12 @@
"_": false,
// sinon
"sinon": false,
// Jquery
"$": false,
// Browser
"document": false,
"console": false
"console": false,
"window": false
},
//relaxing options
"globalstrict": true,
Expand All @@ -62,4 +68,4 @@
"devel": true //'console' is not defined.

//"jasmine": true
}
}
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,29 @@ gulp serve # start client at http://localhost:3000/
exports.users = [{
provider: 'local',
role: 'admin',
name: '15801213126',
password: 'auth4fun',
userId: 'dave',
name: 'dave1',
password: 'dave1',
userId: 'dave1',
active: true
}, {
provider: 'local',
role: 'admin',
name: 'dave2',
password: 'dave2',
userId: 'dave2',
active: true
}, {
provider: 'local',
role: 'root',
name: 'Root',
name: 'root',
userId: 'root',
password: 'auth4fun',
password: 'root',
active: true
}];
```
```

# License
Copyright (c) 2015 Hain, Lyman, Neo, Wendy, contributors.

Released under the [MIT license](https://tldrlegal.com/license/mit-license).

7 changes: 5 additions & 2 deletions bin/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

'use strict';

var app = require('../server/austack-server');
var app = require('../server/app');

// start sockets for this instance and start server
app.startServer().listen(app.get('port'), app.get('ip'), function serverStarted() {
console.log('austack started server on ip %s on port %d, in %s mode',
console.log('> austack started server on ip %s on port %d, in %s mode',
app.get('ip'), app.get('port'), app.get('env'));
console.log('+ + + + + + + + + + +');
console.log('+ IN CODE, WE TRUST +');
console.log('+ + + + + + + + + + +');
});

// expose app
Expand Down
14 changes: 11 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@
"angular-ui-router": "latest",
"material-design-icons": ">=1.0.1",
"lodash": "~2.4.1",
"angular-material": "0.10.0",
"angular-material": "0.10.1",
"angular-socket-io": "~0.6.0",
"angular-i18n": "~1.3.14",
"angular-moment": "~0.9.0",
"angular-loading-bar": "~0.7.1",
"jQuery": "~2.1.4",
"angular-breadcrumb": "~0.4.0"
"angular-breadcrumb": "~0.4.0",
"angular-timer": "~1.3.3",
"cal-heatmap": "~3.5.2",
"file-saver.js": "~1.20150507.2",
"angular-ui-ace": "bower",
"angular-material-data-table": "~0.8.0",
"angular-drag-and-drop-lists": "~1.2.0",
"animate.css": "~3.3.1",
"geopattern": "~1.2.3",
"ngImgCrop": "~0.3.2"
},
"devDependencies": {
"angular-mocks": ">=1.2.*",
Expand Down
8 changes: 5 additions & 3 deletions client/app/account/account.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<section id="user-content" layout="column" layout-fill flex>
<div ui-view layout="row" layout-fill flex></div>
</section>
<div id="account-content" flex layout="column">
<section flex layout="row" layout-align="center center">
<div ui-view flex layout="column"></div>
</section>
</div>
6 changes: 4 additions & 2 deletions client/app/account/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
angular
.module('austackApp.account', [
'ui.router',
'ngMaterial'
'timer',
'ngMaterial',
'austackApp.account.settings'
])
.config(configAccountRoute);

Expand All @@ -25,7 +27,7 @@
function configAccountRoute($stateProvider) {
var accountState = {
name: 'account',
url: '/acount',
abstract: true,
templateUrl: 'app/account/account.html',
controller: 'AccountController',
controllerAs: 'account'
Expand Down
21 changes: 20 additions & 1 deletion client/app/account/account.scss
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
#account-items-content {}
#account-content {
background-color: $as-primary;
margin-bottom: 8%;
.text-center {
color: #fff;
}
.captcha {
margin-top: 20px;
height: 30px;
cursor: pointer;
}
md-card {
width: 100%;
max-width: 360px;
border-radius: 8px;
.md-button {
min-width: inherit;
}
}
}
41 changes: 3 additions & 38 deletions client/app/account/login/login.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,59 +23,24 @@
* @param {Service} $state The state service to use
* @returns {Service} {@link austackApp.account.controller:AccountLoginController AccountLoginController}
*/

AccountLoginController.$inject = ['$state', 'Auth', 'Toast'];
/* @ngInject */
function AccountLoginController($state, Auth) {
function AccountLoginController($state, Auth, Toast) {
var vm = this;

// view model bindings
/**
* @ngdoc property
* @name user
* @propertyOf austackApp.account.controller:AccountLoginController
* @description
* The user data to use as login
*
* @returns {User} The user data
*/
vm.user = {};
vm.user = {
name: '18959264502',
password: 'laijinyue'
};

/**
* @ngdoc property
* @name error
* @propertyOf austackApp.account.controller:AccountLoginController
* @description
* Error flag
* @returns {Boolean} True if there is an error
*/
vm.error = false;

// Login function (documented below)
vm.login = login;

/**
* @ngdoc function
* @name login
* @methodOf austackApp.account.controller:AccountLoginController
* @description
* Function to use as submit for the login form
* @param {form} form The form to fetch the data from
*/
function login(form) {
if (form.$valid) {
Auth.login({
name: vm.user.name,
password: vm.user.password
}).then(function () {
// Logged in, redirect to home
// $location.path('/');
$state.go('dashboard');
}).catch(function (err) {
vm.error = err;
Toast.show('用户名或密码错误');
});
}
}
Expand Down
55 changes: 27 additions & 28 deletions client/app/account/login/login.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
<section id="login-content" layout="column" flex layout-align="center center">
<h1>登录</h1>
<p ng-show="login.error" class="md-warn">{{login.error.message}}</p>
<form class="card" name="loginForm" layout="column" layout-fill layout-align="space-between" ng-submit="login.login(loginForm)">
<md-input-container md-is-error="loginForm.name.$error.required && loginForm.name.$dirty">
<label>用户ID / 手机号</label>
<input name="name" ng-model="login.user.name" required/>
<div ng-messages="loginForm.name.$error" ng-if="loginForm.name.$dirty">
<div ng-message="required">请输入您的用户ID / 手机号</div>
</div>
</md-input-container>
<md-input-container md-is-error="loginForm.password.$error.required && loginForm.password.$dirty">
<label>密码</label>
<input name="password" type="password" ng-model="login.user.password" required/>
<div ng-messages="loginForm.password.$error" ng-if="loginForm.password.$dirty">
<div ng-message="required">请输入您的密码</div>
</div>
</md-input-container>
<span layout="row" layout-align="center center">
<md-button class="md-primary md-raised" ng-disabled="!loginForm.$valid" type="submit">登录</md-button>
</span>
<br>
<br>
<section layout="row" layout-sm="column" layout-align="center center">
<md-button class="md-primary" ui-sref="account.signup">注册</md-button>
<md-button ui-sref="account.resetPassword">重置密码</md-button>
</section>
</form>
<section id="login-content" layout="column" layout-fill layout-align="center center">
<h1 class="text-center">登入 Austack</h1>
<md-card>
<md-card-content>
<form class="card" name="loginForm" layout="column" layout-fill layout-align="space-between" ng-submit="login.login(loginForm)">
<md-input-container md-is-error="loginForm.name.$error.required && loginForm.name.$dirty">
<label>用户ID / 手机号</label>
<input name="name" ng-model="login.user.name" required/>
<div ng-messages="loginForm.name.$error" ng-if="loginForm.name.$dirty">
<div ng-message="required">请输入您的用户ID / 手机号</div>
</div>
</md-input-container>
<md-input-container md-is-error="loginForm.password.$error.required && loginForm.password.$dirty">
<label>密码</label>
<input name="password" type="password" ng-model="login.user.password" required/>
<div ng-messages="loginForm.password.$error" ng-if="loginForm.password.$dirty">
<div ng-message="required">请输入您的密码</div>
</div>
</md-input-container>
<md-button class="md-primary md-raised" ng-disabled="!loginForm.$valid" type="submit">登录</md-button>
<div class="md-actions" layout="row" layout-align="space-between center">
<md-button class="md-accent" ui-sref="account.signup">注册</md-button>
<md-button ui-sref="account.reset">重置密码</md-button>
</div>
</form>
</md-card-content>
</md-card>
</section>
9 changes: 4 additions & 5 deletions client/app/account/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,27 @@
.config(configAccountLogin);

// inject configAccountLogin dependencies
configAccountLogin.$inject = ['$stateProvider', 'mainMenuProvider'];
configAccountLogin.$inject = ['$stateProvider'];

/**
* Route configuration function configuring the passed $stateProvider.
* Register the user.login state with the list template for the
* 'login' view paired with the UserMainController as 'login'.
*
* @param {$stateProvider} $stateProvider - The state provider to configure
* @param {mainMenuProvider} mainMenuProvider - The service to pass navigation information to
*/
function configAccountLogin($stateProvider, mainMenuProvider) {
function configAccountLogin($stateProvider) {
// The login state configuration
var loginState = {
name: 'account.login',
url: '^/login',
url: '/login',
authenticate: false,
// role: 'anonymous',
templateUrl: 'app/account/login/login.html',
controller: 'AccountLoginController',
controllerAs: 'login',
ncyBreadcrumb: {
label: 'Login'
skip: true
}
};

Expand Down
14 changes: 1 addition & 13 deletions client/app/account/login/login.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
#login-content {
& > * {
max-width: 350px;
}
form > .md-warn {
padding-bottom: 20px;
}
}

.ll {
height: 30px;
color: #333;
}
#login-content {}
2 changes: 1 addition & 1 deletion client/app/account/logout/logout.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
.module('austackApp.account')
.controller('AccountLogoutController', AccountLogoutController);


/**
* @ngdoc function
* @name austackApp.account.provider:AccountLogoutController
Expand All @@ -25,6 +24,7 @@
* @returns {Service} {@link austackApp.account.controller:AccountLogoutController AccountLogoutController}
*/

AccountLogoutController.$inject = 'Auth';
/** @ngInject */
function AccountLogoutController(Auth) {
Auth.logout();
Expand Down
Loading

0 comments on commit d7f388f

Please sign in to comment.