fixes the statuslabeltypeforatter instead of the model
This commit is contained in:
parent
a0d5774635
commit
6b94ef6adc
3 changed files with 21 additions and 7 deletions
|
@ -74,14 +74,14 @@ class Statuslabel extends SnipeModel
|
||||||
public function getStatuslabelType()
|
public function getStatuslabelType()
|
||||||
{
|
{
|
||||||
if (($this->pending == '1') && ($this->archived == '0') && ($this->deployable == '0')) {
|
if (($this->pending == '1') && ($this->archived == '0') && ($this->deployable == '0')) {
|
||||||
return trans('admin/statuslabels/table.pending');
|
return 'pending';
|
||||||
} elseif (($this->pending == '0') && ($this->archived == '1') && ($this->deployable == '0')) {
|
} elseif (($this->pending == '0') && ($this->archived == '1') && ($this->deployable == '0')) {
|
||||||
return trans('admin/statuslabels/table.archived');
|
return 'archived';
|
||||||
} elseif (($this->pending == '0') && ($this->archived == '0') && ($this->deployable == '0')) {
|
} elseif (($this->pending == '0') && ($this->archived == '0') && ($this->deployable == '0')) {
|
||||||
return trans('admin/statuslabels/table.undeployable');
|
return 'undeployable';
|
||||||
}
|
}
|
||||||
|
|
||||||
return trans('admin/statuslabels/table.deployable');
|
return 'deployable';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -17392,7 +17392,7 @@
|
||||||
"performance-now": {
|
"performance-now": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
||||||
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
|
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"picocolors": {
|
"picocolors": {
|
||||||
|
@ -18500,7 +18500,7 @@
|
||||||
"rgbcolor": {
|
"rgbcolor": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
|
||||||
"integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
|
"integrity": "sha1-1lBezbMEplldom+ktDMHMGd1lF0=",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"rimraf": {
|
"rimraf": {
|
||||||
|
|
|
@ -111,25 +111,39 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusLabelTypeFormatter (row, value) {
|
function statusLabelTypeFormatter (row, value) {
|
||||||
|
|
||||||
switch (value.type) {
|
switch (value.type) {
|
||||||
case 'deployed':
|
case 'deployed':
|
||||||
text_color = 'blue';
|
text_color = 'blue';
|
||||||
icon_style = 'fa-circle';
|
icon_style = 'fa-circle';
|
||||||
|
trans = '{{ strtolower(trans('general.deployed')) }}';
|
||||||
break;
|
break;
|
||||||
case 'deployable':
|
case 'deployable':
|
||||||
text_color = 'green';
|
text_color = 'green';
|
||||||
icon_style = 'fa-circle';
|
icon_style = 'fa-circle';
|
||||||
|
trans = '{{ strtolower(trans('admin/hardware/general.deployable')) }}';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'pending':
|
case 'pending':
|
||||||
text_color = 'orange';
|
text_color = 'orange';
|
||||||
icon_style = 'fa-circle';
|
icon_style = 'fa-circle';
|
||||||
|
trans = '{{ strtolower(trans('general.deployed')) }}';
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'undeployable':
|
||||||
|
text_color = 'orange';
|
||||||
|
icon_style = 'fa-circle';
|
||||||
|
trans ='{{ trans('admin/statuslabels/table.undeployable') }}';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
text_color = 'red';
|
text_color = 'red';
|
||||||
icon_style = 'fa-times';
|
icon_style = 'fa-times';
|
||||||
|
trans = '{{ strtolower(trans('general.archived')) }}';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var typename_lower = value.type;
|
var typename_lower = trans;
|
||||||
var typename = typename_lower.charAt(0).toUpperCase() + typename_lower.slice(1);
|
var typename = typename_lower.charAt(0).toUpperCase() + typename_lower.slice(1);
|
||||||
return '<i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + typename;
|
return '<i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + typename;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue