4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 var rw
= require('utils/rw.js');
20 var API_SERVER
= rw
.getSearchParams(window
.location
).api_server
;
21 var aboutActions
= require('./aboutActions.js');
22 var Utils
= require('utils/utils.js');
23 import $ from 'jquery';
27 remote: function(state
) {
28 return new Promise(function(resolve
, reject
) {
30 url
: 'api/?api_server=' + API_SERVER
,
32 beforeSend
: Utils
.addAuthorizationStub
,
33 contentType
: "application/json",
34 success: function(data
) {
37 error: function(error
) {
38 console
.log("There was an error getting the crash details: ", error
);
41 }).fail(function(xhr
){
43 //Authentication and the handling of fail states should be wrapped up into a connection class.
44 Utils
.checkAuthentication(xhr
.status
);
47 }).catch(function(){});
49 success
: aboutActions
.getAboutSuccess
,
50 loading
: aboutActions
.getAboutLoading
,
51 error
: aboutActions
.getAboutFail
54 createTime: function() {
56 remote: function(state
) {
57 return new Promise(function(resolve
, reject
) {
59 url
: 'api/create-time?api_server=' + API_SERVER
,
61 beforeSend
: Utils
.addAuthorizationStub
,
62 contentType
: "application/json",
63 success: function(data
) {
66 error: function(error
) {
67 console
.log("There was an error getting the uptime : ", error
);
72 }).catch(function(){});;
74 success
: aboutActions
.getCreateTimeSuccess
,
75 loading
: aboutActions
.getCreateTimeLoading
,
76 error
: aboutActions
.getCreateTimeFail
80 module
.exports
= aboutSource
;