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
9db6f826
Commit
9db6f826
authored
Sep 12, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: finished timepicker to typescript and directive refactor
parent
d96a6a59
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
7 deletions
+86
-7
pkg/api/api.go
+1
-1
public/app/directives/all.js
+0
-1
public/app/features/dashboard/dashboardSrv.js
+1
-1
public/app/features/dashboard/timepicker/custom.html
+81
-0
public/app/features/dashboard/timepicker/timepicker.html
+3
-3
public/app/features/dashboard/timepicker/timepicker.ts
+0
-0
public/test/specs/dashboardSrv-specs.js
+0
-1
No files found.
pkg/api/api.go
View file @
9db6f826
...
...
@@ -17,7 +17,7 @@ func Register(r *macaron.Macaron) {
bind
:=
binding
.
Bind
// not logged in views
r
.
Get
(
"/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/logout"
,
Logout
)
r
.
Post
(
"/login"
,
bind
(
dtos
.
LoginCommand
{}),
wrap
(
LoginPost
))
r
.
Get
(
"/login/:name"
,
OAuthLogin
)
...
...
public/app/directives/all.js
View file @
9db6f826
define
([
'./dashUpload'
,
'./grafanaSimplePanel'
,
'./dashEditLink'
,
'./ngModelOnBlur'
,
'./misc'
,
...
...
public/app/features/dashboard/dashboardSrv.js
View file @
9db6f826
...
...
@@ -31,8 +31,8 @@ function (angular, $, kbn, _, moment) {
this
.
hideControls
=
data
.
hideControls
||
false
;
this
.
sharedCrosshair
=
data
.
sharedCrosshair
||
false
;
this
.
rows
=
data
.
rows
||
[];
this
.
timepicker
=
data
.
timepicker
||
{};
this
.
time
=
data
.
time
||
{
from
:
'now-6h'
,
to
:
'now'
};
this
.
timepicker
=
data
.
timepicker
||
{};
this
.
templating
=
this
.
_ensureListExist
(
data
.
templating
);
this
.
annotations
=
this
.
_ensureListExist
(
data
.
annotations
);
this
.
refresh
=
data
.
refresh
;
...
...
public/app/features/dashboard/timepicker/custom.html
0 → 100644
View file @
9db6f826
<div
class=
"gf-box-header"
>
<div
class=
"gf-box-title"
>
<i
class=
"fa fa-clock-o"
></i>
Custom time range
</div>
<button
class=
"gf-box-header-close-btn"
ng-click=
"dismiss();"
>
<i
class=
"fa fa-remove"
></i>
</button>
</div>
<div
class=
"gf-box-body"
>
<style>
.timepicker-to-column
{
margin-top
:
10px
;
}
.timepicker-input
input
{
outline
:
0
!important
;
border
:
0px
!important
;
-webkit-box-shadow
:
0
;
-moz-box-shadow
:
0
;
box-shadow
:
0
;
position
:
relative
;
}
.timepicker-input
input
::-webkit-outer-spin-button
,
.timepicker-input
input
::-webkit-inner-spin-button
{
-webkit-appearance
:
none
;
margin
:
0
;
}
input
.timepicker-date
{
width
:
90px
;
}
input
.timepicker-hms
{
width
:
20px
;
}
input
.timepicker-ms
{
width
:
25px
;
}
div
.timepicker-now
{
float
:
right
;
}
</style>
<div
class=
"timepicker form-horizontal"
>
<form
name=
"timeForm"
style=
"margin-bottom: 0"
>
<div
class=
"timepicker-from-column"
>
<label
class=
"small"
>
From
</label>
<div
class=
"fake-input timepicker-input"
>
<input
class=
"timepicker-date"
type=
"text"
ng-change=
"validate(temptime)"
ng-model=
"temptime.from.date"
data-date-format=
"yyyy-mm-dd"
required
bs-datepicker
/>
@
<input
class=
"timepicker-hms"
type=
"text"
maxlength=
"2"
ng-change=
"validate(temptime)"
ng-model=
"temptime.from.hour"
required
ng-pattern=
"patterns.hour"
onClick=
"this.select();"
/>
:
<input
class=
"timepicker-hms"
type=
"text"
maxlength=
"2"
ng-change=
"validate(temptime)"
ng-model=
"temptime.from.minute"
required
ng-pattern=
"patterns.minute"
onClick=
"this.select();"
/>
:
<input
class=
"timepicker-hms"
type=
"text"
maxlength=
"2"
ng-change=
"validate(temptime)"
ng-model=
"temptime.from.second"
required
ng-pattern=
"patterns.second"
onClick=
"this.select();"
/>
.
<input
class=
"timepicker-ms"
type=
"text"
maxlength=
"3"
ng-change=
"validate(temptime)"
ng-model=
"temptime.from.millisecond"
required
ng-pattern=
"patterns.millisecond"
onClick=
"this.select();"
/>
</div>
</div>
<div
class=
"timepicker-to-column"
>
<label
class=
"small"
>
To (
<a
class=
"link"
ng-class=
"{'strong':temptime.now}"
ng-click=
"ctrl.setNow();temptime.now=true"
>
set now
</a>
)
</label>
<div
class=
"fake-input timepicker-input"
>
<div
ng-hide=
"temptime.now"
>
<input
class=
"timepicker-date"
type=
"text"
ng-change=
"validate(temptime)"
ng-model=
"temptime.to.date"
data-date-format=
"yyyy-mm-dd"
required
bs-datepicker
/>
@
<input
class=
"timepicker-hms"
type=
"text"
maxlength=
"2"
ng-change=
"validate(temptime)"
ng-model=
"temptime.to.hour"
required
ng-pattern=
"patterns.hour"
onClick=
"this.select();"
/>
:
<input
class=
"timepicker-hms"
type=
"text"
maxlength=
"2"
ng-change=
"validate(temptime)"
ng-model=
"temptime.to.minute"
required
ng-pattern=
"patterns.minute"
onClick=
"this.select();"
/>
:
<input
class=
"timepicker-hms"
type=
"text"
maxlength=
"2"
ng-change=
"validate(temptime)"
ng-model=
"temptime.to.second"
required
ng-pattern=
"patterns.second"
onClick=
"this.select();"
/>
.
<input
class=
"timepicker-ms"
type=
"text"
maxlength=
"3"
ng-change=
"validate(temptime)"
ng-model=
"temptime.to.millisecond"
required
ng-pattern=
"patterns.millisecond"
onClick=
"this.select();"
/>
</div>
<span
type=
"text"
ng-show=
"temptime.now"
ng-disabled=
"temptime.now"
>
&
nbsp
<i
class=
"pointer fa fa-remove"
ng-click=
"ctrl.setNow();temptime.now=false;"
></i>
Right Now
<input
type=
"text"
name=
"dummy"
style=
"visibility:hidden"
/></span>
</div>
</div>
<br>
<button
ng-click=
"ctrl.setAbsoluteTimeFilter(ctrl.validate(temptime));dismiss();"
ng-disabled=
"!timeForm.$valid"
class=
"btn btn-success"
>
Apply
</button>
<span
class=
""
ng-hide=
"input.$valid"
>
Invalid date or range
</span>
</form>
</div>
</div>
public/app/features/dashboard/timepicker/timepicker.html
View file @
9db6f826
...
...
@@ -19,7 +19,7 @@
<li
class=
"dropdown"
>
<a
class=
"dropdown-toggle timepicker-dropdown"
data-toggle=
"dropdown"
bs-tooltip=
"time.tooltip"
data-placement=
"bottom"
ng-click=
"loadTimeOptions();"
>
<a
class=
"dropdown-toggle timepicker-dropdown"
data-toggle=
"dropdown"
bs-tooltip=
"time.tooltip"
data-placement=
"bottom"
ng-click=
"
ctrl.
loadTimeOptions();"
>
<i
class=
"fa fa-clock-o"
></i>
<span
ng-bind=
"time.rangeString"
></span>
<span
ng-show=
"dashboard.refresh"
class=
"text-warning"
>
refreshed every {{dashboard.refresh}}
</span>
...
...
@@ -29,7 +29,7 @@
<!-- lacy load this -->
<ul
class=
"dropdown-menu"
ng-if=
"time_options"
>
<li
bindonce
ng-repeat=
'option in time_options'
>
<a
ng-click=
"setRelativeFilter(option)"
bo-text=
"option.text"
></a>
<a
ng-click=
"
ctrl.
setRelativeFilter(option)"
bo-text=
"option.text"
></a>
</li>
<!-- Auto refresh submenu -->
...
...
@@ -44,7 +44,7 @@
</li>
</ul>
</li>
<li><a
ng-click=
"customTime()"
>
Custom
</a></li>
<li><a
ng-click=
"c
trl.c
ustomTime()"
>
Custom
</a></li>
</ul>
</li>
...
...
public/app/features/dashboard/timepicker/timepicker.ts
View file @
9db6f826
This diff is collapsed.
Click to expand it.
public/test/specs/dashboardSrv-specs.js
View file @
9db6f826
...
...
@@ -31,7 +31,6 @@ define([
it
(
'should have default properties'
,
function
()
{
expect
(
model
.
rows
.
length
).
to
.
be
(
0
);
});
});
describe
(
'when getting next panel id'
,
function
()
{
...
...
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