repo_name
stringclasses 5
values | pr_number
int64 1.52k
15.5k
| pr_title
stringlengths 8
143
| pr_description
stringlengths 0
10.2k
| author
stringlengths 3
18
| date_created
timestamp[ns, tz=UTC] | date_merged
timestamp[ns, tz=UTC] | previous_commit
stringlengths 40
40
| pr_commit
stringlengths 40
40
| query
stringlengths 11
10.2k
| filepath
stringlengths 6
220
| before_content
stringlengths 0
597M
| after_content
stringlengths 0
597M
| label
int64 -1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/util/OpenApiBeanUtils.java | package com.ctrip.framework.apollo.openapi.util;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.util.CollectionUtils;
import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleDTO;
import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleItemDTO;
import com.ctrip.framework.apollo.common.dto.ItemDTO;
import com.ctrip.framework.apollo.common.dto.NamespaceLockDTO;
import com.ctrip.framework.apollo.common.dto.ReleaseDTO;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.common.entity.AppNamespace;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenAppNamespaceDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenReleaseDTO;
import com.ctrip.framework.apollo.portal.entity.bo.ItemBO;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.google.common.base.Preconditions;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
public class OpenApiBeanUtils {
private static final Gson GSON = new Gson();
private static Type type = new TypeToken<Map<String, String>>() {}.getType();
public static OpenItemDTO transformFromItemDTO(ItemDTO item) {
Preconditions.checkArgument(item != null);
return BeanUtils.transform(OpenItemDTO.class, item);
}
public static ItemDTO transformToItemDTO(OpenItemDTO openItemDTO) {
Preconditions.checkArgument(openItemDTO != null);
return BeanUtils.transform(ItemDTO.class, openItemDTO);
}
public static OpenAppNamespaceDTO transformToOpenAppNamespaceDTO(AppNamespace appNamespace) {
Preconditions.checkArgument(appNamespace != null);
return BeanUtils.transform(OpenAppNamespaceDTO.class, appNamespace);
}
public static AppNamespace transformToAppNamespace(OpenAppNamespaceDTO openAppNamespaceDTO) {
Preconditions.checkArgument(openAppNamespaceDTO != null);
return BeanUtils.transform(AppNamespace.class, openAppNamespaceDTO);
}
public static OpenReleaseDTO transformFromReleaseDTO(ReleaseDTO release) {
Preconditions.checkArgument(release != null);
OpenReleaseDTO openReleaseDTO = BeanUtils.transform(OpenReleaseDTO.class, release);
Map<String, String> configs = GSON.fromJson(release.getConfigurations(), type);
openReleaseDTO.setConfigurations(configs);
return openReleaseDTO;
}
public static OpenNamespaceDTO transformFromNamespaceBO(NamespaceBO namespaceBO) {
Preconditions.checkArgument(namespaceBO != null);
OpenNamespaceDTO openNamespaceDTO =
BeanUtils.transform(OpenNamespaceDTO.class, namespaceBO.getBaseInfo());
// app namespace info
openNamespaceDTO.setFormat(namespaceBO.getFormat());
openNamespaceDTO.setComment(namespaceBO.getComment());
openNamespaceDTO.setPublic(namespaceBO.isPublic());
// items
List<OpenItemDTO> items = new LinkedList<>();
List<ItemBO> itemBOs = namespaceBO.getItems();
if (!CollectionUtils.isEmpty(itemBOs)) {
items.addAll(itemBOs.stream().map(itemBO -> transformFromItemDTO(itemBO.getItem()))
.collect(Collectors.toList()));
}
openNamespaceDTO.setItems(items);
return openNamespaceDTO;
}
public static List<OpenNamespaceDTO> batchTransformFromNamespaceBOs(
List<NamespaceBO> namespaceBOs) {
if (CollectionUtils.isEmpty(namespaceBOs)) {
return Collections.emptyList();
}
List<OpenNamespaceDTO> openNamespaceDTOs =
namespaceBOs.stream().map(OpenApiBeanUtils::transformFromNamespaceBO)
.collect(Collectors.toCollection(LinkedList::new));
return openNamespaceDTOs;
}
public static OpenNamespaceLockDTO transformFromNamespaceLockDTO(String namespaceName,
NamespaceLockDTO namespaceLock) {
OpenNamespaceLockDTO lock = new OpenNamespaceLockDTO();
lock.setNamespaceName(namespaceName);
if (namespaceLock == null) {
lock.setLocked(false);
} else {
lock.setLocked(true);
lock.setLockedBy(namespaceLock.getDataChangeCreatedBy());
}
return lock;
}
public static OpenGrayReleaseRuleDTO transformFromGrayReleaseRuleDTO(
GrayReleaseRuleDTO grayReleaseRuleDTO) {
Preconditions.checkArgument(grayReleaseRuleDTO != null);
return BeanUtils.transform(OpenGrayReleaseRuleDTO.class, grayReleaseRuleDTO);
}
public static GrayReleaseRuleDTO transformToGrayReleaseRuleDTO(
OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) {
Preconditions.checkArgument(openGrayReleaseRuleDTO != null);
String appId = openGrayReleaseRuleDTO.getAppId();
String branchName = openGrayReleaseRuleDTO.getBranchName();
String clusterName = openGrayReleaseRuleDTO.getClusterName();
String namespaceName = openGrayReleaseRuleDTO.getNamespaceName();
GrayReleaseRuleDTO grayReleaseRuleDTO =
new GrayReleaseRuleDTO(appId, clusterName, namespaceName, branchName);
Set<OpenGrayReleaseRuleItemDTO> openGrayReleaseRuleItemDTOSet =
openGrayReleaseRuleDTO.getRuleItems();
openGrayReleaseRuleItemDTOSet.forEach(openGrayReleaseRuleItemDTO -> {
String clientAppId = openGrayReleaseRuleItemDTO.getClientAppId();
Set<String> clientIpList = openGrayReleaseRuleItemDTO.getClientIpList();
GrayReleaseRuleItemDTO ruleItem = new GrayReleaseRuleItemDTO(clientAppId, clientIpList);
grayReleaseRuleDTO.addRuleItem(ruleItem);
});
return grayReleaseRuleDTO;
}
public static List<OpenAppDTO> transformFromApps(final List<App> apps) {
if (CollectionUtils.isEmpty(apps)) {
return Collections.emptyList();
}
return apps.stream().map(OpenApiBeanUtils::transformFromApp).collect(Collectors.toList());
}
public static OpenAppDTO transformFromApp(final App app) {
Preconditions.checkArgument(app != null);
return BeanUtils.transform(OpenAppDTO.class, app);
}
public static OpenClusterDTO transformFromClusterDTO(ClusterDTO Cluster) {
Preconditions.checkArgument(Cluster != null);
return BeanUtils.transform(OpenClusterDTO.class, Cluster);
}
public static ClusterDTO transformToClusterDTO(OpenClusterDTO openClusterDTO) {
Preconditions.checkArgument(openClusterDTO != null);
return BeanUtils.transform(ClusterDTO.class, openClusterDTO);
}
}
| package com.ctrip.framework.apollo.openapi.util;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.util.CollectionUtils;
import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleDTO;
import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleItemDTO;
import com.ctrip.framework.apollo.common.dto.ItemDTO;
import com.ctrip.framework.apollo.common.dto.NamespaceLockDTO;
import com.ctrip.framework.apollo.common.dto.ReleaseDTO;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.common.entity.AppNamespace;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenAppNamespaceDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenReleaseDTO;
import com.ctrip.framework.apollo.portal.entity.bo.ItemBO;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.google.common.base.Preconditions;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
public class OpenApiBeanUtils {
private static final Gson GSON = new Gson();
private static Type type = new TypeToken<Map<String, String>>() {}.getType();
public static OpenItemDTO transformFromItemDTO(ItemDTO item) {
Preconditions.checkArgument(item != null);
return BeanUtils.transform(OpenItemDTO.class, item);
}
public static ItemDTO transformToItemDTO(OpenItemDTO openItemDTO) {
Preconditions.checkArgument(openItemDTO != null);
return BeanUtils.transform(ItemDTO.class, openItemDTO);
}
public static OpenAppNamespaceDTO transformToOpenAppNamespaceDTO(AppNamespace appNamespace) {
Preconditions.checkArgument(appNamespace != null);
return BeanUtils.transform(OpenAppNamespaceDTO.class, appNamespace);
}
public static AppNamespace transformToAppNamespace(OpenAppNamespaceDTO openAppNamespaceDTO) {
Preconditions.checkArgument(openAppNamespaceDTO != null);
return BeanUtils.transform(AppNamespace.class, openAppNamespaceDTO);
}
public static OpenReleaseDTO transformFromReleaseDTO(ReleaseDTO release) {
Preconditions.checkArgument(release != null);
OpenReleaseDTO openReleaseDTO = BeanUtils.transform(OpenReleaseDTO.class, release);
Map<String, String> configs = GSON.fromJson(release.getConfigurations(), type);
openReleaseDTO.setConfigurations(configs);
return openReleaseDTO;
}
public static OpenNamespaceDTO transformFromNamespaceBO(NamespaceBO namespaceBO) {
Preconditions.checkArgument(namespaceBO != null);
OpenNamespaceDTO openNamespaceDTO =
BeanUtils.transform(OpenNamespaceDTO.class, namespaceBO.getBaseInfo());
// app namespace info
openNamespaceDTO.setFormat(namespaceBO.getFormat());
openNamespaceDTO.setComment(namespaceBO.getComment());
openNamespaceDTO.setPublic(namespaceBO.isPublic());
// items
List<OpenItemDTO> items = new LinkedList<>();
List<ItemBO> itemBOs = namespaceBO.getItems();
if (!CollectionUtils.isEmpty(itemBOs)) {
items.addAll(itemBOs.stream().map(itemBO -> transformFromItemDTO(itemBO.getItem()))
.collect(Collectors.toList()));
}
openNamespaceDTO.setItems(items);
return openNamespaceDTO;
}
public static List<OpenNamespaceDTO> batchTransformFromNamespaceBOs(
List<NamespaceBO> namespaceBOs) {
if (CollectionUtils.isEmpty(namespaceBOs)) {
return Collections.emptyList();
}
List<OpenNamespaceDTO> openNamespaceDTOs =
namespaceBOs.stream().map(OpenApiBeanUtils::transformFromNamespaceBO)
.collect(Collectors.toCollection(LinkedList::new));
return openNamespaceDTOs;
}
public static OpenNamespaceLockDTO transformFromNamespaceLockDTO(String namespaceName,
NamespaceLockDTO namespaceLock) {
OpenNamespaceLockDTO lock = new OpenNamespaceLockDTO();
lock.setNamespaceName(namespaceName);
if (namespaceLock == null) {
lock.setLocked(false);
} else {
lock.setLocked(true);
lock.setLockedBy(namespaceLock.getDataChangeCreatedBy());
}
return lock;
}
public static OpenGrayReleaseRuleDTO transformFromGrayReleaseRuleDTO(
GrayReleaseRuleDTO grayReleaseRuleDTO) {
Preconditions.checkArgument(grayReleaseRuleDTO != null);
return BeanUtils.transform(OpenGrayReleaseRuleDTO.class, grayReleaseRuleDTO);
}
public static GrayReleaseRuleDTO transformToGrayReleaseRuleDTO(
OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) {
Preconditions.checkArgument(openGrayReleaseRuleDTO != null);
String appId = openGrayReleaseRuleDTO.getAppId();
String branchName = openGrayReleaseRuleDTO.getBranchName();
String clusterName = openGrayReleaseRuleDTO.getClusterName();
String namespaceName = openGrayReleaseRuleDTO.getNamespaceName();
GrayReleaseRuleDTO grayReleaseRuleDTO =
new GrayReleaseRuleDTO(appId, clusterName, namespaceName, branchName);
Set<OpenGrayReleaseRuleItemDTO> openGrayReleaseRuleItemDTOSet =
openGrayReleaseRuleDTO.getRuleItems();
openGrayReleaseRuleItemDTOSet.forEach(openGrayReleaseRuleItemDTO -> {
String clientAppId = openGrayReleaseRuleItemDTO.getClientAppId();
Set<String> clientIpList = openGrayReleaseRuleItemDTO.getClientIpList();
GrayReleaseRuleItemDTO ruleItem = new GrayReleaseRuleItemDTO(clientAppId, clientIpList);
grayReleaseRuleDTO.addRuleItem(ruleItem);
});
return grayReleaseRuleDTO;
}
public static List<OpenAppDTO> transformFromApps(final List<App> apps) {
if (CollectionUtils.isEmpty(apps)) {
return Collections.emptyList();
}
return apps.stream().map(OpenApiBeanUtils::transformFromApp).collect(Collectors.toList());
}
public static OpenAppDTO transformFromApp(final App app) {
Preconditions.checkArgument(app != null);
return BeanUtils.transform(OpenAppDTO.class, app);
}
public static OpenClusterDTO transformFromClusterDTO(ClusterDTO Cluster) {
Preconditions.checkArgument(Cluster != null);
return BeanUtils.transform(OpenClusterDTO.class, Cluster);
}
public static ClusterDTO transformToClusterDTO(OpenClusterDTO openClusterDTO) {
Preconditions.checkArgument(openClusterDTO != null);
return BeanUtils.transform(ClusterDTO.class, openClusterDTO);
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/test/java/com/ctrip/framework/apollo/openapi/filter/ConsumerAuthenticationFilterTest.java | package com.ctrip.framework.apollo.openapi.filter;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuditUtil;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import javax.servlet.FilterChain;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpHeaders;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* @author Jason Song([email protected])
*/
@RunWith(MockitoJUnitRunner.class)
public class ConsumerAuthenticationFilterTest {
private ConsumerAuthenticationFilter authenticationFilter;
@Mock
private ConsumerAuthUtil consumerAuthUtil;
@Mock
private ConsumerAuditUtil consumerAuditUtil;
@Mock
private HttpServletRequest request;
@Mock
private HttpServletResponse response;
@Mock
private FilterChain filterChain;
@Before
public void setUp() throws Exception {
authenticationFilter = new ConsumerAuthenticationFilter(consumerAuthUtil, consumerAuditUtil);
}
@Test
public void testAuthSuccessfully() throws Exception {
String someToken = "someToken";
Long someConsumerId = 1L;
when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someToken);
when(consumerAuthUtil.getConsumerId(someToken)).thenReturn(someConsumerId);
authenticationFilter.doFilter(request, response, filterChain);
verify(consumerAuthUtil, times(1)).storeConsumerId(request, someConsumerId);
verify(consumerAuditUtil, times(1)).audit(request, someConsumerId);
verify(filterChain, times(1)).doFilter(request, response);
}
@Test
public void testAuthFailed() throws Exception {
String someInvalidToken = "someInvalidToken";
when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someInvalidToken);
when(consumerAuthUtil.getConsumerId(someInvalidToken)).thenReturn(null);
authenticationFilter.doFilter(request, response, filterChain);
verify(response, times(1)).sendError(eq(HttpServletResponse.SC_UNAUTHORIZED), anyString());
verify(consumerAuthUtil, never()).storeConsumerId(eq(request), anyLong());
verify(consumerAuditUtil, never()).audit(eq(request), anyLong());
verify(filterChain, never()).doFilter(request, response);
}
}
| package com.ctrip.framework.apollo.openapi.filter;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuditUtil;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import javax.servlet.FilterChain;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpHeaders;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* @author Jason Song([email protected])
*/
@RunWith(MockitoJUnitRunner.class)
public class ConsumerAuthenticationFilterTest {
private ConsumerAuthenticationFilter authenticationFilter;
@Mock
private ConsumerAuthUtil consumerAuthUtil;
@Mock
private ConsumerAuditUtil consumerAuditUtil;
@Mock
private HttpServletRequest request;
@Mock
private HttpServletResponse response;
@Mock
private FilterChain filterChain;
@Before
public void setUp() throws Exception {
authenticationFilter = new ConsumerAuthenticationFilter(consumerAuthUtil, consumerAuditUtil);
}
@Test
public void testAuthSuccessfully() throws Exception {
String someToken = "someToken";
Long someConsumerId = 1L;
when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someToken);
when(consumerAuthUtil.getConsumerId(someToken)).thenReturn(someConsumerId);
authenticationFilter.doFilter(request, response, filterChain);
verify(consumerAuthUtil, times(1)).storeConsumerId(request, someConsumerId);
verify(consumerAuditUtil, times(1)).audit(request, someConsumerId);
verify(filterChain, times(1)).doFilter(request, response);
}
@Test
public void testAuthFailed() throws Exception {
String someInvalidToken = "someInvalidToken";
when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someInvalidToken);
when(consumerAuthUtil.getConsumerId(someInvalidToken)).thenReturn(null);
authenticationFilter.doFilter(request, response, filterChain);
verify(response, times(1)).sendError(eq(HttpServletResponse.SC_UNAUTHORIZED), anyString());
verify(consumerAuthUtil, never()).storeConsumerId(eq(request), anyLong());
verify(consumerAuditUtil, never()).audit(eq(request), anyLong());
verify(filterChain, never()).doFilter(request, response);
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/resources/static/vendor/bootstrap/css/bootstrap-theme.min.css | /*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=822d18dc2e4e823a577b)
* Config saved to config.json and https://gist.github.com/822d18dc2e4e823a577b
*//*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
.btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075)
}
.btn-default:active, .btn-primary:active, .btn-success:active, .btn-info:active, .btn-warning:active, .btn-danger:active, .btn-default.active, .btn-primary.active, .btn-success.active, .btn-info.active, .btn-warning.active, .btn-danger.active {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125)
}
.btn-default.disabled, .btn-primary.disabled, .btn-success.disabled, .btn-info.disabled, .btn-warning.disabled, .btn-danger.disabled, .btn-default[disabled], .btn-primary[disabled], .btn-success[disabled], .btn-info[disabled], .btn-warning[disabled], .btn-danger[disabled], fieldset[disabled] .btn-default, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-success, fieldset[disabled] .btn-info, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-danger {
-webkit-box-shadow: none;
box-shadow: none
}
.btn-default .badge, .btn-primary .badge, .btn-success .badge, .btn-info .badge, .btn-warning .badge, .btn-danger .badge {
text-shadow: none
}
.btn:active, .btn.active {
background-image: none
}
.btn-default {
background-image: -webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);
background-image: -o-linear-gradient(top, #fff 0, #e0e0e0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#e0e0e0));
background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #dbdbdb;
text-shadow: 0 1px 0 #fff;
border-color: #ccc
}
.btn-default:hover, .btn-default:focus {
background-color: #e0e0e0;
background-position: 0 -15px
}
.btn-default:active, .btn-default.active {
background-color: #e0e0e0;
border-color: #dbdbdb
}
.btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active {
background-color: #e0e0e0;
background-image: none
}
.btn-primary {
background-image: -webkit-linear-gradient(top, #337ab7 0, #265a88 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #265a88 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#265a88));
background-image: linear-gradient(to bottom, #337ab7 0, #265a88 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #245580
}
.btn-primary:hover, .btn-primary:focus {
background-color: #265a88;
background-position: 0 -15px
}
.btn-primary:active, .btn-primary.active {
background-color: #265a88;
border-color: #245580
}
.btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active {
background-color: #265a88;
background-image: none
}
.btn-success {
background-image: -webkit-linear-gradient(top, #5cb85c 0, #419641 100%);
background-image: -o-linear-gradient(top, #5cb85c 0, #419641 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#419641));
background-image: linear-gradient(to bottom, #5cb85c 0, #419641 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #3e8f3e
}
.btn-success:hover, .btn-success:focus {
background-color: #419641;
background-position: 0 -15px
}
.btn-success:active, .btn-success.active {
background-color: #419641;
border-color: #3e8f3e
}
.btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active {
background-color: #419641;
background-image: none
}
.btn-info {
background-image: -webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%);
background-image: -o-linear-gradient(top, #5bc0de 0, #2aabd2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#2aabd2));
background-image: linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #28a4c9
}
.btn-info:hover, .btn-info:focus {
background-color: #2aabd2;
background-position: 0 -15px
}
.btn-info:active, .btn-info.active {
background-color: #2aabd2;
border-color: #28a4c9
}
.btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active {
background-color: #2aabd2;
background-image: none
}
.btn-warning {
background-image: -webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%);
background-image: -o-linear-gradient(top, #f0ad4e 0, #eb9316 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#eb9316));
background-image: linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #e38d13
}
.btn-warning:hover, .btn-warning:focus {
background-color: #eb9316;
background-position: 0 -15px
}
.btn-warning:active, .btn-warning.active {
background-color: #eb9316;
border-color: #e38d13
}
.btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active {
background-color: #eb9316;
background-image: none
}
.btn-danger {
background-image: -webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%);
background-image: -o-linear-gradient(top, #d9534f 0, #c12e2a 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c12e2a));
background-image: linear-gradient(to bottom, #d9534f 0, #c12e2a 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #b92c28
}
.btn-danger:hover, .btn-danger:focus {
background-color: #c12e2a;
background-position: 0 -15px
}
.btn-danger:active, .btn-danger.active {
background-color: #c12e2a;
border-color: #b92c28
}
.btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active {
background-color: #c12e2a;
background-image: none
}
.thumbnail, .img-thumbnail {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075)
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));
background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
background-color: #e8e8e8
}
.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
background-color: #2e6da4
}
.navbar-default {
background-image: -webkit-linear-gradient(top, #fff 0, #f8f8f8 100%);
background-image: -o-linear-gradient(top, #fff 0, #f8f8f8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#f8f8f8));
background-image: linear-gradient(to bottom, #fff 0, #f8f8f8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075)
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .active > a {
background-image: -webkit-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);
background-image: -o-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dbdbdb), to(#e2e2e2));
background-image: linear-gradient(to bottom, #dbdbdb 0, #e2e2e2 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075)
}
.navbar-brand, .navbar-nav > li > a {
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25)
}
.navbar-inverse {
background-image: -webkit-linear-gradient(top, #3c3c3c 0, #222 100%);
background-image: -o-linear-gradient(top, #3c3c3c 0, #222 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3c3c3c), to(#222));
background-image: linear-gradient(to bottom, #3c3c3c 0, #222 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
border-radius: 4px
}
.navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .active > a {
background-image: -webkit-linear-gradient(top, #080808 0, #0f0f0f 100%);
background-image: -o-linear-gradient(top, #080808 0, #0f0f0f 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #080808), to(#0f0f0f));
background-image: linear-gradient(to bottom, #080808 0, #0f0f0f 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25)
}
.navbar-inverse .navbar-brand, .navbar-inverse .navbar-nav > li > a {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)
}
.navbar-static-top, .navbar-fixed-top, .navbar-fixed-bottom {
border-radius: 0
}
@media (max-width: 767px) {
.navbar .navbar-nav .open .dropdown-menu > .active > a, .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #fff;
background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0)
}
}
.alert {
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05)
}
.alert-success {
background-image: -webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);
background-image: -o-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#c8e5bc));
background-image: linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
border-color: #b2dba1
}
.alert-info {
background-image: -webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%);
background-image: -o-linear-gradient(top, #d9edf7 0, #b9def0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#b9def0));
background-image: linear-gradient(to bottom, #d9edf7 0, #b9def0 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
border-color: #9acfea
}
.alert-warning {
background-image: -webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);
background-image: -o-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#f8efc0));
background-image: linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
border-color: #f5e79e
}
.alert-danger {
background-image: -webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%);
background-image: -o-linear-gradient(top, #f2dede 0, #e7c3c3 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#e7c3c3));
background-image: linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
border-color: #dca7a7
}
.progress {
background-image: -webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ebebeb), to(#f5f5f5));
background-image: linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)
}
.progress-bar {
background-image: -webkit-linear-gradient(top, #337ab7 0, #286090 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #286090 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#286090));
background-image: linear-gradient(to bottom, #337ab7 0, #286090 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0)
}
.progress-bar-success {
background-image: -webkit-linear-gradient(top, #5cb85c 0, #449d44 100%);
background-image: -o-linear-gradient(top, #5cb85c 0, #449d44 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#449d44));
background-image: linear-gradient(to bottom, #5cb85c 0, #449d44 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)
}
.progress-bar-info {
background-image: -webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%);
background-image: -o-linear-gradient(top, #5bc0de 0, #31b0d5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#31b0d5));
background-image: linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)
}
.progress-bar-warning {
background-image: -webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%);
background-image: -o-linear-gradient(top, #f0ad4e 0, #ec971f 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#ec971f));
background-image: linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)
}
.progress-bar-danger {
background-image: -webkit-linear-gradient(top, #d9534f 0, #c9302c 100%);
background-image: -o-linear-gradient(top, #d9534f 0, #c9302c 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c9302c));
background-image: linear-gradient(to bottom, #d9534f 0, #c9302c 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)
}
.progress-bar-striped {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent)
}
.list-group {
border-radius: 4px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075)
}
.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus {
text-shadow: 0 -1px 0 #286090;
background-image: -webkit-linear-gradient(top, #337ab7 0, #2b669a 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2b669a 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2b669a));
background-image: linear-gradient(to bottom, #337ab7 0, #2b669a 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
border-color: #2b669a
}
.list-group-item.active .badge, .list-group-item.active:hover .badge, .list-group-item.active:focus .badge {
text-shadow: none
}
.panel {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05)
}
.panel-default > .panel-heading {
background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));
background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)
}
.panel-primary > .panel-heading {
background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0)
}
.panel-success > .panel-heading {
background-image: -webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);
background-image: -o-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#d0e9c6));
background-image: linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)
}
.panel-info > .panel-heading {
background-image: -webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);
background-image: -o-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#c4e3f3));
background-image: linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)
}
.panel-warning > .panel-heading {
background-image: -webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);
background-image: -o-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#faf2cc));
background-image: linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)
}
.panel-danger > .panel-heading {
background-image: -webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%);
background-image: -o-linear-gradient(top, #f2dede 0, #ebcccc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#ebcccc));
background-image: linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)
}
.well {
background-image: -webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #e8e8e8), to(#f5f5f5));
background-image: linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
border-color: #dcdcdc;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1)
}
| /*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=822d18dc2e4e823a577b)
* Config saved to config.json and https://gist.github.com/822d18dc2e4e823a577b
*//*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
.btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075)
}
.btn-default:active, .btn-primary:active, .btn-success:active, .btn-info:active, .btn-warning:active, .btn-danger:active, .btn-default.active, .btn-primary.active, .btn-success.active, .btn-info.active, .btn-warning.active, .btn-danger.active {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125)
}
.btn-default.disabled, .btn-primary.disabled, .btn-success.disabled, .btn-info.disabled, .btn-warning.disabled, .btn-danger.disabled, .btn-default[disabled], .btn-primary[disabled], .btn-success[disabled], .btn-info[disabled], .btn-warning[disabled], .btn-danger[disabled], fieldset[disabled] .btn-default, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-success, fieldset[disabled] .btn-info, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-danger {
-webkit-box-shadow: none;
box-shadow: none
}
.btn-default .badge, .btn-primary .badge, .btn-success .badge, .btn-info .badge, .btn-warning .badge, .btn-danger .badge {
text-shadow: none
}
.btn:active, .btn.active {
background-image: none
}
.btn-default {
background-image: -webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);
background-image: -o-linear-gradient(top, #fff 0, #e0e0e0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#e0e0e0));
background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #dbdbdb;
text-shadow: 0 1px 0 #fff;
border-color: #ccc
}
.btn-default:hover, .btn-default:focus {
background-color: #e0e0e0;
background-position: 0 -15px
}
.btn-default:active, .btn-default.active {
background-color: #e0e0e0;
border-color: #dbdbdb
}
.btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active {
background-color: #e0e0e0;
background-image: none
}
.btn-primary {
background-image: -webkit-linear-gradient(top, #337ab7 0, #265a88 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #265a88 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#265a88));
background-image: linear-gradient(to bottom, #337ab7 0, #265a88 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #245580
}
.btn-primary:hover, .btn-primary:focus {
background-color: #265a88;
background-position: 0 -15px
}
.btn-primary:active, .btn-primary.active {
background-color: #265a88;
border-color: #245580
}
.btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active {
background-color: #265a88;
background-image: none
}
.btn-success {
background-image: -webkit-linear-gradient(top, #5cb85c 0, #419641 100%);
background-image: -o-linear-gradient(top, #5cb85c 0, #419641 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#419641));
background-image: linear-gradient(to bottom, #5cb85c 0, #419641 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #3e8f3e
}
.btn-success:hover, .btn-success:focus {
background-color: #419641;
background-position: 0 -15px
}
.btn-success:active, .btn-success.active {
background-color: #419641;
border-color: #3e8f3e
}
.btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active {
background-color: #419641;
background-image: none
}
.btn-info {
background-image: -webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%);
background-image: -o-linear-gradient(top, #5bc0de 0, #2aabd2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#2aabd2));
background-image: linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #28a4c9
}
.btn-info:hover, .btn-info:focus {
background-color: #2aabd2;
background-position: 0 -15px
}
.btn-info:active, .btn-info.active {
background-color: #2aabd2;
border-color: #28a4c9
}
.btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active {
background-color: #2aabd2;
background-image: none
}
.btn-warning {
background-image: -webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%);
background-image: -o-linear-gradient(top, #f0ad4e 0, #eb9316 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#eb9316));
background-image: linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #e38d13
}
.btn-warning:hover, .btn-warning:focus {
background-color: #eb9316;
background-position: 0 -15px
}
.btn-warning:active, .btn-warning.active {
background-color: #eb9316;
border-color: #e38d13
}
.btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active {
background-color: #eb9316;
background-image: none
}
.btn-danger {
background-image: -webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%);
background-image: -o-linear-gradient(top, #d9534f 0, #c12e2a 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c12e2a));
background-image: linear-gradient(to bottom, #d9534f 0, #c12e2a 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
background-repeat: repeat-x;
border-color: #b92c28
}
.btn-danger:hover, .btn-danger:focus {
background-color: #c12e2a;
background-position: 0 -15px
}
.btn-danger:active, .btn-danger.active {
background-color: #c12e2a;
border-color: #b92c28
}
.btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active {
background-color: #c12e2a;
background-image: none
}
.thumbnail, .img-thumbnail {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075)
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));
background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
background-color: #e8e8e8
}
.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
background-color: #2e6da4
}
.navbar-default {
background-image: -webkit-linear-gradient(top, #fff 0, #f8f8f8 100%);
background-image: -o-linear-gradient(top, #fff 0, #f8f8f8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#f8f8f8));
background-image: linear-gradient(to bottom, #fff 0, #f8f8f8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075)
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .active > a {
background-image: -webkit-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);
background-image: -o-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dbdbdb), to(#e2e2e2));
background-image: linear-gradient(to bottom, #dbdbdb 0, #e2e2e2 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075)
}
.navbar-brand, .navbar-nav > li > a {
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25)
}
.navbar-inverse {
background-image: -webkit-linear-gradient(top, #3c3c3c 0, #222 100%);
background-image: -o-linear-gradient(top, #3c3c3c 0, #222 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3c3c3c), to(#222));
background-image: linear-gradient(to bottom, #3c3c3c 0, #222 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
border-radius: 4px
}
.navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .active > a {
background-image: -webkit-linear-gradient(top, #080808 0, #0f0f0f 100%);
background-image: -o-linear-gradient(top, #080808 0, #0f0f0f 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #080808), to(#0f0f0f));
background-image: linear-gradient(to bottom, #080808 0, #0f0f0f 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25)
}
.navbar-inverse .navbar-brand, .navbar-inverse .navbar-nav > li > a {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)
}
.navbar-static-top, .navbar-fixed-top, .navbar-fixed-bottom {
border-radius: 0
}
@media (max-width: 767px) {
.navbar .navbar-nav .open .dropdown-menu > .active > a, .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #fff;
background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0)
}
}
.alert {
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05)
}
.alert-success {
background-image: -webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);
background-image: -o-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#c8e5bc));
background-image: linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
border-color: #b2dba1
}
.alert-info {
background-image: -webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%);
background-image: -o-linear-gradient(top, #d9edf7 0, #b9def0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#b9def0));
background-image: linear-gradient(to bottom, #d9edf7 0, #b9def0 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
border-color: #9acfea
}
.alert-warning {
background-image: -webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);
background-image: -o-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#f8efc0));
background-image: linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
border-color: #f5e79e
}
.alert-danger {
background-image: -webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%);
background-image: -o-linear-gradient(top, #f2dede 0, #e7c3c3 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#e7c3c3));
background-image: linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
border-color: #dca7a7
}
.progress {
background-image: -webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ebebeb), to(#f5f5f5));
background-image: linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)
}
.progress-bar {
background-image: -webkit-linear-gradient(top, #337ab7 0, #286090 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #286090 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#286090));
background-image: linear-gradient(to bottom, #337ab7 0, #286090 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0)
}
.progress-bar-success {
background-image: -webkit-linear-gradient(top, #5cb85c 0, #449d44 100%);
background-image: -o-linear-gradient(top, #5cb85c 0, #449d44 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#449d44));
background-image: linear-gradient(to bottom, #5cb85c 0, #449d44 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)
}
.progress-bar-info {
background-image: -webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%);
background-image: -o-linear-gradient(top, #5bc0de 0, #31b0d5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#31b0d5));
background-image: linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)
}
.progress-bar-warning {
background-image: -webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%);
background-image: -o-linear-gradient(top, #f0ad4e 0, #ec971f 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#ec971f));
background-image: linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)
}
.progress-bar-danger {
background-image: -webkit-linear-gradient(top, #d9534f 0, #c9302c 100%);
background-image: -o-linear-gradient(top, #d9534f 0, #c9302c 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c9302c));
background-image: linear-gradient(to bottom, #d9534f 0, #c9302c 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)
}
.progress-bar-striped {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent)
}
.list-group {
border-radius: 4px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075)
}
.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus {
text-shadow: 0 -1px 0 #286090;
background-image: -webkit-linear-gradient(top, #337ab7 0, #2b669a 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2b669a 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2b669a));
background-image: linear-gradient(to bottom, #337ab7 0, #2b669a 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
border-color: #2b669a
}
.list-group-item.active .badge, .list-group-item.active:hover .badge, .list-group-item.active:focus .badge {
text-shadow: none
}
.panel {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05)
}
.panel-default > .panel-heading {
background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));
background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)
}
.panel-primary > .panel-heading {
background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0)
}
.panel-success > .panel-heading {
background-image: -webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);
background-image: -o-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#d0e9c6));
background-image: linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)
}
.panel-info > .panel-heading {
background-image: -webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);
background-image: -o-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#c4e3f3));
background-image: linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)
}
.panel-warning > .panel-heading {
background-image: -webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);
background-image: -o-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#faf2cc));
background-image: linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)
}
.panel-danger > .panel-heading {
background-image: -webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%);
background-image: -o-linear-gradient(top, #f2dede 0, #ebcccc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#ebcccc));
background-image: linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)
}
.well {
background-image: -webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #e8e8e8), to(#f5f5f5));
background-image: linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
border-color: #dcdcdc;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1)
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/dto/NamespaceGrayDelReleaseDTO.java | package com.ctrip.framework.apollo.openapi.dto;
import java.util.Set;
public class NamespaceGrayDelReleaseDTO extends NamespaceReleaseDTO {
private Set<String> grayDelKeys;
public Set<String> getGrayDelKeys() {
return grayDelKeys;
}
public void setGrayDelKeys(Set<String> grayDelKeys) {
this.grayDelKeys = grayDelKeys;
}
}
| package com.ctrip.framework.apollo.openapi.dto;
import java.util.Set;
public class NamespaceGrayDelReleaseDTO extends NamespaceReleaseDTO {
private Set<String> grayDelKeys;
public Set<String> getGrayDelKeys() {
return grayDelKeys;
}
public void setGrayDelKeys(Set<String> grayDelKeys) {
this.grayDelKeys = grayDelKeys;
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SsoHeartbeatController.java | package com.ctrip.framework.apollo.portal.controller;
import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Since sso auth information has a limited expiry time, so we need to do sso heartbeat to keep the
* information refreshed when unavailable
*
* @author Jason Song([email protected])
*/
@Controller
@RequestMapping("/sso_heartbeat")
public class SsoHeartbeatController {
private final SsoHeartbeatHandler handler;
public SsoHeartbeatController(final SsoHeartbeatHandler handler) {
this.handler = handler;
}
@GetMapping
public void heartbeat(HttpServletRequest request, HttpServletResponse response) {
handler.doHeartbeat(request, response);
}
}
| package com.ctrip.framework.apollo.portal.controller;
import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Since sso auth information has a limited expiry time, so we need to do sso heartbeat to keep the
* information refreshed when unavailable
*
* @author Jason Song([email protected])
*/
@Controller
@RequestMapping("/sso_heartbeat")
public class SsoHeartbeatController {
private final SsoHeartbeatHandler handler;
public SsoHeartbeatController(final SsoHeartbeatHandler handler) {
this.handler = handler;
}
@GetMapping
public void heartbeat(HttpServletRequest request, HttpServletResponse response) {
handler.doHeartbeat(request, response);
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-core/src/test/resources/properties/server.properties | idc=SHAJQ
env=DEV
subenv=Dev123
bigdata=true
tooling=true
pci=true
| idc=SHAJQ
env=DEV
subenv=Dev123
bigdata=true
tooling=true
pci=true
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-openapi/src/test/java/com/ctrip/framework/apollo/openapi/client/ApolloOpenApiClientTest.java | package com.ctrip.framework.apollo.openapi.client;
import static org.junit.Assert.*;
import org.junit.Test;
public class ApolloOpenApiClientTest {
@Test
public void testCreate() {
String someUrl = "http://someUrl";
String someToken = "someToken";
ApolloOpenApiClient client = ApolloOpenApiClient.newBuilder().withPortalUrl(someUrl).withToken(someToken).build();
assertEquals(someUrl, client.getPortalUrl());
assertEquals(someToken, client.getToken());
}
@Test(expected = IllegalArgumentException.class)
public void testCreateWithInvalidUrl() {
String someInvalidUrl = "someInvalidUrl";
String someToken = "someToken";
ApolloOpenApiClient.newBuilder().withPortalUrl(someInvalidUrl).withToken(someToken).build();
}
}
| package com.ctrip.framework.apollo.openapi.client;
import static org.junit.Assert.*;
import org.junit.Test;
public class ApolloOpenApiClientTest {
@Test
public void testCreate() {
String someUrl = "http://someUrl";
String someToken = "someToken";
ApolloOpenApiClient client = ApolloOpenApiClient.newBuilder().withPortalUrl(someUrl).withToken(someToken).build();
assertEquals(someUrl, client.getPortalUrl());
assertEquals(someToken, client.getToken());
}
@Test(expected = IllegalArgumentException.class)
public void testCreateWithInvalidUrl() {
String someInvalidUrl = "someInvalidUrl";
String someToken = "someToken";
ApolloOpenApiClient.newBuilder().withPortalUrl(someInvalidUrl).withToken(someToken).build();
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/RetryableRestTemplateTest.java | package com.ctrip.framework.apollo.portal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.common.exception.ServiceException;
import com.ctrip.framework.apollo.core.dto.ServiceDTO;
import com.ctrip.framework.apollo.portal.component.AdminServiceAddressLocator;
import com.ctrip.framework.apollo.portal.component.RetryableRestTemplate;
import com.ctrip.framework.apollo.portal.component.config.PortalConfig;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.portal.environment.PortalMetaDomainService;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import java.net.SocketTimeoutException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpHost;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.HttpHostConnectException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;
public class RetryableRestTemplateTest extends AbstractUnitTest {
@Mock
private AdminServiceAddressLocator serviceAddressLocator;
@Mock
private RestTemplate restTemplate;
@Mock
private PortalMetaDomainService portalMetaDomainService;
@Mock
private PortalConfig portalConfig;
@InjectMocks
private RetryableRestTemplate retryableRestTemplate;
private static final Gson GSON = new Gson();
private String path = "app";
private String serviceOne = "http://10.0.0.1";
private String serviceTwo = "http://10.0.0.2";
private String serviceThree = "http://10.0.0.3";
private ResourceAccessException socketTimeoutException = new ResourceAccessException("");
private ResourceAccessException httpHostConnectException = new ResourceAccessException("");
private ResourceAccessException connectTimeoutException = new ResourceAccessException("");
private Object request = new Object();
private Object result = new Object();
private Class<?> requestType = request.getClass();
@Before
public void init() {
socketTimeoutException.initCause(new SocketTimeoutException());
httpHostConnectException
.initCause(new HttpHostConnectException(new ConnectTimeoutException(),
new HttpHost(serviceOne, 80)));
connectTimeoutException.initCause(new ConnectTimeoutException());
}
@Test(expected = ServiceException.class)
public void testNoAdminServer() {
when(serviceAddressLocator.getServiceList(any())).thenReturn(Collections.emptyList());
retryableRestTemplate.get(Env.DEV, path, Object.class);
}
@Test(expected = ServiceException.class)
public void testAllServerDown() {
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(socketTimeoutException);
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(httpHostConnectException);
when(restTemplate
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(connectTimeoutException);
retryableRestTemplate.get(Env.DEV, path, Object.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, times(1))
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
}
@Test
public void testOneServerDown() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(someEntity.getBody()).thenReturn(result);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(socketTimeoutException);
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenReturn(someEntity);
when(restTemplate
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(connectTimeoutException);
Object actualResult = retryableRestTemplate.get(Env.DEV, path, Object.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, never())
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
assertEquals(result, actualResult);
}
@Test
public void testPostSocketTimeoutNotRetry() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(someEntity.getBody()).thenReturn(result);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class))).thenThrow(socketTimeoutException);
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class))).thenReturn(someEntity);
Throwable exception = null;
Object actualResult = null;
try {
actualResult = retryableRestTemplate.post(Env.DEV, path, request, Object.class);
} catch (Throwable ex) {
exception = ex;
}
assertNull(actualResult);
assertSame(socketTimeoutException, exception);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, never())
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class));
}
@Test
public void testDelete() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class),
(Class<Object>) isNull())).thenReturn(someEntity);
retryableRestTemplate.delete(Env.DEV, path);
verify(restTemplate)
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class),
(Class<Object>) isNull());
}
@Test
public void testPut() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), any(HttpEntity.class),
(Class<Object>) isNull())).thenReturn(someEntity);
retryableRestTemplate.put(Env.DEV, path, request);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate)
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), argumentCaptor.capture(),
(Class<Object>) isNull());
assertEquals(request, argumentCaptor.getValue().getBody());
}
@Test
public void testPostObjectWithNoAccessToken() {
Env someEnv = Env.DEV;
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
assertSame(request, entity.getBody());
assertTrue(headers.isEmpty());
}
@Test
public void testPostObjectWithAccessToken() {
Env someEnv = Env.DEV;
String someToken = "someToken";
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION);
assertSame(request, entity.getBody());
assertEquals(1, headers.size());
assertEquals(1, headerValue.size());
assertEquals(someToken, headerValue.get(0));
}
@Test
public void testPostObjectWithNoAccessTokenForEnv() {
Env someEnv = Env.DEV;
Env anotherEnv = Env.PRO;
String someToken = "someToken";
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(serviceAddressLocator.getServiceList(anotherEnv))
.thenReturn(Collections.singletonList(mockService(serviceTwo)));
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(anotherEnv, path, request, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
assertSame(request, entity.getBody());
assertTrue(headers.isEmpty());
}
@Test
public void testPostEntityWithNoAccessToken() {
Env someEnv = Env.DEV;
String originalHeader = "someHeader";
String originalValue = "someValue";
HttpHeaders originalHeaders = new HttpHeaders();
originalHeaders.add(originalHeader, originalValue);
HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
assertSame(requestEntity, entity);
assertSame(request, entity.getBody());
assertEquals(originalHeaders, entity.getHeaders());
}
@Test
public void testPostEntityWithAccessToken() {
Env someEnv = Env.DEV;
String someToken = "someToken";
String originalHeader = "someHeader";
String originalValue = "someValue";
HttpHeaders originalHeaders = new HttpHeaders();
originalHeaders.add(originalHeader, originalValue);
HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
assertSame(request, entity.getBody());
assertEquals(2, headers.size());
assertEquals(originalValue, headers.get(originalHeader).get(0));
assertEquals(someToken, headers.get(HttpHeaders.AUTHORIZATION).get(0));
}
@Test
public void testGetEntityWithNoAccessToken() {
Env someEnv = Env.DEV;
ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType);
assertEquals(someEntity, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(),
eq(requestType));
HttpHeaders headers = argumentCaptor.getValue().getHeaders();
assertTrue(headers.isEmpty());
}
@Test
public void testGetEntityWithAccessToken() {
Env someEnv = Env.DEV;
String someToken = "someToken";
ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType);
assertEquals(someEntity, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(),
eq(requestType));
HttpHeaders headers = argumentCaptor.getValue().getHeaders();
List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION);
assertEquals(1, headers.size());
assertEquals(1, headerValue.size());
assertEquals(someToken, headerValue.get(0));
}
@Test
public void testGetEntityWithNoAccessTokenForEnv() {
Env someEnv = Env.DEV;
Env anotherEnv = Env.PRO;
String someToken = "someToken";
ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(serviceAddressLocator.getServiceList(anotherEnv))
.thenReturn(Collections.singletonList(mockService(serviceTwo)));
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
ResponseEntity actualResult = retryableRestTemplate.get(anotherEnv, path, requestType);
assertEquals(someEntity, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(),
eq(requestType));
HttpHeaders headers = argumentCaptor.getValue().getHeaders();
assertTrue(headers.isEmpty());
}
private String mockAdminServiceTokens(Env env, String token) {
Map<String, String> tokenMap = Maps.newHashMap();
tokenMap.put(env.getName(), token);
return GSON.toJson(tokenMap);
}
private ServiceDTO mockService(String homeUrl) {
ServiceDTO serviceDTO = new ServiceDTO();
serviceDTO.setHomepageUrl(homeUrl);
return serviceDTO;
}
}
| package com.ctrip.framework.apollo.portal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.common.exception.ServiceException;
import com.ctrip.framework.apollo.core.dto.ServiceDTO;
import com.ctrip.framework.apollo.portal.component.AdminServiceAddressLocator;
import com.ctrip.framework.apollo.portal.component.RetryableRestTemplate;
import com.ctrip.framework.apollo.portal.component.config.PortalConfig;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.portal.environment.PortalMetaDomainService;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import java.net.SocketTimeoutException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpHost;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.HttpHostConnectException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;
public class RetryableRestTemplateTest extends AbstractUnitTest {
@Mock
private AdminServiceAddressLocator serviceAddressLocator;
@Mock
private RestTemplate restTemplate;
@Mock
private PortalMetaDomainService portalMetaDomainService;
@Mock
private PortalConfig portalConfig;
@InjectMocks
private RetryableRestTemplate retryableRestTemplate;
private static final Gson GSON = new Gson();
private String path = "app";
private String serviceOne = "http://10.0.0.1";
private String serviceTwo = "http://10.0.0.2";
private String serviceThree = "http://10.0.0.3";
private ResourceAccessException socketTimeoutException = new ResourceAccessException("");
private ResourceAccessException httpHostConnectException = new ResourceAccessException("");
private ResourceAccessException connectTimeoutException = new ResourceAccessException("");
private Object request = new Object();
private Object result = new Object();
private Class<?> requestType = request.getClass();
@Before
public void init() {
socketTimeoutException.initCause(new SocketTimeoutException());
httpHostConnectException
.initCause(new HttpHostConnectException(new ConnectTimeoutException(),
new HttpHost(serviceOne, 80)));
connectTimeoutException.initCause(new ConnectTimeoutException());
}
@Test(expected = ServiceException.class)
public void testNoAdminServer() {
when(serviceAddressLocator.getServiceList(any())).thenReturn(Collections.emptyList());
retryableRestTemplate.get(Env.DEV, path, Object.class);
}
@Test(expected = ServiceException.class)
public void testAllServerDown() {
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(socketTimeoutException);
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(httpHostConnectException);
when(restTemplate
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(connectTimeoutException);
retryableRestTemplate.get(Env.DEV, path, Object.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, times(1))
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
}
@Test
public void testOneServerDown() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(someEntity.getBody()).thenReturn(result);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(socketTimeoutException);
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenReturn(someEntity);
when(restTemplate
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class))).thenThrow(connectTimeoutException);
Object actualResult = retryableRestTemplate.get(Env.DEV, path, Object.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, never())
.exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(Object.class));
assertEquals(result, actualResult);
}
@Test
public void testPostSocketTimeoutNotRetry() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(someEntity.getBody()).thenReturn(result);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class))).thenThrow(socketTimeoutException);
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class))).thenReturn(someEntity);
Throwable exception = null;
Object actualResult = null;
try {
actualResult = retryableRestTemplate.post(Env.DEV, path, request, Object.class);
} catch (Throwable ex) {
exception = ex;
}
assertNull(actualResult);
assertSame(socketTimeoutException, exception);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class));
verify(restTemplate, never())
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(Object.class));
}
@Test
public void testDelete() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class),
(Class<Object>) isNull())).thenReturn(someEntity);
retryableRestTemplate.delete(Env.DEV, path);
verify(restTemplate)
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class),
(Class<Object>) isNull());
}
@Test
public void testPut() {
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(any()))
.thenReturn(Arrays
.asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), any(HttpEntity.class),
(Class<Object>) isNull())).thenReturn(someEntity);
retryableRestTemplate.put(Env.DEV, path, request);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate)
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), argumentCaptor.capture(),
(Class<Object>) isNull());
assertEquals(request, argumentCaptor.getValue().getBody());
}
@Test
public void testPostObjectWithNoAccessToken() {
Env someEnv = Env.DEV;
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
assertSame(request, entity.getBody());
assertTrue(headers.isEmpty());
}
@Test
public void testPostObjectWithAccessToken() {
Env someEnv = Env.DEV;
String someToken = "someToken";
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION);
assertSame(request, entity.getBody());
assertEquals(1, headers.size());
assertEquals(1, headerValue.size());
assertEquals(someToken, headerValue.get(0));
}
@Test
public void testPostObjectWithNoAccessTokenForEnv() {
Env someEnv = Env.DEV;
Env anotherEnv = Env.PRO;
String someToken = "someToken";
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(serviceAddressLocator.getServiceList(anotherEnv))
.thenReturn(Collections.singletonList(mockService(serviceTwo)));
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(anotherEnv, path, request, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
assertSame(request, entity.getBody());
assertTrue(headers.isEmpty());
}
@Test
public void testPostEntityWithNoAccessToken() {
Env someEnv = Env.DEV;
String originalHeader = "someHeader";
String originalValue = "someValue";
HttpHeaders originalHeaders = new HttpHeaders();
originalHeaders.add(originalHeader, originalValue);
HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
assertSame(requestEntity, entity);
assertSame(request, entity.getBody());
assertEquals(originalHeaders, entity.getHeaders());
}
@Test
public void testPostEntityWithAccessToken() {
Env someEnv = Env.DEV;
String someToken = "someToken";
String originalHeader = "someHeader";
String originalValue = "someValue";
HttpHeaders originalHeaders = new HttpHeaders();
originalHeaders.add(originalHeader, originalValue);
HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
when(someEntity.getBody()).thenReturn(result);
Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType);
assertEquals(result, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(),
eq(requestType));
HttpEntity entity = argumentCaptor.getValue();
HttpHeaders headers = entity.getHeaders();
assertSame(request, entity.getBody());
assertEquals(2, headers.size());
assertEquals(originalValue, headers.get(originalHeader).get(0));
assertEquals(someToken, headers.get(HttpHeaders.AUTHORIZATION).get(0));
}
@Test
public void testGetEntityWithNoAccessToken() {
Env someEnv = Env.DEV;
ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType);
assertEquals(someEntity, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(),
eq(requestType));
HttpHeaders headers = argumentCaptor.getValue().getHeaders();
assertTrue(headers.isEmpty());
}
@Test
public void testGetEntityWithAccessToken() {
Env someEnv = Env.DEV;
String someToken = "someToken";
ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(restTemplate
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType);
assertEquals(someEntity, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(),
eq(requestType));
HttpHeaders headers = argumentCaptor.getValue().getHeaders();
List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION);
assertEquals(1, headers.size());
assertEquals(1, headerValue.size());
assertEquals(someToken, headerValue.get(0));
}
@Test
public void testGetEntityWithNoAccessTokenForEnv() {
Env someEnv = Env.DEV;
Env anotherEnv = Env.PRO;
String someToken = "someToken";
ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class);
ResponseEntity someEntity = mock(ResponseEntity.class);
when(portalConfig.getAdminServiceAccessTokens())
.thenReturn(mockAdminServiceTokens(someEnv, someToken));
when(serviceAddressLocator.getServiceList(someEnv))
.thenReturn(Collections.singletonList(mockService(serviceOne)));
when(serviceAddressLocator.getServiceList(anotherEnv))
.thenReturn(Collections.singletonList(mockService(serviceTwo)));
when(restTemplate
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class),
eq(requestType))).thenReturn(someEntity);
ResponseEntity actualResult = retryableRestTemplate.get(anotherEnv, path, requestType);
assertEquals(someEntity, actualResult);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
verify(restTemplate, times(1))
.exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(),
eq(requestType));
HttpHeaders headers = argumentCaptor.getValue().getHeaders();
assertTrue(headers.isEmpty());
}
private String mockAdminServiceTokens(Env env, String token) {
Map<String, String> tokenMap = Maps.newHashMap();
tokenMap.put(env.getName(), token);
return GSON.toJson(tokenMap);
}
private ServiceDTO mockService(String homeUrl) {
ServiceDTO serviceDTO = new ServiceDTO();
serviceDTO.setHomepageUrl(homeUrl);
return serviceDTO;
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./.git/logs/refs/remotes/origin/HEAD | 0000000000000000000000000000000000000000 6657a58831a544606f78177b61d92bb959ccce94 jupyter <[email protected]> 1704839356 +0000 clone: from https://github.com/apolloconfig/apollo.git
| 0000000000000000000000000000000000000000 6657a58831a544606f78177b61d92bb959ccce94 jupyter <[email protected]> 1704839356 +0000 clone: from https://github.com/apolloconfig/apollo.git
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./scripts/helm/apollo-service/values.yaml | configdb:
name: apollo-configdb
# apolloconfigdb host
host: ""
port: 3306
dbName: ApolloConfigDB
# apolloconfigdb user name
userName: ""
# apolloconfigdb password
password: ""
connectionStringProperties: characterEncoding=utf8
service:
# whether to create a Service for this host or not
enabled: false
fullNameOverride: ""
port: 3306
type: ClusterIP
configService:
name: apollo-configservice
fullNameOverride: ""
replicaCount: 2
containerPort: 8080
image:
repository: apolloconfig/apollo-configservice
tag: ""
pullPolicy: IfNotPresent
imagePullSecrets: []
service:
fullNameOverride: ""
port: 8080
targetPort: 8080
type: ClusterIP
ingress:
enabled: false
annotations: { }
hosts:
- host: ""
paths: [ ]
tls: [ ]
liveness:
initialDelaySeconds: 100
periodSeconds: 10
readiness:
initialDelaySeconds: 30
periodSeconds: 5
config:
# spring profiles to activate
profiles: "github,kubernetes"
# override apollo.config-service.url: config service url to be accessed by apollo-client
configServiceUrlOverride: ""
# override apollo.admin-service.url: admin service url to be accessed by apollo-portal
adminServiceUrlOverride: ""
# specify the context path, e.g. /apollo
contextPath: ""
# environment variables passed to the container, e.g. JAVA_OPTS
env: {}
strategy: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
adminService:
name: apollo-adminservice
fullNameOverride: ""
replicaCount: 2
containerPort: 8090
image:
repository: apolloconfig/apollo-adminservice
tag: ""
pullPolicy: IfNotPresent
imagePullSecrets: []
service:
fullNameOverride: ""
port: 8090
targetPort: 8090
type: ClusterIP
ingress:
enabled: false
annotations: { }
hosts:
- host: ""
paths: [ ]
tls: [ ]
liveness:
initialDelaySeconds: 100
periodSeconds: 10
readiness:
initialDelaySeconds: 30
periodSeconds: 5
config:
# spring profiles to activate
profiles: "github,kubernetes"
# specify the context path, e.g. /apollo
contextPath: ""
# environment variables passed to the container, e.g. JAVA_OPTS
env: {}
strategy: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {} | configdb:
name: apollo-configdb
# apolloconfigdb host
host: ""
port: 3306
dbName: ApolloConfigDB
# apolloconfigdb user name
userName: ""
# apolloconfigdb password
password: ""
connectionStringProperties: characterEncoding=utf8
service:
# whether to create a Service for this host or not
enabled: false
fullNameOverride: ""
port: 3306
type: ClusterIP
configService:
name: apollo-configservice
fullNameOverride: ""
replicaCount: 2
containerPort: 8080
image:
repository: apolloconfig/apollo-configservice
tag: ""
pullPolicy: IfNotPresent
imagePullSecrets: []
service:
fullNameOverride: ""
port: 8080
targetPort: 8080
type: ClusterIP
ingress:
enabled: false
annotations: { }
hosts:
- host: ""
paths: [ ]
tls: [ ]
liveness:
initialDelaySeconds: 100
periodSeconds: 10
readiness:
initialDelaySeconds: 30
periodSeconds: 5
config:
# spring profiles to activate
profiles: "github,kubernetes"
# override apollo.config-service.url: config service url to be accessed by apollo-client
configServiceUrlOverride: ""
# override apollo.admin-service.url: admin service url to be accessed by apollo-portal
adminServiceUrlOverride: ""
# specify the context path, e.g. /apollo
contextPath: ""
# environment variables passed to the container, e.g. JAVA_OPTS
env: {}
strategy: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
adminService:
name: apollo-adminservice
fullNameOverride: ""
replicaCount: 2
containerPort: 8090
image:
repository: apolloconfig/apollo-adminservice
tag: ""
pullPolicy: IfNotPresent
imagePullSecrets: []
service:
fullNameOverride: ""
port: 8090
targetPort: 8090
type: ClusterIP
ingress:
enabled: false
annotations: { }
hosts:
- host: ""
paths: [ ]
tls: [ ]
liveness:
initialDelaySeconds: 100
periodSeconds: 10
readiness:
initialDelaySeconds: 30
periodSeconds: 5
config:
# spring profiles to activate
profiles: "github,kubernetes"
# specify the context path, e.g. /apollo
contextPath: ""
# environment variables passed to the container, e.g. JAVA_OPTS
env: {}
strategy: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {} | -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/resources/static/vendor/jquery-plugin/textareafullscreen.css | .tx-editor-wrapper {
position: relative;
}
.tx-editor-wrapper .tx-editor.expanded {
position: fixed;
top: 0;
left: 0;
width: 80%;
height: 80%;
z-index: 500;
}
.tx-editor-wrapper .tx-editor {
height: 140px;
}
.tx-editor-wrapper .tx-editor .tx-icon {
position: absolute;
right: 5px;
top: 5px;
width: 18px;
height: 16px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAQCAYAAAAbBi9cAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA4LzE2LzEzspl6ugAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAB7SURBVDiN7ZOxCsAgDESvxXyhi5P/Fif/0i6NGJH2KIUufVOUJB45s6lqw0DOGQylFHfeqSqCYEGMESJCF6aUAAC1Vt9IRPolixtDG1DVxjLnhtVL8yAvlZy8Nuy/0T1L19g1cY3Mavupd9bPWL5T9ERJV2SBrcfn238A3whjoYEPESwAAAAASUVORK5CYII=');
cursor: pointer;
z-index: 3;
}
.tx-editor-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.7);
z-index: 2;
opacity: 0;
}
| .tx-editor-wrapper {
position: relative;
}
.tx-editor-wrapper .tx-editor.expanded {
position: fixed;
top: 0;
left: 0;
width: 80%;
height: 80%;
z-index: 500;
}
.tx-editor-wrapper .tx-editor {
height: 140px;
}
.tx-editor-wrapper .tx-editor .tx-icon {
position: absolute;
right: 5px;
top: 5px;
width: 18px;
height: 16px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAQCAYAAAAbBi9cAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA4LzE2LzEzspl6ugAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAB7SURBVDiN7ZOxCsAgDESvxXyhi5P/Fif/0i6NGJH2KIUufVOUJB45s6lqw0DOGQylFHfeqSqCYEGMESJCF6aUAAC1Vt9IRPolixtDG1DVxjLnhtVL8yAvlZy8Nuy/0T1L19g1cY3Mavupd9bPWL5T9ERJV2SBrcfn238A3whjoYEPESwAAAAASUVORK5CYII=');
cursor: pointer;
z-index: 3;
}
.tx-editor-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.7);
z-index: 2;
opacity: 0;
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-biz/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId>
<name>Apollo Biz</name>
<packaging>jar</packaging>
<properties>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-common</artifactId>
</dependency>
<!-- eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId>
<name>Apollo Biz</name>
<packaging>jar</packaging>
<properties>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-common</artifactId>
</dependency>
<!-- eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-core/src/main/java/com/ctrip/framework/foundation/spi/provider/ServerProvider.java | package com.ctrip.framework.foundation.spi.provider;
import java.io.IOException;
import java.io.InputStream;
/**
* Provider for server related properties
*/
public interface ServerProvider extends Provider {
/**
* @return current environment or {@code null} if not set
*/
String getEnvType();
/**
* @return whether current environment is set or not
*/
boolean isEnvTypeSet();
/**
* @return current data center or {@code null} if not set
*/
String getDataCenter();
/**
* @return whether data center is set or not
*/
boolean isDataCenterSet();
/**
* Initialize server provider with the specified input stream
*
* @throws IOException
*/
void initialize(InputStream in) throws IOException;
}
| package com.ctrip.framework.foundation.spi.provider;
import java.io.IOException;
import java.io.InputStream;
/**
* Provider for server related properties
*/
public interface ServerProvider extends Provider {
/**
* @return current environment or {@code null} if not set
*/
String getEnvType();
/**
* @return whether current environment is set or not
*/
boolean isEnvTypeSet();
/**
* @return current data center or {@code null} if not set
*/
String getDataCenter();
/**
* @return whether data center is set or not
*/
boolean isDataCenterSet();
/**
* Initialize server provider with the specified input stream
*
* @throws IOException
*/
void initialize(InputStream in) throws IOException;
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/message/MessageSender.java | package com.ctrip.framework.apollo.biz.message;
/**
* @author Jason Song([email protected])
*/
public interface MessageSender {
void sendMessage(String message, String channel);
}
| package com.ctrip.framework.apollo.biz.message;
/**
* @author Jason Song([email protected])
*/
public interface MessageSender {
void sendMessage(String message, String channel);
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/resources/static/img/hide_sidebar.png | PNG
IHDR X IDATx^Or33ˑ|cN0 i1 lNx2K q`ka,E狖mUԟ[wUe}YUb? ; 0 M `t@ F 372B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B 4(ѝVXĽ_#晈([?=wYY($0`w^LY耉}ט:DNliJQ Ѳ1<?!]a
k6<
Ckyv_w95yx27YD~~ruM:<2^.~LG_g{j~NOm`z8{cʴ /&R3u*GZ0v^\Se@~0VL
Rn2+mBdo6|*AD8Tm /aZjWuO"(uu˫f=St||ޑ _+twctь ^Xȃ`]nW$%2v?cf^Pr|MaApex9aR?A곺r\7kO:ƕ1X4.jDȋtFgi{y!gϫz Ѻ5Ht9=dDut_I"b7~]
<Ini["j XBU+EYFuBr[\'lcX@kz@x͵$|?Q/NFȚ ?oU|-9Jǵ [QyT%=ʪh#=E{+WNz]ȱ="ٛMeI]3ʇi>B]s?l],vezOvAUq!yO4&^tUr۾F,is]r?k[KturlxY'lQ{u҈kBP-v[ZA G⺐ R>A~L<#(T\*AVa#dMDǚ!)<@HF3+H.Hx=[9@0sj
9Q0줂hzsre
: ~_h9hz:A= G +7BI|0ZD2AǓ1!HAm$c9<IAߐ<KO@2ART
$N䐘Rߌ (HҌ*dr$I5T
SI&dzi֦vI_Vd~,D[Dcv>w<eg;Tdm^:`"/XQ9-)EI.H ZӭVDۖQvU$oO|jI_56誟T ۭ;+jyJI0sT ڟd!X=apr
IrUm8 r\c/~S=}.o5iY5XS]~0VjeNmkXqvpN7$d٣JWzvU>Ȅ^W%[ Anaq^"bATJi3
!
D8]Q
JMwG6nѶp/:l>ڻ )B$6ɫ]7}I٦i?ĀDL7BZ1\ q-Jb.jk$"W3qE-i;3!Aћi?X+fԷ[ܔݡXCk n<b]';jmoN$dF1J0|+-I=y/_ߛ
6Oh״VXؓ_~D&CϘ\i Q$8/EٮlPO˻rB/iL6J)Fk%+b^_
!$p]?iG-u V[u ě$HTZ9A,Z8Z[JP2)%5OK1Xvy}9ӂ|G2Ʉ::,HfEFٓ|lkXynp%ĕʙ ALt% A\ɡ DIWĕʙ ALt% A\ɡ DIWĕʙ ALt% A\ɡ DIWĕʙ ALt% A\ɡ DIWĕʙ HA34wH[&N=LDFˊ+&e~DPY1D\i?M)Jcfr̙R~lOy7|*ЂbGW|?v|qd|&\uh纐FQ _ {=;GOxV]z9eD|u I'-ogP퉼oFٴQ9;2_B@fAލL31 f(DBGS?BR)prHL": W*6-H m!`{
]cuGMy'FGTAʎwKf=4ƟBi6^xK&-zh/̩*f'ړ{u#Ղ,nOq%RY^HuFK^V`{Xj/ј[oSU>@dC&SW
MC|dEVF#L$*\Hޓ0F)h4iq5 H H H H H H H H H H H OTl IENDB` | PNG
IHDR X IDATx^Or33ˑ|cN0 i1 lNx2K q`ka,E狖mUԟ[wUe}YUb? ; 0 M `t@ F 372B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B I4F qC)# Dn 72B 4(ѝVXĽ_#晈([?=wYY($0`w^LY耉}ט:DNliJQ Ѳ1<?!]a
k6<
Ckyv_w95yx27YD~~ruM:<2^.~LG_g{j~NOm`z8{cʴ /&R3u*GZ0v^\Se@~0VL
Rn2+mBdo6|*AD8Tm /aZjWuO"(uu˫f=St||ޑ _+twctь ^Xȃ`]nW$%2v?cf^Pr|MaApex9aR?A곺r\7kO:ƕ1X4.jDȋtFgi{y!gϫz Ѻ5Ht9=dDut_I"b7~]
<Ini["j XBU+EYFuBr[\'lcX@kz@x͵$|?Q/NFȚ ?oU|-9Jǵ [QyT%=ʪh#=E{+WNz]ȱ="ٛMeI]3ʇi>B]s?l],vezOvAUq!yO4&^tUr۾F,is]r?k[KturlxY'lQ{u҈kBP-v[ZA G⺐ R>A~L<#(T\*AVa#dMDǚ!)<@HF3+H.Hx=[9@0sj
9Q0줂hzsre
: ~_h9hz:A= G +7BI|0ZD2AǓ1!HAm$c9<IAߐ<KO@2ART
$N䐘Rߌ (HҌ*dr$I5T
SI&dzi֦vI_Vd~,D[Dcv>w<eg;Tdm^:`"/XQ9-)EI.H ZӭVDۖQvU$oO|jI_56誟T ۭ;+jyJI0sT ڟd!X=apr
IrUm8 r\c/~S=}.o5iY5XS]~0VjeNmkXqvpN7$d٣JWzvU>Ȅ^W%[ Anaq^"bATJi3
!
D8]Q
JMwG6nѶp/:l>ڻ )B$6ɫ]7}I٦i?ĀDL7BZ1\ q-Jb.jk$"W3qE-i;3!Aћi?X+fԷ[ܔݡXCk n<b]';jmoN$dF1J0|+-I=y/_ߛ
6Oh״VXؓ_~D&CϘ\i Q$8/EٮlPO˻rB/iL6J)Fk%+b^_
!$p]?iG-u V[u ě$HTZ9A,Z8Z[JP2)%5OK1Xvy}9ӂ|G2Ʉ::,HfEFٓ|lkXynp%ĕʙ ALt% A\ɡ DIWĕʙ ALt% A\ɡ DIWĕʙ ALt% A\ɡ DIWĕʙ ALt% A\ɡ DIWĕʙ HA34wH[&N=LDFˊ+&e~DPY1D\i?M)Jcfr̙R~lOy7|*ЂbGW|?v|qd|&\uh纐FQ _ {=;GOxV]z9eD|u I'-ogP퉼oFٴQ9;2_B@fAލL31 f(DBGS?BR)prHL": W*6-H m!`{
]cuGMy'FGTAʎwKf=4ƟBi6^xK&-zh/̩*f'ړ{u#Ղ,nOq%RY^HuFK^V`{Xj/ј[oSU>@dC&SW
MC|dEVF#L$*\Hޓ0F)h4iq5 H H H H H H H H H H H OTl IENDB` | -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-configservice/src/main/resources/application-nacos-discovery.properties | apollo.eureka.server.enabled=false
eureka.client.enabled=false
spring.cloud.discovery.enabled=false
#nacos enabled
nacos.discovery.register.enabled=true
nacos.discovery.auto-register=true
nacos.discovery.register.service-name=apollo-configservice
| apollo.eureka.server.enabled=false
eureka.client.enabled=false
spring.cloud.discovery.enabled=false
#nacos enabled
nacos.discovery.register.enabled=true
nacos.discovery.auto-register=true
nacos.discovery.register.service-name=apollo-configservice
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/resources/static/delete_app_cluster_namespace.html | <!doctype html>
<html ng-app="delete_app_cluster_namespace">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" href="img/config.png">
<!-- styles -->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css">
<link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css">
<link rel="stylesheet" type="text/css" href="styles/common-style.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<title>{{'Delete.Title' | translate }}</title>
</head>
<body>
<apollonav></apollonav>
<div class="container-fluid" ng-controller="DeleteAppClusterNamespaceController">
<div class="col-md-10 col-md-offset-1 panel">
<section class="panel-body" ng-show="isRootUser">
<!-- delete app -->
<section class="row">
<h5>{{'Delete.DeleteApp' | translate }}
<small>
{{'Delete.DeleteAppTips' | translate }}
</small>
</h5>
<hr>
<form class="form-horizontal">
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.AppId' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="app.appId">
<small> {{'Delete.AppIdTips' | translate }}</small>
</div>
<div class="col-sm-1">
<button class="btn btn-info" ng-click="getAppInfo()">{{'Common.Search' | translate }}</button>
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
{{'Delete.AppInfo' | translate }}</label>
<div class="col-sm-5">
<h5 ng-show="app.info" ng-bind="app.info"></h5>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-9">
<button type="submit" class="btn btn-primary" ng-disabled="deleteAppBtnDisabled"
ng-click="deleteApp()">
{{'Delete.DeleteApp' | translate }}
</button>
</div>
</div>
</form>
</section>
<!-- delete cluster -->
<section class="row">
<h5>{{'Delete.DeleteCluster' | translate }}
<small>
{{'Delete.DeleteClusterTips' | translate }}
</small>
</h5>
<hr>
<form class="form-horizontal">
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.AppId' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="cluster.appId">
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Delete.EnvName' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="cluster.env">
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.ClusterName' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="cluster.name">
<small>{{'Delete.ClusterNameTips' | translate }}</small>
</div>
<div class="col-sm-1">
<button class="btn btn-info"
ng-click="getClusterInfo()">{{'Common.Search' | translate }}</button>
</div>
</div>
<div class="form-group" viv clform-group>
<label class="col-sm-2 control-label">
{{'Delete.ClusterInfo' | translate }}</label>
<div class="col-sm-5">
<h5 ng-show="cluster.info" ng-bind="cluster.info"></h5>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-9">
<button type="submit" class="btn btn-primary" ng-disabled="deleteClusterBtnDisabled"
ng-click="deleteCluster()">
{{'Delete.DeleteCluster' | translate }}
</button>
</div>
</div>
</form>
</section>
<!-- delete app namespace -->
<section class="row">
<h5>{{'Delete.DeleteNamespace' | translate }}
<small>{{'Delete.DeleteNamespaceTips' | translate }}</small>
</h5>
<small>
{{'Delete.DeleteNamespaceTips2' | translate }}
</small>
<hr>
<form class="form-horizontal">
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.AppId' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="appNamespace.appId">
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Delete.AppNamespaceName' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="appNamespace.name">
<small>{{'Delete.AppNamespaceNameTips' | translate }}</small>
</div>
<div class="col-sm-1">
<button class="btn btn-info" ng-click="getAppNamespaceInfo()">{{'Common.Search' | translate }}</button>
</div>
</div>
<div class="form-group" viv clform-group>
<label class="col-sm-2 control-label">
{{'Delete.AppNamespaceInfo' | translate }}</label>
<div class="col-sm-5">
<h5 ng-show="appNamespace.info" ng-bind="appNamespace.info"></h5>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-9">
<button type="submit" class="btn btn-primary"
ng-disabled="deleteAppNamespaceBtnDisabled" ng-click="deleteAppNamespace()">
{{'Delete.DeleteNamespace' | translate }}
</button>
</div>
</div>
</form>
</section>
</section>
<section class="panel-body text-center" ng-if="!isRootUser">
<h4>{{'Common.IsRootUser' | translate }}</h4>
</section>
</div>
</div>
<div ng-include="'views/common/footer.html'"></div>
<!-- jquery.js -->
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<!--angular-->
<script src="vendor/angular/angular.min.js"></script>
<script src="vendor/angular/angular-route.min.js"></script>
<script src="vendor/angular/angular-resource.min.js"></script>
<script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script>
<script src="vendor/angular/loading-bar.min.js"></script>
<script src="vendor/angular/angular-cookies.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script>
<!--valdr-->
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<!-- bootstrap.js -->
<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="vendor/lodash.min.js"></script>
<script src="vendor/select2/select2.min.js" type="text/javascript"></script>
<!--biz-->
<!--must import-->
<script type="application/javascript" src="scripts/app.js"></script>
<script type="application/javascript" src="scripts/services/AppService.js"></script>
<script type="application/javascript" src="scripts/services/EnvService.js"></script>
<script type="application/javascript" src="scripts/services/UserService.js"></script>
<script type="application/javascript" src="scripts/services/CommonService.js"></script>
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="scripts/services/ClusterService.js"></script>
<script type="application/javascript" src="scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/PageCommon.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/valdr.js"></script>
<script type="application/javascript" src="scripts/controller/DeleteAppClusterNamespaceController.js"></script>
</body>
</html> | <!doctype html>
<html ng-app="delete_app_cluster_namespace">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" href="img/config.png">
<!-- styles -->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css">
<link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css">
<link rel="stylesheet" type="text/css" href="styles/common-style.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<title>{{'Delete.Title' | translate }}</title>
</head>
<body>
<apollonav></apollonav>
<div class="container-fluid" ng-controller="DeleteAppClusterNamespaceController">
<div class="col-md-10 col-md-offset-1 panel">
<section class="panel-body" ng-show="isRootUser">
<!-- delete app -->
<section class="row">
<h5>{{'Delete.DeleteApp' | translate }}
<small>
{{'Delete.DeleteAppTips' | translate }}
</small>
</h5>
<hr>
<form class="form-horizontal">
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.AppId' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="app.appId">
<small> {{'Delete.AppIdTips' | translate }}</small>
</div>
<div class="col-sm-1">
<button class="btn btn-info" ng-click="getAppInfo()">{{'Common.Search' | translate }}</button>
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
{{'Delete.AppInfo' | translate }}</label>
<div class="col-sm-5">
<h5 ng-show="app.info" ng-bind="app.info"></h5>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-9">
<button type="submit" class="btn btn-primary" ng-disabled="deleteAppBtnDisabled"
ng-click="deleteApp()">
{{'Delete.DeleteApp' | translate }}
</button>
</div>
</div>
</form>
</section>
<!-- delete cluster -->
<section class="row">
<h5>{{'Delete.DeleteCluster' | translate }}
<small>
{{'Delete.DeleteClusterTips' | translate }}
</small>
</h5>
<hr>
<form class="form-horizontal">
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.AppId' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="cluster.appId">
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Delete.EnvName' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="cluster.env">
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.ClusterName' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="cluster.name">
<small>{{'Delete.ClusterNameTips' | translate }}</small>
</div>
<div class="col-sm-1">
<button class="btn btn-info"
ng-click="getClusterInfo()">{{'Common.Search' | translate }}</button>
</div>
</div>
<div class="form-group" viv clform-group>
<label class="col-sm-2 control-label">
{{'Delete.ClusterInfo' | translate }}</label>
<div class="col-sm-5">
<h5 ng-show="cluster.info" ng-bind="cluster.info"></h5>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-9">
<button type="submit" class="btn btn-primary" ng-disabled="deleteClusterBtnDisabled"
ng-click="deleteCluster()">
{{'Delete.DeleteCluster' | translate }}
</button>
</div>
</div>
</form>
</section>
<!-- delete app namespace -->
<section class="row">
<h5>{{'Delete.DeleteNamespace' | translate }}
<small>{{'Delete.DeleteNamespaceTips' | translate }}</small>
</h5>
<small>
{{'Delete.DeleteNamespaceTips2' | translate }}
</small>
<hr>
<form class="form-horizontal">
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.AppId' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="appNamespace.appId">
</div>
</div>
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Delete.AppNamespaceName' | translate }}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" ng-model="appNamespace.name">
<small>{{'Delete.AppNamespaceNameTips' | translate }}</small>
</div>
<div class="col-sm-1">
<button class="btn btn-info" ng-click="getAppNamespaceInfo()">{{'Common.Search' | translate }}</button>
</div>
</div>
<div class="form-group" viv clform-group>
<label class="col-sm-2 control-label">
{{'Delete.AppNamespaceInfo' | translate }}</label>
<div class="col-sm-5">
<h5 ng-show="appNamespace.info" ng-bind="appNamespace.info"></h5>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-9">
<button type="submit" class="btn btn-primary"
ng-disabled="deleteAppNamespaceBtnDisabled" ng-click="deleteAppNamespace()">
{{'Delete.DeleteNamespace' | translate }}
</button>
</div>
</div>
</form>
</section>
</section>
<section class="panel-body text-center" ng-if="!isRootUser">
<h4>{{'Common.IsRootUser' | translate }}</h4>
</section>
</div>
</div>
<div ng-include="'views/common/footer.html'"></div>
<!-- jquery.js -->
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<!--angular-->
<script src="vendor/angular/angular.min.js"></script>
<script src="vendor/angular/angular-route.min.js"></script>
<script src="vendor/angular/angular-resource.min.js"></script>
<script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script>
<script src="vendor/angular/loading-bar.min.js"></script>
<script src="vendor/angular/angular-cookies.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script>
<!--valdr-->
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<!-- bootstrap.js -->
<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="vendor/lodash.min.js"></script>
<script src="vendor/select2/select2.min.js" type="text/javascript"></script>
<!--biz-->
<!--must import-->
<script type="application/javascript" src="scripts/app.js"></script>
<script type="application/javascript" src="scripts/services/AppService.js"></script>
<script type="application/javascript" src="scripts/services/EnvService.js"></script>
<script type="application/javascript" src="scripts/services/UserService.js"></script>
<script type="application/javascript" src="scripts/services/CommonService.js"></script>
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="scripts/services/ClusterService.js"></script>
<script type="application/javascript" src="scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/PageCommon.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/valdr.js"></script>
<script type="application/javascript" src="scripts/controller/DeleteAppClusterNamespaceController.js"></script>
</body>
</html> | -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloAnnotationProcessor.java | package com.ctrip.framework.apollo.spring.annotation;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigChangeListener;
import com.ctrip.framework.apollo.ConfigService;
import com.ctrip.framework.apollo.build.ApolloInjector;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.spring.property.PlaceholderHelper;
import com.ctrip.framework.apollo.spring.property.SpringValue;
import com.ctrip.framework.apollo.spring.property.SpringValueRegistry;
import com.ctrip.framework.apollo.spring.util.SpringInjector;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.google.common.base.Preconditions;
import com.google.gson.Gson;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Set;
import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.env.Environment;
import org.springframework.util.ReflectionUtils;
/**
* Apollo Annotation Processor for Spring Application
*
* @author Jason Song([email protected])
*/
public class ApolloAnnotationProcessor extends ApolloProcessor implements BeanFactoryAware,
EnvironmentAware {
private static final Logger logger = LoggerFactory.getLogger(ApolloAnnotationProcessor.class);
private static final Gson GSON = new Gson();
private final ConfigUtil configUtil;
private final PlaceholderHelper placeholderHelper;
private final SpringValueRegistry springValueRegistry;
/**
* resolve the expression.
*/
private ConfigurableBeanFactory configurableBeanFactory;
private Environment environment;
public ApolloAnnotationProcessor() {
configUtil = ApolloInjector.getInstance(ConfigUtil.class);
placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class);
springValueRegistry = SpringInjector.getInstance(SpringValueRegistry.class);
}
@Override
protected void processField(Object bean, String beanName, Field field) {
this.processApolloConfig(bean, field);
this.processApolloJsonValue(bean, beanName, field);
}
@Override
protected void processMethod(final Object bean, String beanName, final Method method) {
this.processApolloConfigChangeListener(bean, method);
this.processApolloJsonValue(bean, beanName, method);
}
private void processApolloConfig(Object bean, Field field) {
ApolloConfig annotation = AnnotationUtils.getAnnotation(field, ApolloConfig.class);
if (annotation == null) {
return;
}
Preconditions.checkArgument(Config.class.isAssignableFrom(field.getType()),
"Invalid type: %s for field: %s, should be Config", field.getType(), field);
final String namespace = annotation.value();
final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace);
Config config = ConfigService.getConfig(resolvedNamespace);
ReflectionUtils.makeAccessible(field);
ReflectionUtils.setField(field, bean, config);
}
private void processApolloConfigChangeListener(final Object bean, final Method method) {
ApolloConfigChangeListener annotation = AnnotationUtils
.findAnnotation(method, ApolloConfigChangeListener.class);
if (annotation == null) {
return;
}
Class<?>[] parameterTypes = method.getParameterTypes();
Preconditions.checkArgument(parameterTypes.length == 1,
"Invalid number of parameters: %s for method: %s, should be 1", parameterTypes.length,
method);
Preconditions.checkArgument(ConfigChangeEvent.class.isAssignableFrom(parameterTypes[0]),
"Invalid parameter type: %s for method: %s, should be ConfigChangeEvent", parameterTypes[0],
method);
ReflectionUtils.makeAccessible(method);
String[] namespaces = annotation.value();
String[] annotatedInterestedKeys = annotation.interestedKeys();
String[] annotatedInterestedKeyPrefixes = annotation.interestedKeyPrefixes();
ConfigChangeListener configChangeListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
ReflectionUtils.invokeMethod(method, bean, changeEvent);
}
};
Set<String> interestedKeys =
annotatedInterestedKeys.length > 0 ? Sets.newHashSet(annotatedInterestedKeys) : null;
Set<String> interestedKeyPrefixes =
annotatedInterestedKeyPrefixes.length > 0 ? Sets.newHashSet(annotatedInterestedKeyPrefixes)
: null;
for (String namespace : namespaces) {
final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace);
Config config = ConfigService.getConfig(resolvedNamespace);
if (interestedKeys == null && interestedKeyPrefixes == null) {
config.addChangeListener(configChangeListener);
} else {
config.addChangeListener(configChangeListener, interestedKeys, interestedKeyPrefixes);
}
}
}
private void processApolloJsonValue(Object bean, String beanName, Field field) {
ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(field, ApolloJsonValue.class);
if (apolloJsonValue == null) {
return;
}
String placeholder = apolloJsonValue.value();
Object propertyValue = placeholderHelper
.resolvePropertyValue(this.configurableBeanFactory, beanName, placeholder);
// propertyValue will never be null, as @ApolloJsonValue will not allow that
if (!(propertyValue instanceof String)) {
return;
}
boolean accessible = field.isAccessible();
field.setAccessible(true);
ReflectionUtils
.setField(field, bean, parseJsonValue((String) propertyValue, field.getGenericType()));
field.setAccessible(accessible);
if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) {
Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeholder);
for (String key : keys) {
SpringValue springValue = new SpringValue(key, placeholder, bean, beanName, field, true);
springValueRegistry.register(this.configurableBeanFactory, key, springValue);
logger.debug("Monitoring {}", springValue);
}
}
}
private void processApolloJsonValue(Object bean, String beanName, Method method) {
ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(method, ApolloJsonValue.class);
if (apolloJsonValue == null) {
return;
}
String placeHolder = apolloJsonValue.value();
Object propertyValue = placeholderHelper
.resolvePropertyValue(this.configurableBeanFactory, beanName, placeHolder);
// propertyValue will never be null, as @ApolloJsonValue will not allow that
if (!(propertyValue instanceof String)) {
return;
}
Type[] types = method.getGenericParameterTypes();
Preconditions.checkArgument(types.length == 1,
"Ignore @Value setter {}.{}, expecting 1 parameter, actual {} parameters",
bean.getClass().getName(), method.getName(), method.getParameterTypes().length);
boolean accessible = method.isAccessible();
method.setAccessible(true);
ReflectionUtils.invokeMethod(method, bean, parseJsonValue((String) propertyValue, types[0]));
method.setAccessible(accessible);
if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) {
Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeHolder);
for (String key : keys) {
SpringValue springValue = new SpringValue(key, apolloJsonValue.value(), bean, beanName,
method, true);
springValueRegistry.register(this.configurableBeanFactory, key, springValue);
logger.debug("Monitoring {}", springValue);
}
}
}
private Object parseJsonValue(String json, Type targetType) {
try {
return GSON.fromJson(json, targetType);
} catch (Throwable ex) {
logger.error("Parsing json '{}' to type {} failed!", json, targetType, ex);
throw ex;
}
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.configurableBeanFactory = (ConfigurableBeanFactory) beanFactory;
}
@Override
public void setEnvironment(Environment environment) {
this.environment = environment;
}
}
| package com.ctrip.framework.apollo.spring.annotation;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigChangeListener;
import com.ctrip.framework.apollo.ConfigService;
import com.ctrip.framework.apollo.build.ApolloInjector;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.spring.property.PlaceholderHelper;
import com.ctrip.framework.apollo.spring.property.SpringValue;
import com.ctrip.framework.apollo.spring.property.SpringValueRegistry;
import com.ctrip.framework.apollo.spring.util.SpringInjector;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.google.common.base.Preconditions;
import com.google.gson.Gson;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Set;
import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.env.Environment;
import org.springframework.util.ReflectionUtils;
/**
* Apollo Annotation Processor for Spring Application
*
* @author Jason Song([email protected])
*/
public class ApolloAnnotationProcessor extends ApolloProcessor implements BeanFactoryAware,
EnvironmentAware {
private static final Logger logger = LoggerFactory.getLogger(ApolloAnnotationProcessor.class);
private static final Gson GSON = new Gson();
private final ConfigUtil configUtil;
private final PlaceholderHelper placeholderHelper;
private final SpringValueRegistry springValueRegistry;
/**
* resolve the expression.
*/
private ConfigurableBeanFactory configurableBeanFactory;
private Environment environment;
public ApolloAnnotationProcessor() {
configUtil = ApolloInjector.getInstance(ConfigUtil.class);
placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class);
springValueRegistry = SpringInjector.getInstance(SpringValueRegistry.class);
}
@Override
protected void processField(Object bean, String beanName, Field field) {
this.processApolloConfig(bean, field);
this.processApolloJsonValue(bean, beanName, field);
}
@Override
protected void processMethod(final Object bean, String beanName, final Method method) {
this.processApolloConfigChangeListener(bean, method);
this.processApolloJsonValue(bean, beanName, method);
}
private void processApolloConfig(Object bean, Field field) {
ApolloConfig annotation = AnnotationUtils.getAnnotation(field, ApolloConfig.class);
if (annotation == null) {
return;
}
Preconditions.checkArgument(Config.class.isAssignableFrom(field.getType()),
"Invalid type: %s for field: %s, should be Config", field.getType(), field);
final String namespace = annotation.value();
final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace);
Config config = ConfigService.getConfig(resolvedNamespace);
ReflectionUtils.makeAccessible(field);
ReflectionUtils.setField(field, bean, config);
}
private void processApolloConfigChangeListener(final Object bean, final Method method) {
ApolloConfigChangeListener annotation = AnnotationUtils
.findAnnotation(method, ApolloConfigChangeListener.class);
if (annotation == null) {
return;
}
Class<?>[] parameterTypes = method.getParameterTypes();
Preconditions.checkArgument(parameterTypes.length == 1,
"Invalid number of parameters: %s for method: %s, should be 1", parameterTypes.length,
method);
Preconditions.checkArgument(ConfigChangeEvent.class.isAssignableFrom(parameterTypes[0]),
"Invalid parameter type: %s for method: %s, should be ConfigChangeEvent", parameterTypes[0],
method);
ReflectionUtils.makeAccessible(method);
String[] namespaces = annotation.value();
String[] annotatedInterestedKeys = annotation.interestedKeys();
String[] annotatedInterestedKeyPrefixes = annotation.interestedKeyPrefixes();
ConfigChangeListener configChangeListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
ReflectionUtils.invokeMethod(method, bean, changeEvent);
}
};
Set<String> interestedKeys =
annotatedInterestedKeys.length > 0 ? Sets.newHashSet(annotatedInterestedKeys) : null;
Set<String> interestedKeyPrefixes =
annotatedInterestedKeyPrefixes.length > 0 ? Sets.newHashSet(annotatedInterestedKeyPrefixes)
: null;
for (String namespace : namespaces) {
final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace);
Config config = ConfigService.getConfig(resolvedNamespace);
if (interestedKeys == null && interestedKeyPrefixes == null) {
config.addChangeListener(configChangeListener);
} else {
config.addChangeListener(configChangeListener, interestedKeys, interestedKeyPrefixes);
}
}
}
private void processApolloJsonValue(Object bean, String beanName, Field field) {
ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(field, ApolloJsonValue.class);
if (apolloJsonValue == null) {
return;
}
String placeholder = apolloJsonValue.value();
Object propertyValue = placeholderHelper
.resolvePropertyValue(this.configurableBeanFactory, beanName, placeholder);
// propertyValue will never be null, as @ApolloJsonValue will not allow that
if (!(propertyValue instanceof String)) {
return;
}
boolean accessible = field.isAccessible();
field.setAccessible(true);
ReflectionUtils
.setField(field, bean, parseJsonValue((String) propertyValue, field.getGenericType()));
field.setAccessible(accessible);
if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) {
Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeholder);
for (String key : keys) {
SpringValue springValue = new SpringValue(key, placeholder, bean, beanName, field, true);
springValueRegistry.register(this.configurableBeanFactory, key, springValue);
logger.debug("Monitoring {}", springValue);
}
}
}
private void processApolloJsonValue(Object bean, String beanName, Method method) {
ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(method, ApolloJsonValue.class);
if (apolloJsonValue == null) {
return;
}
String placeHolder = apolloJsonValue.value();
Object propertyValue = placeholderHelper
.resolvePropertyValue(this.configurableBeanFactory, beanName, placeHolder);
// propertyValue will never be null, as @ApolloJsonValue will not allow that
if (!(propertyValue instanceof String)) {
return;
}
Type[] types = method.getGenericParameterTypes();
Preconditions.checkArgument(types.length == 1,
"Ignore @Value setter {}.{}, expecting 1 parameter, actual {} parameters",
bean.getClass().getName(), method.getName(), method.getParameterTypes().length);
boolean accessible = method.isAccessible();
method.setAccessible(true);
ReflectionUtils.invokeMethod(method, bean, parseJsonValue((String) propertyValue, types[0]));
method.setAccessible(accessible);
if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) {
Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeHolder);
for (String key : keys) {
SpringValue springValue = new SpringValue(key, apolloJsonValue.value(), bean, beanName,
method, true);
springValueRegistry.register(this.configurableBeanFactory, key, springValue);
logger.debug("Monitoring {}", springValue);
}
}
}
private Object parseJsonValue(String json, Type targetType) {
try {
return GSON.fromJson(json, targetType);
} catch (Throwable ex) {
logger.error("Parsing json '{}' to type {} failed!", json, targetType, ex);
throw ex;
}
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.configurableBeanFactory = (ConfigurableBeanFactory) beanFactory;
}
@Override
public void setEnvironment(Environment environment) {
this.environment = environment;
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-client/src/main/resources/META-INF/spring.handlers | http\://www.ctrip.com/schema/apollo=com.ctrip.framework.apollo.spring.config.NamespaceHandler | http\://www.ctrip.com/schema/apollo=com.ctrip.framework.apollo.spring.config.NamespaceHandler | -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-client/src/main/java/com/ctrip/framework/apollo/util/OrderedProperties.java | package com.ctrip.framework.apollo.util;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
/**
* An OrderedProperties instance will keep appearance order in config file.
*
* <strong>
* Warnings: 1. It should be noticed that stream APIs or JDk1.8 APIs( listed in
* https://github.com/ctripcorp/apollo/pull/2861) are not implemented here. 2. {@link Properties}
* implementation are different between JDK1.8 and later JDKs. At least, {@link Properties} have an
* individual implementation in JDK10. Hence, there should be an individual putAll method here.
* </strong>
*
* @author [email protected]
*/
public class OrderedProperties extends Properties {
private static final long serialVersionUID = -1741073539526213291L;
private final Set<String> propertyNames;
public OrderedProperties() {
propertyNames = Collections.synchronizedSet(new LinkedHashSet<String>());
}
@Override
public synchronized Object put(Object key, Object value) {
addPropertyName(key);
return super.put(key, value);
}
private void addPropertyName(Object key) {
if (key instanceof String) {
propertyNames.add((String) key);
}
}
@Override
public Set<String> stringPropertyNames() {
return propertyNames;
}
@Override
public Enumeration<?> propertyNames() {
return Collections.enumeration(propertyNames);
}
@Override
public synchronized Enumeration<Object> keys() {
return new Enumeration<Object>() {
private final Iterator<String> i = propertyNames.iterator();
@Override
public boolean hasMoreElements() {
return i.hasNext();
}
@Override
public Object nextElement() {
return i.next();
}
};
}
@Override
public Set<Object> keySet() {
return new LinkedHashSet<Object>(propertyNames);
}
@Override
public Set<Entry<Object, Object>> entrySet() {
Set<Entry<Object, Object>> original = super.entrySet();
LinkedHashMap<Object, Entry<Object, Object>> entryMap = new LinkedHashMap<>();
for (String propertyName : propertyNames) {
entryMap.put(propertyName, null);
}
for (Entry<Object, Object> entry : original) {
entryMap.put(entry.getKey(), entry);
}
return new LinkedHashSet<>(entryMap.values());
}
@Override
public synchronized void putAll(Map<?, ?> t) {
super.putAll(t);
for (Object name : t.keySet()) {
addPropertyName(name);
}
}
@Override
public synchronized void clear() {
super.clear();
this.propertyNames.clear();
}
@Override
public synchronized Object remove(Object key) {
if (key instanceof String) {
this.propertyNames.remove(key);
}
return super.remove(key);
}
}
| package com.ctrip.framework.apollo.util;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
/**
* An OrderedProperties instance will keep appearance order in config file.
*
* <strong>
* Warnings: 1. It should be noticed that stream APIs or JDk1.8 APIs( listed in
* https://github.com/ctripcorp/apollo/pull/2861) are not implemented here. 2. {@link Properties}
* implementation are different between JDK1.8 and later JDKs. At least, {@link Properties} have an
* individual implementation in JDK10. Hence, there should be an individual putAll method here.
* </strong>
*
* @author [email protected]
*/
public class OrderedProperties extends Properties {
private static final long serialVersionUID = -1741073539526213291L;
private final Set<String> propertyNames;
public OrderedProperties() {
propertyNames = Collections.synchronizedSet(new LinkedHashSet<String>());
}
@Override
public synchronized Object put(Object key, Object value) {
addPropertyName(key);
return super.put(key, value);
}
private void addPropertyName(Object key) {
if (key instanceof String) {
propertyNames.add((String) key);
}
}
@Override
public Set<String> stringPropertyNames() {
return propertyNames;
}
@Override
public Enumeration<?> propertyNames() {
return Collections.enumeration(propertyNames);
}
@Override
public synchronized Enumeration<Object> keys() {
return new Enumeration<Object>() {
private final Iterator<String> i = propertyNames.iterator();
@Override
public boolean hasMoreElements() {
return i.hasNext();
}
@Override
public Object nextElement() {
return i.next();
}
};
}
@Override
public Set<Object> keySet() {
return new LinkedHashSet<Object>(propertyNames);
}
@Override
public Set<Entry<Object, Object>> entrySet() {
Set<Entry<Object, Object>> original = super.entrySet();
LinkedHashMap<Object, Entry<Object, Object>> entryMap = new LinkedHashMap<>();
for (String propertyName : propertyNames) {
entryMap.put(propertyName, null);
}
for (Entry<Object, Object> entry : original) {
entryMap.put(entry.getKey(), entry);
}
return new LinkedHashSet<>(entryMap.values());
}
@Override
public synchronized void putAll(Map<?, ?> t) {
super.putAll(t);
for (Object name : t.keySet()) {
addPropertyName(name);
}
}
@Override
public synchronized void clear() {
super.clear();
this.propertyNames.clear();
}
@Override
public synchronized Object remove(Object key) {
if (key instanceof String) {
this.propertyNames.remove(key);
}
return super.remove(key);
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/javaConfigDemo/AnnotationApplication.java | package com.ctrip.framework.apollo.demo.spring.javaConfigDemo;
import com.ctrip.framework.apollo.demo.spring.common.bean.AnnotatedBean;
import com.google.common.base.Charsets;
import com.google.common.base.Strings;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
* @author Jason Song([email protected])
*/
public class AnnotationApplication {
public static void main(String[] args) throws IOException {
ApplicationContext context = new AnnotationConfigApplicationContext("com.ctrip.framework.apollo.demo.spring.common");
AnnotatedBean annotatedBean = context.getBean(AnnotatedBean.class);
System.out.println("AnnotationApplication Demo. Input any key except quit to print the values. Input quit to exit.");
while (true) {
System.out.print("> ");
String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine();
if (!Strings.isNullOrEmpty(input) && input.trim().equalsIgnoreCase("quit")) {
System.exit(0);
}
System.out.println(annotatedBean.toString());
}
}
}
| package com.ctrip.framework.apollo.demo.spring.javaConfigDemo;
import com.ctrip.framework.apollo.demo.spring.common.bean.AnnotatedBean;
import com.google.common.base.Charsets;
import com.google.common.base.Strings;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
* @author Jason Song([email protected])
*/
public class AnnotationApplication {
public static void main(String[] args) throws IOException {
ApplicationContext context = new AnnotationConfigApplicationContext("com.ctrip.framework.apollo.demo.spring.common");
AnnotatedBean annotatedBean = context.getBean(AnnotatedBean.class);
System.out.println("AnnotationApplication Demo. Input any key except quit to print the values. Input quit to exit.");
while (true) {
System.out.print("> ");
String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine();
if (!Strings.isNullOrEmpty(input) && input.trim().equalsIgnoreCase("quit")) {
System.exit(0);
}
System.out.println(annotatedBean.toString());
}
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./scripts/helm/apollo-portal/templates/NOTES.txt | Portal url for current release:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "apollo.portal.fullName" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "apollo.portal.fullName" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "apollo.portal.serviceName" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "apollo.portal.fullName" . }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8070 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8070:8070
{{- end }}
{{- if .Values.ingress.enabled }}
Ingress:
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- end }} | Portal url for current release:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "apollo.portal.fullName" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "apollo.portal.fullName" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "apollo.portal.serviceName" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "apollo.portal.fullName" . }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8070 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8070:8070
{{- end }}
{{- if .Values.ingress.enabled }}
Ingress:
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- end }} | -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-client/src/test/java/com/ctrip/framework/apollo/internals/DefaultConfigTest.java | package com.ctrip.framework.apollo.internals;
import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.enums.ConfigSourceType;
import com.ctrip.framework.apollo.util.OrderedProperties;
import com.ctrip.framework.apollo.util.factory.PropertiesFactory;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.io.File;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Function;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.awaitility.core.ThrowingRunnable;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigChangeListener;
import com.ctrip.framework.apollo.build.MockInjector;
import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil;
import com.ctrip.framework.apollo.enums.PropertyChangeType;
import com.ctrip.framework.apollo.model.ConfigChange;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.google.common.base.Charsets;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Files;
import com.google.common.util.concurrent.SettableFuture;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
/**
* @author Jason Song([email protected])
*/
public class DefaultConfigTest {
private File someResourceDir;
private String someNamespace;
private ConfigRepository configRepository;
private Properties someProperties;
private ConfigSourceType someSourceType;
private PropertiesFactory propertiesFactory;
@Before
public void setUp() throws Exception {
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtil());
propertiesFactory = mock(PropertiesFactory.class);
when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() {
@Override
public Properties answer(InvocationOnMock invocation) {
return new Properties();
}
});
MockInjector.setInstance(PropertiesFactory.class, propertiesFactory);
someResourceDir = new File(ClassLoaderUtil.getClassPath() + "/META-INF/config");
someResourceDir.mkdirs();
someNamespace = "someName";
configRepository = mock(ConfigRepository.class);
}
@After
public void tearDown() throws Exception {
MockInjector.reset();
recursiveDelete(someResourceDir);
}
//helper method to clean created files
private void recursiveDelete(File file) {
if (!file.exists()) {
return;
}
if (file.isDirectory()) {
for (File f : file.listFiles()) {
recursiveDelete(f);
}
}
file.delete();
}
@Test
public void testGetPropertyWithAllPropertyHierarchy() throws Exception {
String someKey = "someKey";
String someSystemPropertyValue = "system-property-value";
String anotherKey = "anotherKey";
String someLocalFileValue = "local-file-value";
String lastKey = "lastKey";
String someResourceValue = "resource-value";
//set up system property
System.setProperty(someKey, someSystemPropertyValue);
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someLocalFileValue);
someProperties.setProperty(anotherKey, someLocalFileValue);
when(configRepository.getConfig()).thenReturn(someProperties);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getSourceType()).thenReturn(someSourceType);
//set up resource file
File resourceFile = new File(someResourceDir, someNamespace + ".properties");
Files.write(someKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8);
Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8);
Files.append(anotherKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8);
Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8);
Files.append(lastKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
String someKeyValue = defaultConfig.getProperty(someKey, null);
String anotherKeyValue = defaultConfig.getProperty(anotherKey, null);
String lastKeyValue = defaultConfig.getProperty(lastKey, null);
//clean up
System.clearProperty(someKey);
assertEquals(someSystemPropertyValue, someKeyValue);
assertEquals(someLocalFileValue, anotherKeyValue);
assertEquals(someResourceValue, lastKeyValue);
assertEquals(someSourceType, defaultConfig.getSourceType());
}
@Test
public void testGetIntProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Integer someValue = 2;
Integer someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getIntProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetIntPropertyMultipleTimesWithCache() throws Exception {
String someKey = "someKey";
Integer someValue = 2;
Integer someDefaultValue = -1;
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
}
@Test
public void testGetIntPropertyMultipleTimesWithPropertyChanges() throws Exception {
String someKey = "someKey";
Integer someValue = 2;
Integer anotherValue = 3;
Integer someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
Properties anotherProperties = new Properties();
anotherProperties.setProperty(someKey, String.valueOf(anotherValue));
defaultConfig.onRepositoryChange(someNamespace, anotherProperties);
assertEquals(anotherValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
}
@Test
public void testGetIntPropertyMultipleTimesWithSmallCache() throws Exception {
String someKey = "someKey";
Integer someValue = 2;
String anotherKey = "anotherKey";
Integer anotherValue = 3;
Integer someDefaultValue = -1;
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithSmallCache());
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue));
when(someProperties.getProperty(anotherKey)).thenReturn(String.valueOf(anotherValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue));
assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(anotherKey);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(2)).getProperty(someKey);
}
@Test
public void testGetIntPropertyMultipleTimesWithShortExpireTime() throws Exception {
final String someKey = "someKey";
final Integer someValue = 2;
final Integer someDefaultValue = -1;
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithShortExpireTime());
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
final DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
await().atMost(500, TimeUnit.MILLISECONDS).untilAsserted(new ThrowingRunnable() {
@Override
public void run() throws Throwable {
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(2)).getProperty(someKey);
}
});
}
@Test
public void testGetLongProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Long someValue = 2L;
Long someDefaultValue = -1L;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getLongProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getLongProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetShortProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Short someValue = 2;
Short someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getShortProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getShortProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetFloatProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Float someValue = 2.20f;
Float someDefaultValue = -1f;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getFloatProperty(someKey, someDefaultValue), 0.001);
assertEquals(someDefaultValue, defaultConfig.getFloatProperty(someStringKey, someDefaultValue), 0.001);
}
@Test
public void testGetDoubleProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Double someValue = 2.20d;
Double someDefaultValue = -1d;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getDoubleProperty(someKey, someDefaultValue), 0.001);
assertEquals(someDefaultValue, defaultConfig.getDoubleProperty(someStringKey, someDefaultValue), 0.001);
}
@Test
public void testGetByteProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Byte someValue = 10;
Byte someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getByteProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getByteProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetBooleanProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Boolean someValue = true;
Boolean someDefaultValue = false;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getBooleanProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getBooleanProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetArrayProperty() throws Exception {
String someKey = "someKey";
String someDelimiter = ",";
String someInvalidDelimiter = "{";
String[] values = new String[]{"a", "b", "c"};
String someValue = Joiner.on(someDelimiter).join(values);
String[] someDefaultValue = new String[]{"1", "2"};
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter,
someDefaultValue));
}
@Test
public void testGetArrayPropertyMultipleTimesWithCache() throws Exception {
String someKey = "someKey";
String someDelimiter = ",";
String someInvalidDelimiter = "{";
String[] values = new String[]{"a", "b", "c"};
String someValue = Joiner.on(someDelimiter).join(values);
String[] someDefaultValue = new String[]{"1", "2"};
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter,
someDefaultValue));
assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter,
someDefaultValue));
verify(someProperties, times(3)).getProperty(someKey);
}
@Test
public void testGetArrayPropertyMultipleTimesWithCacheAndValueChanges() throws Exception {
String someKey = "someKey";
String someDelimiter = ",";
String[] values = new String[]{"a", "b", "c"};
String[] anotherValues = new String[]{"b", "c", "d"};
String someValue = Joiner.on(someDelimiter).join(values);
String anotherValue = Joiner.on(someDelimiter).join(anotherValues);
String[] someDefaultValue = new String[]{"1", "2"};
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
Properties anotherProperties = new Properties();
anotherProperties.setProperty(someKey, anotherValue);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
defaultConfig.onRepositoryChange(someNamespace, anotherProperties);
assertArrayEquals(anotherValues, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
}
@Test
public void testGetDatePropertyWithFormat() throws Exception {
Date someDefaultValue = new Date();
Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0);
Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0);
Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123);
//set up config repo
someProperties = new Properties();
someProperties.setProperty("shortDateProperty", "2016-09-28");
someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10");
someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
checkDatePropertyWithFormat(defaultConfig, shortDate, "shortDateProperty", "yyyy-MM-dd", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, mediumDate, "mediumDateProperty", "yyyy-MM-dd HH:mm:ss",
someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, shortDate, "mediumDateProperty", "yyyy-MM-dd", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, longDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss.SSS",
someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, mediumDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, shortDate, "longDateProperty", "yyyy-MM-dd", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, someDefaultValue, "stringProperty", "yyyy-MM-dd", someDefaultValue);
}
@Test
public void testGetDatePropertyWithNoFormat() throws Exception {
Date someDefaultValue = new Date();
Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0);
Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0);
Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123);
//set up config repo
someProperties = new Properties();
someProperties.setProperty("shortDateProperty", "2016-09-28");
someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10");
someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
checkDatePropertyWithoutFormat(defaultConfig, shortDate, "shortDateProperty", someDefaultValue);
checkDatePropertyWithoutFormat(defaultConfig, mediumDate, "mediumDateProperty", someDefaultValue);
checkDatePropertyWithoutFormat(defaultConfig, longDate, "longDateProperty", someDefaultValue);
checkDatePropertyWithoutFormat(defaultConfig, someDefaultValue, "stringProperty", someDefaultValue);
}
@Test
public void testGetEnumProperty() throws Exception {
SomeEnum someDefaultValue = SomeEnum.defaultValue;
//set up config repo
someProperties = new Properties();
someProperties.setProperty("enumProperty", "someValue");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(SomeEnum.someValue, defaultConfig.getEnumProperty("enumProperty", SomeEnum.class, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getEnumProperty("stringProperty", SomeEnum.class, someDefaultValue));
}
@Test
public void testGetDurationProperty() throws Exception {
long someDefaultValue = 1000;
long result = 2 * 24 * 3600 * 1000 + 3 * 3600 * 1000 + 4 * 60 * 1000 + 5 * 1000 + 123;
//set up config repo
someProperties = new Properties();
someProperties.setProperty("durationProperty", "2D3H4m5S123ms");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(result, defaultConfig.getDurationProperty("durationProperty", someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getDurationProperty("stringProperty", someDefaultValue));
}
@Test
public void testOnRepositoryChange() throws Exception {
String someKey = "someKey";
String someSystemPropertyValue = "system-property-value";
String anotherKey = "anotherKey";
String someLocalFileValue = "local-file-value";
String keyToBeDeleted = "keyToBeDeleted";
String keyToBeDeletedValue = "keyToBeDeletedValue";
String yetAnotherKey = "yetAnotherKey";
String yetAnotherValue = "yetAnotherValue";
String yetAnotherResourceValue = "yetAnotherResourceValue";
//set up system property
System.setProperty(someKey, someSystemPropertyValue);
//set up config repo
someProperties = new Properties();
someProperties.putAll(ImmutableMap
.of(someKey, someLocalFileValue, anotherKey, someLocalFileValue, keyToBeDeleted,
keyToBeDeletedValue, yetAnotherKey, yetAnotherValue));
when(configRepository.getConfig()).thenReturn(someProperties);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getSourceType()).thenReturn(someSourceType);
//set up resource file
File resourceFile = new File(someResourceDir, someNamespace + ".properties");
Files.append(yetAnotherKey + "=" + yetAnotherResourceValue, resourceFile, Charsets.UTF_8);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someSourceType, defaultConfig.getSourceType());
final SettableFuture<ConfigChangeEvent> configChangeFuture = SettableFuture.create();
ConfigChangeListener someListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
configChangeFuture.set(changeEvent);
}
};
defaultConfig.addChangeListener(someListener);
Properties newProperties = new Properties();
String someKeyNewValue = "new-some-value";
String anotherKeyNewValue = "another-new-value";
String newKey = "newKey";
String newValue = "newValue";
newProperties.putAll(ImmutableMap
.of(someKey, someKeyNewValue, anotherKey, anotherKeyNewValue, newKey, newValue));
ConfigSourceType anotherSourceType = ConfigSourceType.REMOTE;
when(configRepository.getSourceType()).thenReturn(anotherSourceType);
defaultConfig.onRepositoryChange(someNamespace, newProperties);
ConfigChangeEvent changeEvent = configChangeFuture.get(500, TimeUnit.MILLISECONDS);
//clean up
System.clearProperty(someKey);
assertEquals(someNamespace, changeEvent.getNamespace());
assertEquals(4, changeEvent.changedKeys().size());
ConfigChange anotherKeyChange = changeEvent.getChange(anotherKey);
assertEquals(someLocalFileValue, anotherKeyChange.getOldValue());
assertEquals(anotherKeyNewValue, anotherKeyChange.getNewValue());
assertEquals(PropertyChangeType.MODIFIED, anotherKeyChange.getChangeType());
ConfigChange yetAnotherKeyChange = changeEvent.getChange(yetAnotherKey);
assertEquals(yetAnotherValue, yetAnotherKeyChange.getOldValue());
assertEquals(yetAnotherResourceValue, yetAnotherKeyChange.getNewValue());
assertEquals(PropertyChangeType.MODIFIED, yetAnotherKeyChange.getChangeType());
ConfigChange keyToBeDeletedChange = changeEvent.getChange(keyToBeDeleted);
assertEquals(keyToBeDeletedValue, keyToBeDeletedChange.getOldValue());
assertEquals(null, keyToBeDeletedChange.getNewValue());
assertEquals(PropertyChangeType.DELETED, keyToBeDeletedChange.getChangeType());
ConfigChange newKeyChange = changeEvent.getChange(newKey);
assertEquals(null, newKeyChange.getOldValue());
assertEquals(newValue, newKeyChange.getNewValue());
assertEquals(PropertyChangeType.ADDED, newKeyChange.getChangeType());
assertEquals(anotherSourceType, defaultConfig.getSourceType());
}
@Test
public void testFireConfigChangeWithInterestedKeys() throws Exception {
String someKeyChanged = "someKeyChanged";
String anotherKeyChanged = "anotherKeyChanged";
String someKeyNotChanged = "someKeyNotChanged";
String someNamespace = "someNamespace";
Map<String, ConfigChange> changes = Maps.newHashMap();
changes.put(someKeyChanged, mock(ConfigChange.class));
changes.put(anotherKeyChanged, mock(ConfigChange.class));
ConfigChangeEvent someChangeEvent = new ConfigChangeEvent(someNamespace, changes);
final SettableFuture<ConfigChangeEvent> interestedInAllKeysFuture = SettableFuture.create();
ConfigChangeListener interestedInAllKeys = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
interestedInAllKeysFuture.set(changeEvent);
}
};
final SettableFuture<ConfigChangeEvent> interestedInSomeKeyFuture = SettableFuture.create();
ConfigChangeListener interestedInSomeKey = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
interestedInSomeKeyFuture.set(changeEvent);
}
};
final SettableFuture<ConfigChangeEvent> interestedInSomeKeyNotChangedFuture = SettableFuture.create();
ConfigChangeListener interestedInSomeKeyNotChanged = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
interestedInSomeKeyNotChangedFuture.set(changeEvent);
}
};
DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class));
config.addChangeListener(interestedInAllKeys);
config.addChangeListener(interestedInSomeKey, Sets.newHashSet(someKeyChanged));
config.addChangeListener(interestedInSomeKeyNotChanged, Sets.newHashSet(someKeyNotChanged));
config.fireConfigChange(someChangeEvent);
ConfigChangeEvent changeEvent = interestedInAllKeysFuture.get(500, TimeUnit.MILLISECONDS);
assertEquals(someChangeEvent, changeEvent);
assertEquals(someChangeEvent, interestedInSomeKeyFuture.get(500, TimeUnit.MILLISECONDS));
assertFalse(interestedInSomeKeyNotChangedFuture.isDone());
}
@Test
public void testRemoveChangeListener() throws Exception {
String someNamespace = "someNamespace";
final ConfigChangeEvent someConfigChangeEvent = mock(ConfigChangeEvent.class);
ConfigChangeEvent anotherConfigChangeEvent = mock(ConfigChangeEvent.class);
final SettableFuture<ConfigChangeEvent> someListenerFuture1 = SettableFuture.create();
final SettableFuture<ConfigChangeEvent> someListenerFuture2 = SettableFuture.create();
ConfigChangeListener someListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
if (someConfigChangeEvent == changeEvent) {
someListenerFuture1.set(changeEvent);
} else {
someListenerFuture2.set(changeEvent);
}
}
};
final SettableFuture<ConfigChangeEvent> anotherListenerFuture1 = SettableFuture.create();
final SettableFuture<ConfigChangeEvent> anotherListenerFuture2 = SettableFuture.create();
ConfigChangeListener anotherListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
if (someConfigChangeEvent == changeEvent) {
anotherListenerFuture1.set(changeEvent);
} else {
anotherListenerFuture2.set(changeEvent);
}
}
};
ConfigChangeListener yetAnotherListener = mock(ConfigChangeListener.class);
DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class));
config.addChangeListener(someListener);
config.addChangeListener(anotherListener);
config.fireConfigChange(someConfigChangeEvent);
assertEquals(someConfigChangeEvent, someListenerFuture1.get(500, TimeUnit.MILLISECONDS));
assertEquals(someConfigChangeEvent, anotherListenerFuture1.get(500, TimeUnit.MILLISECONDS));
assertFalse(config.removeChangeListener(yetAnotherListener));
assertTrue(config.removeChangeListener(someListener));
config.fireConfigChange(anotherConfigChangeEvent);
assertEquals(anotherConfigChangeEvent, anotherListenerFuture2.get(500, TimeUnit.MILLISECONDS));
TimeUnit.MILLISECONDS.sleep(100);
assertFalse(someListenerFuture2.isDone());
}
@Test
public void testGetPropertyNames() {
String someKeyPrefix = "someKey";
String someValuePrefix = "someValue";
//set up config repo
someProperties = new Properties();
for (int i = 0; i < 10; i++) {
someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i);
}
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository);
Set<String> propertyNames = defaultConfig.getPropertyNames();
assertEquals(10, propertyNames.size());
assertEquals(someProperties.stringPropertyNames(), propertyNames);
}
@Test
public void testGetPropertyNamesWithOrderedProperties() {
String someKeyPrefix = "someKey";
String someValuePrefix = "someValue";
when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() {
@Override
public Properties answer(InvocationOnMock invocation) {
return new OrderedProperties();
}
});
//set up config repo
someProperties = new OrderedProperties();
for (int i = 0; i < 10; i++) {
someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i);
}
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository);
Set<String> propertyNames = defaultConfig.getPropertyNames();
assertEquals(10, propertyNames.size());
assertEquals(someProperties.stringPropertyNames(), propertyNames);
}
@Test
public void testGetPropertyNamesWithNullProp() {
when(configRepository.getConfig()).thenReturn(null);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
Set<String> propertyNames = defaultConfig.getPropertyNames();
assertEquals(Collections.emptySet(), propertyNames);
}
@Test
public void testGetPropertyWithFunction() throws Exception {
String someKey = "someKey";
String someValue = "a,b,c";
String someNullKey = "someNullKey";
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(defaultConfig.getProperty(someKey, new Function<String, List<String>>() {
@Override
public List<String> apply(String s) {
return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s);
}
}, Lists.<String>newArrayList()), Lists.newArrayList("a", "b", "c"));
assertEquals(defaultConfig.getProperty(someNullKey, new Function<String, List<String>>() {
@Override
public List<String> apply(String s) {
return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s);
}
}, Lists.<String>newArrayList()), Lists.newArrayList());
}
@Test
public void testLoadFromRepositoryFailedAndThenRecovered() {
String someKey = "someKey";
String someValue = "someValue";
String someDefaultValue = "someDefaultValue";
ConfigSourceType someSourceType = ConfigSourceType.REMOTE;
when(configRepository.getConfig()).thenThrow(mock(RuntimeException.class));
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
verify(configRepository, times(1)).addChangeListener(defaultConfig);
assertEquals(ConfigSourceType.NONE, defaultConfig.getSourceType());
assertEquals(someDefaultValue, defaultConfig.getProperty(someKey, someDefaultValue));
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getSourceType()).thenReturn(someSourceType);
defaultConfig.onRepositoryChange(someNamespace, someProperties);
assertEquals(someSourceType, defaultConfig.getSourceType());
assertEquals(someValue, defaultConfig.getProperty(someKey, someDefaultValue));
}
private void checkDatePropertyWithFormat(Config config, Date expected, String propertyName, String format, Date
defaultValue) {
assertEquals(expected, config.getDateProperty(propertyName, format, defaultValue));
}
private void checkDatePropertyWithoutFormat(Config config, Date expected, String propertyName, Date defaultValue) {
assertEquals(expected, config.getDateProperty(propertyName, defaultValue));
}
private Date assembleDate(int year, int month, int day, int hour, int minute, int second, int millisecond) {
Calendar date = Calendar.getInstance();
date.set(year, month - 1, day, hour, minute, second); //Month in Calendar is 0 based
date.set(Calendar.MILLISECOND, millisecond);
return date.getTime();
}
private enum SomeEnum {
someValue, defaultValue
}
public static class MockConfigUtil extends ConfigUtil {
@Override
public long getMaxConfigCacheSize() {
return 10;
}
@Override
public long getConfigCacheExpireTime() {
return 1;
}
@Override
public TimeUnit getConfigCacheExpireTimeUnit() {
return TimeUnit.MINUTES;
}
}
public static class MockConfigUtilWithSmallCache extends MockConfigUtil {
@Override
public long getMaxConfigCacheSize() {
return 1;
}
}
public static class MockConfigUtilWithShortExpireTime extends MockConfigUtil {
@Override
public long getConfigCacheExpireTime() {
return 50;
}
@Override
public TimeUnit getConfigCacheExpireTimeUnit() {
return TimeUnit.MILLISECONDS;
}
}
}
| package com.ctrip.framework.apollo.internals;
import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.enums.ConfigSourceType;
import com.ctrip.framework.apollo.util.OrderedProperties;
import com.ctrip.framework.apollo.util.factory.PropertiesFactory;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.io.File;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Function;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.awaitility.core.ThrowingRunnable;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigChangeListener;
import com.ctrip.framework.apollo.build.MockInjector;
import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil;
import com.ctrip.framework.apollo.enums.PropertyChangeType;
import com.ctrip.framework.apollo.model.ConfigChange;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.google.common.base.Charsets;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Files;
import com.google.common.util.concurrent.SettableFuture;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
/**
* @author Jason Song([email protected])
*/
public class DefaultConfigTest {
private File someResourceDir;
private String someNamespace;
private ConfigRepository configRepository;
private Properties someProperties;
private ConfigSourceType someSourceType;
private PropertiesFactory propertiesFactory;
@Before
public void setUp() throws Exception {
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtil());
propertiesFactory = mock(PropertiesFactory.class);
when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() {
@Override
public Properties answer(InvocationOnMock invocation) {
return new Properties();
}
});
MockInjector.setInstance(PropertiesFactory.class, propertiesFactory);
someResourceDir = new File(ClassLoaderUtil.getClassPath() + "/META-INF/config");
someResourceDir.mkdirs();
someNamespace = "someName";
configRepository = mock(ConfigRepository.class);
}
@After
public void tearDown() throws Exception {
MockInjector.reset();
recursiveDelete(someResourceDir);
}
//helper method to clean created files
private void recursiveDelete(File file) {
if (!file.exists()) {
return;
}
if (file.isDirectory()) {
for (File f : file.listFiles()) {
recursiveDelete(f);
}
}
file.delete();
}
@Test
public void testGetPropertyWithAllPropertyHierarchy() throws Exception {
String someKey = "someKey";
String someSystemPropertyValue = "system-property-value";
String anotherKey = "anotherKey";
String someLocalFileValue = "local-file-value";
String lastKey = "lastKey";
String someResourceValue = "resource-value";
//set up system property
System.setProperty(someKey, someSystemPropertyValue);
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someLocalFileValue);
someProperties.setProperty(anotherKey, someLocalFileValue);
when(configRepository.getConfig()).thenReturn(someProperties);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getSourceType()).thenReturn(someSourceType);
//set up resource file
File resourceFile = new File(someResourceDir, someNamespace + ".properties");
Files.write(someKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8);
Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8);
Files.append(anotherKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8);
Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8);
Files.append(lastKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
String someKeyValue = defaultConfig.getProperty(someKey, null);
String anotherKeyValue = defaultConfig.getProperty(anotherKey, null);
String lastKeyValue = defaultConfig.getProperty(lastKey, null);
//clean up
System.clearProperty(someKey);
assertEquals(someSystemPropertyValue, someKeyValue);
assertEquals(someLocalFileValue, anotherKeyValue);
assertEquals(someResourceValue, lastKeyValue);
assertEquals(someSourceType, defaultConfig.getSourceType());
}
@Test
public void testGetIntProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Integer someValue = 2;
Integer someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getIntProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetIntPropertyMultipleTimesWithCache() throws Exception {
String someKey = "someKey";
Integer someValue = 2;
Integer someDefaultValue = -1;
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
}
@Test
public void testGetIntPropertyMultipleTimesWithPropertyChanges() throws Exception {
String someKey = "someKey";
Integer someValue = 2;
Integer anotherValue = 3;
Integer someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
Properties anotherProperties = new Properties();
anotherProperties.setProperty(someKey, String.valueOf(anotherValue));
defaultConfig.onRepositoryChange(someNamespace, anotherProperties);
assertEquals(anotherValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
}
@Test
public void testGetIntPropertyMultipleTimesWithSmallCache() throws Exception {
String someKey = "someKey";
Integer someValue = 2;
String anotherKey = "anotherKey";
Integer anotherValue = 3;
Integer someDefaultValue = -1;
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithSmallCache());
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue));
when(someProperties.getProperty(anotherKey)).thenReturn(String.valueOf(anotherValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue));
assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(anotherKey);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(2)).getProperty(someKey);
}
@Test
public void testGetIntPropertyMultipleTimesWithShortExpireTime() throws Exception {
final String someKey = "someKey";
final Integer someValue = 2;
final Integer someDefaultValue = -1;
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithShortExpireTime());
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
final DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
await().atMost(500, TimeUnit.MILLISECONDS).untilAsserted(new ThrowingRunnable() {
@Override
public void run() throws Throwable {
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue));
verify(someProperties, times(2)).getProperty(someKey);
}
});
}
@Test
public void testGetLongProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Long someValue = 2L;
Long someDefaultValue = -1L;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getLongProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getLongProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetShortProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Short someValue = 2;
Short someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getShortProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getShortProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetFloatProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Float someValue = 2.20f;
Float someDefaultValue = -1f;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getFloatProperty(someKey, someDefaultValue), 0.001);
assertEquals(someDefaultValue, defaultConfig.getFloatProperty(someStringKey, someDefaultValue), 0.001);
}
@Test
public void testGetDoubleProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Double someValue = 2.20d;
Double someDefaultValue = -1d;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getDoubleProperty(someKey, someDefaultValue), 0.001);
assertEquals(someDefaultValue, defaultConfig.getDoubleProperty(someStringKey, someDefaultValue), 0.001);
}
@Test
public void testGetByteProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Byte someValue = 10;
Byte someDefaultValue = -1;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getByteProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getByteProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetBooleanProperty() throws Exception {
String someStringKey = "someStringKey";
String someStringValue = "someStringValue";
String someKey = "someKey";
Boolean someValue = true;
Boolean someDefaultValue = false;
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someStringKey, someStringValue);
someProperties.setProperty(someKey, String.valueOf(someValue));
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someValue, defaultConfig.getBooleanProperty(someKey, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getBooleanProperty(someStringKey, someDefaultValue));
}
@Test
public void testGetArrayProperty() throws Exception {
String someKey = "someKey";
String someDelimiter = ",";
String someInvalidDelimiter = "{";
String[] values = new String[]{"a", "b", "c"};
String someValue = Joiner.on(someDelimiter).join(values);
String[] someDefaultValue = new String[]{"1", "2"};
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter,
someDefaultValue));
}
@Test
public void testGetArrayPropertyMultipleTimesWithCache() throws Exception {
String someKey = "someKey";
String someDelimiter = ",";
String someInvalidDelimiter = "{";
String[] values = new String[]{"a", "b", "c"};
String someValue = Joiner.on(someDelimiter).join(values);
String[] someDefaultValue = new String[]{"1", "2"};
//set up config repo
someProperties = mock(Properties.class);
when(someProperties.getProperty(someKey)).thenReturn(someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
verify(someProperties, times(1)).getProperty(someKey);
assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter,
someDefaultValue));
assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter,
someDefaultValue));
verify(someProperties, times(3)).getProperty(someKey);
}
@Test
public void testGetArrayPropertyMultipleTimesWithCacheAndValueChanges() throws Exception {
String someKey = "someKey";
String someDelimiter = ",";
String[] values = new String[]{"a", "b", "c"};
String[] anotherValues = new String[]{"b", "c", "d"};
String someValue = Joiner.on(someDelimiter).join(values);
String anotherValue = Joiner.on(someDelimiter).join(anotherValues);
String[] someDefaultValue = new String[]{"1", "2"};
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
Properties anotherProperties = new Properties();
anotherProperties.setProperty(someKey, anotherValue);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
defaultConfig.onRepositoryChange(someNamespace, anotherProperties);
assertArrayEquals(anotherValues, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue));
}
@Test
public void testGetDatePropertyWithFormat() throws Exception {
Date someDefaultValue = new Date();
Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0);
Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0);
Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123);
//set up config repo
someProperties = new Properties();
someProperties.setProperty("shortDateProperty", "2016-09-28");
someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10");
someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
checkDatePropertyWithFormat(defaultConfig, shortDate, "shortDateProperty", "yyyy-MM-dd", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, mediumDate, "mediumDateProperty", "yyyy-MM-dd HH:mm:ss",
someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, shortDate, "mediumDateProperty", "yyyy-MM-dd", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, longDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss.SSS",
someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, mediumDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, shortDate, "longDateProperty", "yyyy-MM-dd", someDefaultValue);
checkDatePropertyWithFormat(defaultConfig, someDefaultValue, "stringProperty", "yyyy-MM-dd", someDefaultValue);
}
@Test
public void testGetDatePropertyWithNoFormat() throws Exception {
Date someDefaultValue = new Date();
Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0);
Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0);
Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123);
//set up config repo
someProperties = new Properties();
someProperties.setProperty("shortDateProperty", "2016-09-28");
someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10");
someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
checkDatePropertyWithoutFormat(defaultConfig, shortDate, "shortDateProperty", someDefaultValue);
checkDatePropertyWithoutFormat(defaultConfig, mediumDate, "mediumDateProperty", someDefaultValue);
checkDatePropertyWithoutFormat(defaultConfig, longDate, "longDateProperty", someDefaultValue);
checkDatePropertyWithoutFormat(defaultConfig, someDefaultValue, "stringProperty", someDefaultValue);
}
@Test
public void testGetEnumProperty() throws Exception {
SomeEnum someDefaultValue = SomeEnum.defaultValue;
//set up config repo
someProperties = new Properties();
someProperties.setProperty("enumProperty", "someValue");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(SomeEnum.someValue, defaultConfig.getEnumProperty("enumProperty", SomeEnum.class, someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getEnumProperty("stringProperty", SomeEnum.class, someDefaultValue));
}
@Test
public void testGetDurationProperty() throws Exception {
long someDefaultValue = 1000;
long result = 2 * 24 * 3600 * 1000 + 3 * 3600 * 1000 + 4 * 60 * 1000 + 5 * 1000 + 123;
//set up config repo
someProperties = new Properties();
someProperties.setProperty("durationProperty", "2D3H4m5S123ms");
someProperties.setProperty("stringProperty", "someString");
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(result, defaultConfig.getDurationProperty("durationProperty", someDefaultValue));
assertEquals(someDefaultValue, defaultConfig.getDurationProperty("stringProperty", someDefaultValue));
}
@Test
public void testOnRepositoryChange() throws Exception {
String someKey = "someKey";
String someSystemPropertyValue = "system-property-value";
String anotherKey = "anotherKey";
String someLocalFileValue = "local-file-value";
String keyToBeDeleted = "keyToBeDeleted";
String keyToBeDeletedValue = "keyToBeDeletedValue";
String yetAnotherKey = "yetAnotherKey";
String yetAnotherValue = "yetAnotherValue";
String yetAnotherResourceValue = "yetAnotherResourceValue";
//set up system property
System.setProperty(someKey, someSystemPropertyValue);
//set up config repo
someProperties = new Properties();
someProperties.putAll(ImmutableMap
.of(someKey, someLocalFileValue, anotherKey, someLocalFileValue, keyToBeDeleted,
keyToBeDeletedValue, yetAnotherKey, yetAnotherValue));
when(configRepository.getConfig()).thenReturn(someProperties);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getSourceType()).thenReturn(someSourceType);
//set up resource file
File resourceFile = new File(someResourceDir, someNamespace + ".properties");
Files.append(yetAnotherKey + "=" + yetAnotherResourceValue, resourceFile, Charsets.UTF_8);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(someSourceType, defaultConfig.getSourceType());
final SettableFuture<ConfigChangeEvent> configChangeFuture = SettableFuture.create();
ConfigChangeListener someListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
configChangeFuture.set(changeEvent);
}
};
defaultConfig.addChangeListener(someListener);
Properties newProperties = new Properties();
String someKeyNewValue = "new-some-value";
String anotherKeyNewValue = "another-new-value";
String newKey = "newKey";
String newValue = "newValue";
newProperties.putAll(ImmutableMap
.of(someKey, someKeyNewValue, anotherKey, anotherKeyNewValue, newKey, newValue));
ConfigSourceType anotherSourceType = ConfigSourceType.REMOTE;
when(configRepository.getSourceType()).thenReturn(anotherSourceType);
defaultConfig.onRepositoryChange(someNamespace, newProperties);
ConfigChangeEvent changeEvent = configChangeFuture.get(500, TimeUnit.MILLISECONDS);
//clean up
System.clearProperty(someKey);
assertEquals(someNamespace, changeEvent.getNamespace());
assertEquals(4, changeEvent.changedKeys().size());
ConfigChange anotherKeyChange = changeEvent.getChange(anotherKey);
assertEquals(someLocalFileValue, anotherKeyChange.getOldValue());
assertEquals(anotherKeyNewValue, anotherKeyChange.getNewValue());
assertEquals(PropertyChangeType.MODIFIED, anotherKeyChange.getChangeType());
ConfigChange yetAnotherKeyChange = changeEvent.getChange(yetAnotherKey);
assertEquals(yetAnotherValue, yetAnotherKeyChange.getOldValue());
assertEquals(yetAnotherResourceValue, yetAnotherKeyChange.getNewValue());
assertEquals(PropertyChangeType.MODIFIED, yetAnotherKeyChange.getChangeType());
ConfigChange keyToBeDeletedChange = changeEvent.getChange(keyToBeDeleted);
assertEquals(keyToBeDeletedValue, keyToBeDeletedChange.getOldValue());
assertEquals(null, keyToBeDeletedChange.getNewValue());
assertEquals(PropertyChangeType.DELETED, keyToBeDeletedChange.getChangeType());
ConfigChange newKeyChange = changeEvent.getChange(newKey);
assertEquals(null, newKeyChange.getOldValue());
assertEquals(newValue, newKeyChange.getNewValue());
assertEquals(PropertyChangeType.ADDED, newKeyChange.getChangeType());
assertEquals(anotherSourceType, defaultConfig.getSourceType());
}
@Test
public void testFireConfigChangeWithInterestedKeys() throws Exception {
String someKeyChanged = "someKeyChanged";
String anotherKeyChanged = "anotherKeyChanged";
String someKeyNotChanged = "someKeyNotChanged";
String someNamespace = "someNamespace";
Map<String, ConfigChange> changes = Maps.newHashMap();
changes.put(someKeyChanged, mock(ConfigChange.class));
changes.put(anotherKeyChanged, mock(ConfigChange.class));
ConfigChangeEvent someChangeEvent = new ConfigChangeEvent(someNamespace, changes);
final SettableFuture<ConfigChangeEvent> interestedInAllKeysFuture = SettableFuture.create();
ConfigChangeListener interestedInAllKeys = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
interestedInAllKeysFuture.set(changeEvent);
}
};
final SettableFuture<ConfigChangeEvent> interestedInSomeKeyFuture = SettableFuture.create();
ConfigChangeListener interestedInSomeKey = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
interestedInSomeKeyFuture.set(changeEvent);
}
};
final SettableFuture<ConfigChangeEvent> interestedInSomeKeyNotChangedFuture = SettableFuture.create();
ConfigChangeListener interestedInSomeKeyNotChanged = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
interestedInSomeKeyNotChangedFuture.set(changeEvent);
}
};
DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class));
config.addChangeListener(interestedInAllKeys);
config.addChangeListener(interestedInSomeKey, Sets.newHashSet(someKeyChanged));
config.addChangeListener(interestedInSomeKeyNotChanged, Sets.newHashSet(someKeyNotChanged));
config.fireConfigChange(someChangeEvent);
ConfigChangeEvent changeEvent = interestedInAllKeysFuture.get(500, TimeUnit.MILLISECONDS);
assertEquals(someChangeEvent, changeEvent);
assertEquals(someChangeEvent, interestedInSomeKeyFuture.get(500, TimeUnit.MILLISECONDS));
assertFalse(interestedInSomeKeyNotChangedFuture.isDone());
}
@Test
public void testRemoveChangeListener() throws Exception {
String someNamespace = "someNamespace";
final ConfigChangeEvent someConfigChangeEvent = mock(ConfigChangeEvent.class);
ConfigChangeEvent anotherConfigChangeEvent = mock(ConfigChangeEvent.class);
final SettableFuture<ConfigChangeEvent> someListenerFuture1 = SettableFuture.create();
final SettableFuture<ConfigChangeEvent> someListenerFuture2 = SettableFuture.create();
ConfigChangeListener someListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
if (someConfigChangeEvent == changeEvent) {
someListenerFuture1.set(changeEvent);
} else {
someListenerFuture2.set(changeEvent);
}
}
};
final SettableFuture<ConfigChangeEvent> anotherListenerFuture1 = SettableFuture.create();
final SettableFuture<ConfigChangeEvent> anotherListenerFuture2 = SettableFuture.create();
ConfigChangeListener anotherListener = new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
if (someConfigChangeEvent == changeEvent) {
anotherListenerFuture1.set(changeEvent);
} else {
anotherListenerFuture2.set(changeEvent);
}
}
};
ConfigChangeListener yetAnotherListener = mock(ConfigChangeListener.class);
DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class));
config.addChangeListener(someListener);
config.addChangeListener(anotherListener);
config.fireConfigChange(someConfigChangeEvent);
assertEquals(someConfigChangeEvent, someListenerFuture1.get(500, TimeUnit.MILLISECONDS));
assertEquals(someConfigChangeEvent, anotherListenerFuture1.get(500, TimeUnit.MILLISECONDS));
assertFalse(config.removeChangeListener(yetAnotherListener));
assertTrue(config.removeChangeListener(someListener));
config.fireConfigChange(anotherConfigChangeEvent);
assertEquals(anotherConfigChangeEvent, anotherListenerFuture2.get(500, TimeUnit.MILLISECONDS));
TimeUnit.MILLISECONDS.sleep(100);
assertFalse(someListenerFuture2.isDone());
}
@Test
public void testGetPropertyNames() {
String someKeyPrefix = "someKey";
String someValuePrefix = "someValue";
//set up config repo
someProperties = new Properties();
for (int i = 0; i < 10; i++) {
someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i);
}
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository);
Set<String> propertyNames = defaultConfig.getPropertyNames();
assertEquals(10, propertyNames.size());
assertEquals(someProperties.stringPropertyNames(), propertyNames);
}
@Test
public void testGetPropertyNamesWithOrderedProperties() {
String someKeyPrefix = "someKey";
String someValuePrefix = "someValue";
when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() {
@Override
public Properties answer(InvocationOnMock invocation) {
return new OrderedProperties();
}
});
//set up config repo
someProperties = new OrderedProperties();
for (int i = 0; i < 10; i++) {
someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i);
}
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository);
Set<String> propertyNames = defaultConfig.getPropertyNames();
assertEquals(10, propertyNames.size());
assertEquals(someProperties.stringPropertyNames(), propertyNames);
}
@Test
public void testGetPropertyNamesWithNullProp() {
when(configRepository.getConfig()).thenReturn(null);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
Set<String> propertyNames = defaultConfig.getPropertyNames();
assertEquals(Collections.emptySet(), propertyNames);
}
@Test
public void testGetPropertyWithFunction() throws Exception {
String someKey = "someKey";
String someValue = "a,b,c";
String someNullKey = "someNullKey";
//set up config repo
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getConfig()).thenReturn(someProperties);
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
assertEquals(defaultConfig.getProperty(someKey, new Function<String, List<String>>() {
@Override
public List<String> apply(String s) {
return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s);
}
}, Lists.<String>newArrayList()), Lists.newArrayList("a", "b", "c"));
assertEquals(defaultConfig.getProperty(someNullKey, new Function<String, List<String>>() {
@Override
public List<String> apply(String s) {
return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s);
}
}, Lists.<String>newArrayList()), Lists.newArrayList());
}
@Test
public void testLoadFromRepositoryFailedAndThenRecovered() {
String someKey = "someKey";
String someValue = "someValue";
String someDefaultValue = "someDefaultValue";
ConfigSourceType someSourceType = ConfigSourceType.REMOTE;
when(configRepository.getConfig()).thenThrow(mock(RuntimeException.class));
DefaultConfig defaultConfig =
new DefaultConfig(someNamespace, configRepository);
verify(configRepository, times(1)).addChangeListener(defaultConfig);
assertEquals(ConfigSourceType.NONE, defaultConfig.getSourceType());
assertEquals(someDefaultValue, defaultConfig.getProperty(someKey, someDefaultValue));
someProperties = new Properties();
someProperties.setProperty(someKey, someValue);
when(configRepository.getSourceType()).thenReturn(someSourceType);
defaultConfig.onRepositoryChange(someNamespace, someProperties);
assertEquals(someSourceType, defaultConfig.getSourceType());
assertEquals(someValue, defaultConfig.getProperty(someKey, someDefaultValue));
}
private void checkDatePropertyWithFormat(Config config, Date expected, String propertyName, String format, Date
defaultValue) {
assertEquals(expected, config.getDateProperty(propertyName, format, defaultValue));
}
private void checkDatePropertyWithoutFormat(Config config, Date expected, String propertyName, Date defaultValue) {
assertEquals(expected, config.getDateProperty(propertyName, defaultValue));
}
private Date assembleDate(int year, int month, int day, int hour, int minute, int second, int millisecond) {
Calendar date = Calendar.getInstance();
date.set(year, month - 1, day, hour, minute, second); //Month in Calendar is 0 based
date.set(Calendar.MILLISECOND, millisecond);
return date.getTime();
}
private enum SomeEnum {
someValue, defaultValue
}
public static class MockConfigUtil extends ConfigUtil {
@Override
public long getMaxConfigCacheSize() {
return 10;
}
@Override
public long getConfigCacheExpireTime() {
return 1;
}
@Override
public TimeUnit getConfigCacheExpireTimeUnit() {
return TimeUnit.MINUTES;
}
}
public static class MockConfigUtilWithSmallCache extends MockConfigUtil {
@Override
public long getMaxConfigCacheSize() {
return 1;
}
}
public static class MockConfigUtilWithShortExpireTime extends MockConfigUtil {
@Override
public long getConfigCacheExpireTime() {
return 50;
}
@Override
public TimeUnit getConfigCacheExpireTimeUnit() {
return TimeUnit.MILLISECONDS;
}
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-mockserver/src/test/java/com/ctrip/framework/apollo/mockserver/ApolloMockServerSpringIntegrationTest.java | package com.ctrip.framework.apollo.mockserver;
import com.ctrip.framework.apollo.enums.PropertyChangeType;
import com.ctrip.framework.apollo.mockserver.ApolloMockServerSpringIntegrationTest.TestConfiguration;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.google.common.util.concurrent.SettableFuture;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import static org.junit.Assert.assertEquals;
/**
* Create by zhangzheng on 8/16/18 Email:[email protected]
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = TestConfiguration.class)
public class ApolloMockServerSpringIntegrationTest {
private static final String otherNamespace = "otherNamespace";
@ClassRule
public static EmbeddedApollo embeddedApollo = new EmbeddedApollo();
@Autowired
private TestBean testBean;
@Autowired
private TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean;
@Test
@DirtiesContext
public void testPropertyInject() {
assertEquals("value1", testBean.key1);
assertEquals("value2", testBean.key2);
}
@Test
@DirtiesContext
public void testListenerTriggeredByAdd() throws InterruptedException, ExecutionException, TimeoutException {
embeddedApollo.addOrModifyProperty(otherNamespace, "someKey", "someValue");
ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS);
assertEquals(otherNamespace, changeEvent.getNamespace());
assertEquals("someValue", changeEvent.getChange("someKey").getNewValue());
}
@Test
@DirtiesContext
public void testListenerTriggeredByDel()
throws InterruptedException, ExecutionException, TimeoutException {
embeddedApollo.deleteProperty(otherNamespace, "key1");
ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS);
assertEquals(otherNamespace, changeEvent.getNamespace());
assertEquals(PropertyChangeType.DELETED, changeEvent.getChange("key1").getChangeType());
}
@Test
@DirtiesContext
public void shouldNotifyOnInterestedPatterns() throws Exception {
embeddedApollo.addOrModifyProperty(otherNamespace, "server.port", "8080");
embeddedApollo.addOrModifyProperty(otherNamespace, "server.path", "/apollo");
embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "whatever");
ConfigChangeEvent changeEvent = testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS);
assertEquals(otherNamespace, changeEvent.getNamespace());
assertEquals("8080", changeEvent.getChange("server.port").getNewValue());
assertEquals("/apollo", changeEvent.getChange("server.path").getNewValue());
}
@Test(expected = TimeoutException.class)
@DirtiesContext
public void shouldNotNotifyOnUninterestedPatterns() throws Exception {
embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "apollo");
testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS);
}
@EnableApolloConfig
@Configuration
static class TestConfiguration {
@Bean
public TestBean testBean() {
return new TestBean();
}
@Bean
public TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean() {
return new TestInterestedKeyPrefixesBean();
}
}
private static class TestBean {
@Value("${key1:default}")
private String key1;
@Value("${key2:default}")
private String key2;
private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create();
@ApolloConfigChangeListener(otherNamespace)
private void onChange(ConfigChangeEvent changeEvent) {
futureData.set(changeEvent);
}
}
private static class TestInterestedKeyPrefixesBean {
private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create();
@ApolloConfigChangeListener(value = otherNamespace, interestedKeyPrefixes = "server.")
private void onChange(ConfigChangeEvent changeEvent) {
futureData.set(changeEvent);
}
}
}
| package com.ctrip.framework.apollo.mockserver;
import com.ctrip.framework.apollo.enums.PropertyChangeType;
import com.ctrip.framework.apollo.mockserver.ApolloMockServerSpringIntegrationTest.TestConfiguration;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.google.common.util.concurrent.SettableFuture;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import static org.junit.Assert.assertEquals;
/**
* Create by zhangzheng on 8/16/18 Email:[email protected]
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = TestConfiguration.class)
public class ApolloMockServerSpringIntegrationTest {
private static final String otherNamespace = "otherNamespace";
@ClassRule
public static EmbeddedApollo embeddedApollo = new EmbeddedApollo();
@Autowired
private TestBean testBean;
@Autowired
private TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean;
@Test
@DirtiesContext
public void testPropertyInject() {
assertEquals("value1", testBean.key1);
assertEquals("value2", testBean.key2);
}
@Test
@DirtiesContext
public void testListenerTriggeredByAdd() throws InterruptedException, ExecutionException, TimeoutException {
embeddedApollo.addOrModifyProperty(otherNamespace, "someKey", "someValue");
ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS);
assertEquals(otherNamespace, changeEvent.getNamespace());
assertEquals("someValue", changeEvent.getChange("someKey").getNewValue());
}
@Test
@DirtiesContext
public void testListenerTriggeredByDel()
throws InterruptedException, ExecutionException, TimeoutException {
embeddedApollo.deleteProperty(otherNamespace, "key1");
ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS);
assertEquals(otherNamespace, changeEvent.getNamespace());
assertEquals(PropertyChangeType.DELETED, changeEvent.getChange("key1").getChangeType());
}
@Test
@DirtiesContext
public void shouldNotifyOnInterestedPatterns() throws Exception {
embeddedApollo.addOrModifyProperty(otherNamespace, "server.port", "8080");
embeddedApollo.addOrModifyProperty(otherNamespace, "server.path", "/apollo");
embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "whatever");
ConfigChangeEvent changeEvent = testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS);
assertEquals(otherNamespace, changeEvent.getNamespace());
assertEquals("8080", changeEvent.getChange("server.port").getNewValue());
assertEquals("/apollo", changeEvent.getChange("server.path").getNewValue());
}
@Test(expected = TimeoutException.class)
@DirtiesContext
public void shouldNotNotifyOnUninterestedPatterns() throws Exception {
embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "apollo");
testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS);
}
@EnableApolloConfig
@Configuration
static class TestConfiguration {
@Bean
public TestBean testBean() {
return new TestBean();
}
@Bean
public TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean() {
return new TestInterestedKeyPrefixesBean();
}
}
private static class TestBean {
@Value("${key1:default}")
private String key1;
@Value("${key2:default}")
private String key2;
private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create();
@ApolloConfigChangeListener(otherNamespace)
private void onChange(ConfigChangeEvent changeEvent) {
futureData.set(changeEvent);
}
}
private static class TestInterestedKeyPrefixesBean {
private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create();
@ApolloConfigChangeListener(value = otherNamespace, interestedKeyPrefixes = "server.")
private void onChange(ConfigChangeEvent changeEvent) {
futureData.set(changeEvent);
}
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/dto/NamespaceReleaseDTO.java | package com.ctrip.framework.apollo.openapi.dto;
public class NamespaceReleaseDTO {
private String releaseTitle;
private String releaseComment;
private String releasedBy;
private boolean isEmergencyPublish;
public String getReleaseTitle() {
return releaseTitle;
}
public void setReleaseTitle(String releaseTitle) {
this.releaseTitle = releaseTitle;
}
public String getReleaseComment() {
return releaseComment;
}
public void setReleaseComment(String releaseComment) {
this.releaseComment = releaseComment;
}
public String getReleasedBy() {
return releasedBy;
}
public void setReleasedBy(String releasedBy) {
this.releasedBy = releasedBy;
}
public boolean isEmergencyPublish() {
return isEmergencyPublish;
}
public void setEmergencyPublish(boolean emergencyPublish) {
isEmergencyPublish = emergencyPublish;
}
}
| package com.ctrip.framework.apollo.openapi.dto;
public class NamespaceReleaseDTO {
private String releaseTitle;
private String releaseComment;
private String releasedBy;
private boolean isEmergencyPublish;
public String getReleaseTitle() {
return releaseTitle;
}
public void setReleaseTitle(String releaseTitle) {
this.releaseTitle = releaseTitle;
}
public String getReleaseComment() {
return releaseComment;
}
public void setReleaseComment(String releaseComment) {
this.releaseComment = releaseComment;
}
public String getReleasedBy() {
return releasedBy;
}
public void setReleasedBy(String releasedBy) {
this.releasedBy = releasedBy;
}
public boolean isEmergencyPublish() {
return isEmergencyPublish;
}
public void setEmergencyPublish(boolean emergencyPublish) {
isEmergencyPublish = emergencyPublish;
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java | package com.ctrip.framework.apollo.portal.service;
import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import com.ctrip.framework.apollo.portal.component.PermissionValidator;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.entity.bo.ConfigBO;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.portal.util.ConfigFileUtils;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collection;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@Service
public class ConfigsExportService {
private static final Logger logger = LoggerFactory.getLogger(ConfigsExportService.class);
private final AppService appService;
private final ClusterService clusterService;
private final NamespaceService namespaceService;
private final PortalSettings portalSettings;
private final PermissionValidator permissionValidator;
public ConfigsExportService(
AppService appService,
ClusterService clusterService,
final @Lazy NamespaceService namespaceService,
PortalSettings portalSettings,
PermissionValidator permissionValidator) {
this.appService = appService;
this.clusterService = clusterService;
this.namespaceService = namespaceService;
this.portalSettings = portalSettings;
this.permissionValidator = permissionValidator;
}
/**
* write multiple namespace to a zip. use {@link Stream#reduce(Object, BiFunction,
* BinaryOperator)} to forbid concurrent write.
*
* @param configBOStream namespace's stream
* @param outputStream receive zip file output stream
* @throws IOException if happen write problem
*/
private static void writeAsZipOutputStream(
Stream<ConfigBO> configBOStream, OutputStream outputStream) throws IOException {
try (final ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
final Consumer<ConfigBO> configBOConsumer =
configBO -> {
try {
// TODO, Stream.reduce will cause some problems. Is There other way to speed up the
// downloading?
synchronized (zipOutputStream) {
write2ZipOutputStream(zipOutputStream, configBO);
}
} catch (IOException e) {
logger.error("Write error. {}", configBO);
throw new IllegalStateException(e);
}
};
configBOStream.forEach(configBOConsumer);
}
}
/**
* write {@link ConfigBO} as file to {@link ZipOutputStream}. Watch out the concurrent problem!
* zip output stream is same like cannot write concurrently! the name of file is determined by
* {@link ConfigFileUtils#toFilename(String, String, String, ConfigFileFormat)}. the path of file
* is determined by {@link ConfigFileUtils#toFilePath(String, String, Env, String)}.
*
* @param zipOutputStream zip file output stream
* @param configBO a namespace represent
* @return zip file output stream same as parameter zipOutputStream
*/
private static ZipOutputStream write2ZipOutputStream(
final ZipOutputStream zipOutputStream, final ConfigBO configBO) throws IOException {
final Env env = configBO.getEnv();
final String ownerName = configBO.getOwnerName();
final String appId = configBO.getAppId();
final String clusterName = configBO.getClusterName();
final String namespace = configBO.getNamespace();
final String configFileContent = configBO.getConfigFileContent();
final ConfigFileFormat configFileFormat = configBO.getFormat();
final String configFilename =
ConfigFileUtils.toFilename(appId, clusterName, namespace, configFileFormat);
final String filePath = ConfigFileUtils.toFilePath(ownerName, appId, env, configFilename);
final ZipEntry zipEntry = new ZipEntry(filePath);
try {
zipOutputStream.putNextEntry(zipEntry);
zipOutputStream.write(configFileContent.getBytes());
zipOutputStream.closeEntry();
} catch (IOException e) {
logger.error("config export failed. {}", configBO);
throw new IOException("config export failed", e);
}
return zipOutputStream;
}
/** @return the namespaces current user exists */
private Stream<ConfigBO> makeStreamBy(
final Env env, final String ownerName, final String appId, final String clusterName) {
final List<NamespaceBO> namespaceBOS =
namespaceService.findNamespaceBOs(appId, env, clusterName);
final Function<NamespaceBO, ConfigBO> function =
namespaceBO -> new ConfigBO(env, ownerName, appId, clusterName, namespaceBO);
return namespaceBOS.parallelStream().map(function);
}
private Stream<ConfigBO> makeStreamBy(final Env env, final String ownerName, final String appId) {
final List<ClusterDTO> clusterDTOS = clusterService.findClusters(env, appId);
final Function<ClusterDTO, Stream<ConfigBO>> function =
clusterDTO -> this.makeStreamBy(env, ownerName, appId, clusterDTO.getName());
return clusterDTOS.parallelStream().flatMap(function);
}
private Stream<ConfigBO> makeStreamBy(final Env env, final List<App> apps) {
final Function<App, Stream<ConfigBO>> function =
app -> this.makeStreamBy(env, app.getOwnerName(), app.getAppId());
return apps.parallelStream().flatMap(function);
}
private Stream<ConfigBO> makeStreamBy(final Collection<Env> envs) {
// get all apps
final List<App> apps = appService.findAll();
// permission check
final Predicate<App> isAppAdmin =
app -> {
try {
return permissionValidator.isAppAdmin(app.getAppId());
} catch (Exception e) {
logger.error("app = {}", app);
logger.error(app.getAppId());
}
return false;
};
// app admin permission filter
final List<App> appsExistPermission =
apps.stream().filter(isAppAdmin).collect(Collectors.toList());
return envs.parallelStream().flatMap(env -> this.makeStreamBy(env, appsExistPermission));
}
/**
* Export all projects which current user own them. Permission check by {@link
* PermissionValidator#isAppAdmin(java.lang.String)}
*
* @param outputStream network file download stream to user
* @throws IOException if happen write problem
*/
public void exportAllTo(OutputStream outputStream) throws IOException {
final List<Env> activeEnvs = portalSettings.getActiveEnvs();
final Stream<ConfigBO> configBOStream = this.makeStreamBy(activeEnvs);
writeAsZipOutputStream(configBOStream, outputStream);
}
}
| package com.ctrip.framework.apollo.portal.service;
import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import com.ctrip.framework.apollo.portal.component.PermissionValidator;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.entity.bo.ConfigBO;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.portal.util.ConfigFileUtils;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collection;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@Service
public class ConfigsExportService {
private static final Logger logger = LoggerFactory.getLogger(ConfigsExportService.class);
private final AppService appService;
private final ClusterService clusterService;
private final NamespaceService namespaceService;
private final PortalSettings portalSettings;
private final PermissionValidator permissionValidator;
public ConfigsExportService(
AppService appService,
ClusterService clusterService,
final @Lazy NamespaceService namespaceService,
PortalSettings portalSettings,
PermissionValidator permissionValidator) {
this.appService = appService;
this.clusterService = clusterService;
this.namespaceService = namespaceService;
this.portalSettings = portalSettings;
this.permissionValidator = permissionValidator;
}
/**
* write multiple namespace to a zip. use {@link Stream#reduce(Object, BiFunction,
* BinaryOperator)} to forbid concurrent write.
*
* @param configBOStream namespace's stream
* @param outputStream receive zip file output stream
* @throws IOException if happen write problem
*/
private static void writeAsZipOutputStream(
Stream<ConfigBO> configBOStream, OutputStream outputStream) throws IOException {
try (final ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
final Consumer<ConfigBO> configBOConsumer =
configBO -> {
try {
// TODO, Stream.reduce will cause some problems. Is There other way to speed up the
// downloading?
synchronized (zipOutputStream) {
write2ZipOutputStream(zipOutputStream, configBO);
}
} catch (IOException e) {
logger.error("Write error. {}", configBO);
throw new IllegalStateException(e);
}
};
configBOStream.forEach(configBOConsumer);
}
}
/**
* write {@link ConfigBO} as file to {@link ZipOutputStream}. Watch out the concurrent problem!
* zip output stream is same like cannot write concurrently! the name of file is determined by
* {@link ConfigFileUtils#toFilename(String, String, String, ConfigFileFormat)}. the path of file
* is determined by {@link ConfigFileUtils#toFilePath(String, String, Env, String)}.
*
* @param zipOutputStream zip file output stream
* @param configBO a namespace represent
* @return zip file output stream same as parameter zipOutputStream
*/
private static ZipOutputStream write2ZipOutputStream(
final ZipOutputStream zipOutputStream, final ConfigBO configBO) throws IOException {
final Env env = configBO.getEnv();
final String ownerName = configBO.getOwnerName();
final String appId = configBO.getAppId();
final String clusterName = configBO.getClusterName();
final String namespace = configBO.getNamespace();
final String configFileContent = configBO.getConfigFileContent();
final ConfigFileFormat configFileFormat = configBO.getFormat();
final String configFilename =
ConfigFileUtils.toFilename(appId, clusterName, namespace, configFileFormat);
final String filePath = ConfigFileUtils.toFilePath(ownerName, appId, env, configFilename);
final ZipEntry zipEntry = new ZipEntry(filePath);
try {
zipOutputStream.putNextEntry(zipEntry);
zipOutputStream.write(configFileContent.getBytes());
zipOutputStream.closeEntry();
} catch (IOException e) {
logger.error("config export failed. {}", configBO);
throw new IOException("config export failed", e);
}
return zipOutputStream;
}
/** @return the namespaces current user exists */
private Stream<ConfigBO> makeStreamBy(
final Env env, final String ownerName, final String appId, final String clusterName) {
final List<NamespaceBO> namespaceBOS =
namespaceService.findNamespaceBOs(appId, env, clusterName);
final Function<NamespaceBO, ConfigBO> function =
namespaceBO -> new ConfigBO(env, ownerName, appId, clusterName, namespaceBO);
return namespaceBOS.parallelStream().map(function);
}
private Stream<ConfigBO> makeStreamBy(final Env env, final String ownerName, final String appId) {
final List<ClusterDTO> clusterDTOS = clusterService.findClusters(env, appId);
final Function<ClusterDTO, Stream<ConfigBO>> function =
clusterDTO -> this.makeStreamBy(env, ownerName, appId, clusterDTO.getName());
return clusterDTOS.parallelStream().flatMap(function);
}
private Stream<ConfigBO> makeStreamBy(final Env env, final List<App> apps) {
final Function<App, Stream<ConfigBO>> function =
app -> this.makeStreamBy(env, app.getOwnerName(), app.getAppId());
return apps.parallelStream().flatMap(function);
}
private Stream<ConfigBO> makeStreamBy(final Collection<Env> envs) {
// get all apps
final List<App> apps = appService.findAll();
// permission check
final Predicate<App> isAppAdmin =
app -> {
try {
return permissionValidator.isAppAdmin(app.getAppId());
} catch (Exception e) {
logger.error("app = {}", app);
logger.error(app.getAppId());
}
return false;
};
// app admin permission filter
final List<App> appsExistPermission =
apps.stream().filter(isAppAdmin).collect(Collectors.toList());
return envs.parallelStream().flatMap(env -> this.makeStreamBy(env, appsExistPermission));
}
/**
* Export all projects which current user own them. Permission check by {@link
* PermissionValidator#isAppAdmin(java.lang.String)}
*
* @param outputStream network file download stream to user
* @throws IOException if happen write problem
*/
public void exportAllTo(OutputStream outputStream) throws IOException {
final List<Env> activeEnvs = portalSettings.getActiveEnvs();
final Stream<ConfigBO> configBOStream = this.makeStreamBy(activeEnvs);
writeAsZipOutputStream(configBOStream, outputStream);
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-portal/src/main/resources/static/vendor/angular/ui-bootstrap-tpls-0.13.0.min.js | /*
* angular-ui-bootstrap
* http://angular-ui.github.io/bootstrap/
* Version: 0.13.0 - 2015-05-02
* License: MIT
*/
angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse", "ui.bootstrap.accordion", "ui.bootstrap.alert", "ui.bootstrap.bindHtml", "ui.bootstrap.buttons", "ui.bootstrap.carousel", "ui.bootstrap.dateparser", "ui.bootstrap.position", "ui.bootstrap.datepicker", "ui.bootstrap.dropdown", "ui.bootstrap.modal", "ui.bootstrap.pagination", "ui.bootstrap.tooltip", "ui.bootstrap.popover", "ui.bootstrap.progressbar", "ui.bootstrap.rating", "ui.bootstrap.tabs", "ui.bootstrap.timepicker", "ui.bootstrap.transition", "ui.bootstrap.typeahead"]), angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html", "template/accordion/accordion.html", "template/alert/alert.html", "template/carousel/carousel.html", "template/carousel/slide.html", "template/datepicker/datepicker.html", "template/datepicker/day.html", "template/datepicker/month.html", "template/datepicker/popup.html", "template/datepicker/year.html", "template/modal/backdrop.html", "template/modal/window.html", "template/pagination/pager.html", "template/pagination/pagination.html", "template/tooltip/tooltip-html-popup.html", "template/tooltip/tooltip-html-unsafe-popup.html", "template/tooltip/tooltip-popup.html", "template/tooltip/tooltip-template-popup.html", "template/popover/popover-template.html", "template/popover/popover.html", "template/progressbar/bar.html", "template/progressbar/progress.html", "template/progressbar/progressbar.html", "template/rating/rating.html", "template/tabs/tab.html", "template/tabs/tabset.html", "template/timepicker/timepicker.html", "template/typeahead/typeahead-match.html", "template/typeahead/typeahead-popup.html"]), angular.module("ui.bootstrap.collapse", []).directive("collapse", ["$animate", function (a) {
return {
link: function (b, c, d) {
function e() {
c.removeClass("collapse").addClass("collapsing"), a.addClass(c, "in", {to: {height: c[0].scrollHeight + "px"}}).then(f)
}
function f() {
c.removeClass("collapsing"), c.css({height: "auto"})
}
function g() {
c.css({height: c[0].scrollHeight + "px"}).removeClass("collapse").addClass("collapsing"), a.removeClass(c, "in", {to: {height: "0"}}).then(h)
}
function h() {
c.css({height: "0"}), c.removeClass("collapsing"), c.addClass("collapse")
}
b.$watch(d.collapse, function (a) {
a ? g() : e()
})
}
}
}]), angular.module("ui.bootstrap.accordion", ["ui.bootstrap.collapse"]).constant("accordionConfig", {closeOthers: !0}).controller("AccordionController", ["$scope", "$attrs", "accordionConfig", function (a, b, c) {
this.groups = [], this.closeOthers = function (d) {
var e = angular.isDefined(b.closeOthers) ? a.$eval(b.closeOthers) : c.closeOthers;
e && angular.forEach(this.groups, function (a) {
a !== d && (a.isOpen = !1)
})
}, this.addGroup = function (a) {
var b = this;
this.groups.push(a), a.$on("$destroy", function () {
b.removeGroup(a)
})
}, this.removeGroup = function (a) {
var b = this.groups.indexOf(a);
-1 !== b && this.groups.splice(b, 1)
}
}]).directive("accordion", function () {
return {
restrict: "EA",
controller: "AccordionController",
transclude: !0,
replace: !1,
templateUrl: "template/accordion/accordion.html"
}
}).directive("accordionGroup", function () {
return {
require: "^accordion",
restrict: "EA",
transclude: !0,
replace: !0,
templateUrl: "template/accordion/accordion-group.html",
scope: {heading: "@", isOpen: "=?", isDisabled: "=?"},
controller: function () {
this.setHeading = function (a) {
this.heading = a
}
},
link: function (a, b, c, d) {
d.addGroup(a), a.$watch("isOpen", function (b) {
b && d.closeOthers(a)
}), a.toggleOpen = function () {
a.isDisabled || (a.isOpen = !a.isOpen)
}
}
}
}).directive("accordionHeading", function () {
return {
restrict: "EA",
transclude: !0,
template: "",
replace: !0,
require: "^accordionGroup",
link: function (a, b, c, d, e) {
d.setHeading(e(a, angular.noop))
}
}
}).directive("accordionTransclude", function () {
return {
require: "^accordionGroup", link: function (a, b, c, d) {
a.$watch(function () {
return d[c.accordionTransclude]
}, function (a) {
a && (b.html(""), b.append(a))
})
}
}
}), angular.module("ui.bootstrap.alert", []).controller("AlertController", ["$scope", "$attrs", function (a, b) {
a.closeable = "close" in b, this.close = a.close
}]).directive("alert", function () {
return {
restrict: "EA",
controller: "AlertController",
templateUrl: "template/alert/alert.html",
transclude: !0,
replace: !0,
scope: {type: "@", close: "&"}
}
}).directive("dismissOnTimeout", ["$timeout", function (a) {
return {
require: "alert", link: function (b, c, d, e) {
a(function () {
e.close()
}, parseInt(d.dismissOnTimeout, 10))
}
}
}]), angular.module("ui.bootstrap.bindHtml", []).directive("bindHtmlUnsafe", function () {
return function (a, b, c) {
b.addClass("ng-binding").data("$binding", c.bindHtmlUnsafe), a.$watch(c.bindHtmlUnsafe, function (a) {
b.html(a || "")
})
}
}), angular.module("ui.bootstrap.buttons", []).constant("buttonConfig", {
activeClass: "active",
toggleEvent: "click"
}).controller("ButtonsController", ["buttonConfig", function (a) {
this.activeClass = a.activeClass || "active", this.toggleEvent = a.toggleEvent || "click"
}]).directive("btnRadio", function () {
return {
require: ["btnRadio", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) {
var e = d[0], f = d[1];
f.$render = function () {
b.toggleClass(e.activeClass, angular.equals(f.$modelValue, a.$eval(c.btnRadio)))
}, b.bind(e.toggleEvent, function () {
var d = b.hasClass(e.activeClass);
(!d || angular.isDefined(c.uncheckable)) && a.$apply(function () {
f.$setViewValue(d ? null : a.$eval(c.btnRadio)), f.$render()
})
})
}
}
}).directive("btnCheckbox", function () {
return {
require: ["btnCheckbox", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) {
function e() {
return g(c.btnCheckboxTrue, !0)
}
function f() {
return g(c.btnCheckboxFalse, !1)
}
function g(b, c) {
var d = a.$eval(b);
return angular.isDefined(d) ? d : c
}
var h = d[0], i = d[1];
i.$render = function () {
b.toggleClass(h.activeClass, angular.equals(i.$modelValue, e()))
}, b.bind(h.toggleEvent, function () {
a.$apply(function () {
i.$setViewValue(b.hasClass(h.activeClass) ? f() : e()), i.$render()
})
})
}
}
}), angular.module("ui.bootstrap.carousel", []).controller("CarouselController", ["$scope", "$interval", "$animate", function (a, b, c) {
function d(a) {
if (angular.isUndefined(k[a].index))return k[a];
{
var b;
k.length
}
for (b = 0; b < k.length; ++b)if (k[b].index == a)return k[b]
}
function e() {
f();
var c = +a.interval;
!isNaN(c) && c > 0 && (h = b(g, c))
}
function f() {
h && (b.cancel(h), h = null)
}
function g() {
var b = +a.interval;
i && !isNaN(b) && b > 0 ? a.next() : a.pause()
}
var h, i, j = this, k = j.slides = a.slides = [], l = -1;
j.currentSlide = null;
var m = !1;
j.select = a.select = function (b, d) {
function f() {
m || (angular.extend(b, {direction: d, active: !0}), angular.extend(j.currentSlide || {}, {
direction: d,
active: !1
}), c.enabled() && !a.noTransition && b.$element && (a.$currentTransition = !0, b.$element.one("$animate:close", function () {
a.$currentTransition = null
})), j.currentSlide = b, l = g, e())
}
var g = j.indexOfSlide(b);
void 0 === d && (d = g > j.getCurrentIndex() ? "next" : "prev"), b && b !== j.currentSlide && f()
}, a.$on("$destroy", function () {
m = !0
}), j.getCurrentIndex = function () {
return j.currentSlide && angular.isDefined(j.currentSlide.index) ? +j.currentSlide.index : l
}, j.indexOfSlide = function (a) {
return angular.isDefined(a.index) ? +a.index : k.indexOf(a)
}, a.next = function () {
var b = (j.getCurrentIndex() + 1) % k.length;
return a.$currentTransition ? void 0 : j.select(d(b), "next")
}, a.prev = function () {
var b = j.getCurrentIndex() - 1 < 0 ? k.length - 1 : j.getCurrentIndex() - 1;
return a.$currentTransition ? void 0 : j.select(d(b), "prev")
}, a.isActive = function (a) {
return j.currentSlide === a
}, a.$watch("interval", e), a.$on("$destroy", f), a.play = function () {
i || (i = !0, e())
}, a.pause = function () {
a.noPause || (i = !1, f())
}, j.addSlide = function (b, c) {
b.$element = c, k.push(b), 1 === k.length || b.active ? (j.select(k[k.length - 1]), 1 == k.length && a.play()) : b.active = !1
}, j.removeSlide = function (a) {
angular.isDefined(a.index) && k.sort(function (a, b) {
return +a.index > +b.index
});
var b = k.indexOf(a);
k.splice(b, 1), k.length > 0 && a.active ? j.select(b >= k.length ? k[b - 1] : k[b]) : l > b && l--
}
}]).directive("carousel", [function () {
return {
restrict: "EA",
transclude: !0,
replace: !0,
controller: "CarouselController",
require: "carousel",
templateUrl: "template/carousel/carousel.html",
scope: {interval: "=", noTransition: "=", noPause: "="}
}
}]).directive("slide", function () {
return {
require: "^carousel",
restrict: "EA",
transclude: !0,
replace: !0,
templateUrl: "template/carousel/slide.html",
scope: {active: "=?", index: "=?"},
link: function (a, b, c, d) {
d.addSlide(a, b), a.$on("$destroy", function () {
d.removeSlide(a)
}), a.$watch("active", function (b) {
b && d.select(a)
})
}
}
}).animation(".item", ["$animate", function (a) {
return {
beforeAddClass: function (b, c, d) {
if ("active" == c && b.parent() && !b.parent().scope().noTransition) {
var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right";
return b.addClass(f), a.addClass(b, g).then(function () {
e || b.removeClass(g + " " + f), d()
}), function () {
e = !0
}
}
d()
}, beforeRemoveClass: function (b, c, d) {
if ("active" == c && b.parent() && !b.parent().scope().noTransition) {
var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right";
return a.addClass(b, g).then(function () {
e || b.removeClass(g), d()
}), function () {
e = !0
}
}
d()
}
}
}]), angular.module("ui.bootstrap.dateparser", []).service("dateParser", ["$locale", "orderByFilter", function (a, b) {
function c(a) {
var c = [], d = a.split("");
return angular.forEach(f, function (b, e) {
var f = a.indexOf(e);
if (f > -1) {
a = a.split(""), d[f] = "(" + b.regex + ")", a[f] = "$";
for (var g = f + 1, h = f + e.length; h > g; g++)d[g] = "", a[g] = "$";
a = a.join(""), c.push({index: f, apply: b.apply})
}
}), {regex: new RegExp("^" + d.join("") + "$"), map: b(c, "index")}
}
function d(a, b, c) {
return 1 > c ? !1 : 1 === b && c > 28 ? 29 === c && (a % 4 === 0 && a % 100 !== 0 || a % 400 === 0) : 3 === b || 5 === b || 8 === b || 10 === b ? 31 > c : !0
}
var e = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
this.parsers = {};
var f = {
yyyy: {
regex: "\\d{4}", apply: function (a) {
this.year = +a
}
},
yy: {
regex: "\\d{2}", apply: function (a) {
this.year = +a + 2e3
}
},
y: {
regex: "\\d{1,4}", apply: function (a) {
this.year = +a
}
},
MMMM: {
regex: a.DATETIME_FORMATS.MONTH.join("|"), apply: function (b) {
this.month = a.DATETIME_FORMATS.MONTH.indexOf(b)
}
},
MMM: {
regex: a.DATETIME_FORMATS.SHORTMONTH.join("|"), apply: function (b) {
this.month = a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)
}
},
MM: {
regex: "0[1-9]|1[0-2]", apply: function (a) {
this.month = a - 1
}
},
M: {
regex: "[1-9]|1[0-2]", apply: function (a) {
this.month = a - 1
}
},
dd: {
regex: "[0-2][0-9]{1}|3[0-1]{1}", apply: function (a) {
this.date = +a
}
},
d: {
regex: "[1-2]?[0-9]{1}|3[0-1]{1}", apply: function (a) {
this.date = +a
}
},
EEEE: {regex: a.DATETIME_FORMATS.DAY.join("|")},
EEE: {regex: a.DATETIME_FORMATS.SHORTDAY.join("|")},
HH: {
regex: "(?:0|1)[0-9]|2[0-3]", apply: function (a) {
this.hours = +a
}
},
H: {
regex: "1?[0-9]|2[0-3]", apply: function (a) {
this.hours = +a
}
},
mm: {
regex: "[0-5][0-9]", apply: function (a) {
this.minutes = +a
}
},
m: {
regex: "[0-9]|[1-5][0-9]", apply: function (a) {
this.minutes = +a
}
},
sss: {
regex: "[0-9][0-9][0-9]", apply: function (a) {
this.milliseconds = +a
}
},
ss: {
regex: "[0-5][0-9]", apply: function (a) {
this.seconds = +a
}
},
s: {
regex: "[0-9]|[1-5][0-9]", apply: function (a) {
this.seconds = +a
}
}
};
this.parse = function (b, f, g) {
if (!angular.isString(b) || !f)return b;
f = a.DATETIME_FORMATS[f] || f, f = f.replace(e, "\\$&"), this.parsers[f] || (this.parsers[f] = c(f));
var h = this.parsers[f], i = h.regex, j = h.map, k = b.match(i);
if (k && k.length) {
var l, m;
l = g ? {
year: g.getFullYear(),
month: g.getMonth(),
date: g.getDate(),
hours: g.getHours(),
minutes: g.getMinutes(),
seconds: g.getSeconds(),
milliseconds: g.getMilliseconds()
} : {year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0};
for (var n = 1, o = k.length; o > n; n++) {
var p = j[n - 1];
p.apply && p.apply.call(l, k[n])
}
return d(l.year, l.month, l.date) && (m = new Date(l.year, l.month, l.date, l.hours, l.minutes, l.seconds, l.milliseconds || 0)), m
}
}
}]), angular.module("ui.bootstrap.position", []).factory("$position", ["$document", "$window", function (a, b) {
function c(a, c) {
return a.currentStyle ? a.currentStyle[c] : b.getComputedStyle ? b.getComputedStyle(a)[c] : a.style[c]
}
function d(a) {
return "static" === (c(a, "position") || "static")
}
var e = function (b) {
for (var c = a[0], e = b.offsetParent || c; e && e !== c && d(e);)e = e.offsetParent;
return e || c
};
return {
position: function (b) {
var c = this.offset(b), d = {top: 0, left: 0}, f = e(b[0]);
f != a[0] && (d = this.offset(angular.element(f)), d.top += f.clientTop - f.scrollTop, d.left += f.clientLeft - f.scrollLeft);
var g = b[0].getBoundingClientRect();
return {
width: g.width || b.prop("offsetWidth"),
height: g.height || b.prop("offsetHeight"),
top: c.top - d.top,
left: c.left - d.left
}
}, offset: function (c) {
var d = c[0].getBoundingClientRect();
return {
width: d.width || c.prop("offsetWidth"),
height: d.height || c.prop("offsetHeight"),
top: d.top + (b.pageYOffset || a[0].documentElement.scrollTop),
left: d.left + (b.pageXOffset || a[0].documentElement.scrollLeft)
}
}, positionElements: function (a, b, c, d) {
var e, f, g, h, i = c.split("-"), j = i[0], k = i[1] || "center";
e = d ? this.offset(a) : this.position(a), f = b.prop("offsetWidth"), g = b.prop("offsetHeight");
var l = {
center: function () {
return e.left + e.width / 2 - f / 2
}, left: function () {
return e.left
}, right: function () {
return e.left + e.width
}
}, m = {
center: function () {
return e.top + e.height / 2 - g / 2
}, top: function () {
return e.top
}, bottom: function () {
return e.top + e.height
}
};
switch (j) {
case"right":
h = {top: m[k](), left: l[j]()};
break;
case"left":
h = {top: m[k](), left: e.left - f};
break;
case"bottom":
h = {top: m[j](), left: l[k]()};
break;
default:
h = {top: e.top - g, left: l[k]()}
}
return h
}
}
}]), angular.module("ui.bootstrap.datepicker", ["ui.bootstrap.dateparser", "ui.bootstrap.position"]).constant("datepickerConfig", {
formatDay: "dd",
formatMonth: "MMMM",
formatYear: "yyyy",
formatDayHeader: "EEE",
formatDayTitle: "MMMM yyyy",
formatMonthTitle: "yyyy",
datepickerMode: "day",
minMode: "day",
maxMode: "year",
showWeeks: !0,
startingDay: 0,
yearRange: 20,
minDate: null,
maxDate: null,
shortcutPropagation: !1
}).controller("DatepickerController", ["$scope", "$attrs", "$parse", "$interpolate", "$timeout", "$log", "dateFilter", "datepickerConfig", function (a, b, c, d, e, f, g, h) {
var i = this, j = {$setViewValue: angular.noop};
this.modes = ["day", "month", "year"], angular.forEach(["formatDay", "formatMonth", "formatYear", "formatDayHeader", "formatDayTitle", "formatMonthTitle", "minMode", "maxMode", "showWeeks", "startingDay", "yearRange", "shortcutPropagation"], function (c, e) {
i[c] = angular.isDefined(b[c]) ? 8 > e ? d(b[c])(a.$parent) : a.$parent.$eval(b[c]) : h[c]
}), angular.forEach(["minDate", "maxDate"], function (d) {
b[d] ? a.$parent.$watch(c(b[d]), function (a) {
i[d] = a ? new Date(a) : null, i.refreshView()
}) : i[d] = h[d] ? new Date(h[d]) : null
}), a.datepickerMode = a.datepickerMode || h.datepickerMode, a.maxMode = i.maxMode, a.uniqueId = "datepicker-" + a.$id + "-" + Math.floor(1e4 * Math.random()), angular.isDefined(b.initDate) ? (this.activeDate = a.$parent.$eval(b.initDate) || new Date, a.$parent.$watch(b.initDate, function (a) {
a && (j.$isEmpty(j.$modelValue) || j.$invalid) && (i.activeDate = a, i.refreshView())
})) : this.activeDate = new Date, a.isActive = function (b) {
return 0 === i.compare(b.date, i.activeDate) ? (a.activeDateId = b.uid, !0) : !1
}, this.init = function (a) {
j = a, j.$render = function () {
i.render()
}
}, this.render = function () {
if (j.$viewValue) {
var a = new Date(j.$viewValue), b = !isNaN(a);
b ? this.activeDate = a : f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'), j.$setValidity("date", b)
}
this.refreshView()
}, this.refreshView = function () {
if (this.element) {
this._refreshView();
var a = j.$viewValue ? new Date(j.$viewValue) : null;
j.$setValidity("date-disabled", !a || this.element && !this.isDisabled(a))
}
}, this.createDateObject = function (a, b) {
var c = j.$viewValue ? new Date(j.$viewValue) : null;
return {
date: a,
label: g(a, b),
selected: c && 0 === this.compare(a, c),
disabled: this.isDisabled(a),
current: 0 === this.compare(a, new Date),
customClass: this.customClass(a)
}
}, this.isDisabled = function (c) {
return this.minDate && this.compare(c, this.minDate) < 0 || this.maxDate && this.compare(c, this.maxDate) > 0 || b.dateDisabled && a.dateDisabled({
date: c,
mode: a.datepickerMode
})
}, this.customClass = function (b) {
return a.customClass({date: b, mode: a.datepickerMode})
}, this.split = function (a, b) {
for (var c = []; a.length > 0;)c.push(a.splice(0, b));
return c
}, a.select = function (b) {
if (a.datepickerMode === i.minMode) {
var c = j.$viewValue ? new Date(j.$viewValue) : new Date(0, 0, 0, 0, 0, 0, 0);
c.setFullYear(b.getFullYear(), b.getMonth(), b.getDate()), j.$setViewValue(c), j.$render()
} else i.activeDate = b, a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) - 1]
}, a.move = function (a) {
var b = i.activeDate.getFullYear() + a * (i.step.years || 0), c = i.activeDate.getMonth() + a * (i.step.months || 0);
i.activeDate.setFullYear(b, c, 1), i.refreshView()
}, a.toggleMode = function (b) {
b = b || 1, a.datepickerMode === i.maxMode && 1 === b || a.datepickerMode === i.minMode && -1 === b || (a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) + b])
}, a.keys = {
13: "enter",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down"
};
var k = function () {
e(function () {
i.element[0].focus()
}, 0, !1)
};
a.$on("datepicker.focus", k), a.keydown = function (b) {
var c = a.keys[b.which];
if (c && !b.shiftKey && !b.altKey)if (b.preventDefault(), i.shortcutPropagation || b.stopPropagation(), "enter" === c || "space" === c) {
if (i.isDisabled(i.activeDate))return;
a.select(i.activeDate), k()
} else!b.ctrlKey || "up" !== c && "down" !== c ? (i.handleKeyDown(c, b), i.refreshView()) : (a.toggleMode("up" === c ? 1 : -1), k())
}
}]).directive("datepicker", function () {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/datepicker.html",
scope: {datepickerMode: "=?", dateDisabled: "&", customClass: "&", shortcutPropagation: "&?"},
require: ["datepicker", "?^ngModel"],
controller: "DatepickerController",
link: function (a, b, c, d) {
var e = d[0], f = d[1];
f && e.init(f)
}
}
}).directive("daypicker", ["dateFilter", function (a) {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/day.html",
require: "^datepicker",
link: function (b, c, d, e) {
function f(a, b) {
return 1 !== b || a % 4 !== 0 || a % 100 === 0 && a % 400 !== 0 ? i[b] : 29
}
function g(a, b) {
var c = new Array(b), d = new Date(a), e = 0;
for (d.setHours(12); b > e;)c[e++] = new Date(d), d.setDate(d.getDate() + 1);
return c
}
function h(a) {
var b = new Date(a);
b.setDate(b.getDate() + 4 - (b.getDay() || 7));
var c = b.getTime();
return b.setMonth(0), b.setDate(1), Math.floor(Math.round((c - b) / 864e5) / 7) + 1
}
b.showWeeks = e.showWeeks, e.step = {months: 1}, e.element = c;
var i = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
e._refreshView = function () {
var c = e.activeDate.getFullYear(), d = e.activeDate.getMonth(), f = new Date(c, d, 1), i = e.startingDay - f.getDay(), j = i > 0 ? 7 - i : -i, k = new Date(f);
j > 0 && k.setDate(-j + 1);
for (var l = g(k, 42), m = 0; 42 > m; m++)l[m] = angular.extend(e.createDateObject(l[m], e.formatDay), {
secondary: l[m].getMonth() !== d,
uid: b.uniqueId + "-" + m
});
b.labels = new Array(7);
for (var n = 0; 7 > n; n++)b.labels[n] = {
abbr: a(l[n].date, e.formatDayHeader),
full: a(l[n].date, "EEEE")
};
if (b.title = a(e.activeDate, e.formatDayTitle), b.rows = e.split(l, 7), b.showWeeks) {
b.weekNumbers = [];
for (var o = (11 - e.startingDay) % 7, p = b.rows.length, q = 0; p > q; q++)b.weekNumbers.push(h(b.rows[q][o].date))
}
}, e.compare = function (a, b) {
return new Date(a.getFullYear(), a.getMonth(), a.getDate()) - new Date(b.getFullYear(), b.getMonth(), b.getDate())
}, e.handleKeyDown = function (a) {
var b = e.activeDate.getDate();
if ("left" === a)b -= 1; else if ("up" === a)b -= 7; else if ("right" === a)b += 1; else if ("down" === a)b += 7; else if ("pageup" === a || "pagedown" === a) {
var c = e.activeDate.getMonth() + ("pageup" === a ? -1 : 1);
e.activeDate.setMonth(c, 1), b = Math.min(f(e.activeDate.getFullYear(), e.activeDate.getMonth()), b)
} else"home" === a ? b = 1 : "end" === a && (b = f(e.activeDate.getFullYear(), e.activeDate.getMonth()));
e.activeDate.setDate(b)
}, e.refreshView()
}
}
}]).directive("monthpicker", ["dateFilter", function (a) {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/month.html",
require: "^datepicker",
link: function (b, c, d, e) {
e.step = {years: 1}, e.element = c, e._refreshView = function () {
for (var c = new Array(12), d = e.activeDate.getFullYear(), f = 0; 12 > f; f++)c[f] = angular.extend(e.createDateObject(new Date(d, f, 1), e.formatMonth), {uid: b.uniqueId + "-" + f});
b.title = a(e.activeDate, e.formatMonthTitle), b.rows = e.split(c, 3)
}, e.compare = function (a, b) {
return new Date(a.getFullYear(), a.getMonth()) - new Date(b.getFullYear(), b.getMonth())
}, e.handleKeyDown = function (a) {
var b = e.activeDate.getMonth();
if ("left" === a)b -= 1; else if ("up" === a)b -= 3; else if ("right" === a)b += 1; else if ("down" === a)b += 3; else if ("pageup" === a || "pagedown" === a) {
var c = e.activeDate.getFullYear() + ("pageup" === a ? -1 : 1);
e.activeDate.setFullYear(c)
} else"home" === a ? b = 0 : "end" === a && (b = 11);
e.activeDate.setMonth(b)
}, e.refreshView()
}
}
}]).directive("yearpicker", ["dateFilter", function () {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/year.html",
require: "^datepicker",
link: function (a, b, c, d) {
function e(a) {
return parseInt((a - 1) / f, 10) * f + 1
}
var f = d.yearRange;
d.step = {years: f}, d.element = b, d._refreshView = function () {
for (var b = new Array(f), c = 0, g = e(d.activeDate.getFullYear()); f > c; c++)b[c] = angular.extend(d.createDateObject(new Date(g + c, 0, 1), d.formatYear), {uid: a.uniqueId + "-" + c});
a.title = [b[0].label, b[f - 1].label].join(" - "), a.rows = d.split(b, 5)
}, d.compare = function (a, b) {
return a.getFullYear() - b.getFullYear()
}, d.handleKeyDown = function (a) {
var b = d.activeDate.getFullYear();
"left" === a ? b -= 1 : "up" === a ? b -= 5 : "right" === a ? b += 1 : "down" === a ? b += 5 : "pageup" === a || "pagedown" === a ? b += ("pageup" === a ? -1 : 1) * d.step.years : "home" === a ? b = e(d.activeDate.getFullYear()) : "end" === a && (b = e(d.activeDate.getFullYear()) + f - 1), d.activeDate.setFullYear(b)
}, d.refreshView()
}
}
}]).constant("datepickerPopupConfig", {
datepickerPopup: "yyyy-MM-dd",
html5Types: {date: "yyyy-MM-dd", "datetime-local": "yyyy-MM-ddTHH:mm:ss.sss", month: "yyyy-MM"},
currentText: "Today",
clearText: "Clear",
closeText: "Done",
closeOnDateSelection: !0,
appendToBody: !1,
showButtonBar: !0
}).directive("datepickerPopup", ["$compile", "$parse", "$document", "$position", "dateFilter", "dateParser", "datepickerPopupConfig", function (a, b, c, d, e, f, g) {
return {
restrict: "EA",
require: "ngModel",
scope: {isOpen: "=?", currentText: "@", clearText: "@", closeText: "@", dateDisabled: "&", customClass: "&"},
link: function (h, i, j, k) {
function l(a) {
return a.replace(/([A-Z])/g, function (a) {
return "-" + a.toLowerCase()
})
}
function m(a) {
if (angular.isNumber(a) && (a = new Date(a)), a) {
if (angular.isDate(a) && !isNaN(a))return a;
if (angular.isString(a)) {
var b = f.parse(a, o, h.date) || new Date(a);
return isNaN(b) ? void 0 : b
}
return void 0
}
return null
}
function n(a, b) {
var c = a || b;
if (angular.isNumber(c) && (c = new Date(c)), c) {
if (angular.isDate(c) && !isNaN(c))return !0;
if (angular.isString(c)) {
var d = f.parse(c, o) || new Date(c);
return !isNaN(d)
}
return !1
}
return !0
}
var o, p = angular.isDefined(j.closeOnDateSelection) ? h.$parent.$eval(j.closeOnDateSelection) : g.closeOnDateSelection, q = angular.isDefined(j.datepickerAppendToBody) ? h.$parent.$eval(j.datepickerAppendToBody) : g.appendToBody;
h.showButtonBar = angular.isDefined(j.showButtonBar) ? h.$parent.$eval(j.showButtonBar) : g.showButtonBar, h.getText = function (a) {
return h[a + "Text"] || g[a + "Text"]
};
var r = !1;
if (g.html5Types[j.type] ? (o = g.html5Types[j.type], r = !0) : (o = j.datepickerPopup || g.datepickerPopup, j.$observe("datepickerPopup", function (a) {
var b = a || g.datepickerPopup;
if (b !== o && (o = b, k.$modelValue = null, !o))throw new Error("datepickerPopup must have a date format specified.")
})), !o)throw new Error("datepickerPopup must have a date format specified.");
if (r && j.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");
var s = angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");
s.attr({"ng-model": "date", "ng-change": "dateSelection()"});
var t = angular.element(s.children()[0]);
if (r && "month" == j.type && (t.attr("datepicker-mode", '"month"'), t.attr("min-mode", "month")), j.datepickerOptions) {
var u = h.$parent.$eval(j.datepickerOptions);
u.initDate && (h.initDate = u.initDate, t.attr("init-date", "initDate"), delete u.initDate), angular.forEach(u, function (a, b) {
t.attr(l(b), a)
})
}
h.watchData = {}, angular.forEach(["minDate", "maxDate", "datepickerMode", "initDate", "shortcutPropagation"], function (a) {
if (j[a]) {
var c = b(j[a]);
if (h.$parent.$watch(c, function (b) {
h.watchData[a] = b
}), t.attr(l(a), "watchData." + a), "datepickerMode" === a) {
var d = c.assign;
h.$watch("watchData." + a, function (a, b) {
a !== b && d(h.$parent, a)
})
}
}
}), j.dateDisabled && t.attr("date-disabled", "dateDisabled({ date: date, mode: mode })"), j.showWeeks && t.attr("show-weeks", j.showWeeks), j.customClass && t.attr("custom-class", "customClass({ date: date, mode: mode })"), r ? k.$formatters.push(function (a) {
return h.date = a, a
}) : (k.$$parserName = "date", k.$validators.date = n, k.$parsers.unshift(m), k.$formatters.push(function (a) {
return h.date = a, k.$isEmpty(a) ? a : e(a, o)
})), h.dateSelection = function (a) {
angular.isDefined(a) && (h.date = a);
var b = h.date ? e(h.date, o) : "";
i.val(b), k.$setViewValue(b), p && (h.isOpen = !1, i[0].focus())
}, k.$viewChangeListeners.push(function () {
h.date = f.parse(k.$viewValue, o, h.date) || new Date(k.$viewValue)
});
var v = function (a) {
h.isOpen && a.target !== i[0] && h.$apply(function () {
h.isOpen = !1
})
}, w = function (a) {
h.keydown(a)
};
i.bind("keydown", w), h.keydown = function (a) {
27 === a.which ? (a.preventDefault(), h.isOpen && a.stopPropagation(), h.close()) : 40 !== a.which || h.isOpen || (h.isOpen = !0)
}, h.$watch("isOpen", function (a) {
a ? (h.$broadcast("datepicker.focus"), h.position = q ? d.offset(i) : d.position(i), h.position.top = h.position.top + i.prop("offsetHeight"), c.bind("click", v)) : c.unbind("click", v)
}), h.select = function (a) {
if ("today" === a) {
var b = new Date;
angular.isDate(h.date) ? (a = new Date(h.date), a.setFullYear(b.getFullYear(), b.getMonth(), b.getDate())) : a = new Date(b.setHours(0, 0, 0, 0))
}
h.dateSelection(a)
}, h.close = function () {
h.isOpen = !1, i[0].focus()
};
var x = a(s)(h);
s.remove(), q ? c.find("body").append(x) : i.after(x), h.$on("$destroy", function () {
x.remove(), i.unbind("keydown", w), c.unbind("click", v)
})
}
}
}]).directive("datepickerPopupWrap", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
templateUrl: "template/datepicker/popup.html",
link: function (a, b) {
b.bind("click", function (a) {
a.preventDefault(), a.stopPropagation()
})
}
}
}), angular.module("ui.bootstrap.dropdown", ["ui.bootstrap.position"]).constant("dropdownConfig", {openClass: "open"}).service("dropdownService", ["$document", "$rootScope", function (a, b) {
var c = null;
this.open = function (b) {
c || (a.bind("click", d), a.bind("keydown", e)), c && c !== b && (c.isOpen = !1), c = b
}, this.close = function (b) {
c === b && (c = null, a.unbind("click", d), a.unbind("keydown", e))
};
var d = function (a) {
if (c && (!a || "disabled" !== c.getAutoClose())) {
var d = c.getToggleElement();
if (!(a && d && d[0].contains(a.target))) {
var e = c.getElement();
a && "outsideClick" === c.getAutoClose() && e && e[0].contains(a.target) || (c.isOpen = !1, b.$$phase || c.$apply())
}
}
}, e = function (a) {
27 === a.which && (c.focusToggleElement(), d())
}
}]).controller("DropdownController", ["$scope", "$attrs", "$parse", "dropdownConfig", "dropdownService", "$animate", "$position", "$document", function (a, b, c, d, e, f, g, h) {
var i, j = this, k = a.$new(), l = d.openClass, m = angular.noop, n = b.onToggle ? c(b.onToggle) : angular.noop, o = !1;
this.init = function (d) {
j.$element = d, b.isOpen && (i = c(b.isOpen), m = i.assign, a.$watch(i, function (a) {
k.isOpen = !!a
})), o = angular.isDefined(b.dropdownAppendToBody), o && j.dropdownMenu && (h.find("body").append(j.dropdownMenu), d.on("$destroy", function () {
j.dropdownMenu.remove()
}))
}, this.toggle = function (a) {
return k.isOpen = arguments.length ? !!a : !k.isOpen
}, this.isOpen = function () {
return k.isOpen
}, k.getToggleElement = function () {
return j.toggleElement
}, k.getAutoClose = function () {
return b.autoClose || "always"
}, k.getElement = function () {
return j.$element
}, k.focusToggleElement = function () {
j.toggleElement && j.toggleElement[0].focus()
}, k.$watch("isOpen", function (b, c) {
if (o && j.dropdownMenu) {
var d = g.positionElements(j.$element, j.dropdownMenu, "bottom-left", !0);
j.dropdownMenu.css({top: d.top + "px", left: d.left + "px", display: b ? "block" : "none"})
}
f[b ? "addClass" : "removeClass"](j.$element, l), b ? (k.focusToggleElement(), e.open(k)) : e.close(k), m(a, b), angular.isDefined(b) && b !== c && n(a, {open: !!b})
}), a.$on("$locationChangeSuccess", function () {
k.isOpen = !1
}), a.$on("$destroy", function () {
k.$destroy()
})
}]).directive("dropdown", function () {
return {
controller: "DropdownController", link: function (a, b, c, d) {
d.init(b)
}
}
}).directive("dropdownMenu", function () {
return {
restrict: "AC", require: "?^dropdown", link: function (a, b, c, d) {
d && (d.dropdownMenu = b)
}
}
}).directive("dropdownToggle", function () {
return {
require: "?^dropdown", link: function (a, b, c, d) {
if (d) {
d.toggleElement = b;
var e = function (e) {
e.preventDefault(), b.hasClass("disabled") || c.disabled || a.$apply(function () {
d.toggle()
})
};
b.bind("click", e), b.attr({
"aria-haspopup": !0,
"aria-expanded": !1
}), a.$watch(d.isOpen, function (a) {
b.attr("aria-expanded", !!a)
}), a.$on("$destroy", function () {
b.unbind("click", e)
})
}
}
}
}), angular.module("ui.bootstrap.modal", []).factory("$$stackedMap", function () {
return {
createNew: function () {
var a = [];
return {
add: function (b, c) {
a.push({key: b, value: c})
}, get: function (b) {
for (var c = 0; c < a.length; c++)if (b == a[c].key)return a[c]
}, keys: function () {
for (var b = [], c = 0; c < a.length; c++)b.push(a[c].key);
return b
}, top: function () {
return a[a.length - 1]
}, remove: function (b) {
for (var c = -1, d = 0; d < a.length; d++)if (b == a[d].key) {
c = d;
break
}
return a.splice(c, 1)[0]
}, removeTop: function () {
return a.splice(a.length - 1, 1)[0]
}, length: function () {
return a.length
}
}
}
}
}).directive("modalBackdrop", ["$timeout", function (a) {
function b(b) {
b.animate = !1, a(function () {
b.animate = !0
})
}
return {
restrict: "EA", replace: !0, templateUrl: "template/modal/backdrop.html", compile: function (a, c) {
return a.addClass(c.backdropClass), b
}
}
}]).directive("modalWindow", ["$modalStack", "$q", function (a, b) {
return {
restrict: "EA",
scope: {index: "@", animate: "="},
replace: !0,
transclude: !0,
templateUrl: function (a, b) {
return b.templateUrl || "template/modal/window.html"
},
link: function (c, d, e) {
d.addClass(e.windowClass || ""), c.size = e.size, c.close = function (b) {
var c = a.getTop();
c && c.value.backdrop && "static" != c.value.backdrop && b.target === b.currentTarget && (b.preventDefault(), b.stopPropagation(), a.dismiss(c.key, "backdrop click"))
}, c.$isRendered = !0;
var f = b.defer();
e.$observe("modalRender", function (a) {
"true" == a && f.resolve()
}), f.promise.then(function () {
c.animate = !0;
var b = d[0].querySelectorAll("[autofocus]");
b.length ? b[0].focus() : d[0].focus();
var e = a.getTop();
e && a.modalRendered(e.key)
})
}
}
}]).directive("modalAnimationClass", [function () {
return {
compile: function (a, b) {
b.modalAnimation && a.addClass(b.modalAnimationClass)
}
}
}]).directive("modalTransclude", function () {
return {
link: function (a, b, c, d, e) {
e(a.$parent, function (a) {
b.empty(), b.append(a)
})
}
}
}).factory("$modalStack", ["$animate", "$timeout", "$document", "$compile", "$rootScope", "$$stackedMap", function (a, b, c, d, e, f) {
function g() {
for (var a = -1, b = o.keys(), c = 0; c < b.length; c++)o.get(b[c]).value.backdrop && (a = c);
return a
}
function h(a) {
var b = c.find("body").eq(0), d = o.get(a).value;
o.remove(a), j(d.modalDomEl, d.modalScope, function () {
b.toggleClass(n, o.length() > 0), i()
})
}
function i() {
if (l && -1 == g()) {
var a = m;
j(l, m, function () {
a = null
}), l = void 0, m = void 0
}
}
function j(c, d, f) {
function g() {
g.done || (g.done = !0, c.remove(), d.$destroy(), f && f())
}
d.animate = !1, c.attr("modal-animation") && a.enabled() ? c.one("$animate:close", function () {
e.$evalAsync(g)
}) : b(g)
}
function k(a, b, c) {
return !a.value.modalScope.$broadcast("modal.closing", b, c).defaultPrevented
}
var l, m, n = "modal-open", o = f.createNew(), p = {};
return e.$watch(g, function (a) {
m && (m.index = a)
}), c.bind("keydown", function (a) {
var b;
27 === a.which && (b = o.top(), b && b.value.keyboard && (a.preventDefault(), e.$apply(function () {
p.dismiss(b.key, "escape key press")
})))
}), p.open = function (a, b) {
var f = c[0].activeElement;
o.add(a, {
deferred: b.deferred,
renderDeferred: b.renderDeferred,
modalScope: b.scope,
backdrop: b.backdrop,
keyboard: b.keyboard
});
var h = c.find("body").eq(0), i = g();
if (i >= 0 && !l) {
m = e.$new(!0), m.index = i;
var j = angular.element('<div modal-backdrop="modal-backdrop"></div>');
j.attr("backdrop-class", b.backdropClass), b.animation && j.attr("modal-animation", "true"), l = d(j)(m), h.append(l)
}
var k = angular.element('<div modal-window="modal-window"></div>');
k.attr({
"template-url": b.windowTemplateUrl,
"window-class": b.windowClass,
size: b.size,
index: o.length() - 1,
animate: "animate"
}).html(b.content), b.animation && k.attr("modal-animation", "true");
var p = d(k)(b.scope);
o.top().value.modalDomEl = p, o.top().value.modalOpener = f, h.append(p), h.addClass(n)
}, p.close = function (a, b) {
var c = o.get(a);
return c && k(c, b, !0) ? (c.value.deferred.resolve(b), h(a), c.value.modalOpener.focus(), !0) : !c
}, p.dismiss = function (a, b) {
var c = o.get(a);
return c && k(c, b, !1) ? (c.value.deferred.reject(b), h(a), c.value.modalOpener.focus(), !0) : !c
}, p.dismissAll = function (a) {
for (var b = this.getTop(); b && this.dismiss(b.key, a);)b = this.getTop()
}, p.getTop = function () {
return o.top()
}, p.modalRendered = function (a) {
var b = o.get(a);
b && b.value.renderDeferred.resolve()
}, p
}]).provider("$modal", function () {
var a = {
options: {animation: !0, backdrop: !0, keyboard: !0},
$get: ["$injector", "$rootScope", "$q", "$templateRequest", "$controller", "$modalStack", function (b, c, d, e, f, g) {
function h(a) {
return a.template ? d.when(a.template) : e(angular.isFunction(a.templateUrl) ? a.templateUrl() : a.templateUrl)
}
function i(a) {
var c = [];
return angular.forEach(a, function (a) {
(angular.isFunction(a) || angular.isArray(a)) && c.push(d.when(b.invoke(a)))
}), c
}
var j = {};
return j.open = function (b) {
var e = d.defer(), j = d.defer(), k = d.defer(), l = {
result: e.promise,
opened: j.promise,
rendered: k.promise,
close: function (a) {
return g.close(l, a)
},
dismiss: function (a) {
return g.dismiss(l, a)
}
};
if (b = angular.extend({}, a.options, b), b.resolve = b.resolve || {}, !b.template && !b.templateUrl)throw new Error("One of template or templateUrl options is required.");
var m = d.all([h(b)].concat(i(b.resolve)));
return m.then(function (a) {
var d = (b.scope || c).$new();
d.$close = l.close, d.$dismiss = l.dismiss;
var h, i = {}, j = 1;
b.controller && (i.$scope = d, i.$modalInstance = l, angular.forEach(b.resolve, function (b, c) {
i[c] = a[j++]
}), h = f(b.controller, i), b.controllerAs && (d[b.controllerAs] = h)), g.open(l, {
scope: d,
deferred: e,
renderDeferred: k,
content: a[0],
animation: b.animation,
backdrop: b.backdrop,
keyboard: b.keyboard,
backdropClass: b.backdropClass,
windowClass: b.windowClass,
windowTemplateUrl: b.windowTemplateUrl,
size: b.size
})
}, function (a) {
e.reject(a)
}), m.then(function () {
j.resolve(!0)
}, function (a) {
j.reject(a)
}), l
}, j
}]
};
return a
}), angular.module("ui.bootstrap.pagination", []).controller("PaginationController", ["$scope", "$attrs", "$parse", function (a, b, c) {
var d = this, e = {$setViewValue: angular.noop}, f = b.numPages ? c(b.numPages).assign : angular.noop;
this.init = function (g, h) {
e = g, this.config = h, e.$render = function () {
d.render()
}, b.itemsPerPage ? a.$parent.$watch(c(b.itemsPerPage), function (b) {
d.itemsPerPage = parseInt(b, 10), a.totalPages = d.calculateTotalPages()
}) : this.itemsPerPage = h.itemsPerPage, a.$watch("totalItems", function () {
a.totalPages = d.calculateTotalPages()
}), a.$watch("totalPages", function (b) {
f(a.$parent, b), a.page > b ? a.selectPage(b) : e.$render()
})
}, this.calculateTotalPages = function () {
var b = this.itemsPerPage < 1 ? 1 : Math.ceil(a.totalItems / this.itemsPerPage);
return Math.max(b || 0, 1)
}, this.render = function () {
a.page = parseInt(e.$viewValue, 10) || 1
}, a.selectPage = function (b, c) {
a.page !== b && b > 0 && b <= a.totalPages && (c && c.target && c.target.blur(), e.$setViewValue(b), e.$render())
}, a.getText = function (b) {
return a[b + "Text"] || d.config[b + "Text"]
}, a.noPrevious = function () {
return 1 === a.page
}, a.noNext = function () {
return a.page === a.totalPages
}
}]).constant("paginationConfig", {
itemsPerPage: 10,
boundaryLinks: !1,
directionLinks: !0,
firstText: "First",
previousText: "Previous",
nextText: "Next",
lastText: "Last",
rotate: !0
}).directive("pagination", ["$parse", "paginationConfig", function (a, b) {
return {
restrict: "EA",
scope: {totalItems: "=", firstText: "@", previousText: "@", nextText: "@", lastText: "@"},
require: ["pagination", "?ngModel"],
controller: "PaginationController",
templateUrl: "template/pagination/pagination.html",
replace: !0,
link: function (c, d, e, f) {
function g(a, b, c) {
return {number: a, text: b, active: c}
}
function h(a, b) {
var c = [], d = 1, e = b, f = angular.isDefined(k) && b > k;
f && (l ? (d = Math.max(a - Math.floor(k / 2), 1), e = d + k - 1, e > b && (e = b, d = e - k + 1)) : (d = (Math.ceil(a / k) - 1) * k + 1, e = Math.min(d + k - 1, b)));
for (var h = d; e >= h; h++) {
var i = g(h, h, h === a);
c.push(i)
}
if (f && !l) {
if (d > 1) {
var j = g(d - 1, "...", !1);
c.unshift(j)
}
if (b > e) {
var m = g(e + 1, "...", !1);
c.push(m)
}
}
return c
}
var i = f[0], j = f[1];
if (j) {
var k = angular.isDefined(e.maxSize) ? c.$parent.$eval(e.maxSize) : b.maxSize, l = angular.isDefined(e.rotate) ? c.$parent.$eval(e.rotate) : b.rotate;
c.boundaryLinks = angular.isDefined(e.boundaryLinks) ? c.$parent.$eval(e.boundaryLinks) : b.boundaryLinks, c.directionLinks = angular.isDefined(e.directionLinks) ? c.$parent.$eval(e.directionLinks) : b.directionLinks, i.init(j, b), e.maxSize && c.$parent.$watch(a(e.maxSize), function (a) {
k = parseInt(a, 10), i.render()
});
var m = i.render;
i.render = function () {
m(), c.page > 0 && c.page <= c.totalPages && (c.pages = h(c.page, c.totalPages))
}
}
}
}
}]).constant("pagerConfig", {
itemsPerPage: 10,
previousText: "« Previous",
nextText: "Next »",
align: !0
}).directive("pager", ["pagerConfig", function (a) {
return {
restrict: "EA",
scope: {totalItems: "=", previousText: "@", nextText: "@"},
require: ["pager", "?ngModel"],
controller: "PaginationController",
templateUrl: "template/pagination/pager.html",
replace: !0,
link: function (b, c, d, e) {
var f = e[0], g = e[1];
g && (b.align = angular.isDefined(d.align) ? b.$parent.$eval(d.align) : a.align, f.init(g, a))
}
}
}]), angular.module("ui.bootstrap.tooltip", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).provider("$tooltip", function () {
function a(a) {
var b = /[A-Z]/g, c = "-";
return a.replace(b, function (a, b) {
return (b ? c : "") + a.toLowerCase()
})
}
var b = {placement: "top", animation: !0, popupDelay: 0, useContentExp: !1}, c = {
mouseenter: "mouseleave",
click: "click",
focus: "blur"
}, d = {};
this.options = function (a) {
angular.extend(d, a)
}, this.setTriggers = function (a) {
angular.extend(c, a)
}, this.$get = ["$window", "$compile", "$timeout", "$document", "$position", "$interpolate", function (e, f, g, h, i, j) {
return function (e, k, l, m) {
function n(a) {
var b = a || m.trigger || l, d = c[b] || b;
return {show: b, hide: d}
}
m = angular.extend({}, b, d, m);
var o = a(e), p = j.startSymbol(), q = j.endSymbol(), r = "<div " + o + '-popup title="' + p + "title" + q + '" ' + (m.useContentExp ? 'content-exp="contentExp()" ' : 'content="' + p + "content" + q + '" ') + 'placement="' + p + "placement" + q + '" popup-class="' + p + "popupClass" + q + '" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';
return {
restrict: "EA", compile: function () {
var a = f(r);
return function (b, c, d) {
function f() {
E.isOpen ? l() : j()
}
function j() {
(!D || b.$eval(d[k + "Enable"])) && (s(), E.popupDelay ? A || (A = g(o, E.popupDelay, !1), A.then(function (a) {
a()
})) : o()())
}
function l() {
b.$apply(function () {
p()
})
}
function o() {
return A = null, z && (g.cancel(z), z = null), (m.useContentExp ? E.contentExp() : E.content) ? (q(), x.css({
top: 0,
left: 0,
display: "block"
}), E.$digest(), F(), E.isOpen = !0, E.$apply(), F) : angular.noop
}
function p() {
E.isOpen = !1, g.cancel(A), A = null, E.animation ? z || (z = g(r, 500)) : r()
}
function q() {
x && r(), y = E.$new(), x = a(y, function (a) {
B ? h.find("body").append(a) : c.after(a)
}), y.$watch(function () {
g(F, 0, !1)
}), m.useContentExp && y.$watch("contentExp()", function (a) {
!a && E.isOpen && p()
})
}
function r() {
z = null, x && (x.remove(), x = null), y && (y.$destroy(), y = null)
}
function s() {
t(), u(), v()
}
function t() {
E.popupClass = d[k + "Class"]
}
function u() {
var a = d[k + "Placement"];
E.placement = angular.isDefined(a) ? a : m.placement
}
function v() {
var a = d[k + "PopupDelay"], b = parseInt(a, 10);
E.popupDelay = isNaN(b) ? m.popupDelay : b
}
function w() {
var a = d[k + "Trigger"];
G(), C = n(a), C.show === C.hide ? c.bind(C.show, f) : (c.bind(C.show, j), c.bind(C.hide, l))
}
var x, y, z, A, B = angular.isDefined(m.appendToBody) ? m.appendToBody : !1, C = n(void 0), D = angular.isDefined(d[k + "Enable"]), E = b.$new(!0), F = function () {
if (x) {
var a = i.positionElements(c, x, E.placement, B);
a.top += "px", a.left += "px", x.css(a)
}
};
E.origScope = b, E.isOpen = !1, E.contentExp = function () {
return b.$eval(d[e])
}, m.useContentExp || d.$observe(e, function (a) {
E.content = a, !a && E.isOpen && p()
}), d.$observe("disabled", function (a) {
a && E.isOpen && p()
}), d.$observe(k + "Title", function (a) {
E.title = a
});
var G = function () {
c.unbind(C.show, j), c.unbind(C.hide, l)
};
w();
var H = b.$eval(d[k + "Animation"]);
E.animation = angular.isDefined(H) ? !!H : m.animation;
var I = b.$eval(d[k + "AppendToBody"]);
B = angular.isDefined(I) ? I : B, B && b.$on("$locationChangeSuccess", function () {
E.isOpen && p()
}), b.$on("$destroy", function () {
g.cancel(z), g.cancel(A), G(), r(), E = null
})
}
}
}
}
}]
}).directive("tooltipTemplateTransclude", ["$animate", "$sce", "$compile", "$templateRequest", function (a, b, c, d) {
return {
link: function (e, f, g) {
var h, i, j, k = e.$eval(g.tooltipTemplateTranscludeScope), l = 0, m = function () {
i && (i.remove(), i = null), h && (h.$destroy(), h = null), j && (a.leave(j).then(function () {
i = null
}), i = j, j = null)
};
e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude), function (b) {
var g = ++l;
b ? (d(b, !0).then(function (d) {
if (g === l) {
var e = k.$new(), i = d, n = c(i)(e, function (b) {
m(), a.enter(b, f)
});
h = e, j = n, h.$emit("$includeContentLoaded", b)
}
}, function () {
g === l && (m(), e.$emit("$includeContentError", b))
}), e.$emit("$includeContentRequested", b)) : m()
}), e.$on("$destroy", m)
}
}
}]).directive("tooltipClasses", function () {
return {
restrict: "A", link: function (a, b, c) {
a.placement && b.addClass(a.placement), a.popupClass && b.addClass(a.popupClass), a.animation() && b.addClass(c.tooltipAnimationClass)
}
}
}).directive("tooltipPopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/tooltip/tooltip-popup.html"
}
}).directive("tooltip", ["$tooltip", function (a) {
return a("tooltip", "tooltip", "mouseenter")
}]).directive("tooltipTemplatePopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&"},
templateUrl: "template/tooltip/tooltip-template-popup.html"
}
}).directive("tooltipTemplate", ["$tooltip", function (a) {
return a("tooltipTemplate", "tooltip", "mouseenter", {useContentExp: !0})
}]).directive("tooltipHtmlPopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/tooltip/tooltip-html-popup.html"
}
}).directive("tooltipHtml", ["$tooltip", function (a) {
return a("tooltipHtml", "tooltip", "mouseenter", {useContentExp: !0})
}]).directive("tooltipHtmlUnsafePopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/tooltip/tooltip-html-unsafe-popup.html"
}
}).value("tooltipHtmlUnsafeSuppressDeprecated", !1).directive("tooltipHtmlUnsafe", ["$tooltip", "tooltipHtmlUnsafeSuppressDeprecated", "$log", function (a, b, c) {
return b || c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."), a("tooltipHtmlUnsafe", "tooltip", "mouseenter")
}]), angular.module("ui.bootstrap.popover", ["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {
title: "@",
contentExp: "&",
placement: "@",
popupClass: "@",
animation: "&",
isOpen: "&",
originScope: "&"
},
templateUrl: "template/popover/popover-template.html"
}
}).directive("popoverTemplate", ["$tooltip", function (a) {
return a("popoverTemplate", "popover", "click", {useContentExp: !0})
}]).directive("popoverPopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {title: "@", content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/popover/popover.html"
}
}).directive("popover", ["$tooltip", function (a) {
return a("popover", "popover", "click")
}]), angular.module("ui.bootstrap.progressbar", []).constant("progressConfig", {
animate: !0,
max: 100
}).controller("ProgressController", ["$scope", "$attrs", "progressConfig", function (a, b, c) {
var d = this, e = angular.isDefined(b.animate) ? a.$parent.$eval(b.animate) : c.animate;
this.bars = [], a.max = angular.isDefined(a.max) ? a.max : c.max, this.addBar = function (b, c) {
e || c.css({transition: "none"}), this.bars.push(b), b.$watch("value", function (c) {
b.percent = +(100 * c / a.max).toFixed(2)
}), b.$on("$destroy", function () {
c = null, d.removeBar(b)
})
}, this.removeBar = function (a) {
this.bars.splice(this.bars.indexOf(a), 1)
}
}]).directive("progress", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
controller: "ProgressController",
require: "progress",
scope: {},
templateUrl: "template/progressbar/progress.html"
}
}).directive("bar", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
require: "^progress",
scope: {value: "=", max: "=?", type: "@"},
templateUrl: "template/progressbar/bar.html",
link: function (a, b, c, d) {
d.addBar(a, b)
}
}
}).directive("progressbar", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
controller: "ProgressController",
scope: {value: "=", max: "=?", type: "@"},
templateUrl: "template/progressbar/progressbar.html",
link: function (a, b, c, d) {
d.addBar(a, angular.element(b.children()[0]))
}
}
}), angular.module("ui.bootstrap.rating", []).constant("ratingConfig", {
max: 5,
stateOn: null,
stateOff: null
}).controller("RatingController", ["$scope", "$attrs", "ratingConfig", function (a, b, c) {
var d = {$setViewValue: angular.noop};
this.init = function (e) {
d = e, d.$render = this.render, d.$formatters.push(function (a) {
return angular.isNumber(a) && a << 0 !== a && (a = Math.round(a)), a
}), this.stateOn = angular.isDefined(b.stateOn) ? a.$parent.$eval(b.stateOn) : c.stateOn, this.stateOff = angular.isDefined(b.stateOff) ? a.$parent.$eval(b.stateOff) : c.stateOff;
var f = angular.isDefined(b.ratingStates) ? a.$parent.$eval(b.ratingStates) : new Array(angular.isDefined(b.max) ? a.$parent.$eval(b.max) : c.max);
a.range = this.buildTemplateObjects(f)
}, this.buildTemplateObjects = function (a) {
for (var b = 0, c = a.length; c > b; b++)a[b] = angular.extend({index: b}, {
stateOn: this.stateOn,
stateOff: this.stateOff
}, a[b]);
return a
}, a.rate = function (b) {
!a.readonly && b >= 0 && b <= a.range.length && (d.$setViewValue(b), d.$render())
}, a.enter = function (b) {
a.readonly || (a.value = b), a.onHover({value: b})
}, a.reset = function () {
a.value = d.$viewValue, a.onLeave()
}, a.onKeydown = function (b) {
/(37|38|39|40)/.test(b.which) && (b.preventDefault(), b.stopPropagation(), a.rate(a.value + (38 === b.which || 39 === b.which ? 1 : -1)))
}, this.render = function () {
a.value = d.$viewValue
}
}]).directive("rating", function () {
return {
restrict: "EA",
require: ["rating", "ngModel"],
scope: {readonly: "=?", onHover: "&", onLeave: "&"},
controller: "RatingController",
templateUrl: "template/rating/rating.html",
replace: !0,
link: function (a, b, c, d) {
var e = d[0], f = d[1];
e.init(f)
}
}
}), angular.module("ui.bootstrap.tabs", []).controller("TabsetController", ["$scope", function (a) {
var b = this, c = b.tabs = a.tabs = [];
b.select = function (a) {
angular.forEach(c, function (b) {
b.active && b !== a && (b.active = !1, b.onDeselect())
}), a.active = !0, a.onSelect()
}, b.addTab = function (a) {
c.push(a), 1 === c.length && a.active !== !1 ? a.active = !0 : a.active ? b.select(a) : a.active = !1
}, b.removeTab = function (a) {
var e = c.indexOf(a);
if (a.active && c.length > 1 && !d) {
var f = e == c.length - 1 ? e - 1 : e + 1;
b.select(c[f])
}
c.splice(e, 1)
};
var d;
a.$on("$destroy", function () {
d = !0
})
}]).directive("tabset", function () {
return {
restrict: "EA",
transclude: !0,
replace: !0,
scope: {type: "@"},
controller: "TabsetController",
templateUrl: "template/tabs/tabset.html",
link: function (a, b, c) {
a.vertical = angular.isDefined(c.vertical) ? a.$parent.$eval(c.vertical) : !1, a.justified = angular.isDefined(c.justified) ? a.$parent.$eval(c.justified) : !1
}
}
}).directive("tab", ["$parse", "$log", function (a, b) {
return {
require: "^tabset",
restrict: "EA",
replace: !0,
templateUrl: "template/tabs/tab.html",
transclude: !0,
scope: {active: "=?", heading: "@", onSelect: "&select", onDeselect: "&deselect"},
controller: function () {
},
compile: function (c, d, e) {
return function (c, d, f, g) {
c.$watch("active", function (a) {
a && g.select(c)
}), c.disabled = !1, f.disable && c.$parent.$watch(a(f.disable), function (a) {
c.disabled = !!a
}), f.disabled && (b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'), c.$parent.$watch(a(f.disabled), function (a) {
c.disabled = !!a
})), c.select = function () {
c.disabled || (c.active = !0)
}, g.addTab(c), c.$on("$destroy", function () {
g.removeTab(c)
}), c.$transcludeFn = e
}
}
}
}]).directive("tabHeadingTransclude", [function () {
return {
restrict: "A", require: "^tab", link: function (a, b) {
a.$watch("headingElement", function (a) {
a && (b.html(""), b.append(a))
})
}
}
}]).directive("tabContentTransclude", function () {
function a(a) {
return a.tagName && (a.hasAttribute("tab-heading") || a.hasAttribute("data-tab-heading") || "tab-heading" === a.tagName.toLowerCase() || "data-tab-heading" === a.tagName.toLowerCase())
}
return {
restrict: "A", require: "^tabset", link: function (b, c, d) {
var e = b.$eval(d.tabContentTransclude);
e.$transcludeFn(e.$parent, function (b) {
angular.forEach(b, function (b) {
a(b) ? e.headingElement = b : c.append(b)
})
})
}
}
}), angular.module("ui.bootstrap.timepicker", []).constant("timepickerConfig", {
hourStep: 1,
minuteStep: 1,
showMeridian: !0,
meridians: null,
readonlyInput: !1,
mousewheel: !0,
arrowkeys: !0
}).controller("TimepickerController", ["$scope", "$attrs", "$parse", "$log", "$locale", "timepickerConfig", function (a, b, c, d, e, f) {
function g() {
var b = parseInt(a.hours, 10), c = a.showMeridian ? b > 0 && 13 > b : b >= 0 && 24 > b;
return c ? (a.showMeridian && (12 === b && (b = 0), a.meridian === p[1] && (b += 12)), b) : void 0
}
function h() {
var b = parseInt(a.minutes, 10);
return b >= 0 && 60 > b ? b : void 0
}
function i(a) {
return angular.isDefined(a) && a.toString().length < 2 ? "0" + a : a.toString()
}
function j(a) {
k(), o.$setViewValue(new Date(n)), l(a)
}
function k() {
o.$setValidity("time", !0), a.invalidHours = !1, a.invalidMinutes = !1
}
function l(b) {
var c = n.getHours(), d = n.getMinutes();
a.showMeridian && (c = 0 === c || 12 === c ? 12 : c % 12), a.hours = "h" === b ? c : i(c), "m" !== b && (a.minutes = i(d)), a.meridian = n.getHours() < 12 ? p[0] : p[1]
}
function m(a) {
var b = new Date(n.getTime() + 6e4 * a);
n.setHours(b.getHours(), b.getMinutes()), j()
}
var n = new Date, o = {$setViewValue: angular.noop}, p = angular.isDefined(b.meridians) ? a.$parent.$eval(b.meridians) : f.meridians || e.DATETIME_FORMATS.AMPMS;
this.init = function (c, d) {
o = c, o.$render = this.render, o.$formatters.unshift(function (a) {
return a ? new Date(a) : null
});
var e = d.eq(0), g = d.eq(1), h = angular.isDefined(b.mousewheel) ? a.$parent.$eval(b.mousewheel) : f.mousewheel;
h && this.setupMousewheelEvents(e, g);
var i = angular.isDefined(b.arrowkeys) ? a.$parent.$eval(b.arrowkeys) : f.arrowkeys;
i && this.setupArrowkeyEvents(e, g), a.readonlyInput = angular.isDefined(b.readonlyInput) ? a.$parent.$eval(b.readonlyInput) : f.readonlyInput, this.setupInputEvents(e, g)
};
var q = f.hourStep;
b.hourStep && a.$parent.$watch(c(b.hourStep), function (a) {
q = parseInt(a, 10)
});
var r = f.minuteStep;
b.minuteStep && a.$parent.$watch(c(b.minuteStep), function (a) {
r = parseInt(a, 10)
}), a.showMeridian = f.showMeridian, b.showMeridian && a.$parent.$watch(c(b.showMeridian), function (b) {
if (a.showMeridian = !!b, o.$error.time) {
var c = g(), d = h();
angular.isDefined(c) && angular.isDefined(d) && (n.setHours(c), j())
} else l()
}), this.setupMousewheelEvents = function (b, c) {
var d = function (a) {
a.originalEvent && (a = a.originalEvent);
var b = a.wheelDelta ? a.wheelDelta : -a.deltaY;
return a.detail || b > 0
};
b.bind("mousewheel wheel", function (b) {
a.$apply(d(b) ? a.incrementHours() : a.decrementHours()), b.preventDefault()
}), c.bind("mousewheel wheel", function (b) {
a.$apply(d(b) ? a.incrementMinutes() : a.decrementMinutes()), b.preventDefault()
})
}, this.setupArrowkeyEvents = function (b, c) {
b.bind("keydown", function (b) {
38 === b.which ? (b.preventDefault(), a.incrementHours(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementHours(), a.$apply())
}), c.bind("keydown", function (b) {
38 === b.which ? (b.preventDefault(), a.incrementMinutes(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementMinutes(), a.$apply())
})
}, this.setupInputEvents = function (b, c) {
if (a.readonlyInput)return a.updateHours = angular.noop, void(a.updateMinutes = angular.noop);
var d = function (b, c) {
o.$setViewValue(null), o.$setValidity("time", !1), angular.isDefined(b) && (a.invalidHours = b), angular.isDefined(c) && (a.invalidMinutes = c)
};
a.updateHours = function () {
var a = g();
angular.isDefined(a) ? (n.setHours(a), j("h")) : d(!0)
}, b.bind("blur", function () {
!a.invalidHours && a.hours < 10 && a.$apply(function () {
a.hours = i(a.hours)
})
}), a.updateMinutes = function () {
var a = h();
angular.isDefined(a) ? (n.setMinutes(a), j("m")) : d(void 0, !0)
}, c.bind("blur", function () {
!a.invalidMinutes && a.minutes < 10 && a.$apply(function () {
a.minutes = i(a.minutes)
})
})
}, this.render = function () {
var a = o.$viewValue;
isNaN(a) ? (o.$setValidity("time", !1), d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')) : (a && (n = a), k(), l())
}, a.incrementHours = function () {
m(60 * q)
}, a.decrementHours = function () {
m(60 * -q)
}, a.incrementMinutes = function () {
m(r)
}, a.decrementMinutes = function () {
m(-r)
}, a.toggleMeridian = function () {
m(720 * (n.getHours() < 12 ? 1 : -1))
}
}]).directive("timepicker", function () {
return {
restrict: "EA",
require: ["timepicker", "?^ngModel"],
controller: "TimepickerController",
replace: !0,
scope: {},
templateUrl: "template/timepicker/timepicker.html",
link: function (a, b, c, d) {
var e = d[0], f = d[1];
f && e.init(f, b.find("input"))
}
}
}), angular.module("ui.bootstrap.transition", []).value("$transitionSuppressDeprecated", !1).factory("$transition", ["$q", "$timeout", "$rootScope", "$log", "$transitionSuppressDeprecated", function (a, b, c, d, e) {
function f(a) {
for (var b in a)if (void 0 !== h.style[b])return a[b]
}
e || d.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");
var g = function (d, e, f) {
f = f || {};
var h = a.defer(), i = g[f.animation ? "animationEndEventName" : "transitionEndEventName"], j = function () {
c.$apply(function () {
d.unbind(i, j), h.resolve(d)
})
};
return i && d.bind(i, j), b(function () {
angular.isString(e) ? d.addClass(e) : angular.isFunction(e) ? e(d) : angular.isObject(e) && d.css(e), i || h.resolve(d)
}), h.promise.cancel = function () {
i && d.unbind(i, j), h.reject("Transition cancelled")
}, h.promise
}, h = document.createElement("trans"), i = {
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd",
transition: "transitionend"
}, j = {
WebkitTransition: "webkitAnimationEnd",
MozTransition: "animationend",
OTransition: "oAnimationEnd",
transition: "animationend"
};
return g.transitionEndEventName = f(i), g.animationEndEventName = f(j), g
}]), angular.module("ui.bootstrap.typeahead", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).factory("typeaheadParser", ["$parse", function (a) {
var b = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;
return {
parse: function (c) {
var d = c.match(b);
if (!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "' + c + '".');
return {itemName: d[3], source: a(d[4]), viewMapper: a(d[2] || d[1]), modelMapper: a(d[1])}
}
}
}]).directive("typeahead", ["$compile", "$parse", "$q", "$timeout", "$document", "$position", "typeaheadParser", function (a, b, c, d, e, f, g) {
var h = [9, 13, 27, 38, 40];
return {
require: "ngModel", link: function (i, j, k, l) {
var m, n = i.$eval(k.typeaheadMinLength) || 1, o = i.$eval(k.typeaheadWaitMs) || 0, p = i.$eval(k.typeaheadEditable) !== !1, q = b(k.typeaheadLoading).assign || angular.noop, r = b(k.typeaheadOnSelect), s = k.typeaheadInputFormatter ? b(k.typeaheadInputFormatter) : void 0, t = k.typeaheadAppendToBody ? i.$eval(k.typeaheadAppendToBody) : !1, u = i.$eval(k.typeaheadFocusFirst) !== !1, v = b(k.ngModel).assign, w = g.parse(k.typeahead), x = i.$new();
i.$on("$destroy", function () {
x.$destroy()
});
var y = "typeahead-" + x.$id + "-" + Math.floor(1e4 * Math.random());
j.attr({"aria-autocomplete": "list", "aria-expanded": !1, "aria-owns": y});
var z = angular.element("<div typeahead-popup></div>");
z.attr({
id: y,
matches: "matches",
active: "activeIdx",
select: "select(activeIdx)",
query: "query",
position: "position"
}), angular.isDefined(k.typeaheadTemplateUrl) && z.attr("template-url", k.typeaheadTemplateUrl);
var A = function () {
x.matches = [], x.activeIdx = -1, j.attr("aria-expanded", !1)
}, B = function (a) {
return y + "-option-" + a
};
x.$watch("activeIdx", function (a) {
0 > a ? j.removeAttr("aria-activedescendant") : j.attr("aria-activedescendant", B(a))
});
var C = function (a) {
var b = {$viewValue: a};
q(i, !0), c.when(w.source(i, b)).then(function (c) {
var d = a === l.$viewValue;
if (d && m)if (c && c.length > 0) {
x.activeIdx = u ? 0 : -1, x.matches.length = 0;
for (var e = 0; e < c.length; e++)b[w.itemName] = c[e], x.matches.push({
id: B(e),
label: w.viewMapper(x, b),
model: c[e]
});
x.query = a, x.position = t ? f.offset(j) : f.position(j), x.position.top = x.position.top + j.prop("offsetHeight"), j.attr("aria-expanded", !0)
} else A();
d && q(i, !1)
}, function () {
A(), q(i, !1)
})
};
A(), x.query = void 0;
var D, E = function (a) {
D = d(function () {
C(a)
}, o)
}, F = function () {
D && d.cancel(D)
};
l.$parsers.unshift(function (a) {
return m = !0, a && a.length >= n ? o > 0 ? (F(), E(a)) : C(a) : (q(i, !1), F(), A()), p ? a : a ? void l.$setValidity("editable", !1) : (l.$setValidity("editable", !0), a)
}), l.$formatters.push(function (a) {
var b, c, d = {};
return p || l.$setValidity("editable", !0), s ? (d.$model = a, s(i, d)) : (d[w.itemName] = a, b = w.viewMapper(i, d), d[w.itemName] = void 0, c = w.viewMapper(i, d), b !== c ? b : a)
}), x.select = function (a) {
var b, c, e = {};
e[w.itemName] = c = x.matches[a].model, b = w.modelMapper(i, e), v(i, b), l.$setValidity("editable", !0), l.$setValidity("parse", !0), r(i, {
$item: c,
$model: b,
$label: w.viewMapper(i, e)
}), A(), d(function () {
j[0].focus()
}, 0, !1)
}, j.bind("keydown", function (a) {
0 !== x.matches.length && -1 !== h.indexOf(a.which) && (-1 != x.activeIdx || 13 !== a.which && 9 !== a.which) && (a.preventDefault(), 40 === a.which ? (x.activeIdx = (x.activeIdx + 1) % x.matches.length, x.$digest()) : 38 === a.which ? (x.activeIdx = (x.activeIdx > 0 ? x.activeIdx : x.matches.length) - 1, x.$digest()) : 13 === a.which || 9 === a.which ? x.$apply(function () {
x.select(x.activeIdx)
}) : 27 === a.which && (a.stopPropagation(), A(), x.$digest()))
}), j.bind("blur", function () {
m = !1
});
var G = function (a) {
j[0] !== a.target && (A(), x.$digest())
};
e.bind("click", G), i.$on("$destroy", function () {
e.unbind("click", G), t && H.remove(), z.remove()
});
var H = a(z)(x);
t ? e.find("body").append(H) : j.after(H)
}
}
}]).directive("typeaheadPopup", function () {
return {
restrict: "EA",
scope: {matches: "=", query: "=", active: "=", position: "=", select: "&"},
replace: !0,
templateUrl: "template/typeahead/typeahead-popup.html",
link: function (a, b, c) {
a.templateUrl = c.templateUrl, a.isOpen = function () {
return a.matches.length > 0
}, a.isActive = function (b) {
return a.active == b
}, a.selectActive = function (b) {
a.active = b
}, a.selectMatch = function (b) {
a.select({activeIdx: b})
}
}
}
}).directive("typeaheadMatch", ["$templateRequest", "$compile", "$parse", function (a, b, c) {
return {
restrict: "EA", scope: {index: "=", match: "=", query: "="}, link: function (d, e, f) {
var g = c(f.templateUrl)(d.$parent) || "template/typeahead/typeahead-match.html";
a(g).then(function (a) {
b(a.trim())(d, function (a) {
e.replaceWith(a)
})
})
}
}
}]).filter("typeaheadHighlight", function () {
function a(a) {
return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1")
}
return function (b, c) {
return c ? ("" + b).replace(new RegExp(a(c), "gi"), "<strong>$&</strong>") : b
}
}), angular.module("template/accordion/accordion-group.html", []).run(["$templateCache", function (a) {
a.put("template/accordion/accordion-group.html", '<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a href="javascript:void(0)" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n')
}]), angular.module("template/accordion/accordion.html", []).run(["$templateCache", function (a) {
a.put("template/accordion/accordion.html", '<div class="panel-group" ng-transclude></div>')
}]), angular.module("template/alert/alert.html", []).run(["$templateCache", function (a) {
a.put("template/alert/alert.html", '<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">×</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')
}]), angular.module("template/carousel/carousel.html", []).run(["$templateCache", function (a) {
a.put("template/carousel/carousel.html", '<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:\'index\' track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')
}]), angular.module("template/carousel/slide.html", []).run(["$templateCache", function (a) {
a.put("template/carousel/slide.html", '<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n')
}]), angular.module("template/datepicker/datepicker.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/datepicker.html", '<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')
}]), angular.module("template/datepicker/day.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/day.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}" ng-class="dt.customClass">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/datepicker/month.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/month.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/datepicker/popup.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/popup.html", '<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')
}]), angular.module("template/datepicker/year.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/year.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/modal/backdrop.html", []).run(["$templateCache", function (a) {
a.put("template/modal/backdrop.html", '<div class="modal-backdrop"\n modal-animation-class="fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')
}]), angular.module("template/modal/window.html", []).run(["$templateCache", function (a) {
a.put("template/modal/window.html", '<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n modal-animation-class="fade"\n ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" modal-transclude></div></div>\n</div>\n')
}]), angular.module("template/pagination/pager.html", []).run(["$templateCache", function (a) {
a.put("template/pagination/pager.html", '<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n</ul>')
}]), angular.module("template/pagination/pagination.html", []).run(["$templateCache", function (a) {
a.put("template/pagination/pagination.html", '<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1, $event)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages, $event)">{{getText(\'last\')}}</a></li>\n</ul>')
}]), angular.module("template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-html-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n')
}]), angular.module("template/tooltip/tooltip-html-unsafe-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-html-unsafe-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')
}]), angular.module("template/tooltip/tooltip-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')
}]), angular.module("template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-template-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')
}]), angular.module("template/popover/popover-template.html", []).run(["$templateCache", function (a) {
a.put("template/popover/popover-template.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n')
}]), angular.module("template/popover/popover-window.html", []).run(["$templateCache", function (a) {
a.put("template/popover/popover-window.html", '<div class="popover {{placement}}" ng-class="{ in: isOpen, fade: animation }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" tooltip-template-transclude></div>\n </div>\n</div>\n')
}]), angular.module("template/popover/popover.html", []).run(["$templateCache", function (a) {
a.put("template/popover/popover.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')
}]), angular.module("template/progressbar/bar.html", []).run(["$templateCache", function (a) {
a.put("template/progressbar/bar.html", '<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n')
}]), angular.module("template/progressbar/progress.html", []).run(["$templateCache", function (a) {
a.put("template/progressbar/progress.html", '<div class="progress" ng-transclude></div>')
}]), angular.module("template/progressbar/progressbar.html", []).run(["$templateCache", function (a) {
a.put("template/progressbar/progressbar.html", '<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>\n')
}]), angular.module("template/rating/rating.html", []).run(["$templateCache", function (a) {
a.put("template/rating/rating.html", '<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')
}]), angular.module("template/tabs/tab.html", []).run(["$templateCache", function (a) {
a.put("template/tabs/tab.html", '<li ng-class="{active: active, disabled: disabled}">\n <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')
}]), angular.module("template/tabs/tabset.html", []).run(["$templateCache", function (a) {
a.put("template/tabs/tabset.html", '<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')
}]), angular.module("template/timepicker/timepicker.html", []).run(["$templateCache", function (a) {
a.put("template/timepicker/timepicker.html", '<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td> </td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td> </td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/typeahead/typeahead-match.html", []).run(["$templateCache", function (a) {
a.put("template/typeahead/typeahead-match.html", '<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')
}]), angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCache", function (a) {
a.put("template/typeahead/typeahead-popup.html", '<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')
}]), !angular.$$csp() && angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');
| /*
* angular-ui-bootstrap
* http://angular-ui.github.io/bootstrap/
* Version: 0.13.0 - 2015-05-02
* License: MIT
*/
angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse", "ui.bootstrap.accordion", "ui.bootstrap.alert", "ui.bootstrap.bindHtml", "ui.bootstrap.buttons", "ui.bootstrap.carousel", "ui.bootstrap.dateparser", "ui.bootstrap.position", "ui.bootstrap.datepicker", "ui.bootstrap.dropdown", "ui.bootstrap.modal", "ui.bootstrap.pagination", "ui.bootstrap.tooltip", "ui.bootstrap.popover", "ui.bootstrap.progressbar", "ui.bootstrap.rating", "ui.bootstrap.tabs", "ui.bootstrap.timepicker", "ui.bootstrap.transition", "ui.bootstrap.typeahead"]), angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html", "template/accordion/accordion.html", "template/alert/alert.html", "template/carousel/carousel.html", "template/carousel/slide.html", "template/datepicker/datepicker.html", "template/datepicker/day.html", "template/datepicker/month.html", "template/datepicker/popup.html", "template/datepicker/year.html", "template/modal/backdrop.html", "template/modal/window.html", "template/pagination/pager.html", "template/pagination/pagination.html", "template/tooltip/tooltip-html-popup.html", "template/tooltip/tooltip-html-unsafe-popup.html", "template/tooltip/tooltip-popup.html", "template/tooltip/tooltip-template-popup.html", "template/popover/popover-template.html", "template/popover/popover.html", "template/progressbar/bar.html", "template/progressbar/progress.html", "template/progressbar/progressbar.html", "template/rating/rating.html", "template/tabs/tab.html", "template/tabs/tabset.html", "template/timepicker/timepicker.html", "template/typeahead/typeahead-match.html", "template/typeahead/typeahead-popup.html"]), angular.module("ui.bootstrap.collapse", []).directive("collapse", ["$animate", function (a) {
return {
link: function (b, c, d) {
function e() {
c.removeClass("collapse").addClass("collapsing"), a.addClass(c, "in", {to: {height: c[0].scrollHeight + "px"}}).then(f)
}
function f() {
c.removeClass("collapsing"), c.css({height: "auto"})
}
function g() {
c.css({height: c[0].scrollHeight + "px"}).removeClass("collapse").addClass("collapsing"), a.removeClass(c, "in", {to: {height: "0"}}).then(h)
}
function h() {
c.css({height: "0"}), c.removeClass("collapsing"), c.addClass("collapse")
}
b.$watch(d.collapse, function (a) {
a ? g() : e()
})
}
}
}]), angular.module("ui.bootstrap.accordion", ["ui.bootstrap.collapse"]).constant("accordionConfig", {closeOthers: !0}).controller("AccordionController", ["$scope", "$attrs", "accordionConfig", function (a, b, c) {
this.groups = [], this.closeOthers = function (d) {
var e = angular.isDefined(b.closeOthers) ? a.$eval(b.closeOthers) : c.closeOthers;
e && angular.forEach(this.groups, function (a) {
a !== d && (a.isOpen = !1)
})
}, this.addGroup = function (a) {
var b = this;
this.groups.push(a), a.$on("$destroy", function () {
b.removeGroup(a)
})
}, this.removeGroup = function (a) {
var b = this.groups.indexOf(a);
-1 !== b && this.groups.splice(b, 1)
}
}]).directive("accordion", function () {
return {
restrict: "EA",
controller: "AccordionController",
transclude: !0,
replace: !1,
templateUrl: "template/accordion/accordion.html"
}
}).directive("accordionGroup", function () {
return {
require: "^accordion",
restrict: "EA",
transclude: !0,
replace: !0,
templateUrl: "template/accordion/accordion-group.html",
scope: {heading: "@", isOpen: "=?", isDisabled: "=?"},
controller: function () {
this.setHeading = function (a) {
this.heading = a
}
},
link: function (a, b, c, d) {
d.addGroup(a), a.$watch("isOpen", function (b) {
b && d.closeOthers(a)
}), a.toggleOpen = function () {
a.isDisabled || (a.isOpen = !a.isOpen)
}
}
}
}).directive("accordionHeading", function () {
return {
restrict: "EA",
transclude: !0,
template: "",
replace: !0,
require: "^accordionGroup",
link: function (a, b, c, d, e) {
d.setHeading(e(a, angular.noop))
}
}
}).directive("accordionTransclude", function () {
return {
require: "^accordionGroup", link: function (a, b, c, d) {
a.$watch(function () {
return d[c.accordionTransclude]
}, function (a) {
a && (b.html(""), b.append(a))
})
}
}
}), angular.module("ui.bootstrap.alert", []).controller("AlertController", ["$scope", "$attrs", function (a, b) {
a.closeable = "close" in b, this.close = a.close
}]).directive("alert", function () {
return {
restrict: "EA",
controller: "AlertController",
templateUrl: "template/alert/alert.html",
transclude: !0,
replace: !0,
scope: {type: "@", close: "&"}
}
}).directive("dismissOnTimeout", ["$timeout", function (a) {
return {
require: "alert", link: function (b, c, d, e) {
a(function () {
e.close()
}, parseInt(d.dismissOnTimeout, 10))
}
}
}]), angular.module("ui.bootstrap.bindHtml", []).directive("bindHtmlUnsafe", function () {
return function (a, b, c) {
b.addClass("ng-binding").data("$binding", c.bindHtmlUnsafe), a.$watch(c.bindHtmlUnsafe, function (a) {
b.html(a || "")
})
}
}), angular.module("ui.bootstrap.buttons", []).constant("buttonConfig", {
activeClass: "active",
toggleEvent: "click"
}).controller("ButtonsController", ["buttonConfig", function (a) {
this.activeClass = a.activeClass || "active", this.toggleEvent = a.toggleEvent || "click"
}]).directive("btnRadio", function () {
return {
require: ["btnRadio", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) {
var e = d[0], f = d[1];
f.$render = function () {
b.toggleClass(e.activeClass, angular.equals(f.$modelValue, a.$eval(c.btnRadio)))
}, b.bind(e.toggleEvent, function () {
var d = b.hasClass(e.activeClass);
(!d || angular.isDefined(c.uncheckable)) && a.$apply(function () {
f.$setViewValue(d ? null : a.$eval(c.btnRadio)), f.$render()
})
})
}
}
}).directive("btnCheckbox", function () {
return {
require: ["btnCheckbox", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) {
function e() {
return g(c.btnCheckboxTrue, !0)
}
function f() {
return g(c.btnCheckboxFalse, !1)
}
function g(b, c) {
var d = a.$eval(b);
return angular.isDefined(d) ? d : c
}
var h = d[0], i = d[1];
i.$render = function () {
b.toggleClass(h.activeClass, angular.equals(i.$modelValue, e()))
}, b.bind(h.toggleEvent, function () {
a.$apply(function () {
i.$setViewValue(b.hasClass(h.activeClass) ? f() : e()), i.$render()
})
})
}
}
}), angular.module("ui.bootstrap.carousel", []).controller("CarouselController", ["$scope", "$interval", "$animate", function (a, b, c) {
function d(a) {
if (angular.isUndefined(k[a].index))return k[a];
{
var b;
k.length
}
for (b = 0; b < k.length; ++b)if (k[b].index == a)return k[b]
}
function e() {
f();
var c = +a.interval;
!isNaN(c) && c > 0 && (h = b(g, c))
}
function f() {
h && (b.cancel(h), h = null)
}
function g() {
var b = +a.interval;
i && !isNaN(b) && b > 0 ? a.next() : a.pause()
}
var h, i, j = this, k = j.slides = a.slides = [], l = -1;
j.currentSlide = null;
var m = !1;
j.select = a.select = function (b, d) {
function f() {
m || (angular.extend(b, {direction: d, active: !0}), angular.extend(j.currentSlide || {}, {
direction: d,
active: !1
}), c.enabled() && !a.noTransition && b.$element && (a.$currentTransition = !0, b.$element.one("$animate:close", function () {
a.$currentTransition = null
})), j.currentSlide = b, l = g, e())
}
var g = j.indexOfSlide(b);
void 0 === d && (d = g > j.getCurrentIndex() ? "next" : "prev"), b && b !== j.currentSlide && f()
}, a.$on("$destroy", function () {
m = !0
}), j.getCurrentIndex = function () {
return j.currentSlide && angular.isDefined(j.currentSlide.index) ? +j.currentSlide.index : l
}, j.indexOfSlide = function (a) {
return angular.isDefined(a.index) ? +a.index : k.indexOf(a)
}, a.next = function () {
var b = (j.getCurrentIndex() + 1) % k.length;
return a.$currentTransition ? void 0 : j.select(d(b), "next")
}, a.prev = function () {
var b = j.getCurrentIndex() - 1 < 0 ? k.length - 1 : j.getCurrentIndex() - 1;
return a.$currentTransition ? void 0 : j.select(d(b), "prev")
}, a.isActive = function (a) {
return j.currentSlide === a
}, a.$watch("interval", e), a.$on("$destroy", f), a.play = function () {
i || (i = !0, e())
}, a.pause = function () {
a.noPause || (i = !1, f())
}, j.addSlide = function (b, c) {
b.$element = c, k.push(b), 1 === k.length || b.active ? (j.select(k[k.length - 1]), 1 == k.length && a.play()) : b.active = !1
}, j.removeSlide = function (a) {
angular.isDefined(a.index) && k.sort(function (a, b) {
return +a.index > +b.index
});
var b = k.indexOf(a);
k.splice(b, 1), k.length > 0 && a.active ? j.select(b >= k.length ? k[b - 1] : k[b]) : l > b && l--
}
}]).directive("carousel", [function () {
return {
restrict: "EA",
transclude: !0,
replace: !0,
controller: "CarouselController",
require: "carousel",
templateUrl: "template/carousel/carousel.html",
scope: {interval: "=", noTransition: "=", noPause: "="}
}
}]).directive("slide", function () {
return {
require: "^carousel",
restrict: "EA",
transclude: !0,
replace: !0,
templateUrl: "template/carousel/slide.html",
scope: {active: "=?", index: "=?"},
link: function (a, b, c, d) {
d.addSlide(a, b), a.$on("$destroy", function () {
d.removeSlide(a)
}), a.$watch("active", function (b) {
b && d.select(a)
})
}
}
}).animation(".item", ["$animate", function (a) {
return {
beforeAddClass: function (b, c, d) {
if ("active" == c && b.parent() && !b.parent().scope().noTransition) {
var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right";
return b.addClass(f), a.addClass(b, g).then(function () {
e || b.removeClass(g + " " + f), d()
}), function () {
e = !0
}
}
d()
}, beforeRemoveClass: function (b, c, d) {
if ("active" == c && b.parent() && !b.parent().scope().noTransition) {
var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right";
return a.addClass(b, g).then(function () {
e || b.removeClass(g), d()
}), function () {
e = !0
}
}
d()
}
}
}]), angular.module("ui.bootstrap.dateparser", []).service("dateParser", ["$locale", "orderByFilter", function (a, b) {
function c(a) {
var c = [], d = a.split("");
return angular.forEach(f, function (b, e) {
var f = a.indexOf(e);
if (f > -1) {
a = a.split(""), d[f] = "(" + b.regex + ")", a[f] = "$";
for (var g = f + 1, h = f + e.length; h > g; g++)d[g] = "", a[g] = "$";
a = a.join(""), c.push({index: f, apply: b.apply})
}
}), {regex: new RegExp("^" + d.join("") + "$"), map: b(c, "index")}
}
function d(a, b, c) {
return 1 > c ? !1 : 1 === b && c > 28 ? 29 === c && (a % 4 === 0 && a % 100 !== 0 || a % 400 === 0) : 3 === b || 5 === b || 8 === b || 10 === b ? 31 > c : !0
}
var e = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
this.parsers = {};
var f = {
yyyy: {
regex: "\\d{4}", apply: function (a) {
this.year = +a
}
},
yy: {
regex: "\\d{2}", apply: function (a) {
this.year = +a + 2e3
}
},
y: {
regex: "\\d{1,4}", apply: function (a) {
this.year = +a
}
},
MMMM: {
regex: a.DATETIME_FORMATS.MONTH.join("|"), apply: function (b) {
this.month = a.DATETIME_FORMATS.MONTH.indexOf(b)
}
},
MMM: {
regex: a.DATETIME_FORMATS.SHORTMONTH.join("|"), apply: function (b) {
this.month = a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)
}
},
MM: {
regex: "0[1-9]|1[0-2]", apply: function (a) {
this.month = a - 1
}
},
M: {
regex: "[1-9]|1[0-2]", apply: function (a) {
this.month = a - 1
}
},
dd: {
regex: "[0-2][0-9]{1}|3[0-1]{1}", apply: function (a) {
this.date = +a
}
},
d: {
regex: "[1-2]?[0-9]{1}|3[0-1]{1}", apply: function (a) {
this.date = +a
}
},
EEEE: {regex: a.DATETIME_FORMATS.DAY.join("|")},
EEE: {regex: a.DATETIME_FORMATS.SHORTDAY.join("|")},
HH: {
regex: "(?:0|1)[0-9]|2[0-3]", apply: function (a) {
this.hours = +a
}
},
H: {
regex: "1?[0-9]|2[0-3]", apply: function (a) {
this.hours = +a
}
},
mm: {
regex: "[0-5][0-9]", apply: function (a) {
this.minutes = +a
}
},
m: {
regex: "[0-9]|[1-5][0-9]", apply: function (a) {
this.minutes = +a
}
},
sss: {
regex: "[0-9][0-9][0-9]", apply: function (a) {
this.milliseconds = +a
}
},
ss: {
regex: "[0-5][0-9]", apply: function (a) {
this.seconds = +a
}
},
s: {
regex: "[0-9]|[1-5][0-9]", apply: function (a) {
this.seconds = +a
}
}
};
this.parse = function (b, f, g) {
if (!angular.isString(b) || !f)return b;
f = a.DATETIME_FORMATS[f] || f, f = f.replace(e, "\\$&"), this.parsers[f] || (this.parsers[f] = c(f));
var h = this.parsers[f], i = h.regex, j = h.map, k = b.match(i);
if (k && k.length) {
var l, m;
l = g ? {
year: g.getFullYear(),
month: g.getMonth(),
date: g.getDate(),
hours: g.getHours(),
minutes: g.getMinutes(),
seconds: g.getSeconds(),
milliseconds: g.getMilliseconds()
} : {year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0};
for (var n = 1, o = k.length; o > n; n++) {
var p = j[n - 1];
p.apply && p.apply.call(l, k[n])
}
return d(l.year, l.month, l.date) && (m = new Date(l.year, l.month, l.date, l.hours, l.minutes, l.seconds, l.milliseconds || 0)), m
}
}
}]), angular.module("ui.bootstrap.position", []).factory("$position", ["$document", "$window", function (a, b) {
function c(a, c) {
return a.currentStyle ? a.currentStyle[c] : b.getComputedStyle ? b.getComputedStyle(a)[c] : a.style[c]
}
function d(a) {
return "static" === (c(a, "position") || "static")
}
var e = function (b) {
for (var c = a[0], e = b.offsetParent || c; e && e !== c && d(e);)e = e.offsetParent;
return e || c
};
return {
position: function (b) {
var c = this.offset(b), d = {top: 0, left: 0}, f = e(b[0]);
f != a[0] && (d = this.offset(angular.element(f)), d.top += f.clientTop - f.scrollTop, d.left += f.clientLeft - f.scrollLeft);
var g = b[0].getBoundingClientRect();
return {
width: g.width || b.prop("offsetWidth"),
height: g.height || b.prop("offsetHeight"),
top: c.top - d.top,
left: c.left - d.left
}
}, offset: function (c) {
var d = c[0].getBoundingClientRect();
return {
width: d.width || c.prop("offsetWidth"),
height: d.height || c.prop("offsetHeight"),
top: d.top + (b.pageYOffset || a[0].documentElement.scrollTop),
left: d.left + (b.pageXOffset || a[0].documentElement.scrollLeft)
}
}, positionElements: function (a, b, c, d) {
var e, f, g, h, i = c.split("-"), j = i[0], k = i[1] || "center";
e = d ? this.offset(a) : this.position(a), f = b.prop("offsetWidth"), g = b.prop("offsetHeight");
var l = {
center: function () {
return e.left + e.width / 2 - f / 2
}, left: function () {
return e.left
}, right: function () {
return e.left + e.width
}
}, m = {
center: function () {
return e.top + e.height / 2 - g / 2
}, top: function () {
return e.top
}, bottom: function () {
return e.top + e.height
}
};
switch (j) {
case"right":
h = {top: m[k](), left: l[j]()};
break;
case"left":
h = {top: m[k](), left: e.left - f};
break;
case"bottom":
h = {top: m[j](), left: l[k]()};
break;
default:
h = {top: e.top - g, left: l[k]()}
}
return h
}
}
}]), angular.module("ui.bootstrap.datepicker", ["ui.bootstrap.dateparser", "ui.bootstrap.position"]).constant("datepickerConfig", {
formatDay: "dd",
formatMonth: "MMMM",
formatYear: "yyyy",
formatDayHeader: "EEE",
formatDayTitle: "MMMM yyyy",
formatMonthTitle: "yyyy",
datepickerMode: "day",
minMode: "day",
maxMode: "year",
showWeeks: !0,
startingDay: 0,
yearRange: 20,
minDate: null,
maxDate: null,
shortcutPropagation: !1
}).controller("DatepickerController", ["$scope", "$attrs", "$parse", "$interpolate", "$timeout", "$log", "dateFilter", "datepickerConfig", function (a, b, c, d, e, f, g, h) {
var i = this, j = {$setViewValue: angular.noop};
this.modes = ["day", "month", "year"], angular.forEach(["formatDay", "formatMonth", "formatYear", "formatDayHeader", "formatDayTitle", "formatMonthTitle", "minMode", "maxMode", "showWeeks", "startingDay", "yearRange", "shortcutPropagation"], function (c, e) {
i[c] = angular.isDefined(b[c]) ? 8 > e ? d(b[c])(a.$parent) : a.$parent.$eval(b[c]) : h[c]
}), angular.forEach(["minDate", "maxDate"], function (d) {
b[d] ? a.$parent.$watch(c(b[d]), function (a) {
i[d] = a ? new Date(a) : null, i.refreshView()
}) : i[d] = h[d] ? new Date(h[d]) : null
}), a.datepickerMode = a.datepickerMode || h.datepickerMode, a.maxMode = i.maxMode, a.uniqueId = "datepicker-" + a.$id + "-" + Math.floor(1e4 * Math.random()), angular.isDefined(b.initDate) ? (this.activeDate = a.$parent.$eval(b.initDate) || new Date, a.$parent.$watch(b.initDate, function (a) {
a && (j.$isEmpty(j.$modelValue) || j.$invalid) && (i.activeDate = a, i.refreshView())
})) : this.activeDate = new Date, a.isActive = function (b) {
return 0 === i.compare(b.date, i.activeDate) ? (a.activeDateId = b.uid, !0) : !1
}, this.init = function (a) {
j = a, j.$render = function () {
i.render()
}
}, this.render = function () {
if (j.$viewValue) {
var a = new Date(j.$viewValue), b = !isNaN(a);
b ? this.activeDate = a : f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'), j.$setValidity("date", b)
}
this.refreshView()
}, this.refreshView = function () {
if (this.element) {
this._refreshView();
var a = j.$viewValue ? new Date(j.$viewValue) : null;
j.$setValidity("date-disabled", !a || this.element && !this.isDisabled(a))
}
}, this.createDateObject = function (a, b) {
var c = j.$viewValue ? new Date(j.$viewValue) : null;
return {
date: a,
label: g(a, b),
selected: c && 0 === this.compare(a, c),
disabled: this.isDisabled(a),
current: 0 === this.compare(a, new Date),
customClass: this.customClass(a)
}
}, this.isDisabled = function (c) {
return this.minDate && this.compare(c, this.minDate) < 0 || this.maxDate && this.compare(c, this.maxDate) > 0 || b.dateDisabled && a.dateDisabled({
date: c,
mode: a.datepickerMode
})
}, this.customClass = function (b) {
return a.customClass({date: b, mode: a.datepickerMode})
}, this.split = function (a, b) {
for (var c = []; a.length > 0;)c.push(a.splice(0, b));
return c
}, a.select = function (b) {
if (a.datepickerMode === i.minMode) {
var c = j.$viewValue ? new Date(j.$viewValue) : new Date(0, 0, 0, 0, 0, 0, 0);
c.setFullYear(b.getFullYear(), b.getMonth(), b.getDate()), j.$setViewValue(c), j.$render()
} else i.activeDate = b, a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) - 1]
}, a.move = function (a) {
var b = i.activeDate.getFullYear() + a * (i.step.years || 0), c = i.activeDate.getMonth() + a * (i.step.months || 0);
i.activeDate.setFullYear(b, c, 1), i.refreshView()
}, a.toggleMode = function (b) {
b = b || 1, a.datepickerMode === i.maxMode && 1 === b || a.datepickerMode === i.minMode && -1 === b || (a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) + b])
}, a.keys = {
13: "enter",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down"
};
var k = function () {
e(function () {
i.element[0].focus()
}, 0, !1)
};
a.$on("datepicker.focus", k), a.keydown = function (b) {
var c = a.keys[b.which];
if (c && !b.shiftKey && !b.altKey)if (b.preventDefault(), i.shortcutPropagation || b.stopPropagation(), "enter" === c || "space" === c) {
if (i.isDisabled(i.activeDate))return;
a.select(i.activeDate), k()
} else!b.ctrlKey || "up" !== c && "down" !== c ? (i.handleKeyDown(c, b), i.refreshView()) : (a.toggleMode("up" === c ? 1 : -1), k())
}
}]).directive("datepicker", function () {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/datepicker.html",
scope: {datepickerMode: "=?", dateDisabled: "&", customClass: "&", shortcutPropagation: "&?"},
require: ["datepicker", "?^ngModel"],
controller: "DatepickerController",
link: function (a, b, c, d) {
var e = d[0], f = d[1];
f && e.init(f)
}
}
}).directive("daypicker", ["dateFilter", function (a) {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/day.html",
require: "^datepicker",
link: function (b, c, d, e) {
function f(a, b) {
return 1 !== b || a % 4 !== 0 || a % 100 === 0 && a % 400 !== 0 ? i[b] : 29
}
function g(a, b) {
var c = new Array(b), d = new Date(a), e = 0;
for (d.setHours(12); b > e;)c[e++] = new Date(d), d.setDate(d.getDate() + 1);
return c
}
function h(a) {
var b = new Date(a);
b.setDate(b.getDate() + 4 - (b.getDay() || 7));
var c = b.getTime();
return b.setMonth(0), b.setDate(1), Math.floor(Math.round((c - b) / 864e5) / 7) + 1
}
b.showWeeks = e.showWeeks, e.step = {months: 1}, e.element = c;
var i = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
e._refreshView = function () {
var c = e.activeDate.getFullYear(), d = e.activeDate.getMonth(), f = new Date(c, d, 1), i = e.startingDay - f.getDay(), j = i > 0 ? 7 - i : -i, k = new Date(f);
j > 0 && k.setDate(-j + 1);
for (var l = g(k, 42), m = 0; 42 > m; m++)l[m] = angular.extend(e.createDateObject(l[m], e.formatDay), {
secondary: l[m].getMonth() !== d,
uid: b.uniqueId + "-" + m
});
b.labels = new Array(7);
for (var n = 0; 7 > n; n++)b.labels[n] = {
abbr: a(l[n].date, e.formatDayHeader),
full: a(l[n].date, "EEEE")
};
if (b.title = a(e.activeDate, e.formatDayTitle), b.rows = e.split(l, 7), b.showWeeks) {
b.weekNumbers = [];
for (var o = (11 - e.startingDay) % 7, p = b.rows.length, q = 0; p > q; q++)b.weekNumbers.push(h(b.rows[q][o].date))
}
}, e.compare = function (a, b) {
return new Date(a.getFullYear(), a.getMonth(), a.getDate()) - new Date(b.getFullYear(), b.getMonth(), b.getDate())
}, e.handleKeyDown = function (a) {
var b = e.activeDate.getDate();
if ("left" === a)b -= 1; else if ("up" === a)b -= 7; else if ("right" === a)b += 1; else if ("down" === a)b += 7; else if ("pageup" === a || "pagedown" === a) {
var c = e.activeDate.getMonth() + ("pageup" === a ? -1 : 1);
e.activeDate.setMonth(c, 1), b = Math.min(f(e.activeDate.getFullYear(), e.activeDate.getMonth()), b)
} else"home" === a ? b = 1 : "end" === a && (b = f(e.activeDate.getFullYear(), e.activeDate.getMonth()));
e.activeDate.setDate(b)
}, e.refreshView()
}
}
}]).directive("monthpicker", ["dateFilter", function (a) {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/month.html",
require: "^datepicker",
link: function (b, c, d, e) {
e.step = {years: 1}, e.element = c, e._refreshView = function () {
for (var c = new Array(12), d = e.activeDate.getFullYear(), f = 0; 12 > f; f++)c[f] = angular.extend(e.createDateObject(new Date(d, f, 1), e.formatMonth), {uid: b.uniqueId + "-" + f});
b.title = a(e.activeDate, e.formatMonthTitle), b.rows = e.split(c, 3)
}, e.compare = function (a, b) {
return new Date(a.getFullYear(), a.getMonth()) - new Date(b.getFullYear(), b.getMonth())
}, e.handleKeyDown = function (a) {
var b = e.activeDate.getMonth();
if ("left" === a)b -= 1; else if ("up" === a)b -= 3; else if ("right" === a)b += 1; else if ("down" === a)b += 3; else if ("pageup" === a || "pagedown" === a) {
var c = e.activeDate.getFullYear() + ("pageup" === a ? -1 : 1);
e.activeDate.setFullYear(c)
} else"home" === a ? b = 0 : "end" === a && (b = 11);
e.activeDate.setMonth(b)
}, e.refreshView()
}
}
}]).directive("yearpicker", ["dateFilter", function () {
return {
restrict: "EA",
replace: !0,
templateUrl: "template/datepicker/year.html",
require: "^datepicker",
link: function (a, b, c, d) {
function e(a) {
return parseInt((a - 1) / f, 10) * f + 1
}
var f = d.yearRange;
d.step = {years: f}, d.element = b, d._refreshView = function () {
for (var b = new Array(f), c = 0, g = e(d.activeDate.getFullYear()); f > c; c++)b[c] = angular.extend(d.createDateObject(new Date(g + c, 0, 1), d.formatYear), {uid: a.uniqueId + "-" + c});
a.title = [b[0].label, b[f - 1].label].join(" - "), a.rows = d.split(b, 5)
}, d.compare = function (a, b) {
return a.getFullYear() - b.getFullYear()
}, d.handleKeyDown = function (a) {
var b = d.activeDate.getFullYear();
"left" === a ? b -= 1 : "up" === a ? b -= 5 : "right" === a ? b += 1 : "down" === a ? b += 5 : "pageup" === a || "pagedown" === a ? b += ("pageup" === a ? -1 : 1) * d.step.years : "home" === a ? b = e(d.activeDate.getFullYear()) : "end" === a && (b = e(d.activeDate.getFullYear()) + f - 1), d.activeDate.setFullYear(b)
}, d.refreshView()
}
}
}]).constant("datepickerPopupConfig", {
datepickerPopup: "yyyy-MM-dd",
html5Types: {date: "yyyy-MM-dd", "datetime-local": "yyyy-MM-ddTHH:mm:ss.sss", month: "yyyy-MM"},
currentText: "Today",
clearText: "Clear",
closeText: "Done",
closeOnDateSelection: !0,
appendToBody: !1,
showButtonBar: !0
}).directive("datepickerPopup", ["$compile", "$parse", "$document", "$position", "dateFilter", "dateParser", "datepickerPopupConfig", function (a, b, c, d, e, f, g) {
return {
restrict: "EA",
require: "ngModel",
scope: {isOpen: "=?", currentText: "@", clearText: "@", closeText: "@", dateDisabled: "&", customClass: "&"},
link: function (h, i, j, k) {
function l(a) {
return a.replace(/([A-Z])/g, function (a) {
return "-" + a.toLowerCase()
})
}
function m(a) {
if (angular.isNumber(a) && (a = new Date(a)), a) {
if (angular.isDate(a) && !isNaN(a))return a;
if (angular.isString(a)) {
var b = f.parse(a, o, h.date) || new Date(a);
return isNaN(b) ? void 0 : b
}
return void 0
}
return null
}
function n(a, b) {
var c = a || b;
if (angular.isNumber(c) && (c = new Date(c)), c) {
if (angular.isDate(c) && !isNaN(c))return !0;
if (angular.isString(c)) {
var d = f.parse(c, o) || new Date(c);
return !isNaN(d)
}
return !1
}
return !0
}
var o, p = angular.isDefined(j.closeOnDateSelection) ? h.$parent.$eval(j.closeOnDateSelection) : g.closeOnDateSelection, q = angular.isDefined(j.datepickerAppendToBody) ? h.$parent.$eval(j.datepickerAppendToBody) : g.appendToBody;
h.showButtonBar = angular.isDefined(j.showButtonBar) ? h.$parent.$eval(j.showButtonBar) : g.showButtonBar, h.getText = function (a) {
return h[a + "Text"] || g[a + "Text"]
};
var r = !1;
if (g.html5Types[j.type] ? (o = g.html5Types[j.type], r = !0) : (o = j.datepickerPopup || g.datepickerPopup, j.$observe("datepickerPopup", function (a) {
var b = a || g.datepickerPopup;
if (b !== o && (o = b, k.$modelValue = null, !o))throw new Error("datepickerPopup must have a date format specified.")
})), !o)throw new Error("datepickerPopup must have a date format specified.");
if (r && j.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");
var s = angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");
s.attr({"ng-model": "date", "ng-change": "dateSelection()"});
var t = angular.element(s.children()[0]);
if (r && "month" == j.type && (t.attr("datepicker-mode", '"month"'), t.attr("min-mode", "month")), j.datepickerOptions) {
var u = h.$parent.$eval(j.datepickerOptions);
u.initDate && (h.initDate = u.initDate, t.attr("init-date", "initDate"), delete u.initDate), angular.forEach(u, function (a, b) {
t.attr(l(b), a)
})
}
h.watchData = {}, angular.forEach(["minDate", "maxDate", "datepickerMode", "initDate", "shortcutPropagation"], function (a) {
if (j[a]) {
var c = b(j[a]);
if (h.$parent.$watch(c, function (b) {
h.watchData[a] = b
}), t.attr(l(a), "watchData." + a), "datepickerMode" === a) {
var d = c.assign;
h.$watch("watchData." + a, function (a, b) {
a !== b && d(h.$parent, a)
})
}
}
}), j.dateDisabled && t.attr("date-disabled", "dateDisabled({ date: date, mode: mode })"), j.showWeeks && t.attr("show-weeks", j.showWeeks), j.customClass && t.attr("custom-class", "customClass({ date: date, mode: mode })"), r ? k.$formatters.push(function (a) {
return h.date = a, a
}) : (k.$$parserName = "date", k.$validators.date = n, k.$parsers.unshift(m), k.$formatters.push(function (a) {
return h.date = a, k.$isEmpty(a) ? a : e(a, o)
})), h.dateSelection = function (a) {
angular.isDefined(a) && (h.date = a);
var b = h.date ? e(h.date, o) : "";
i.val(b), k.$setViewValue(b), p && (h.isOpen = !1, i[0].focus())
}, k.$viewChangeListeners.push(function () {
h.date = f.parse(k.$viewValue, o, h.date) || new Date(k.$viewValue)
});
var v = function (a) {
h.isOpen && a.target !== i[0] && h.$apply(function () {
h.isOpen = !1
})
}, w = function (a) {
h.keydown(a)
};
i.bind("keydown", w), h.keydown = function (a) {
27 === a.which ? (a.preventDefault(), h.isOpen && a.stopPropagation(), h.close()) : 40 !== a.which || h.isOpen || (h.isOpen = !0)
}, h.$watch("isOpen", function (a) {
a ? (h.$broadcast("datepicker.focus"), h.position = q ? d.offset(i) : d.position(i), h.position.top = h.position.top + i.prop("offsetHeight"), c.bind("click", v)) : c.unbind("click", v)
}), h.select = function (a) {
if ("today" === a) {
var b = new Date;
angular.isDate(h.date) ? (a = new Date(h.date), a.setFullYear(b.getFullYear(), b.getMonth(), b.getDate())) : a = new Date(b.setHours(0, 0, 0, 0))
}
h.dateSelection(a)
}, h.close = function () {
h.isOpen = !1, i[0].focus()
};
var x = a(s)(h);
s.remove(), q ? c.find("body").append(x) : i.after(x), h.$on("$destroy", function () {
x.remove(), i.unbind("keydown", w), c.unbind("click", v)
})
}
}
}]).directive("datepickerPopupWrap", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
templateUrl: "template/datepicker/popup.html",
link: function (a, b) {
b.bind("click", function (a) {
a.preventDefault(), a.stopPropagation()
})
}
}
}), angular.module("ui.bootstrap.dropdown", ["ui.bootstrap.position"]).constant("dropdownConfig", {openClass: "open"}).service("dropdownService", ["$document", "$rootScope", function (a, b) {
var c = null;
this.open = function (b) {
c || (a.bind("click", d), a.bind("keydown", e)), c && c !== b && (c.isOpen = !1), c = b
}, this.close = function (b) {
c === b && (c = null, a.unbind("click", d), a.unbind("keydown", e))
};
var d = function (a) {
if (c && (!a || "disabled" !== c.getAutoClose())) {
var d = c.getToggleElement();
if (!(a && d && d[0].contains(a.target))) {
var e = c.getElement();
a && "outsideClick" === c.getAutoClose() && e && e[0].contains(a.target) || (c.isOpen = !1, b.$$phase || c.$apply())
}
}
}, e = function (a) {
27 === a.which && (c.focusToggleElement(), d())
}
}]).controller("DropdownController", ["$scope", "$attrs", "$parse", "dropdownConfig", "dropdownService", "$animate", "$position", "$document", function (a, b, c, d, e, f, g, h) {
var i, j = this, k = a.$new(), l = d.openClass, m = angular.noop, n = b.onToggle ? c(b.onToggle) : angular.noop, o = !1;
this.init = function (d) {
j.$element = d, b.isOpen && (i = c(b.isOpen), m = i.assign, a.$watch(i, function (a) {
k.isOpen = !!a
})), o = angular.isDefined(b.dropdownAppendToBody), o && j.dropdownMenu && (h.find("body").append(j.dropdownMenu), d.on("$destroy", function () {
j.dropdownMenu.remove()
}))
}, this.toggle = function (a) {
return k.isOpen = arguments.length ? !!a : !k.isOpen
}, this.isOpen = function () {
return k.isOpen
}, k.getToggleElement = function () {
return j.toggleElement
}, k.getAutoClose = function () {
return b.autoClose || "always"
}, k.getElement = function () {
return j.$element
}, k.focusToggleElement = function () {
j.toggleElement && j.toggleElement[0].focus()
}, k.$watch("isOpen", function (b, c) {
if (o && j.dropdownMenu) {
var d = g.positionElements(j.$element, j.dropdownMenu, "bottom-left", !0);
j.dropdownMenu.css({top: d.top + "px", left: d.left + "px", display: b ? "block" : "none"})
}
f[b ? "addClass" : "removeClass"](j.$element, l), b ? (k.focusToggleElement(), e.open(k)) : e.close(k), m(a, b), angular.isDefined(b) && b !== c && n(a, {open: !!b})
}), a.$on("$locationChangeSuccess", function () {
k.isOpen = !1
}), a.$on("$destroy", function () {
k.$destroy()
})
}]).directive("dropdown", function () {
return {
controller: "DropdownController", link: function (a, b, c, d) {
d.init(b)
}
}
}).directive("dropdownMenu", function () {
return {
restrict: "AC", require: "?^dropdown", link: function (a, b, c, d) {
d && (d.dropdownMenu = b)
}
}
}).directive("dropdownToggle", function () {
return {
require: "?^dropdown", link: function (a, b, c, d) {
if (d) {
d.toggleElement = b;
var e = function (e) {
e.preventDefault(), b.hasClass("disabled") || c.disabled || a.$apply(function () {
d.toggle()
})
};
b.bind("click", e), b.attr({
"aria-haspopup": !0,
"aria-expanded": !1
}), a.$watch(d.isOpen, function (a) {
b.attr("aria-expanded", !!a)
}), a.$on("$destroy", function () {
b.unbind("click", e)
})
}
}
}
}), angular.module("ui.bootstrap.modal", []).factory("$$stackedMap", function () {
return {
createNew: function () {
var a = [];
return {
add: function (b, c) {
a.push({key: b, value: c})
}, get: function (b) {
for (var c = 0; c < a.length; c++)if (b == a[c].key)return a[c]
}, keys: function () {
for (var b = [], c = 0; c < a.length; c++)b.push(a[c].key);
return b
}, top: function () {
return a[a.length - 1]
}, remove: function (b) {
for (var c = -1, d = 0; d < a.length; d++)if (b == a[d].key) {
c = d;
break
}
return a.splice(c, 1)[0]
}, removeTop: function () {
return a.splice(a.length - 1, 1)[0]
}, length: function () {
return a.length
}
}
}
}
}).directive("modalBackdrop", ["$timeout", function (a) {
function b(b) {
b.animate = !1, a(function () {
b.animate = !0
})
}
return {
restrict: "EA", replace: !0, templateUrl: "template/modal/backdrop.html", compile: function (a, c) {
return a.addClass(c.backdropClass), b
}
}
}]).directive("modalWindow", ["$modalStack", "$q", function (a, b) {
return {
restrict: "EA",
scope: {index: "@", animate: "="},
replace: !0,
transclude: !0,
templateUrl: function (a, b) {
return b.templateUrl || "template/modal/window.html"
},
link: function (c, d, e) {
d.addClass(e.windowClass || ""), c.size = e.size, c.close = function (b) {
var c = a.getTop();
c && c.value.backdrop && "static" != c.value.backdrop && b.target === b.currentTarget && (b.preventDefault(), b.stopPropagation(), a.dismiss(c.key, "backdrop click"))
}, c.$isRendered = !0;
var f = b.defer();
e.$observe("modalRender", function (a) {
"true" == a && f.resolve()
}), f.promise.then(function () {
c.animate = !0;
var b = d[0].querySelectorAll("[autofocus]");
b.length ? b[0].focus() : d[0].focus();
var e = a.getTop();
e && a.modalRendered(e.key)
})
}
}
}]).directive("modalAnimationClass", [function () {
return {
compile: function (a, b) {
b.modalAnimation && a.addClass(b.modalAnimationClass)
}
}
}]).directive("modalTransclude", function () {
return {
link: function (a, b, c, d, e) {
e(a.$parent, function (a) {
b.empty(), b.append(a)
})
}
}
}).factory("$modalStack", ["$animate", "$timeout", "$document", "$compile", "$rootScope", "$$stackedMap", function (a, b, c, d, e, f) {
function g() {
for (var a = -1, b = o.keys(), c = 0; c < b.length; c++)o.get(b[c]).value.backdrop && (a = c);
return a
}
function h(a) {
var b = c.find("body").eq(0), d = o.get(a).value;
o.remove(a), j(d.modalDomEl, d.modalScope, function () {
b.toggleClass(n, o.length() > 0), i()
})
}
function i() {
if (l && -1 == g()) {
var a = m;
j(l, m, function () {
a = null
}), l = void 0, m = void 0
}
}
function j(c, d, f) {
function g() {
g.done || (g.done = !0, c.remove(), d.$destroy(), f && f())
}
d.animate = !1, c.attr("modal-animation") && a.enabled() ? c.one("$animate:close", function () {
e.$evalAsync(g)
}) : b(g)
}
function k(a, b, c) {
return !a.value.modalScope.$broadcast("modal.closing", b, c).defaultPrevented
}
var l, m, n = "modal-open", o = f.createNew(), p = {};
return e.$watch(g, function (a) {
m && (m.index = a)
}), c.bind("keydown", function (a) {
var b;
27 === a.which && (b = o.top(), b && b.value.keyboard && (a.preventDefault(), e.$apply(function () {
p.dismiss(b.key, "escape key press")
})))
}), p.open = function (a, b) {
var f = c[0].activeElement;
o.add(a, {
deferred: b.deferred,
renderDeferred: b.renderDeferred,
modalScope: b.scope,
backdrop: b.backdrop,
keyboard: b.keyboard
});
var h = c.find("body").eq(0), i = g();
if (i >= 0 && !l) {
m = e.$new(!0), m.index = i;
var j = angular.element('<div modal-backdrop="modal-backdrop"></div>');
j.attr("backdrop-class", b.backdropClass), b.animation && j.attr("modal-animation", "true"), l = d(j)(m), h.append(l)
}
var k = angular.element('<div modal-window="modal-window"></div>');
k.attr({
"template-url": b.windowTemplateUrl,
"window-class": b.windowClass,
size: b.size,
index: o.length() - 1,
animate: "animate"
}).html(b.content), b.animation && k.attr("modal-animation", "true");
var p = d(k)(b.scope);
o.top().value.modalDomEl = p, o.top().value.modalOpener = f, h.append(p), h.addClass(n)
}, p.close = function (a, b) {
var c = o.get(a);
return c && k(c, b, !0) ? (c.value.deferred.resolve(b), h(a), c.value.modalOpener.focus(), !0) : !c
}, p.dismiss = function (a, b) {
var c = o.get(a);
return c && k(c, b, !1) ? (c.value.deferred.reject(b), h(a), c.value.modalOpener.focus(), !0) : !c
}, p.dismissAll = function (a) {
for (var b = this.getTop(); b && this.dismiss(b.key, a);)b = this.getTop()
}, p.getTop = function () {
return o.top()
}, p.modalRendered = function (a) {
var b = o.get(a);
b && b.value.renderDeferred.resolve()
}, p
}]).provider("$modal", function () {
var a = {
options: {animation: !0, backdrop: !0, keyboard: !0},
$get: ["$injector", "$rootScope", "$q", "$templateRequest", "$controller", "$modalStack", function (b, c, d, e, f, g) {
function h(a) {
return a.template ? d.when(a.template) : e(angular.isFunction(a.templateUrl) ? a.templateUrl() : a.templateUrl)
}
function i(a) {
var c = [];
return angular.forEach(a, function (a) {
(angular.isFunction(a) || angular.isArray(a)) && c.push(d.when(b.invoke(a)))
}), c
}
var j = {};
return j.open = function (b) {
var e = d.defer(), j = d.defer(), k = d.defer(), l = {
result: e.promise,
opened: j.promise,
rendered: k.promise,
close: function (a) {
return g.close(l, a)
},
dismiss: function (a) {
return g.dismiss(l, a)
}
};
if (b = angular.extend({}, a.options, b), b.resolve = b.resolve || {}, !b.template && !b.templateUrl)throw new Error("One of template or templateUrl options is required.");
var m = d.all([h(b)].concat(i(b.resolve)));
return m.then(function (a) {
var d = (b.scope || c).$new();
d.$close = l.close, d.$dismiss = l.dismiss;
var h, i = {}, j = 1;
b.controller && (i.$scope = d, i.$modalInstance = l, angular.forEach(b.resolve, function (b, c) {
i[c] = a[j++]
}), h = f(b.controller, i), b.controllerAs && (d[b.controllerAs] = h)), g.open(l, {
scope: d,
deferred: e,
renderDeferred: k,
content: a[0],
animation: b.animation,
backdrop: b.backdrop,
keyboard: b.keyboard,
backdropClass: b.backdropClass,
windowClass: b.windowClass,
windowTemplateUrl: b.windowTemplateUrl,
size: b.size
})
}, function (a) {
e.reject(a)
}), m.then(function () {
j.resolve(!0)
}, function (a) {
j.reject(a)
}), l
}, j
}]
};
return a
}), angular.module("ui.bootstrap.pagination", []).controller("PaginationController", ["$scope", "$attrs", "$parse", function (a, b, c) {
var d = this, e = {$setViewValue: angular.noop}, f = b.numPages ? c(b.numPages).assign : angular.noop;
this.init = function (g, h) {
e = g, this.config = h, e.$render = function () {
d.render()
}, b.itemsPerPage ? a.$parent.$watch(c(b.itemsPerPage), function (b) {
d.itemsPerPage = parseInt(b, 10), a.totalPages = d.calculateTotalPages()
}) : this.itemsPerPage = h.itemsPerPage, a.$watch("totalItems", function () {
a.totalPages = d.calculateTotalPages()
}), a.$watch("totalPages", function (b) {
f(a.$parent, b), a.page > b ? a.selectPage(b) : e.$render()
})
}, this.calculateTotalPages = function () {
var b = this.itemsPerPage < 1 ? 1 : Math.ceil(a.totalItems / this.itemsPerPage);
return Math.max(b || 0, 1)
}, this.render = function () {
a.page = parseInt(e.$viewValue, 10) || 1
}, a.selectPage = function (b, c) {
a.page !== b && b > 0 && b <= a.totalPages && (c && c.target && c.target.blur(), e.$setViewValue(b), e.$render())
}, a.getText = function (b) {
return a[b + "Text"] || d.config[b + "Text"]
}, a.noPrevious = function () {
return 1 === a.page
}, a.noNext = function () {
return a.page === a.totalPages
}
}]).constant("paginationConfig", {
itemsPerPage: 10,
boundaryLinks: !1,
directionLinks: !0,
firstText: "First",
previousText: "Previous",
nextText: "Next",
lastText: "Last",
rotate: !0
}).directive("pagination", ["$parse", "paginationConfig", function (a, b) {
return {
restrict: "EA",
scope: {totalItems: "=", firstText: "@", previousText: "@", nextText: "@", lastText: "@"},
require: ["pagination", "?ngModel"],
controller: "PaginationController",
templateUrl: "template/pagination/pagination.html",
replace: !0,
link: function (c, d, e, f) {
function g(a, b, c) {
return {number: a, text: b, active: c}
}
function h(a, b) {
var c = [], d = 1, e = b, f = angular.isDefined(k) && b > k;
f && (l ? (d = Math.max(a - Math.floor(k / 2), 1), e = d + k - 1, e > b && (e = b, d = e - k + 1)) : (d = (Math.ceil(a / k) - 1) * k + 1, e = Math.min(d + k - 1, b)));
for (var h = d; e >= h; h++) {
var i = g(h, h, h === a);
c.push(i)
}
if (f && !l) {
if (d > 1) {
var j = g(d - 1, "...", !1);
c.unshift(j)
}
if (b > e) {
var m = g(e + 1, "...", !1);
c.push(m)
}
}
return c
}
var i = f[0], j = f[1];
if (j) {
var k = angular.isDefined(e.maxSize) ? c.$parent.$eval(e.maxSize) : b.maxSize, l = angular.isDefined(e.rotate) ? c.$parent.$eval(e.rotate) : b.rotate;
c.boundaryLinks = angular.isDefined(e.boundaryLinks) ? c.$parent.$eval(e.boundaryLinks) : b.boundaryLinks, c.directionLinks = angular.isDefined(e.directionLinks) ? c.$parent.$eval(e.directionLinks) : b.directionLinks, i.init(j, b), e.maxSize && c.$parent.$watch(a(e.maxSize), function (a) {
k = parseInt(a, 10), i.render()
});
var m = i.render;
i.render = function () {
m(), c.page > 0 && c.page <= c.totalPages && (c.pages = h(c.page, c.totalPages))
}
}
}
}
}]).constant("pagerConfig", {
itemsPerPage: 10,
previousText: "« Previous",
nextText: "Next »",
align: !0
}).directive("pager", ["pagerConfig", function (a) {
return {
restrict: "EA",
scope: {totalItems: "=", previousText: "@", nextText: "@"},
require: ["pager", "?ngModel"],
controller: "PaginationController",
templateUrl: "template/pagination/pager.html",
replace: !0,
link: function (b, c, d, e) {
var f = e[0], g = e[1];
g && (b.align = angular.isDefined(d.align) ? b.$parent.$eval(d.align) : a.align, f.init(g, a))
}
}
}]), angular.module("ui.bootstrap.tooltip", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).provider("$tooltip", function () {
function a(a) {
var b = /[A-Z]/g, c = "-";
return a.replace(b, function (a, b) {
return (b ? c : "") + a.toLowerCase()
})
}
var b = {placement: "top", animation: !0, popupDelay: 0, useContentExp: !1}, c = {
mouseenter: "mouseleave",
click: "click",
focus: "blur"
}, d = {};
this.options = function (a) {
angular.extend(d, a)
}, this.setTriggers = function (a) {
angular.extend(c, a)
}, this.$get = ["$window", "$compile", "$timeout", "$document", "$position", "$interpolate", function (e, f, g, h, i, j) {
return function (e, k, l, m) {
function n(a) {
var b = a || m.trigger || l, d = c[b] || b;
return {show: b, hide: d}
}
m = angular.extend({}, b, d, m);
var o = a(e), p = j.startSymbol(), q = j.endSymbol(), r = "<div " + o + '-popup title="' + p + "title" + q + '" ' + (m.useContentExp ? 'content-exp="contentExp()" ' : 'content="' + p + "content" + q + '" ') + 'placement="' + p + "placement" + q + '" popup-class="' + p + "popupClass" + q + '" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';
return {
restrict: "EA", compile: function () {
var a = f(r);
return function (b, c, d) {
function f() {
E.isOpen ? l() : j()
}
function j() {
(!D || b.$eval(d[k + "Enable"])) && (s(), E.popupDelay ? A || (A = g(o, E.popupDelay, !1), A.then(function (a) {
a()
})) : o()())
}
function l() {
b.$apply(function () {
p()
})
}
function o() {
return A = null, z && (g.cancel(z), z = null), (m.useContentExp ? E.contentExp() : E.content) ? (q(), x.css({
top: 0,
left: 0,
display: "block"
}), E.$digest(), F(), E.isOpen = !0, E.$apply(), F) : angular.noop
}
function p() {
E.isOpen = !1, g.cancel(A), A = null, E.animation ? z || (z = g(r, 500)) : r()
}
function q() {
x && r(), y = E.$new(), x = a(y, function (a) {
B ? h.find("body").append(a) : c.after(a)
}), y.$watch(function () {
g(F, 0, !1)
}), m.useContentExp && y.$watch("contentExp()", function (a) {
!a && E.isOpen && p()
})
}
function r() {
z = null, x && (x.remove(), x = null), y && (y.$destroy(), y = null)
}
function s() {
t(), u(), v()
}
function t() {
E.popupClass = d[k + "Class"]
}
function u() {
var a = d[k + "Placement"];
E.placement = angular.isDefined(a) ? a : m.placement
}
function v() {
var a = d[k + "PopupDelay"], b = parseInt(a, 10);
E.popupDelay = isNaN(b) ? m.popupDelay : b
}
function w() {
var a = d[k + "Trigger"];
G(), C = n(a), C.show === C.hide ? c.bind(C.show, f) : (c.bind(C.show, j), c.bind(C.hide, l))
}
var x, y, z, A, B = angular.isDefined(m.appendToBody) ? m.appendToBody : !1, C = n(void 0), D = angular.isDefined(d[k + "Enable"]), E = b.$new(!0), F = function () {
if (x) {
var a = i.positionElements(c, x, E.placement, B);
a.top += "px", a.left += "px", x.css(a)
}
};
E.origScope = b, E.isOpen = !1, E.contentExp = function () {
return b.$eval(d[e])
}, m.useContentExp || d.$observe(e, function (a) {
E.content = a, !a && E.isOpen && p()
}), d.$observe("disabled", function (a) {
a && E.isOpen && p()
}), d.$observe(k + "Title", function (a) {
E.title = a
});
var G = function () {
c.unbind(C.show, j), c.unbind(C.hide, l)
};
w();
var H = b.$eval(d[k + "Animation"]);
E.animation = angular.isDefined(H) ? !!H : m.animation;
var I = b.$eval(d[k + "AppendToBody"]);
B = angular.isDefined(I) ? I : B, B && b.$on("$locationChangeSuccess", function () {
E.isOpen && p()
}), b.$on("$destroy", function () {
g.cancel(z), g.cancel(A), G(), r(), E = null
})
}
}
}
}
}]
}).directive("tooltipTemplateTransclude", ["$animate", "$sce", "$compile", "$templateRequest", function (a, b, c, d) {
return {
link: function (e, f, g) {
var h, i, j, k = e.$eval(g.tooltipTemplateTranscludeScope), l = 0, m = function () {
i && (i.remove(), i = null), h && (h.$destroy(), h = null), j && (a.leave(j).then(function () {
i = null
}), i = j, j = null)
};
e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude), function (b) {
var g = ++l;
b ? (d(b, !0).then(function (d) {
if (g === l) {
var e = k.$new(), i = d, n = c(i)(e, function (b) {
m(), a.enter(b, f)
});
h = e, j = n, h.$emit("$includeContentLoaded", b)
}
}, function () {
g === l && (m(), e.$emit("$includeContentError", b))
}), e.$emit("$includeContentRequested", b)) : m()
}), e.$on("$destroy", m)
}
}
}]).directive("tooltipClasses", function () {
return {
restrict: "A", link: function (a, b, c) {
a.placement && b.addClass(a.placement), a.popupClass && b.addClass(a.popupClass), a.animation() && b.addClass(c.tooltipAnimationClass)
}
}
}).directive("tooltipPopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/tooltip/tooltip-popup.html"
}
}).directive("tooltip", ["$tooltip", function (a) {
return a("tooltip", "tooltip", "mouseenter")
}]).directive("tooltipTemplatePopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&"},
templateUrl: "template/tooltip/tooltip-template-popup.html"
}
}).directive("tooltipTemplate", ["$tooltip", function (a) {
return a("tooltipTemplate", "tooltip", "mouseenter", {useContentExp: !0})
}]).directive("tooltipHtmlPopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/tooltip/tooltip-html-popup.html"
}
}).directive("tooltipHtml", ["$tooltip", function (a) {
return a("tooltipHtml", "tooltip", "mouseenter", {useContentExp: !0})
}]).directive("tooltipHtmlUnsafePopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/tooltip/tooltip-html-unsafe-popup.html"
}
}).value("tooltipHtmlUnsafeSuppressDeprecated", !1).directive("tooltipHtmlUnsafe", ["$tooltip", "tooltipHtmlUnsafeSuppressDeprecated", "$log", function (a, b, c) {
return b || c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."), a("tooltipHtmlUnsafe", "tooltip", "mouseenter")
}]), angular.module("ui.bootstrap.popover", ["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {
title: "@",
contentExp: "&",
placement: "@",
popupClass: "@",
animation: "&",
isOpen: "&",
originScope: "&"
},
templateUrl: "template/popover/popover-template.html"
}
}).directive("popoverTemplate", ["$tooltip", function (a) {
return a("popoverTemplate", "popover", "click", {useContentExp: !0})
}]).directive("popoverPopup", function () {
return {
restrict: "EA",
replace: !0,
scope: {title: "@", content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"},
templateUrl: "template/popover/popover.html"
}
}).directive("popover", ["$tooltip", function (a) {
return a("popover", "popover", "click")
}]), angular.module("ui.bootstrap.progressbar", []).constant("progressConfig", {
animate: !0,
max: 100
}).controller("ProgressController", ["$scope", "$attrs", "progressConfig", function (a, b, c) {
var d = this, e = angular.isDefined(b.animate) ? a.$parent.$eval(b.animate) : c.animate;
this.bars = [], a.max = angular.isDefined(a.max) ? a.max : c.max, this.addBar = function (b, c) {
e || c.css({transition: "none"}), this.bars.push(b), b.$watch("value", function (c) {
b.percent = +(100 * c / a.max).toFixed(2)
}), b.$on("$destroy", function () {
c = null, d.removeBar(b)
})
}, this.removeBar = function (a) {
this.bars.splice(this.bars.indexOf(a), 1)
}
}]).directive("progress", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
controller: "ProgressController",
require: "progress",
scope: {},
templateUrl: "template/progressbar/progress.html"
}
}).directive("bar", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
require: "^progress",
scope: {value: "=", max: "=?", type: "@"},
templateUrl: "template/progressbar/bar.html",
link: function (a, b, c, d) {
d.addBar(a, b)
}
}
}).directive("progressbar", function () {
return {
restrict: "EA",
replace: !0,
transclude: !0,
controller: "ProgressController",
scope: {value: "=", max: "=?", type: "@"},
templateUrl: "template/progressbar/progressbar.html",
link: function (a, b, c, d) {
d.addBar(a, angular.element(b.children()[0]))
}
}
}), angular.module("ui.bootstrap.rating", []).constant("ratingConfig", {
max: 5,
stateOn: null,
stateOff: null
}).controller("RatingController", ["$scope", "$attrs", "ratingConfig", function (a, b, c) {
var d = {$setViewValue: angular.noop};
this.init = function (e) {
d = e, d.$render = this.render, d.$formatters.push(function (a) {
return angular.isNumber(a) && a << 0 !== a && (a = Math.round(a)), a
}), this.stateOn = angular.isDefined(b.stateOn) ? a.$parent.$eval(b.stateOn) : c.stateOn, this.stateOff = angular.isDefined(b.stateOff) ? a.$parent.$eval(b.stateOff) : c.stateOff;
var f = angular.isDefined(b.ratingStates) ? a.$parent.$eval(b.ratingStates) : new Array(angular.isDefined(b.max) ? a.$parent.$eval(b.max) : c.max);
a.range = this.buildTemplateObjects(f)
}, this.buildTemplateObjects = function (a) {
for (var b = 0, c = a.length; c > b; b++)a[b] = angular.extend({index: b}, {
stateOn: this.stateOn,
stateOff: this.stateOff
}, a[b]);
return a
}, a.rate = function (b) {
!a.readonly && b >= 0 && b <= a.range.length && (d.$setViewValue(b), d.$render())
}, a.enter = function (b) {
a.readonly || (a.value = b), a.onHover({value: b})
}, a.reset = function () {
a.value = d.$viewValue, a.onLeave()
}, a.onKeydown = function (b) {
/(37|38|39|40)/.test(b.which) && (b.preventDefault(), b.stopPropagation(), a.rate(a.value + (38 === b.which || 39 === b.which ? 1 : -1)))
}, this.render = function () {
a.value = d.$viewValue
}
}]).directive("rating", function () {
return {
restrict: "EA",
require: ["rating", "ngModel"],
scope: {readonly: "=?", onHover: "&", onLeave: "&"},
controller: "RatingController",
templateUrl: "template/rating/rating.html",
replace: !0,
link: function (a, b, c, d) {
var e = d[0], f = d[1];
e.init(f)
}
}
}), angular.module("ui.bootstrap.tabs", []).controller("TabsetController", ["$scope", function (a) {
var b = this, c = b.tabs = a.tabs = [];
b.select = function (a) {
angular.forEach(c, function (b) {
b.active && b !== a && (b.active = !1, b.onDeselect())
}), a.active = !0, a.onSelect()
}, b.addTab = function (a) {
c.push(a), 1 === c.length && a.active !== !1 ? a.active = !0 : a.active ? b.select(a) : a.active = !1
}, b.removeTab = function (a) {
var e = c.indexOf(a);
if (a.active && c.length > 1 && !d) {
var f = e == c.length - 1 ? e - 1 : e + 1;
b.select(c[f])
}
c.splice(e, 1)
};
var d;
a.$on("$destroy", function () {
d = !0
})
}]).directive("tabset", function () {
return {
restrict: "EA",
transclude: !0,
replace: !0,
scope: {type: "@"},
controller: "TabsetController",
templateUrl: "template/tabs/tabset.html",
link: function (a, b, c) {
a.vertical = angular.isDefined(c.vertical) ? a.$parent.$eval(c.vertical) : !1, a.justified = angular.isDefined(c.justified) ? a.$parent.$eval(c.justified) : !1
}
}
}).directive("tab", ["$parse", "$log", function (a, b) {
return {
require: "^tabset",
restrict: "EA",
replace: !0,
templateUrl: "template/tabs/tab.html",
transclude: !0,
scope: {active: "=?", heading: "@", onSelect: "&select", onDeselect: "&deselect"},
controller: function () {
},
compile: function (c, d, e) {
return function (c, d, f, g) {
c.$watch("active", function (a) {
a && g.select(c)
}), c.disabled = !1, f.disable && c.$parent.$watch(a(f.disable), function (a) {
c.disabled = !!a
}), f.disabled && (b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'), c.$parent.$watch(a(f.disabled), function (a) {
c.disabled = !!a
})), c.select = function () {
c.disabled || (c.active = !0)
}, g.addTab(c), c.$on("$destroy", function () {
g.removeTab(c)
}), c.$transcludeFn = e
}
}
}
}]).directive("tabHeadingTransclude", [function () {
return {
restrict: "A", require: "^tab", link: function (a, b) {
a.$watch("headingElement", function (a) {
a && (b.html(""), b.append(a))
})
}
}
}]).directive("tabContentTransclude", function () {
function a(a) {
return a.tagName && (a.hasAttribute("tab-heading") || a.hasAttribute("data-tab-heading") || "tab-heading" === a.tagName.toLowerCase() || "data-tab-heading" === a.tagName.toLowerCase())
}
return {
restrict: "A", require: "^tabset", link: function (b, c, d) {
var e = b.$eval(d.tabContentTransclude);
e.$transcludeFn(e.$parent, function (b) {
angular.forEach(b, function (b) {
a(b) ? e.headingElement = b : c.append(b)
})
})
}
}
}), angular.module("ui.bootstrap.timepicker", []).constant("timepickerConfig", {
hourStep: 1,
minuteStep: 1,
showMeridian: !0,
meridians: null,
readonlyInput: !1,
mousewheel: !0,
arrowkeys: !0
}).controller("TimepickerController", ["$scope", "$attrs", "$parse", "$log", "$locale", "timepickerConfig", function (a, b, c, d, e, f) {
function g() {
var b = parseInt(a.hours, 10), c = a.showMeridian ? b > 0 && 13 > b : b >= 0 && 24 > b;
return c ? (a.showMeridian && (12 === b && (b = 0), a.meridian === p[1] && (b += 12)), b) : void 0
}
function h() {
var b = parseInt(a.minutes, 10);
return b >= 0 && 60 > b ? b : void 0
}
function i(a) {
return angular.isDefined(a) && a.toString().length < 2 ? "0" + a : a.toString()
}
function j(a) {
k(), o.$setViewValue(new Date(n)), l(a)
}
function k() {
o.$setValidity("time", !0), a.invalidHours = !1, a.invalidMinutes = !1
}
function l(b) {
var c = n.getHours(), d = n.getMinutes();
a.showMeridian && (c = 0 === c || 12 === c ? 12 : c % 12), a.hours = "h" === b ? c : i(c), "m" !== b && (a.minutes = i(d)), a.meridian = n.getHours() < 12 ? p[0] : p[1]
}
function m(a) {
var b = new Date(n.getTime() + 6e4 * a);
n.setHours(b.getHours(), b.getMinutes()), j()
}
var n = new Date, o = {$setViewValue: angular.noop}, p = angular.isDefined(b.meridians) ? a.$parent.$eval(b.meridians) : f.meridians || e.DATETIME_FORMATS.AMPMS;
this.init = function (c, d) {
o = c, o.$render = this.render, o.$formatters.unshift(function (a) {
return a ? new Date(a) : null
});
var e = d.eq(0), g = d.eq(1), h = angular.isDefined(b.mousewheel) ? a.$parent.$eval(b.mousewheel) : f.mousewheel;
h && this.setupMousewheelEvents(e, g);
var i = angular.isDefined(b.arrowkeys) ? a.$parent.$eval(b.arrowkeys) : f.arrowkeys;
i && this.setupArrowkeyEvents(e, g), a.readonlyInput = angular.isDefined(b.readonlyInput) ? a.$parent.$eval(b.readonlyInput) : f.readonlyInput, this.setupInputEvents(e, g)
};
var q = f.hourStep;
b.hourStep && a.$parent.$watch(c(b.hourStep), function (a) {
q = parseInt(a, 10)
});
var r = f.minuteStep;
b.minuteStep && a.$parent.$watch(c(b.minuteStep), function (a) {
r = parseInt(a, 10)
}), a.showMeridian = f.showMeridian, b.showMeridian && a.$parent.$watch(c(b.showMeridian), function (b) {
if (a.showMeridian = !!b, o.$error.time) {
var c = g(), d = h();
angular.isDefined(c) && angular.isDefined(d) && (n.setHours(c), j())
} else l()
}), this.setupMousewheelEvents = function (b, c) {
var d = function (a) {
a.originalEvent && (a = a.originalEvent);
var b = a.wheelDelta ? a.wheelDelta : -a.deltaY;
return a.detail || b > 0
};
b.bind("mousewheel wheel", function (b) {
a.$apply(d(b) ? a.incrementHours() : a.decrementHours()), b.preventDefault()
}), c.bind("mousewheel wheel", function (b) {
a.$apply(d(b) ? a.incrementMinutes() : a.decrementMinutes()), b.preventDefault()
})
}, this.setupArrowkeyEvents = function (b, c) {
b.bind("keydown", function (b) {
38 === b.which ? (b.preventDefault(), a.incrementHours(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementHours(), a.$apply())
}), c.bind("keydown", function (b) {
38 === b.which ? (b.preventDefault(), a.incrementMinutes(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementMinutes(), a.$apply())
})
}, this.setupInputEvents = function (b, c) {
if (a.readonlyInput)return a.updateHours = angular.noop, void(a.updateMinutes = angular.noop);
var d = function (b, c) {
o.$setViewValue(null), o.$setValidity("time", !1), angular.isDefined(b) && (a.invalidHours = b), angular.isDefined(c) && (a.invalidMinutes = c)
};
a.updateHours = function () {
var a = g();
angular.isDefined(a) ? (n.setHours(a), j("h")) : d(!0)
}, b.bind("blur", function () {
!a.invalidHours && a.hours < 10 && a.$apply(function () {
a.hours = i(a.hours)
})
}), a.updateMinutes = function () {
var a = h();
angular.isDefined(a) ? (n.setMinutes(a), j("m")) : d(void 0, !0)
}, c.bind("blur", function () {
!a.invalidMinutes && a.minutes < 10 && a.$apply(function () {
a.minutes = i(a.minutes)
})
})
}, this.render = function () {
var a = o.$viewValue;
isNaN(a) ? (o.$setValidity("time", !1), d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')) : (a && (n = a), k(), l())
}, a.incrementHours = function () {
m(60 * q)
}, a.decrementHours = function () {
m(60 * -q)
}, a.incrementMinutes = function () {
m(r)
}, a.decrementMinutes = function () {
m(-r)
}, a.toggleMeridian = function () {
m(720 * (n.getHours() < 12 ? 1 : -1))
}
}]).directive("timepicker", function () {
return {
restrict: "EA",
require: ["timepicker", "?^ngModel"],
controller: "TimepickerController",
replace: !0,
scope: {},
templateUrl: "template/timepicker/timepicker.html",
link: function (a, b, c, d) {
var e = d[0], f = d[1];
f && e.init(f, b.find("input"))
}
}
}), angular.module("ui.bootstrap.transition", []).value("$transitionSuppressDeprecated", !1).factory("$transition", ["$q", "$timeout", "$rootScope", "$log", "$transitionSuppressDeprecated", function (a, b, c, d, e) {
function f(a) {
for (var b in a)if (void 0 !== h.style[b])return a[b]
}
e || d.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");
var g = function (d, e, f) {
f = f || {};
var h = a.defer(), i = g[f.animation ? "animationEndEventName" : "transitionEndEventName"], j = function () {
c.$apply(function () {
d.unbind(i, j), h.resolve(d)
})
};
return i && d.bind(i, j), b(function () {
angular.isString(e) ? d.addClass(e) : angular.isFunction(e) ? e(d) : angular.isObject(e) && d.css(e), i || h.resolve(d)
}), h.promise.cancel = function () {
i && d.unbind(i, j), h.reject("Transition cancelled")
}, h.promise
}, h = document.createElement("trans"), i = {
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd",
transition: "transitionend"
}, j = {
WebkitTransition: "webkitAnimationEnd",
MozTransition: "animationend",
OTransition: "oAnimationEnd",
transition: "animationend"
};
return g.transitionEndEventName = f(i), g.animationEndEventName = f(j), g
}]), angular.module("ui.bootstrap.typeahead", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).factory("typeaheadParser", ["$parse", function (a) {
var b = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;
return {
parse: function (c) {
var d = c.match(b);
if (!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "' + c + '".');
return {itemName: d[3], source: a(d[4]), viewMapper: a(d[2] || d[1]), modelMapper: a(d[1])}
}
}
}]).directive("typeahead", ["$compile", "$parse", "$q", "$timeout", "$document", "$position", "typeaheadParser", function (a, b, c, d, e, f, g) {
var h = [9, 13, 27, 38, 40];
return {
require: "ngModel", link: function (i, j, k, l) {
var m, n = i.$eval(k.typeaheadMinLength) || 1, o = i.$eval(k.typeaheadWaitMs) || 0, p = i.$eval(k.typeaheadEditable) !== !1, q = b(k.typeaheadLoading).assign || angular.noop, r = b(k.typeaheadOnSelect), s = k.typeaheadInputFormatter ? b(k.typeaheadInputFormatter) : void 0, t = k.typeaheadAppendToBody ? i.$eval(k.typeaheadAppendToBody) : !1, u = i.$eval(k.typeaheadFocusFirst) !== !1, v = b(k.ngModel).assign, w = g.parse(k.typeahead), x = i.$new();
i.$on("$destroy", function () {
x.$destroy()
});
var y = "typeahead-" + x.$id + "-" + Math.floor(1e4 * Math.random());
j.attr({"aria-autocomplete": "list", "aria-expanded": !1, "aria-owns": y});
var z = angular.element("<div typeahead-popup></div>");
z.attr({
id: y,
matches: "matches",
active: "activeIdx",
select: "select(activeIdx)",
query: "query",
position: "position"
}), angular.isDefined(k.typeaheadTemplateUrl) && z.attr("template-url", k.typeaheadTemplateUrl);
var A = function () {
x.matches = [], x.activeIdx = -1, j.attr("aria-expanded", !1)
}, B = function (a) {
return y + "-option-" + a
};
x.$watch("activeIdx", function (a) {
0 > a ? j.removeAttr("aria-activedescendant") : j.attr("aria-activedescendant", B(a))
});
var C = function (a) {
var b = {$viewValue: a};
q(i, !0), c.when(w.source(i, b)).then(function (c) {
var d = a === l.$viewValue;
if (d && m)if (c && c.length > 0) {
x.activeIdx = u ? 0 : -1, x.matches.length = 0;
for (var e = 0; e < c.length; e++)b[w.itemName] = c[e], x.matches.push({
id: B(e),
label: w.viewMapper(x, b),
model: c[e]
});
x.query = a, x.position = t ? f.offset(j) : f.position(j), x.position.top = x.position.top + j.prop("offsetHeight"), j.attr("aria-expanded", !0)
} else A();
d && q(i, !1)
}, function () {
A(), q(i, !1)
})
};
A(), x.query = void 0;
var D, E = function (a) {
D = d(function () {
C(a)
}, o)
}, F = function () {
D && d.cancel(D)
};
l.$parsers.unshift(function (a) {
return m = !0, a && a.length >= n ? o > 0 ? (F(), E(a)) : C(a) : (q(i, !1), F(), A()), p ? a : a ? void l.$setValidity("editable", !1) : (l.$setValidity("editable", !0), a)
}), l.$formatters.push(function (a) {
var b, c, d = {};
return p || l.$setValidity("editable", !0), s ? (d.$model = a, s(i, d)) : (d[w.itemName] = a, b = w.viewMapper(i, d), d[w.itemName] = void 0, c = w.viewMapper(i, d), b !== c ? b : a)
}), x.select = function (a) {
var b, c, e = {};
e[w.itemName] = c = x.matches[a].model, b = w.modelMapper(i, e), v(i, b), l.$setValidity("editable", !0), l.$setValidity("parse", !0), r(i, {
$item: c,
$model: b,
$label: w.viewMapper(i, e)
}), A(), d(function () {
j[0].focus()
}, 0, !1)
}, j.bind("keydown", function (a) {
0 !== x.matches.length && -1 !== h.indexOf(a.which) && (-1 != x.activeIdx || 13 !== a.which && 9 !== a.which) && (a.preventDefault(), 40 === a.which ? (x.activeIdx = (x.activeIdx + 1) % x.matches.length, x.$digest()) : 38 === a.which ? (x.activeIdx = (x.activeIdx > 0 ? x.activeIdx : x.matches.length) - 1, x.$digest()) : 13 === a.which || 9 === a.which ? x.$apply(function () {
x.select(x.activeIdx)
}) : 27 === a.which && (a.stopPropagation(), A(), x.$digest()))
}), j.bind("blur", function () {
m = !1
});
var G = function (a) {
j[0] !== a.target && (A(), x.$digest())
};
e.bind("click", G), i.$on("$destroy", function () {
e.unbind("click", G), t && H.remove(), z.remove()
});
var H = a(z)(x);
t ? e.find("body").append(H) : j.after(H)
}
}
}]).directive("typeaheadPopup", function () {
return {
restrict: "EA",
scope: {matches: "=", query: "=", active: "=", position: "=", select: "&"},
replace: !0,
templateUrl: "template/typeahead/typeahead-popup.html",
link: function (a, b, c) {
a.templateUrl = c.templateUrl, a.isOpen = function () {
return a.matches.length > 0
}, a.isActive = function (b) {
return a.active == b
}, a.selectActive = function (b) {
a.active = b
}, a.selectMatch = function (b) {
a.select({activeIdx: b})
}
}
}
}).directive("typeaheadMatch", ["$templateRequest", "$compile", "$parse", function (a, b, c) {
return {
restrict: "EA", scope: {index: "=", match: "=", query: "="}, link: function (d, e, f) {
var g = c(f.templateUrl)(d.$parent) || "template/typeahead/typeahead-match.html";
a(g).then(function (a) {
b(a.trim())(d, function (a) {
e.replaceWith(a)
})
})
}
}
}]).filter("typeaheadHighlight", function () {
function a(a) {
return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1")
}
return function (b, c) {
return c ? ("" + b).replace(new RegExp(a(c), "gi"), "<strong>$&</strong>") : b
}
}), angular.module("template/accordion/accordion-group.html", []).run(["$templateCache", function (a) {
a.put("template/accordion/accordion-group.html", '<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a href="javascript:void(0)" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n')
}]), angular.module("template/accordion/accordion.html", []).run(["$templateCache", function (a) {
a.put("template/accordion/accordion.html", '<div class="panel-group" ng-transclude></div>')
}]), angular.module("template/alert/alert.html", []).run(["$templateCache", function (a) {
a.put("template/alert/alert.html", '<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">×</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')
}]), angular.module("template/carousel/carousel.html", []).run(["$templateCache", function (a) {
a.put("template/carousel/carousel.html", '<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:\'index\' track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')
}]), angular.module("template/carousel/slide.html", []).run(["$templateCache", function (a) {
a.put("template/carousel/slide.html", '<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n')
}]), angular.module("template/datepicker/datepicker.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/datepicker.html", '<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')
}]), angular.module("template/datepicker/day.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/day.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}" ng-class="dt.customClass">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/datepicker/month.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/month.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/datepicker/popup.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/popup.html", '<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')
}]), angular.module("template/datepicker/year.html", []).run(["$templateCache", function (a) {
a.put("template/datepicker/year.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/modal/backdrop.html", []).run(["$templateCache", function (a) {
a.put("template/modal/backdrop.html", '<div class="modal-backdrop"\n modal-animation-class="fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')
}]), angular.module("template/modal/window.html", []).run(["$templateCache", function (a) {
a.put("template/modal/window.html", '<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n modal-animation-class="fade"\n ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" modal-transclude></div></div>\n</div>\n')
}]), angular.module("template/pagination/pager.html", []).run(["$templateCache", function (a) {
a.put("template/pagination/pager.html", '<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n</ul>')
}]), angular.module("template/pagination/pagination.html", []).run(["$templateCache", function (a) {
a.put("template/pagination/pagination.html", '<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1, $event)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages, $event)">{{getText(\'last\')}}</a></li>\n</ul>')
}]), angular.module("template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-html-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n')
}]), angular.module("template/tooltip/tooltip-html-unsafe-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-html-unsafe-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')
}]), angular.module("template/tooltip/tooltip-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')
}]), angular.module("template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function (a) {
a.put("template/tooltip/tooltip-template-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')
}]), angular.module("template/popover/popover-template.html", []).run(["$templateCache", function (a) {
a.put("template/popover/popover-template.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n')
}]), angular.module("template/popover/popover-window.html", []).run(["$templateCache", function (a) {
a.put("template/popover/popover-window.html", '<div class="popover {{placement}}" ng-class="{ in: isOpen, fade: animation }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" tooltip-template-transclude></div>\n </div>\n</div>\n')
}]), angular.module("template/popover/popover.html", []).run(["$templateCache", function (a) {
a.put("template/popover/popover.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')
}]), angular.module("template/progressbar/bar.html", []).run(["$templateCache", function (a) {
a.put("template/progressbar/bar.html", '<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n')
}]), angular.module("template/progressbar/progress.html", []).run(["$templateCache", function (a) {
a.put("template/progressbar/progress.html", '<div class="progress" ng-transclude></div>')
}]), angular.module("template/progressbar/progressbar.html", []).run(["$templateCache", function (a) {
a.put("template/progressbar/progressbar.html", '<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>\n')
}]), angular.module("template/rating/rating.html", []).run(["$templateCache", function (a) {
a.put("template/rating/rating.html", '<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')
}]), angular.module("template/tabs/tab.html", []).run(["$templateCache", function (a) {
a.put("template/tabs/tab.html", '<li ng-class="{active: active, disabled: disabled}">\n <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')
}]), angular.module("template/tabs/tabset.html", []).run(["$templateCache", function (a) {
a.put("template/tabs/tabset.html", '<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')
}]), angular.module("template/timepicker/timepicker.html", []).run(["$templateCache", function (a) {
a.put("template/timepicker/timepicker.html", '<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td> </td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td> </td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')
}]), angular.module("template/typeahead/typeahead-match.html", []).run(["$templateCache", function (a) {
a.put("template/typeahead/typeahead-match.html", '<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')
}]), angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCache", function (a) {
a.put("template/typeahead/typeahead-popup.html", '<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')
}]), !angular.$$csp() && angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-client/src/test/resources/spring/XmlConfigAnnotationTest6.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerWithInterestedKeysBean"/>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerWithInterestedKeysBean"/>
</beans>
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/exception/BeanUtilsException.java | package com.ctrip.framework.apollo.common.exception;
public class BeanUtilsException extends RuntimeException{
public BeanUtilsException(Throwable e){
super(e);
}
}
| package com.ctrip.framework.apollo.common.exception;
public class BeanUtilsException extends RuntimeException{
public BeanUtilsException(Throwable e){
super(e);
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/ItemDTO.java | package com.ctrip.framework.apollo.common.dto;
public class ItemDTO extends BaseDTO{
private long id;
private long namespaceId;
private String key;
private String value;
private String comment;
private int lineNum;
public ItemDTO() {
}
public ItemDTO(String key, String value, String comment, int lineNum) {
this.key = key;
this.value = value;
this.comment = comment;
this.lineNum = lineNum;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getComment() {
return comment;
}
public String getKey() {
return key;
}
public long getNamespaceId() {
return namespaceId;
}
public String getValue() {
return value;
}
public void setComment(String comment) {
this.comment = comment;
}
public void setKey(String key) {
this.key = key;
}
public void setNamespaceId(long namespaceId) {
this.namespaceId = namespaceId;
}
public void setValue(String value) {
this.value = value;
}
public int getLineNum() {
return lineNum;
}
public void setLineNum(int lineNum) {
this.lineNum = lineNum;
}
}
| package com.ctrip.framework.apollo.common.dto;
public class ItemDTO extends BaseDTO{
private long id;
private long namespaceId;
private String key;
private String value;
private String comment;
private int lineNum;
public ItemDTO() {
}
public ItemDTO(String key, String value, String comment, int lineNum) {
this.key = key;
this.value = value;
this.comment = comment;
this.lineNum = lineNum;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getComment() {
return comment;
}
public String getKey() {
return key;
}
public long getNamespaceId() {
return namespaceId;
}
public String getValue() {
return value;
}
public void setComment(String comment) {
this.comment = comment;
}
public void setKey(String key) {
this.key = key;
}
public void setNamespaceId(long namespaceId) {
this.namespaceId = namespaceId;
}
public void setValue(String value) {
this.value = value;
}
public int getLineNum() {
return lineNum;
}
public void setLineNum(int lineNum) {
this.lineNum = lineNum;
}
}
| -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-apollo-config-server-test-alpha.yaml |
---
# configmap for apollo-config-server-test-alpha
kind: ConfigMap
apiVersion: v1
metadata:
namespace: sre
name: configmap-apollo-config-server-test-alpha
data:
application-github.properties: |
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-alpha-env.sre:3306/TestAlphaApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
eureka.service.url = http://statefulset-apollo-config-server-test-alpha-0.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-1.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-2.service-apollo-meta-server-test-alpha:8080/eureka/
---
kind: Service
apiVersion: v1
metadata:
namespace: sre
name: service-apollo-meta-server-test-alpha
labels:
app: service-apollo-meta-server-test-alpha
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: pod-apollo-config-server-test-alpha
type: ClusterIP
clusterIP: None
sessionAffinity: ClientIP
---
kind: Service
apiVersion: v1
metadata:
namespace: sre
name: service-apollo-config-server-test-alpha
labels:
app: service-apollo-config-server-test-alpha
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
nodePort: 30003
selector:
app: pod-apollo-config-server-test-alpha
type: NodePort
sessionAffinity: ClientIP
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
namespace: sre
name: statefulset-apollo-config-server-test-alpha
labels:
app: statefulset-apollo-config-server-test-alpha
spec:
serviceName: service-apollo-meta-server-test-alpha
replicas: 3
selector:
matchLabels:
app: pod-apollo-config-server-test-alpha
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: pod-apollo-config-server-test-alpha
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- pod-apollo-config-server-test-alpha
topologyKey: kubernetes.io/hostname
volumes:
- name: volume-configmap-apollo-config-server-test-alpha
configMap:
name: configmap-apollo-config-server-test-alpha
items:
- key: application-github.properties
path: application-github.properties
containers:
- image: apollo-config-server:v1.0.0
securityContext:
privileged: true
imagePullPolicy: IfNotPresent
name: container-apollo-config-server-test-alpha
ports:
- protocol: TCP
containerPort: 8080
volumeMounts:
- name: volume-configmap-apollo-config-server-test-alpha
mountPath: /apollo-config-server/config/application-github.properties
subPath: application-github.properties
env:
- name: APOLLO_CONFIG_SERVICE_NAME
value: "service-apollo-config-server-test-alpha.sre"
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 120
periodSeconds: 10
dnsPolicy: ClusterFirst
restartPolicy: Always |
---
# configmap for apollo-config-server-test-alpha
kind: ConfigMap
apiVersion: v1
metadata:
namespace: sre
name: configmap-apollo-config-server-test-alpha
data:
application-github.properties: |
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-alpha-env.sre:3306/TestAlphaApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
eureka.service.url = http://statefulset-apollo-config-server-test-alpha-0.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-1.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-2.service-apollo-meta-server-test-alpha:8080/eureka/
---
kind: Service
apiVersion: v1
metadata:
namespace: sre
name: service-apollo-meta-server-test-alpha
labels:
app: service-apollo-meta-server-test-alpha
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: pod-apollo-config-server-test-alpha
type: ClusterIP
clusterIP: None
sessionAffinity: ClientIP
---
kind: Service
apiVersion: v1
metadata:
namespace: sre
name: service-apollo-config-server-test-alpha
labels:
app: service-apollo-config-server-test-alpha
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
nodePort: 30003
selector:
app: pod-apollo-config-server-test-alpha
type: NodePort
sessionAffinity: ClientIP
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
namespace: sre
name: statefulset-apollo-config-server-test-alpha
labels:
app: statefulset-apollo-config-server-test-alpha
spec:
serviceName: service-apollo-meta-server-test-alpha
replicas: 3
selector:
matchLabels:
app: pod-apollo-config-server-test-alpha
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: pod-apollo-config-server-test-alpha
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- pod-apollo-config-server-test-alpha
topologyKey: kubernetes.io/hostname
volumes:
- name: volume-configmap-apollo-config-server-test-alpha
configMap:
name: configmap-apollo-config-server-test-alpha
items:
- key: application-github.properties
path: application-github.properties
containers:
- image: apollo-config-server:v1.0.0
securityContext:
privileged: true
imagePullPolicy: IfNotPresent
name: container-apollo-config-server-test-alpha
ports:
- protocol: TCP
containerPort: 8080
volumeMounts:
- name: volume-configmap-apollo-config-server-test-alpha
mountPath: /apollo-config-server/config/application-github.properties
subPath: application-github.properties
env:
- name: APOLLO_CONFIG_SERVICE_NAME
value: "service-apollo-config-server-test-alpha.sre"
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 120
periodSeconds: 10
dnsPolicy: ClusterFirst
restartPolicy: Always | -1 |
apolloconfig/apollo | 3,658 | update apolloconfig.com domain | ## What's the purpose of this PR
update apolloconfig.com domain
| nobodyiam | 2021-05-02T02:26:41Z | 2021-05-02T02:31:15Z | a1b19ace8e6eb73e791f89ad30e2210003ba9d33 | e1a6cf9cd40300fad156b6b87835c27b5e378f16 | update apolloconfig.com domain. ## What's the purpose of this PR
update apolloconfig.com domain
| ./docs/charts/apollo-service-0.1.2.tgz | ) +aHR0cHM6Ly95b3V0dS5iZS96OVV6MWljandyTQo=Helm <o:YŬžW<e]Qw,6TIiRdɲ'mqM3p82 D1.v.D(ݵn=9:2nwQw;ERh\$#
I9s`ַHf_{ݷ<2]_j-1pn.8 c-¼ɹP><@Jt&TM*AC+E]/)ȝ$
3LUND*ɷvȅ"~G
:%#Q`%
BM,=RPHj0>=%Ntn0W= "W.q9&S<K݇3K4Y*ݳSɿ`3G(w +rr K`ʥsղ 9px= ѵ7{ m"g
w\x[1r63T@(㪈P\2{M"5~m$MQMQ
$
dL;:5, ƕ|_GWq3C!!/H{e.F+j4GL9ЏykЀL{N
f0{@Lpw
J(PDLP
J%tSF%]<@OQP
LjGVN?;TdBGuΈJ<pF#V'\IdaRl%K7j@\DFbV}͐ǻoL} fTphjgDPmYX:zR'6O7CḰBkD>mw="RGa6TcxU!ai_1MpYB{a0d|_O͇ˡM_wROz'9 @E
]<n$v>ګ1mGjR{mp|:N_B{C~,Wdg/&*&.WE~e_g9|DMZs[W6KHZҕJ
2<VaML=blX,~-y5(QqJL}*M<O%_-C;tt:/2ߌ,ЗXȟx'>a.ͅ 8p ȭxeByp5HCvv-nQ̎W
|ײm rBn[m)W57!w%zhS5 le~T%m&Z%+, 2֢BQs4S/5[XsY,:I ]K|P(>Z:K)n|>wYqȽMK ϶TVkEl|U|ݵvIA)QsqG/ś#Uψmߧ)!
i{ZN}m>"
@?4[):f] |2B_Z)[ZN1yv`0-NNme7qَc;#7MiiJt@qO/,I&psv6i@prh>`+KrN~`5_eU)VmyV@i崂F_X7muӭFyh$jo-|`Uì(BS@V5|7rhweyܻ:C!
R6̿xM2L';ʑ~N\TwP<zdS-dΩFE}wB[r+TsϴcZ?w#TJQ7?CT!!
翓RGwub cWqxK$u^HhzVr, /Z6$mrDb|:[,ip]2o&zN|fkWuo:(p"whKLS5&1ʣb}E,Qq,9\ygDTzZTfRբJKwjQePe&87*( C)irASRrÆo()8 dqN+b269z7-@}Gմf{I.|t\IuUL]#!4cQ5'[JIʥ
T=jz9FfAi'J?hgnݴ;ӵb.E(Є⽳+ DMDz=tߵUeճeF)?[YX\湽Itb*
e_3EKԱaR:ae1*];b{lVMpO7o~:pTIGYL.
%|yKTo0ʫ%
FT4[
v`jmn2
j +Tn8-c%XuRYeFE`YXOaQXS$~'ned]KkPjɴ맠
%17=dUsKY -qvM$ o=ٿ,mXm`[XW2S8UC 9U;1.L.\y^mAV:IQckd]knHTWf*.0n
`dEwB銕[!_QyE菝*SYlM"d-j`~Ǵœ1lG:;\o(yg]1?Gg^c[m'yt&sZz}9Z|"MgMR'vx4~ǼTjZ.ꭈvr1Vs7Җ:;-jd-Fϒ-M뿺?KŖ8WVyMC46SkkwqIʲS'4m]~U(IL3y}d:k1
YN3&_6eu~llMF/9eJV2$ֆM4l
wM(Em
{T,_<~pkBĀnI#S:a\tW~h0 J)Wb"{g{K&(m >Lư@NaQ|G7Egh2~< |