Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
22040c7d
Commit
22040c7d
authored
Nov 12, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade elasticjs
parent
444bb406
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
24 deletions
+38
-24
src/vendor/elasticjs/elastic-angular-client.js
+38
-24
src/vendor/elasticjs/elastic.js
+0
-0
No files found.
src/vendor/elasticjs/elastic-angular-client.js
View file @
22040c7d
/*! elastic.js - v1.
0.0 - 2013-03-05
/*! elastic.js - v1.
1.1 - 2013-05-24
* https://github.com/fullscale/elastic.js
* https://github.com/fullscale/elastic.js
* Copyright (c) 2013 FullScale Labs, LLC; Licensed MIT */
* Copyright (c) 2013 FullScale Labs, LLC; Licensed MIT */
/*jshint browser:true */
/*jshint browser:true */
/*global angular:true */
/*global angular:true */
/*jshint es5:true */
'use strict'
;
'use strict'
;
/*
/*
Angular.js service wrapping the elastic.js API. This module can simply
Angular.js service wrapping the elastic.js API. This module can simply
be injected into your angular controllers.
be injected into your angular controllers.
*/
*/
angular
.
module
(
'elasticjs.service'
,
[])
angular
.
module
(
'elasticjs.service'
,
[])
.
factory
(
'ejsResource'
,
[
'$http'
,
function
(
$http
)
{
.
factory
(
'ejsResource'
,
[
'$http'
,
function
(
$http
)
{
return
function
(
url
)
{
return
function
(
config
)
{
var
var
...
@@ -32,40 +31,54 @@ angular.module('elasticjs.service', [])
...
@@ -32,40 +31,54 @@ angular.module('elasticjs.service', [])
});
});
};
};
// check if we have a config object
// if not, we have the server url so
// we convert it to a config object
if
(
config
!==
Object
(
config
))
{
config
=
{
server
:
config
};
}
// set url to empty string if it was not specified
// set url to empty string if it was not specified
if
(
url
==
null
)
{
if
(
config
.
server
==
null
)
{
url
=
''
;
config
.
server
=
''
;
}
}
/* implement the elastic.js client interface for angular */
/* implement the elastic.js client interface for angular */
ejs
.
client
=
{
ejs
.
client
=
{
server
:
function
(
s
)
{
server
:
function
(
s
)
{
if
(
s
==
null
)
{
if
(
s
==
null
)
{
return
url
;
return
config
.
server
;
}
}
url
=
s
;
config
.
server
=
s
;
return
this
;
return
this
;
},
},
post
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
post
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
path
=
url
+
path
;
path
=
config
.
server
+
path
;
return
promiseThen
(
$http
.
post
(
path
,
data
),
successcb
,
errorcb
);
var
reqConfig
=
{
url
:
path
,
data
:
data
,
method
:
'POST'
};
return
promiseThen
(
$http
(
angular
.
extend
(
reqConfig
,
config
)),
successcb
,
errorcb
);
},
},
get
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
get
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
path
=
url
+
path
;
path
=
config
.
server
+
path
;
return
promiseThen
(
$http
.
get
(
path
,
data
),
successcb
,
errorcb
);
// no body on get request, data will be request params
var
reqConfig
=
{
url
:
path
,
params
:
data
,
method
:
'GET'
};
return
promiseThen
(
$http
(
angular
.
extend
(
reqConfig
,
config
)),
successcb
,
errorcb
);
},
},
put
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
put
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
path
=
url
+
path
;
path
=
config
.
server
+
path
;
return
promiseThen
(
$http
.
put
(
path
,
data
),
successcb
,
errorcb
);
var
reqConfig
=
{
url
:
path
,
data
:
data
,
method
:
'PUT'
};
return
promiseThen
(
$http
(
angular
.
extend
(
reqConfig
,
config
)),
successcb
,
errorcb
);
},
},
del
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
del
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
path
=
url
+
path
;
path
=
config
.
server
+
path
;
return
promiseThen
(
$http
.
delete
(
path
,
data
),
successcb
,
errorcb
);
var
reqConfig
=
{
url
:
path
,
data
:
data
,
method
:
'DELETE'
};
return
promiseThen
(
$http
(
angular
.
extend
(
reqConfig
,
config
)),
successcb
,
errorcb
);
},
},
head
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
head
:
function
(
path
,
data
,
successcb
,
errorcb
)
{
path
=
url
+
path
;
path
=
config
.
server
+
path
;
return
$http
.
head
(
path
,
data
)
// no body on HEAD request, data will be request params
var
reqConfig
=
{
url
:
path
,
params
:
data
,
method
:
'HEAD'
};
return
$http
(
angular
.
extend
(
reqConfig
,
config
))
.
then
(
function
(
response
)
{
.
then
(
function
(
response
)
{
(
successcb
||
angular
.
noop
)(
response
.
headers
());
(
successcb
||
angular
.
noop
)(
response
.
headers
());
return
response
.
headers
();
return
response
.
headers
();
...
@@ -75,7 +88,7 @@ angular.module('elasticjs.service', [])
...
@@ -75,7 +88,7 @@ angular.module('elasticjs.service', [])
});
});
}
}
};
};
return
ejs
;
return
ejs
;
};
};
}]);
}]);
\ No newline at end of file
src/vendor/elasticjs/elastic.js
View file @
22040c7d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment