Преглед изворни кода

updated templates to support file as body or form params

bubble
Tony Tam пре 10 година
родитељ
комит
2de104aac9
2 измењених фајлова са 9 додато и 6 уклоњено
  1. +1
    -3
      src/main/coffeescript/view/OperationView.coffee
  2. +8
    -3
      src/main/template/param.handlebars

+ 1
- 3
src/main/coffeescript/view/OperationView.coffee Прегледај датотеку

@@ -162,7 +162,7 @@ class OperationView extends Backbone.View
# add params
for param in @model.parameters
if param.paramType is 'form'
if map[param.name] != undefined
if param.type.toLowerCase() isnt 'file' and map[param.name] != undefined
bodyParam.append(param.name, map[param.name])

# headers in operation
@@ -179,8 +179,6 @@ class OperationView extends Backbone.View
bodyParam.append($(el).attr('name'), el.files[0])
params += 1

log(bodyParam)

@invocationUrl =
if @model.supportHeaderParams()
headerParams = @model.getHeaderParams(map)


+ 8
- 3
src/main/template/param.handlebars Прегледај датотеку

@@ -15,10 +15,15 @@
{{/if}}
{{/if}}
{{else}}
{{#if defaultValue}}
<input class='parameter' minlength='0' name='{{name}}' placeholder='' type='text' value='{{defaultValue}}'/>
{{#if isFile}}
<input type="file" name='{{name}}'/>
<div class="parameter-content-type" />
{{else}}
<input class='parameter' minlength='0' name='{{name}}' placeholder='' type='text' value=''/>
{{#if defaultValue}}
<input class='parameter' minlength='0' name='{{name}}' placeholder='' type='text' value='{{defaultValue}}'/>
{{else}}
<input class='parameter' minlength='0' name='{{name}}' placeholder='' type='text' value=''/>
{{/if}}
{{/if}}
{{/if}}



Loading…
Откажи
Сачувај