mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Add dropdown of revisions
This commit is contained in:
parent
660139b91e
commit
9523b481a1
3 changed files with 86 additions and 37 deletions
|
|
@ -64,40 +64,56 @@ limitations under the License.
|
|||
tooltip-placement="bottom" tooltip="Export the notebook">
|
||||
<i class="fa fa-download"></i>
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn btn-default btn-xs dropdown-toggle"
|
||||
ng-hide="viewOnly"
|
||||
data-toggle="dropdown"
|
||||
tooltip-placement="bottom" tooltip="Version control">
|
||||
<i class="fa fa-file-code-o"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" style="width:250px">
|
||||
<li>
|
||||
<div class="commit-container">
|
||||
<div>
|
||||
<input type="text"
|
||||
dropdown-input
|
||||
placeholder="commit message"
|
||||
id="note.checkpoint.message"
|
||||
style="width: 145px;"
|
||||
ng-model="note.checkpoint.message"/>
|
||||
<button type="button"
|
||||
class="btn btn-default btn-xs"
|
||||
ng-hide="viewOnly"
|
||||
ng-click="checkpointNotebook(note.checkpoint.message)"
|
||||
style="margin-left: 4px;"
|
||||
tooltip-placement="bottom" tooltip="Commit the notebook">Commit
|
||||
</button>
|
||||
</span>
|
||||
|
||||
<span class="labelBtn btn-group" role="group">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button"
|
||||
class="btn btn-default btn-xs dropdown-toggle"
|
||||
id="versionControlDropdown"
|
||||
ng-hide="viewOnly"
|
||||
data-toggle="dropdown"
|
||||
tooltip-placement="bottom" tooltip="Version control">
|
||||
<i class="fa fa-file-code-o"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu" style="width:250px"
|
||||
aria-labelledby="versionControlDropdown">
|
||||
<li>
|
||||
<div class="commit-container">
|
||||
<div>
|
||||
<input type="text"
|
||||
dropdown-input
|
||||
placeholder="commit message"
|
||||
id="note.checkpoint.message"
|
||||
style="width: 145px;"
|
||||
ng-model="note.checkpoint.message"/>
|
||||
<button type="button"
|
||||
class="btn btn-default btn-xs"
|
||||
ng-hide="viewOnly"
|
||||
ng-click="checkpointNotebook(note.checkpoint.message)"
|
||||
style="margin-left: 4px;"
|
||||
tooltip-placement="bottom" tooltip="Commit the notebook">Commit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li ng-repeat="revision in ::noteRevisions">
|
||||
<div>
|
||||
message: {{revision[$index].message}}
|
||||
time: {{revision[$index].time}}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-default btn-xs revisionName">
|
||||
Head
|
||||
</button>
|
||||
<button type="button" ng-if="noteRevisions.length > 0"
|
||||
class="btn btn-default dropdown-toggle caretSeparator"
|
||||
data-toggle="dropdown" id="revisionsDropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" aria-labelledby="revisionsDropdown">
|
||||
<li ng-repeat="revision in noteRevisions | orderBy:'time'" class="revision">
|
||||
<a style="cursor:pointer"><strong>{{moment.unix(revision.time).format("YY/MM/DD")}}</strong> - {{revision.message}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<!-- put the delete action by itself for your protection -->
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
|
|||
$rootScope, $http, websocketMsgSrv,
|
||||
baseUrlSrv, $timeout, SaveAsService) {
|
||||
$scope.note = null;
|
||||
$scope.moment = moment;
|
||||
$scope.showEditor = false;
|
||||
$scope.editorToggled = false;
|
||||
$scope.tableToggled = false;
|
||||
|
|
@ -54,8 +55,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
|
|||
var previousSelectedListWriters = [];
|
||||
var searchText = [];
|
||||
$scope.role = '';
|
||||
|
||||
$scope.noteRevisions = websocketMsgSrv.listRevisionHistory($routeParams.noteId);
|
||||
$scope.noteRevisions = [];
|
||||
|
||||
$scope.$on('setConnectedStatus', function(event, param) {
|
||||
if (connectedOnce && param) {
|
||||
|
|
@ -80,6 +80,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
|
|||
/** Init the new controller */
|
||||
var initNotebook = function() {
|
||||
websocketMsgSrv.getNotebook($routeParams.noteId);
|
||||
websocketMsgSrv.listRevisionHistory($routeParams.noteId);
|
||||
|
||||
var currentRoute = $route.current;
|
||||
if (currentRoute) {
|
||||
|
|
@ -185,8 +186,8 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
|
|||
};
|
||||
|
||||
$scope.$on('listRevisionHistory', function(event, data) {
|
||||
console.log(data);
|
||||
$scope.noteRevisions = data;
|
||||
console.log("We got the revisions yeahh %o", data);
|
||||
$scope.noteRevisions = data.revisionList;
|
||||
});
|
||||
|
||||
$scope.runNote = function() {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,38 @@
|
|||
|
||||
.notebookContent {
|
||||
padding-top: 36px;
|
||||
|
||||
.revision {
|
||||
max-width: 250px;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.revision a {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 2px 10px !important;
|
||||
}
|
||||
|
||||
.revisionName {
|
||||
cursor: default;
|
||||
padding: 1px 10px !important;
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
.revisionName:hover,
|
||||
.revisionName:focus,
|
||||
.revisionName:active {
|
||||
background: transparent;
|
||||
border-color: #ccc;
|
||||
}
|
||||
|
||||
.caretSeparator {
|
||||
height: 22px;
|
||||
line-height: 9px;
|
||||
width: 16px;
|
||||
padding-left: 3px !important;
|
||||
}
|
||||
|
||||
.paragraph-col {
|
||||
|
|
|
|||
Loading…
Reference in a new issue