mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +02:00
Added translate to everything.
Added new version update modal.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
module.exports = function FatalMessageServiceFactory($modal, $location, $route) {
|
||||
var FatalMessageService = {}
|
||||
|
||||
|
||||
var ModalInstanceCtrl = function ($scope, $modalInstance, device) {
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close(true)
|
||||
$route.reload()
|
||||
//$location.path('/control/' + device.serial)
|
||||
}
|
||||
|
||||
$scope.second = function () {
|
||||
$modalInstance.dismiss()
|
||||
$location.path('/devices/')
|
||||
}
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel')
|
||||
}
|
||||
}
|
||||
|
||||
FatalMessageService.open = function (device) {
|
||||
var modalInstance = $modal.open({
|
||||
template: require('./fatal-message.jade'),
|
||||
controller: ModalInstanceCtrl,
|
||||
resolve: {
|
||||
device: device
|
||||
}
|
||||
})
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
}, function () {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return FatalMessageService
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
describe('FatalMessageService', function() {
|
||||
|
||||
beforeEach(module('stf.fatal-message'));
|
||||
|
||||
it('should ...', inject(function(FatalMessageService) {
|
||||
|
||||
//expect(FatalMessageService.doSomething()).toEqual('something');
|
||||
|
||||
}));
|
||||
|
||||
})
|
||||
@@ -0,0 +1,29 @@
|
||||
.stf-fatal-message.stf-modal
|
||||
.modal-header.dialog-header-error
|
||||
button(type='button', ng-click='cancel()').close ×
|
||||
h4.modal-title.text-danger
|
||||
i.fa.fa-warning
|
||||
span(translate) Device was disconnected
|
||||
.modal-body.text-danger(translate) Device is not in use anymore
|
||||
.modal-footer
|
||||
button.btn.btn-primary(type='button', ng-click='ok()')
|
||||
i.fa.fa-refresh
|
||||
span(translate) Try to reconnect
|
||||
button.btn.btn-success(ng-click='second()')
|
||||
i.fa.fa-sitemap
|
||||
span(translate) Go to Device List
|
||||
//button.btn.btn-warning(ng-click='cancel()') Close
|
||||
|
||||
//'<div class="modal-header dialog-header-error">
|
||||
// <button type="button" class="close" ng-click="close()">×</button>
|
||||
// <h4 class="modal-title text-danger">
|
||||
// <span class="glyphicon glyphicon-warning-sign"></span>
|
||||
// <span ng-bind-html="header"></span>
|
||||
// </h4>
|
||||
//</div>
|
||||
//
|
||||
//<div class="modal-body text-danger" ng-bind-html="msg"></div>
|
||||
//<div class="modal-footer">
|
||||
// <button type="button" class="btn btn-default" ng-click="close()">
|
||||
//'+startSym+'"DIALOGS_CLOSE" | translate'+endSym+'</button>
|
||||
//</div>'
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = angular.module('stf.fatal-message', [
|
||||
require('stf/common-ui/modals/common').name
|
||||
])
|
||||
.factory('FatalMessageService', require('./fatal-message-service'))
|
||||
Reference in New Issue
Block a user