Skip to content

Commit

Permalink
Merge 7ba7307 into ede4697
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Oct 13, 2020
2 parents ede4697 + 7ba7307 commit 3c9bca5
Show file tree
Hide file tree
Showing 7 changed files with 1,960 additions and 1,504 deletions.
2 changes: 1 addition & 1 deletion nsqadmin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Read the [docs](https://nsq.io/components/nsqadmin.html)
### Dependencies

1. Install [`go-bindata`](https://github.com/shuLhan/go-bindata)
2. Install NodeJS 8.x (includes npm)
2. Install NodeJS 14.x (includes npm)

### Workflow

Expand Down
454 changes: 303 additions & 151 deletions nsqadmin/bindata.go

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions nsqadmin/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ function logBundle(filename, watching) {


function sassTask(root, inputFile) {
return function() {
return function sassing() {
var onError = function(err) {
notify({'title': 'Sass Compile Error'}).write(err);
};
gulp.src(path.join(root, 'css', inputFile))
return gulp.src(path.join(root, 'css', inputFile))
.pipe(sass({
'sourceComments': 'map',
'onError': onError
Expand All @@ -63,7 +63,7 @@ function sassTask(root, inputFile) {


function browserifyTask(root, inputFile) {
return function() {
return function browserifying() {
var onError = function() {
var args = Array.prototype.slice.call(arguments);
notify.onError({
Expand Down Expand Up @@ -97,24 +97,24 @@ function browserifyTask(root, inputFile) {


function watchTask(root) {
return function() {
gulp.watch(path.join(root, 'sass/**/*.scss'), ['sass']);
return function watching() {
gulp.watch(path.join(root, 'sass/**/*.scss'), gulp.series('sass'));
gulp.watch([
path.join(root, 'js/**/*.js'),
path.join(root, 'js/**/*.hbs')
], ['browserify']);
], gulp.series('browserify'));
gulp.watch([
path.join(root, 'html/**'),
path.join(root, 'fonts/**')
], ['sync-static-assets'])
], gulp.series('sync-static-assets'))
};
}


function cleanTask(){
function cleanTask() {
var paths = Array.prototype.slice.apply(arguments);
return function () {
gulp.src(paths).pipe(clean());
return function cleaning() {
return gulp.src(paths, {allowEmpty: true}).pipe(clean());
};
}

Expand Down Expand Up @@ -153,8 +153,8 @@ gulp.task('sync-static-assets', function() {

gulp.task('sass', sassTask(ROOT, '*.*css'));
gulp.task('browserify', browserifyTask(ROOT, 'main.js'));
gulp.task('build', ['sass', 'browserify', 'sync-static-assets', 'vendor-build-js']);
gulp.task('watch', ['build'], watchTask(ROOT));
gulp.task('clean', cleanTask(path.join(ROOT, 'build')));
gulp.task('build', gulp.parallel('sass', 'browserify', 'sync-static-assets', 'vendor-build-js'));
gulp.task('watch', gulp.series('build', watchTask(ROOT)));
gulp.task('clean', gulp.series(cleanTask(path.join(ROOT, 'build'))));

gulp.task('default', ['help']);
gulp.task('default', gulp.series('help'));
2 changes: 1 addition & 1 deletion nsqadmin/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (s *httpServer) pingHandler(w http.ResponseWriter, req *http.Request, ps ht
}

func (s *httpServer) indexHandler(w http.ResponseWriter, req *http.Request, ps httprouter.Params) (interface{}, error) {
asset, _ := Asset("index.html")
asset, _ := Asset("/index.html")
t, _ := template.New("index").Funcs(template.FuncMap{
"basePath": func(p string) string {
return path.Join(s.basePath, p)
Expand Down

0 comments on commit 3c9bca5

Please sign in to comment.