Commit 343bb1d0 by Jason Song Committed by GitHub

Merge pull request #398 from lepdou/search_item

history page use release id as anchor
parents f3708887 ee00c5fa
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<span class="label label-primary no-radius" <span class="label label-primary no-radius"
ng-if="release.active">当前生效</span> ng-if="release.active">当前生效</span>
</div> </div>
<div class="row" id="{{release.baseInfo.name}}"> <div class="row" id="{{release.baseInfo.id}}">
<div class="col-md-2 user"> <div class="col-md-2 user">
<img src="../img/user.png" class="i-20"> <img src="../img/user.png" class="i-20">
<span class="info" ng-bind="release.baseInfo.dataChangeCreatedBy"></span> <span class="info" ng-bind="release.baseInfo.dataChangeCreatedBy"></span>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="col-md-3 time"> <div class="col-md-3 time">
<img src="../img/title.png" class="i-20"> <img src="../img/title.png" class="i-20">
<span class="info" <span class="info"
ng-bind="release.baseInfo.name" ng-class="{'highlight':pageContext.scrollTo == release.baseInfo.name}"></span> ng-bind="release.baseInfo.name" ng-class="{'highlight':pageContext.scrollTo == release.baseInfo.id}"></span>
</div> </div>
<div class="col-md-4 comment" ng-show="release.baseInfo.comment"> <div class="col-md-4 comment" ng-show="release.baseInfo.comment">
......
...@@ -246,7 +246,7 @@ directive_module.directive('apollonspanel', ...@@ -246,7 +246,7 @@ directive_module.directive('apollonspanel',
} }
var groupedInstances = {}, var groupedInstances = {},
notLatestReleaseNames = []; notLatestReleases = [];
result.forEach(function (instance) { result.forEach(function (instance) {
var configs = instance.configs; var configs = instance.configs;
...@@ -255,14 +255,14 @@ directive_module.directive('apollonspanel', ...@@ -255,14 +255,14 @@ directive_module.directive('apollonspanel',
var release = instanceConfig.release; var release = instanceConfig.release;
if (!groupedInstances[release.name]) { if (!groupedInstances[release.name]) {
groupedInstances[release.name] = []; groupedInstances[release.name] = [];
notLatestReleaseNames.push(release.name); notLatestReleases.push(release);
} }
groupedInstances[release.name].push(instance); groupedInstances[release.name].push(instance);
}) })
} }
}); });
namespace.notLatestReleaseNames = notLatestReleaseNames; namespace.notLatestReleases = notLatestReleases;
namespace.notLatestReleaseInstances = groupedInstances; namespace.notLatestReleaseInstances = groupedInstances;
}) })
......
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
<div class="panel-default" ng-if="namespace.latestReleaseInstances.total > 0"> <div class="panel-default" ng-if="namespace.latestReleaseInstances.total > 0">
<div class="panel-heading"> <div class="panel-heading">
<a target="_blank" data-tooltip="tooltip" data-placement="bottom" title="查看配置" <a target="_blank" data-tooltip="tooltip" data-placement="bottom" title="查看配置"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&scrollTo={{namespace.latestRelease.name}}"> href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&scrollTo={{namespace.latestRelease.id}}">
{{namespace.latestRelease.name}} {{namespace.latestRelease.name}}
</a> </a>
</div> </div>
...@@ -410,11 +410,12 @@ ...@@ -410,11 +410,12 @@
<!--not latest release instances--> <!--not latest release instances-->
<div class="panel-body" ng-show="namespace.instanceViewType == 'not_latest_release'"> <div class="panel-body" ng-show="namespace.instanceViewType == 'not_latest_release'">
<div class="panel-default" ng-if="namespace.instancesCount - namespace.latestReleaseInstances.total > 0" ng-repeat="releaseName in namespace.notLatestReleaseNames"> <div class="panel-default" ng-if="namespace.instancesCount - namespace.latestReleaseInstances.total > 0"
ng-repeat="release in namespace.notLatestReleases">
<div class="panel-heading"> <div class="panel-heading">
<a target="_blank" data-tooltip="tooltip" data-placement="bottom" title="查看配置" <a target="_blank" data-tooltip="tooltip" data-placement="bottom" title="查看配置"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&scrollTo={{releaseName}}"> href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&scrollTo={{release.id}}">
{{releaseName}} {{release.name}}
</a> </a>
</div> </div>
...@@ -428,7 +429,7 @@ ...@@ -428,7 +429,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="instance in namespace.notLatestReleaseInstances[releaseName]"> <tr ng-repeat="instance in namespace.notLatestReleaseInstances[release.name]">
<td width="25%" ng-bind="instance.appId"></td> <td width="25%" ng-bind="instance.appId"></td>
<td width="25%" ng-bind="instance.clusterName"></td> <td width="25%" ng-bind="instance.clusterName"></td>
<td width="25%" ng-bind="instance.dataCenter"></td> <td width="25%" ng-bind="instance.dataCenter"></td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment