Skip to content

Commit

Permalink
Kick off file upload directive
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Jun 24, 2013
1 parent 15765ab commit 20892f2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
5 changes: 5 additions & 0 deletions hawtio-web/src/main/webapp/app/ui/html/fileUpload.html
@@ -0,0 +1,5 @@
<div>
<ul>
<li ng-repeat="file in files">{{file.fileName}}</li>
</ul>
</div>
5 changes: 5 additions & 0 deletions hawtio-web/src/main/webapp/app/ui/html/test.html
Expand Up @@ -12,9 +12,14 @@
<input type="submit">
</fieldset>
</form>
</div>

<div class="row-fluid">
<div hawtio-file-upload>

</div>
</div>

</div>

<div>
Expand Down
31 changes: 31 additions & 0 deletions hawtio-web/src/main/webapp/app/ui/js/fileUpload.ts
@@ -0,0 +1,31 @@
module UI {

export var fileUploadMBean = "io.hawt.jmx:type=UploadManager";

export class FileUpload {

public restrict = 'A';
public replace = true;

public templateUrl = UI.templatePath + "fileUpload.html";

public controller = ($scope, $element, $attrs, jolokia) => {

$scope.files = [];

$scope.update = (response) => {
$scope.files = response.value;
$scope.$apply();
}

Core.register(jolokia, $scope, {
type: 'exec', mbean: fileUploadMBean,
operation: 'list(java.lang.String)',
arguments: [null]
}, onSuccess($scope.update));

};


}
}
6 changes: 4 additions & 2 deletions hawtio-web/src/main/webapp/app/ui/js/uiPlugin.ts
Expand Up @@ -20,9 +20,11 @@ module UI {
}).
directive('hawtioEditor', function() {
return new UI.Editor();
}).directive('hawtioColorPicker', [function() {
}).directive('hawtioColorPicker', function() {
return new UI.ColorPicker()
}]);
}).directive('hawtioFileUpload', () => {
return new UI.FileUpload();
});

hawtioPluginLoader.addModule(pluginName);

Expand Down

0 comments on commit 20892f2

Please sign in to comment.