created remote console page
TODO: Remove HTERM.
Change-Id: I72026e5ea64c9fba3089b68dfd2b8198255dabb8
Signed-off-by: Michael Davis <michael.s.davis@ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 0f3b729..3ed48a3 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -11,7 +11,11 @@
'use strict';
angular
.module('app.common.services')
+<<<<<<< HEAD
.factory('APIUtils', ['$http', 'Constants', '$q', function($http, Constants, $q){
+=======
+ .factory('APIUtils', ['$http', 'Constants', function($http, Constants){
+>>>>>>> 4c1a3dd... Major update to code structure
var SERVICE = {
LOGIN_CREDENTIALS: Constants.LOGIN_CREDENTIALS,
API_CREDENTIALS: Constants.API_CREDENTIALS,
@@ -19,8 +23,11 @@
CHASSIS_POWER_STATE: Constants.CHASSIS_POWER_STATE,
HOST_STATE_TEXT: Constants.HOST_STATE,
HOST_STATE: Constants.HOST_STATE,
+<<<<<<< HEAD
LED_STATE: Constants.LED_STATE,
LED_STATE_TEXT: Constants.LED_STATE_TEXT,
+=======
+>>>>>>> 4c1a3dd... Major update to code structure
getChassisState: function(callback){
$http({
method: 'GET',
@@ -55,6 +62,7 @@
console.log(error);
});
},
+<<<<<<< HEAD
getLEDState: function(callback){
$http({
method: 'GET',
@@ -76,6 +84,8 @@
console.log(error);
});
},
+=======
+>>>>>>> 4c1a3dd... Major update to code structure
login: function(username, password, callback){
$http({
method: 'POST',
@@ -92,11 +102,15 @@
}
}).error(function(error){
if(callback){
+<<<<<<< HEAD
if(error && error.status && error.status == 'error'){
callback(error);
}else{
callback(error, true);
}
+=======
+ callback(null, true);
+>>>>>>> 4c1a3dd... Major update to code structure
}
console.log(error);
});
@@ -170,6 +184,7 @@
}
});
},
+<<<<<<< HEAD
setLEDState: function(state, callback){
$http({
method: 'PUT',
@@ -219,6 +234,15 @@
});
},
hostPowerOn: function(callback){
+=======
+ hostPowerOn: function(callback){
+ /**
+ curl -c cjar -b cjar -k -H "Content-Type: application/json" -d
+ "{\"data\": \"xyz.openbmc_project.State.Host.Transition.Off\"}"
+ -X PUT
+ https://9.3.164.147/xyz/openbmc_project/state/host0/attr/RequestedHostTransition
+ **/
+>>>>>>> 4c1a3dd... Major update to code structure
$http({
method: 'PUT',
url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/state/host0/attr/RequestedHostTransition",
@@ -313,6 +337,7 @@
console.log(error);
}
});
+<<<<<<< HEAD
},
getLogs: function(callback){
$http({
@@ -785,6 +810,9 @@
return defer.promise;
},
+=======
+ }
+>>>>>>> 4c1a3dd... Major update to code structure
};
return SERVICE;
}]);
diff --git a/app/common/services/apiInterceptor.js b/app/common/services/apiInterceptor.js
index d1a23ad..cba3c6e 100644
--- a/app/common/services/apiInterceptor.js
+++ b/app/common/services/apiInterceptor.js
@@ -16,12 +16,18 @@
.service('apiInterceptor', ['$q', '$rootScope', 'dataService', function($q, $rootScope, dataService){
return {
'request': function(config){
+<<<<<<< HEAD
dataService.loading = true;
config.timeout = 20000;
+=======
+ dataService.server_unreachable = false;
+ dataService.loading = true;
+>>>>>>> 4c1a3dd... Major update to code structure
return config;
},
'response': function(response){
dataService.loading = false;
+<<<<<<< HEAD
//not interested in template requests
if(!/^https?\:/i.test(response.config.url)){
@@ -33,6 +39,12 @@
dataService.server_unreachable = true;
}else{
dataService.server_unreachable = false;
+=======
+ dataService.last_updated = new Date();
+
+ if(response == null){
+ dataService.server_unreachable = true;
+>>>>>>> 4c1a3dd... Major update to code structure
}
if(response && response.status == 'error' &&
@@ -45,9 +57,12 @@
'responseError': function(rejection){
dataService.server_unreachable = true;
dataService.loading = false;
+<<<<<<< HEAD
if(dataService.path != '/login'){
$rootScope.$emit('timedout-user', {});
}
+=======
+>>>>>>> 4c1a3dd... Major update to code structure
return $q.reject(rejection);
}
};
diff --git a/app/common/services/constants.js b/app/common/services/constants.js
index a610ba9..0db039f 100644
--- a/app/common/services/constants.js
+++ b/app/common/services/constants.js
@@ -20,8 +20,12 @@
password: "testpass",
},
API_CREDENTIALS: {
+<<<<<<< HEAD
host: 'https://9.3.181.15',
mock_host: 'http://localhost:3000'
+=======
+ host: 'https://9.3.164.147'
+>>>>>>> 4c1a3dd... Major update to code structure
},
API_RESPONSE: {
ERROR_STATUS: 'error',
@@ -44,6 +48,7 @@
off: -1,
booting: 0,
unreachable: -2
+<<<<<<< HEAD
},
LED_STATE: {
on: true,
@@ -78,8 +83,14 @@
'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'watts',
'xyz.openbmc_project.Sensor.Value.Unit.Amperes': 'amperes',
'xyz.openbmc_project.Sensor.Value.Unit.Joules': 'joules'
+=======
+>>>>>>> 4c1a3dd... Major update to code structure
}
};
});
+<<<<<<< HEAD
})(window.angular);
+=======
+})(window.angular);
+>>>>>>> 4c1a3dd... Major update to code structure
diff --git a/app/common/services/dataService.js b/app/common/services/dataService.js
index 4cb72c5..f5f4c61 100644
--- a/app/common/services/dataService.js
+++ b/app/common/services/dataService.js
@@ -19,8 +19,12 @@
this.server_state = 'Unreachable';
this.server_status = -2;
this.chassis_state = 'On';
+<<<<<<< HEAD
this.LED_state = Constants.LED_STATE_TEXT.off;
this.server_id = Constants.API_CREDENTIALS.host.replace(/[^\d]+/m,"");
+=======
+ this.server_id = "Server 9.3.164.147";
+>>>>>>> 4c1a3dd... Major update to code structure
this.last_updated = new Date();
this.loading = false;
@@ -29,7 +33,10 @@
this.showNavigation = false;
this.bodyStyle = {};
this.path = '';
+<<<<<<< HEAD
this.sensorData = [];
+=======
+>>>>>>> 4c1a3dd... Major update to code structure
this.setPowerOnState = function(){
this.server_state = Constants.HOST_STATE_TEXT.on;
diff --git a/app/common/services/userModel.js b/app/common/services/userModel.js
index dba607d..60f718e 100644
--- a/app/common/services/userModel.js
+++ b/app/common/services/userModel.js
@@ -15,9 +15,12 @@
.module('app.common.services')
.service('userModel', ['APIUtils',function(APIUtils){
return {
+<<<<<<< HEAD
fakeLogin: function(callback){
sessionStorage.setItem('LOGIN_ID', 'FAKE_ID');
},
+=======
+>>>>>>> 4c1a3dd... Major update to code structure
login : function(username, password, callback){
APIUtils.login(username, password, function(response, error){
if(response &&