提交 4930452c 编写于 作者: Z zhangle

optimize portal ui

上级 a0c9e539
......@@ -101,9 +101,9 @@
<div ng-show="pageContext.clusterName == 'default'">
<strong>注意:</strong>所有不属于
<span ng-bind="envMapClusters[pageContext.env]"></span>
集群的实例会使用default集群(当前页面)的配置,属于
集群的实例会使用default集群(当前页面)的配置,属于
<span ng-bind="envMapClusters[pageContext.env]"></span>
的实例会使用对应集群的配置!
的实例会使用对应集群的配置!
</div>
<!--custom cluster tip-->
......@@ -124,7 +124,7 @@
pre-release-ns="prepareReleaseNamespace"
create-item="createItem" edit-item="editItem"
pre-delete-item="preDeleteItem" commit-change="commitChange"
pre-rollback="preRollback"></apollonspanel>
pre-rollback="preRollback" show-text="showText"></apollonspanel>
</div>
<!-- delete modal-->
......@@ -147,6 +147,25 @@
apollo-detail="'确定要回滚吗?'"
apollo-show-cancel-btn="true" apollo-confirm="rollback"></apolloconfirmdialog>
<div class="modal fade" id="showText" tabindex="-1" role="dialog">
<div class="modal-dialog" style="width: 960px;">
<div class="modal-content no-radius">
<div class="modal-header panel-primary">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<button class="btn close" data-clipboard-text="{{text}}" data-tooltip="tooltip"
data-placement="bottom" title="复制">
<img class="i-20" src="img/clippy.svg" style="margin-right: 5px;margin-top: -2px;">
</button>
<h4 class="modal-title">查看</h4>
</div>
<pre id="watchText" class="modal-body no-radius" style="margin-bottom: 0" ng-bind="text"></pre>
</div>
</div>
</div>
<!--create release modal-->
<form class="modal fade form-horizontal" name="releaseForm" valdr-type="Release" id="releaseModal"
......@@ -486,6 +505,8 @@
<script src="vendor/diff.min.js" type="text/javascript"></script>
<script src="vendor/clipboard.min.js" type="text/javascript"></script>
<!--valdr-->
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
......
......@@ -71,30 +71,48 @@
<label class="control-label">需要同步的配置</label>
</div>
<div class="col-sm-10">
<div class="row text-right" style="margin-bottom: 5px; margin-right: 0px;">
按最后更新时间过滤
开始时间:<input type="date" ng-model="filterBeginTime"> 结束时间: <input type="date" ng-model="filterEndTime">
<button class="btn btn-sm btn-primary" ng-click="filter()">过滤</button>
<button class="btn btn-sm btn-default" ng-click="resetFilter()">重置</button>
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<td><input type="checkbox" ng-click="toggleItemsCheckedStatus()"></td>
<td>key</td>
<td>value</td>
<td>comment</td>
<td class="hover" ng-click="col='key';desc=!desc;">
Key
<span class="glyphicon glyphicon-sort"></span>
</td>
<td>Value</td>
<td class="hover" ng-click="col='dataChangeCreatedTime';desc=!desc;">
Create Time
<span class="glyphicon glyphicon-sort"></span>
</td>
<td class="hover" ng-click="col='dataChangeLastModifiedTime';desc=!desc;">
Update Time
<span class="glyphicon glyphicon-sort"></span>
</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in sourceItems">
<tr ng-repeat="item in viewItems|orderBy:col:desc">
<td width="10%"><input type="checkbox" ng-checked="item.checked"
ng-click="switchSelect(item)"></td>
<td width="20%">
<span ng-bind="item.key | limitTo: 250"></span>
<span ng-bind="item.key.length > 250 ? '...' : ''"></span>
</td>
<td width="50%">
<td width="40%">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...' : ''"></span>
</td>
<td width="20%">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ? '...' :''"></span>
<td width="15%">
<span ng-bind="item.dataChangeCreatedTime | date: 'yyyy-MM-dd HH:mm:ss'"></span>
</td>
<td width="15%">
<span ng-bind="item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"></span>
</td>
</tr>
</tbody>
......
<svg height="1024" width="896" xmlns="http://www.w3.org/2000/svg">
<path d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z" />
</svg>
......@@ -44,6 +44,8 @@ application_module.controller("ConfigNamespaceController",
$scope.doItem = doItem;
$scope.closeTip = closeTip;
$scope.showText = showText;
$scope.releaseBtnDisabled = false;
$scope.rollbackBtnDisabled = false;
......@@ -376,6 +378,13 @@ application_module.controller("ConfigNamespaceController",
localStorage.setItem("hideTip", JSON.stringify(hideTip));
}
function showText(text) {
$scope.text = text;
$('#showText').modal('show');
}
$('.config-item-container').removeClass('hide');
new Clipboard('.btn');
}]);
......@@ -9,41 +9,64 @@ sync_item_module.controller("SyncItemController",
clusterName: params.clusterName,
namespaceName: params.namespaceName
};
var sourceItems = [];
$scope.syncBtnDisabled = false;
$scope.viewItems = [];
////// load items //////
ConfigService.find_items($scope.pageContext.appId, $scope.pageContext.env,
$scope.pageContext.clusterName,
$scope.pageContext.namespaceName,
"lastModifiedTime")
.then(function (result) {
$scope.sourceItems = [];
result.forEach(function (item) {
if (item.key) {
item.checked = false;
$scope.sourceItems.push(item);
}
})
$scope.toggleItemsCheckedStatus = toggleItemsCheckedStatus;
$scope.diff = diff;
$scope.removeItem = removeItem;
$scope.syncItems = syncItems;
$scope.collectSelectedClusters = collectSelectedClusters;
}, function (result) {
toastr.error(AppUtil.errorMsg(result), "加载配置出错");
});
$scope.syncItemNextStep = syncItemNextStep;
$scope.backToAppHomePage = backToAppHomePage;
$scope.switchSelect = switchSelect;
$scope.filter = filter;
$scope.resetFilter = resetFilter;
init();
function init() {
////// load items //////
ConfigService.find_items($scope.pageContext.appId, $scope.pageContext.env,
$scope.pageContext.clusterName,
$scope.pageContext.namespaceName,
"lastModifiedTime")
.then(function (result) {
sourceItems = [];
result.forEach(function (item) {
if (item.key) {
item.checked = false;
sourceItems.push(item);
}
});
$scope.viewItems = sourceItems;
}, function (result) {
toastr.error(AppUtil.errorMsg(result), "加载配置出错");
});
}
var itemAllSelected = false;
$scope.toggleItemsCheckedStatus = function () {
function toggleItemsCheckedStatus() {
itemAllSelected = !itemAllSelected;
$scope.sourceItems.forEach(function (item) {
$scope.viewItems.forEach(function (item) {
item.checked = itemAllSelected;
})
};
}
var syncData = {
syncToNamespaces: [],
syncItems: []
};
$scope.diff = function () {
function diff() {
parseSyncSourceData();
if (syncData.syncItems.length == 0) {
toastr.warning("请选择需要同步的配置");
......@@ -62,11 +85,12 @@ sync_item_module.controller("SyncItemController",
$scope.clusterDiffs.forEach(function (clusterDiff) {
if (!$scope.hasDiff) {
$scope.hasDiff =
clusterDiff.diffs.createItems.length + clusterDiff.diffs.updateItems.length
clusterDiff.diffs.createItems.length
+ clusterDiff.diffs.updateItems.length
> 0;
}
if (clusterDiff.diffs.updateItems.length > 0){
if (clusterDiff.diffs.updateItems.length > 0) {
//赋予同步前的值
ConfigService.find_items(clusterDiff.namespace.appId,
clusterDiff.namespace.env,
......@@ -78,19 +102,19 @@ sync_item_module.controller("SyncItemController",
oldItemMap[item.key] = item.value;
});
clusterDiff.diffs.updateItems.forEach(function (item) {
item.oldValue = oldItemMap[item.key];
})
});
item.oldValue = oldItemMap[item.key];
})
});
}
});
$scope.syncItemNextStep(1);
}, function (result) {
toastr.error(AppUtil.errorMsg(result));
});
};
}
$scope.removeItem = function (diff, type, toRemoveItem) {
function removeItem(diff, type, toRemoveItem) {
var syncDataResult = [],
diffSetResult = [],
diffSet;
......@@ -116,9 +140,9 @@ sync_item_module.controller("SyncItemController",
}
});
syncData.syncItems = syncDataResult;
};
}
$scope.syncItems = function () {
function syncItems() {
$scope.syncBtnDisabled = true;
ConfigService.sync_items($scope.pageContext.appId,
$scope.pageContext.namespaceName,
......@@ -131,12 +155,13 @@ sync_item_module.controller("SyncItemController",
$scope.syncBtnDisabled = false;
toastr.error(AppUtil.errorMsg(result));
});
};
}
var selectedClusters = [];
$scope.collectSelectedClusters = function (data) {
function collectSelectedClusters(data) {
selectedClusters = data;
};
}
function parseSyncSourceData() {
syncData = {
......@@ -152,7 +177,7 @@ sync_item_module.controller("SyncItemController",
}
});
$scope.sourceItems.forEach(function (item) {
$scope.viewItems.forEach(function (item) {
if (item.checked) {
syncData.syncItems.push(item);
}
......@@ -163,18 +188,39 @@ sync_item_module.controller("SyncItemController",
////// flow control ///////
$scope.syncItemStep = 1;
$scope.syncItemNextStep = function (offset) {
function syncItemNextStep(offset) {
$scope.syncItemStep += offset;
};
}
$scope.backToAppHomePage = function () {
function backToAppHomePage() {
$window.location.href = '/config.html?#appid=' + $scope.pageContext.appId;
};
}
$scope.switchSelect = function (o) {
function switchSelect(o) {
o.checked = !o.checked;
};
}
function filter() {
var beginTime = $scope.filterBeginTime;
var endTime = $scope.filterEndTime;
var result = [];
sourceItems.forEach(function (item) {
var updateTime = new Date(item.dataChangeLastModifiedTime);
if ((!beginTime || updateTime > beginTime)
&& (!endTime || updateTime < endTime)) {
result.push(item);
}
});
$scope.viewItems = result;
}
function resetFilter() {
$scope.filterBeginTime = null;
$scope.filterEndTime = null;
filter();
}
}]);
......@@ -16,7 +16,8 @@ directive_module.directive('apollonspanel',
createItem: '=',
editItem: '=',
preDeleteItem: '=',
commitChange: '='
commitChange: '=',
showText: '='
},
link: function (scope, element, attrs) {
......@@ -41,7 +42,7 @@ directive_module.directive('apollonspanel',
scope.toggleItemSearchInput = toggleItemSearchInput;
scope.searchItems = searchItems;
scope.loadCommitHistory = loadCommitHistory;
scope.toggleTextEditStatus = toggleTextEditStatus;
......@@ -65,7 +66,7 @@ directive_module.directive('apollonspanel',
function initNamespace(namespace, viewType) {
namespace.showSearchInput = false;
namespace.viewItems = namespace.items;
namespace.viewItems = namespace.items;
namespace.isPropertiesFormat = namespace.format == 'properties';
namespace.isTextEditing = false;
namespace.instanceViewType = namespace_instance_view_type.LATEST_RELEASE;
......@@ -221,10 +222,11 @@ directive_module.directive('apollonspanel',
namespace.latestRelease.id,
namespace.latestReleaseInstancesPage)
.then(function (result) {
if (result && result.content.length){
if (result && result.content.length) {
namespace.latestReleaseInstancesPage++;
result.content.forEach(function (instance) {
namespace.latestReleaseInstances.content.push(instance);
namespace.latestReleaseInstances.content.push(
instance);
})
}
......@@ -271,9 +273,9 @@ directive_module.directive('apollonspanel',
scope.env,
scope.cluster,
namespace.baseInfo.namespaceName,
namespace.allInstancesPage)
namespace.allInstancesPage)
.then(function (result) {
if (result && result.content.length){
if (result && result.content.length) {
namespace.allInstancesPage++;
result.content.forEach(function (instance) {
namespace.allInstances.push(instance);
......@@ -390,7 +392,6 @@ directive_module.directive('apollonspanel',
return result;
}
function toggleItemSearchInput(namespace) {
namespace.showSearchInput = !namespace.showSearchInput;
}
......@@ -400,8 +401,8 @@ directive_module.directive('apollonspanel',
var items = [];
namespace.items.forEach(function (item) {
var key = item.item.key;
if (key && key.toLowerCase().indexOf(searchKey) >= 0){
items.push(item);
if (key && key.toLowerCase().indexOf(searchKey) >= 0) {
items.push(item);
}
});
namespace.viewItems = items;
......@@ -416,6 +417,7 @@ directive_module.directive('apollonspanel',
return true;
}
}
}
});
......@@ -5,8 +5,8 @@ html, body {
body {
min-width: 960px;
color: #797979;
padding: 0px !important;
margin: 0px !important;
padding: 0 !important;
margin: 0 !important;
font-size: 13px;
background: #f1f2f7;
font-family: 'Open Sans', sans-serif;
......@@ -25,12 +25,25 @@ p, td, span {
word-break: break-all;
}
table {
text-align: center;
}
.no-radius {
border-radius: 0px;
border-radius: 0;
}
.cursor-pointer{
cursor: pointer;
}
pre {
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
.hover:hover{
background: #f5f5f5;
cursor: pointer
}
.highlight {
......@@ -38,7 +51,7 @@ table {
}
.hide-border-top {
border-top: 0px;
border-top: 0;
}
.logo {
......@@ -242,7 +255,7 @@ table th {
}
.config-item-container .panel {
border-radius: 0px;
border-radius: 0;
}
.config-item-container .panel-heading b {
......@@ -251,7 +264,7 @@ table th {
.config-item-container .form-control[disabled] {
background: #ffffff;
border: 0px;
border: 0;
}
.config-item-container .second-panel-heading .ns_btn {
......@@ -297,9 +310,9 @@ table th {
}
.namespace-attribute-panel {
margin-left: 0px;
margin-left: 0;
color: #fff;
border-top: 0px;
border-top: 0;
background: #f1f2f7;
}
......@@ -310,7 +323,7 @@ table th {
}
.second-panel-heading .nav-tabs {
border-bottom: 0px;
border-bottom: 0;
}
.namespace-view-table td img {
......@@ -419,7 +432,7 @@ table th {
width: 350px;
height: 200px;
position: absolute;
margin-left: 0px;
margin-left: 0;
cursor: pointer;
background: #ffffff;
border: 1px solid #ddd;
......
/*!
* clipboard.js v1.5.12
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){var o=t("matches-selector");e.exports=function(t,e,n){for(var i=n?t:t.parentNode;i&&i!==document;){if(o(i,e))return i;i=i.parentNode}}},{"matches-selector":5}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e,!0),n.delegateTarget&&o.call(t,n)}}var r=t("closest");e.exports=o},{closest:1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return s(document.body,t,e,n)}var c=t("./is"),s=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t,e){if(r)return r.call(t,e);for(var n=t.parentNode.querySelectorAll(e),o=0;o<n.length;++o)if(n[o]==t)return!0;return!1}var i=Element.prototype,r=i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector;e.exports=o},{}],6:[function(t,e,n){function o(t){var e;if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName)t.focus(),t.setSelectionRange(0,t.value.length),e=t.value;else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o),e=n.toString()}return e}e.exports=o},{}],7:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;i>o;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;a>r;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if("undefined"!=typeof o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return t.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action=e.action,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""},t.prototype.initSelection=function t(){this.text?this.selectFake():this.target&&this.selectTarget()},t.prototype.selectFake=function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px",this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()},t.prototype.removeFake=function t(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},t.prototype.selectTarget=function t(){this.selectedText=(0,i.default)(this.target),this.copyText()},t.prototype.copyText=function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(n){e=!1}this.handleResult(e)},t.prototype.handleResult=function t(e){e?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},t.prototype.clearSelection=function t(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()},t.prototype.destroy=function t(){this.removeFake()},a(t,[{key:"action",set:function t(){var e=arguments.length<=0||void 0===arguments[0]?"copy":arguments[0];if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==("undefined"==typeof e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:6}],9:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=i(e),u=i(n),f=i(o),d=function(t){function e(n,o){r(this,e);var i=a(this,t.call(this));return i.resolveOptions(o),i.listenClick(n),i}return c(e,t),e.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText},e.prototype.listenClick=function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})},e.prototype.onClick=function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})},e.prototype.defaultAction=function t(e){return s("action",e)},e.prototype.defaultTarget=function t(e){var n=s("target",e);return n?document.querySelector(n):void 0},e.prototype.defaultText=function t(e){return s("text",e)},e.prototype.destroy=function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},e}(u.default);t.exports=d})},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)});
\ No newline at end of file
......@@ -9,7 +9,7 @@
<div class="modal-body">
{{detail}}
</div>
<div class="modal-footer">
<div class="modal-footer" ng-show="showFooter">
<button type="button" class="btn btn-default" data-dismiss="modal" ng-show="showCancelBtn">取消</button>
<button type="button" class="btn btn-danger" data-dismiss="modal"
ng-click="confirm()">
......
......@@ -148,14 +148,19 @@
<!--table view-->
<div class="namespace-view-table" ng-show="namespace.viewType == 'table'">
<div class="col-md-8 col-lg-offset-2" style="padding-top: 15px; padding-bottom: 10px" ng-show="namespace.showSearchInput">
<input type="text" class="form-control" placeholder="输入key过滤" ng-model="namespace.searchKey" ng-change="searchItems(namespace)">
<div class="col-md-8 col-lg-offset-2" style="padding-top: 15px; padding-bottom: 10px"
ng-show="namespace.showSearchInput">
<input type="text" class="form-control" placeholder="输入key过滤" ng-model="namespace.searchKey"
ng-change="searchItems(namespace)">
</div>
<table class="table table-bordered table-striped text-center table-hover">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>
Key
<th class="hover" title="排序"
ng-click="col='item.key';desc=!desc;">
Key&nbsp;
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
Value
......@@ -163,11 +168,16 @@
<th>
备注
</th>
<th>
<th class="hover" title="排序"
ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
最后修改人
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
<th class="hover" title="排序"
ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
最后修改时间
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
操作
......@@ -176,17 +186,17 @@
</thead>
<tbody>
<tr ng-repeat="config in namespace.viewItems" ng-class="{warning:config.isModified}"
<tr ng-repeat="config in namespace.viewItems |orderBy:col:desc" ng-class="{warning:config.isModified}"
ng-if="config.item.key && !config.isDeleted">
<td width="20%" title="{{config.item.key}}">
<td width="20%">
<span ng-bind="config.item.key | limitTo: 250"></span>
<span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
</td>
<td width="25%" title="{{config.item.value}}">
<td width="30%" class="cursor-pointer" title="点击查看" ng-click="showText(config.item.value)">
<span ng-bind="config.item.value | limitTo: 250"></span>
<span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
</td>
<td width="20%" title="{{config.item.comment}}">
<td width="15%" title="{{config.item.comment}}">
<span ng-bind="config.item.comment | limitTo: 250"></span>
<span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
</td>
......@@ -196,7 +206,7 @@
ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
</td>
<td width="10%">
<td width="10%" class="text-center">
<img src="img/edit.png" data-tooltip="tooltip" data-placement="bottom" title="修改"
ng-click="editItem(namespace, config.item)"
ng-show="namespace.hasModifyPermission">
......@@ -259,7 +269,7 @@
</td>
<td width="30%">
</td>
<td width="30%" title="{{item.value}}">
<td width="30%" class="cursor-pointer" title="{{item.value}}" ng-click="showText(item.value)">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
......@@ -276,11 +286,11 @@
<span ng-bind="item.newItem.key | limitTo: 250"></span>
<span ng-bind="item.newItem.key.length > 250 ? '...' :''"></span>
</td>
<td width="30%" title="{{item.oldItem.value}}">
<td width="30%" class="cursor-pointer" title="{{item.oldItem.value}}" ng-click="showText(item.oldItem.value)">
<span ng-bind="item.oldItem.value | limitTo: 250"></span>
<span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="30%" title="{{item.newItem.value}}">
<td width="30%" class="cursor-pointer" title="{{item.newItem.value}}" ng-click="showText(item.newItem.value)">
<span ng-bind="item.newItem.value | limitTo: 250"></span>
<span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
</td>
......@@ -397,7 +407,8 @@
</tr>
</tbody>
</table>
<div class="row text-center" ng-show="namespace.latestReleaseInstances.content.length < namespace.latestReleaseInstances.total">
<div class="row text-center"
ng-show="namespace.latestReleaseInstances.content.length < namespace.latestReleaseInstances.total">
<button class="btn btn-default" ng-click="loadInstanceInfo(namespace)">加载更多</button>
</div>
......@@ -443,7 +454,7 @@
</div>
</div>
<!--all instances-->
<!--all instances-->
<div class="panel-body" ng-show="namespace.instanceViewType == 'all'">
<div class="panel-default" ng-if="namespace.instancesCount > 0">
<table class="table table-bordered table-striped" ng-if="namespace.allInstances">
......@@ -474,6 +485,5 @@
</div>
</div>
</div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册