mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-16 10:37:09 +00:00
[ui] Save creator's e-mail address to in browser storage
This commit is contained in:
parent
503a6c0569
commit
9396976771
@ -83,7 +83,7 @@ func templateDefaultTmpl() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "template/default.tmpl", size: 16246, mode: os.FileMode(420), modTime: time.Unix(1470746752, 0)}
|
info := bindataFileInfo{name: "template/default.tmpl", size: 16246, mode: os.FileMode(420), modTime: time.Unix(1474277366, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@ -182,7 +182,6 @@ type bintree struct {
|
|||||||
Func func() (*asset, error)
|
Func func() (*asset, error)
|
||||||
Children map[string]*bintree
|
Children map[string]*bintree
|
||||||
}
|
}
|
||||||
|
|
||||||
var _bintree = &bintree{nil, map[string]*bintree{
|
var _bintree = &bintree{nil, map[string]*bintree{
|
||||||
"template": &bintree{nil, map[string]*bintree{
|
"template": &bintree{nil, map[string]*bintree{
|
||||||
"default.tmpl": &bintree{templateDefaultTmpl, map[string]*bintree{}},
|
"default.tmpl": &bintree{templateDefaultTmpl, map[string]*bintree{}},
|
||||||
@ -235,3 +234,4 @@ func _filePath(dir, name string) string {
|
|||||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,6 +330,7 @@ angular.module('am.controllers').controller('SilenceCreateCtrl',
|
|||||||
end.setHours(end.getHours() + 4)
|
end.setHours(end.getHours() + 4)
|
||||||
|
|
||||||
$scope.silence = angular.copy(origSilence);
|
$scope.silence = angular.copy(origSilence);
|
||||||
|
$scope.silence.createdBy = localStorage.creator;
|
||||||
|
|
||||||
if (!origSilence.startsAt || origSilence.elapsed) {
|
if (!origSilence.startsAt || origSilence.elapsed) {
|
||||||
$scope.silence.startsAt = now;
|
$scope.silence.startsAt = now;
|
||||||
@ -351,6 +352,7 @@ angular.module('am.controllers').controller('SilenceCreateCtrl',
|
|||||||
|
|
||||||
$scope.create = function() {
|
$scope.create = function() {
|
||||||
var now = new Date;
|
var now = new Date;
|
||||||
|
localStorage.creator = $scope.silence.createdBy;
|
||||||
// Go through conditions that go against immutability of historic silences.
|
// Go through conditions that go against immutability of historic silences.
|
||||||
var createNew = !angular.equals(origSilence.matchers, $scope.silence.matchers);
|
var createNew = !angular.equals(origSilence.matchers, $scope.silence.matchers);
|
||||||
console.log(origSilence, $scope.silence);
|
console.log(origSilence, $scope.silence);
|
||||||
@ -407,7 +409,7 @@ angular.module('am.controllers').controller('StatusCtrl',
|
|||||||
$scope.uptime = data.data.uptime;
|
$scope.uptime = data.data.uptime;
|
||||||
},
|
},
|
||||||
function(data) {
|
function(data) {
|
||||||
console.log(data.data);
|
console.log(data.data);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<input ng-model="silence.endsAt" type="datetime-local" name="end-time" required>
|
<input ng-model="silence.endsAt" type="datetime-local" name="end-time" required>
|
||||||
</column>
|
</column>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<label>Matchers <span class="desc">Alerts affected by this silence.</span></label>
|
<label>Matchers <span class="desc">Alerts affected by this silence.</span></label>
|
||||||
<row class="silence-matchers" ng-repeat="m in silence.matchers">
|
<row class="silence-matchers" ng-repeat="m in silence.matchers">
|
||||||
<column cols="2">
|
<column cols="2">
|
||||||
|
147
ui/bindata.go
147
ui/bindata.go
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user