You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: file_upload.go
    path of file: ./repos/go-admin/template/types/action
    
    the code of the file until where you have to start completion: package action

import (
	"html/template"

	"github.com/GoAdminGroup/go-admin/context"
	"github.com/GoAdminGroup/go-admin/modules/constant"
	"github.com/GoAdminGroup/go-admin/template/types"
)

type FileUploadAction struct {
	BaseAction
	Url      string
	Method   string
	FileName string
	Handlers []context.Handler
}

func FileUpload(id string, handler types.Handler) *FileUploadAction {
	if id == "" {
		panic("wrong file upload action parameter, empty id")
	}
	return &FileUploadAction{
		Url:      URL(id),
		Method:   "post",
		FileName: "file",
		Handlers: context.Handlers{handler.Wrap()},
	}
}

func (file *FileUploadAction) SetUrl(url string) *FileUploadAction {
	file.Url = url
	return file
}

func (file *FileUploadAction) SetMethod(method string) *FileUploadAction {
	file.Method = method
	return file
}

func (file *FileUploadAction) GetCallbacks() context.Node {
	return context.Node{
		Path:     file.Ur
    
func (file *FileUploadAction) Js() template.JS {

	return template.JS(`$('` + file.BtnId + `').on('click', function(){
  $('` + file.BtnId + `_input').click();
});

$("` + file.BtnId + `_input").on("change", function () {
  var files = $('` + file.BtnId + `_input').prop('files');

  var data = new FormData();
  data.append('` + file.FileName + `', files[0]);
  NProgress.start();

  $.ajax({
		url: '` + file.Url + `',
		type: '` + file.Method + `',
		data: data,
		cache: false,
  		processData: false,
  		contentType: false,
		success: function (data) { 
		  	NProgress.done();
			if (data.code === 0) {
				swal(data.msg, '', 'success');
				$.pjax.reload('#pjax-container');
			} else {
				swal(data.msg, '', 'error');
			}
		},
		error: function (data) {
			NProgress.done();
			if (data.responseText !== "") {
				swal(data.responseJSON.msg, '', 'error');								
			} else {
				swal('error', '', 'error');
			}
		},
  });
});`)
}