Browse Source

fixes for saving non config items

pull/21/head
KodeStar 7 years ago
parent
commit
fff44f4681
  1. 22
      app/Http/Controllers/ItemController.php
  2. 3
      app/Item.php
  3. 2
      public/js/app.js
  4. 2
      resources/assets/js/app.js

22
app/Http/Controllers/ItemController.php

@ -139,12 +139,11 @@ class ItemController extends Controller
]); ]);
} }
$config = json_encode($request->input('config')); $config = $request->input('config');
if($config) { $config = (!empty($config)) ? json_encode($config) : null;
$request->merge([ $request->merge([
'description' => $config 'description' => $config
]); ]);
}
//die(print_r($request->input('config'))); //die(print_r($request->input('config')));
@ -202,12 +201,11 @@ class ItemController extends Controller
]); ]);
} }
$config = json_encode($request->input('config')); $config = $request->input('config');
if($config) { $config = (!empty($config)) ? json_encode($config) : null;
$request->merge([ $request->merge([
'description' => $config 'description' => $config
]); ]);
}
Item::find($id)->update($request->all()); Item::find($id)->update($request->all());

3
app/Item.php

@ -61,8 +61,9 @@ class Item extends Model
$class = $output->type; $class = $output->type;
$sap = new $class(); $sap = new $class();
$view = $sap->configDetails(); $view = $sap->configDetails();
$output->view = $view;
} }
$output->view = $view;
} }
return (object)$output; return (object)$output;
} }

2
public/js/app.js

@ -23,7 +23,7 @@ $.when( $.ready ).then(function() {
var container = $(this); var container = $(this);
var max_timer = 30000; var max_timer = 30000;
var timer = 1000; var timer = 1000;
(function worker() { (function worker() {
$.ajax({ $.ajax({
url: '/get_stats/'+id, url: '/get_stats/'+id,
success: function(data) { success: function(data) {

2
resources/assets/js/app.js

@ -14,7 +14,7 @@ $.when( $.ready ).then(function() {
var container = $(this); var container = $(this);
var max_timer = 30000; var max_timer = 30000;
var timer = 1000; var timer = 1000;
(function worker() { (function worker() {
$.ajax({ $.ajax({
url: '/get_stats/'+id, url: '/get_stats/'+id,
success: function(data) { success: function(data) {

Loading…
Cancel
Save