You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2016/02/09 10:26:19 UTC
[20/51] [abbrv] ignite git commit: IGNITE-843 changed case of dir
IGNITE-843 changed case of dir
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e8742140
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e8742140
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e8742140
Branch: refs/heads/ignite-843-rc3
Commit: e87421405072a3f24cf18769a0df227961b974cd
Parents: f44371d
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 17:10:14 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:10:14 2016 +0700
----------------------------------------------------------------------
.../main/js/app/modules/User/Auth.service.js | 77 --------------------
.../main/js/app/modules/User/User.service.js | 58 ---------------
.../src/main/js/app/modules/User/user.module.js | 28 -------
.../main/js/app/modules/user/Auth.service.js | 77 ++++++++++++++++++++
.../main/js/app/modules/user/User.service.js | 58 +++++++++++++++
.../src/main/js/app/modules/user/user.module.js | 28 +++++++
6 files changed, 163 insertions(+), 163 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js b/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
deleted file mode 100644
index 3e194e7..0000000
--- a/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User',
- function($http, $root, $state, $common, gettingStarted, User) {
- let _auth = false;
-
- try {
- _auth = localStorage.authorized === 'true';
- }
- catch (ignore) {
- // No-op.
- }
-
- function _authorized(value) {
- try {
- return _auth = localStorage.authorized = !!value;
- } catch (ignore) {
- return _auth = !!value;
- }
- }
-
- return {
- get authorized() {
- return _auth;
- },
- set authorized(auth) {
- _authorized(auth);
- },
- auth(action, userInfo) {
- $http.post('/api/v1/' + action, userInfo)
- .then(User.read)
- .then((user) => {
- if (action !== 'password/forgot') {
- _authorized(true);
-
- $root.$broadcast('user', user);
-
- $state.go('base.configuration.clusters');
-
- $root.gettingStarted.tryShow();
- } else
- $state.go('password.send');
- })
- .catch(function(errMsg) {
- $common.showPopoverMessage(null, null, 'user_email', errMsg.data);
- });
- },
- logout() {
- $http.post('/api/v1/logout')
- .then(function() {
- User.clean();
-
- _authorized(false);
-
- $state.go('login');
- })
- .catch(function(errMsg) {
- $common.showError(errMsg);
- });
- }
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/User/User.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/User.service.js b/modules/control-center-web/src/main/js/app/modules/User/User.service.js
deleted file mode 100644
index dc2117e..0000000
--- a/modules/control-center-web/src/main/js/app/modules/User/User.service.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['User', ['$q', '$injector', '$rootScope', '$state', '$http', function($q, $injector, $root, $state, $http) {
- let _user;
-
- try {
- _user = JSON.parse(localStorage.user);
-
- if (_user)
- $root.user = _user;
- }
- catch (ignore) {
- // No-op.
- }
-
- return {
- read() {
- return $http.post('/api/v1/user').then(({data}) => {
- if (_.isEmpty(data)) {
- const Auth = $injector.get('Auth');
-
- Auth.authorized = false;
-
- $state.go('login');
- }
-
- try {
- localStorage.user = JSON.stringify(data);
- }
- catch (ignore) {
- // No-op.
- }
-
- return _user = $root.user = data;
- });
- },
- clean() {
- delete $root.user;
-
- delete localStorage.user;
- }
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/User/user.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/user.module.js b/modules/control-center-web/src/main/js/app/modules/User/user.module.js
deleted file mode 100644
index 2387f20..0000000
--- a/modules/control-center-web/src/main/js/app/modules/User/user.module.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-import Auth from './Auth.service';
-import User from './User.service';
-
-angular
-.module('ignite-console.user', [
-
-])
-.service(...Auth)
-.service(...User);
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js b/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
new file mode 100644
index 0000000..3e194e7
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User',
+ function($http, $root, $state, $common, gettingStarted, User) {
+ let _auth = false;
+
+ try {
+ _auth = localStorage.authorized === 'true';
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ function _authorized(value) {
+ try {
+ return _auth = localStorage.authorized = !!value;
+ } catch (ignore) {
+ return _auth = !!value;
+ }
+ }
+
+ return {
+ get authorized() {
+ return _auth;
+ },
+ set authorized(auth) {
+ _authorized(auth);
+ },
+ auth(action, userInfo) {
+ $http.post('/api/v1/' + action, userInfo)
+ .then(User.read)
+ .then((user) => {
+ if (action !== 'password/forgot') {
+ _authorized(true);
+
+ $root.$broadcast('user', user);
+
+ $state.go('base.configuration.clusters');
+
+ $root.gettingStarted.tryShow();
+ } else
+ $state.go('password.send');
+ })
+ .catch(function(errMsg) {
+ $common.showPopoverMessage(null, null, 'user_email', errMsg.data);
+ });
+ },
+ logout() {
+ $http.post('/api/v1/logout')
+ .then(function() {
+ User.clean();
+
+ _authorized(false);
+
+ $state.go('login');
+ })
+ .catch(function(errMsg) {
+ $common.showError(errMsg);
+ });
+ }
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/user/User.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/user/User.service.js b/modules/control-center-web/src/main/js/app/modules/user/User.service.js
new file mode 100644
index 0000000..dc2117e
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/user/User.service.js
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['User', ['$q', '$injector', '$rootScope', '$state', '$http', function($q, $injector, $root, $state, $http) {
+ let _user;
+
+ try {
+ _user = JSON.parse(localStorage.user);
+
+ if (_user)
+ $root.user = _user;
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ return {
+ read() {
+ return $http.post('/api/v1/user').then(({data}) => {
+ if (_.isEmpty(data)) {
+ const Auth = $injector.get('Auth');
+
+ Auth.authorized = false;
+
+ $state.go('login');
+ }
+
+ try {
+ localStorage.user = JSON.stringify(data);
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ return _user = $root.user = data;
+ });
+ },
+ clean() {
+ delete $root.user;
+
+ delete localStorage.user;
+ }
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/user/user.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/user/user.module.js b/modules/control-center-web/src/main/js/app/modules/user/user.module.js
new file mode 100644
index 0000000..2387f20
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/user/user.module.js
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import Auth from './Auth.service';
+import User from './User.service';
+
+angular
+.module('ignite-console.user', [
+
+])
+.service(...Auth)
+.service(...User);