added validation and posibility to add custom http status
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
<!-- status -->
|
||||
<div class="max-width small-vertical-margin">
|
||||
<label for="httpStatus">Http Status</label>
|
||||
<!-- <input id="httpStatus" class="bordered-field max-width data-field" type="text" value="200" list="httpStatusSuggestion"> -->
|
||||
<!--
|
||||
<select id="httpStatus" class="bordered-field max-width data-field" value="200">
|
||||
<option value="200">200</option>
|
||||
<option value="300">300</option>
|
||||
@@ -43,6 +43,9 @@
|
||||
<option value="404">404</option>
|
||||
<option value="500">500</option>
|
||||
</select>
|
||||
-->
|
||||
<input id="httpStatus" type="number" class="bordered-field max-width data-field" value="200"/>
|
||||
|
||||
</div>
|
||||
<!-- content type -->
|
||||
<div class="max-width small-vertical-margin">
|
||||
|
||||
@@ -41,7 +41,6 @@ function getData(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkUuid(){
|
||||
if(clientUUID == null || clientUUID == undefined || clientUUID == ''){
|
||||
clientUUID = json[0].clientUUID;
|
||||
@@ -56,8 +55,19 @@ function getDomain(){
|
||||
return result;
|
||||
}
|
||||
|
||||
function httpStatusInvalid(){
|
||||
value = $('#httpStatus').val();
|
||||
return value == '';
|
||||
}
|
||||
|
||||
function setDataModified(){
|
||||
console.log("dupadupagówno")
|
||||
if(dataModified) return;
|
||||
if(httpStatusInvalid()){
|
||||
$('#btn-save').removeClass('active');
|
||||
$('#btn-save').off();
|
||||
return;
|
||||
}
|
||||
dataModified = true;
|
||||
$('#btn-save').addClass('active');
|
||||
$('#btn-save').click(getUpdate);
|
||||
@@ -197,14 +207,14 @@ function clearMock(){
|
||||
$('#httpStatusValues').html('');
|
||||
}
|
||||
|
||||
function initializeMock(index){
|
||||
clearMock();
|
||||
fillStaticFields(json[index].clientUUID
|
||||
, json[index].mockedResponseId
|
||||
, json[index].mediaType
|
||||
, json[index].messageBody
|
||||
, json[index].httpStatus);
|
||||
fillHeaderTable(json[index].httpHeaders);
|
||||
function initializeMocksetModified(index){
|
||||
clearMock();
|
||||
fillStaticFields(json[index].clientUUID
|
||||
, json[index].mockedResponseId
|
||||
, json[index].mediaType
|
||||
, json[index].messageBody
|
||||
, json[index].httpStatus);
|
||||
fillHeaderTable(json[index].httpHeaders);
|
||||
}
|
||||
|
||||
function fillStaticFields(uuid, id, mediaType, body, httpStatus){
|
||||
|
||||
Reference in New Issue
Block a user