change the sorting method of rpc name to natural sorting
This commit is contained in:
parent
4be5492676
commit
7f81e9c07e
|
@ -15,6 +15,7 @@
|
||||||
"awesome-bootstrap-checkbox": "^0.3.7",
|
"awesome-bootstrap-checkbox": "^0.3.7",
|
||||||
"jquery-slimscroll": "^1.3.8",
|
"jquery-slimscroll": "^1.3.8",
|
||||||
"bootstrap-contextmenu": "^1.0.0",
|
"bootstrap-contextmenu": "^1.0.0",
|
||||||
|
"natural-compare": "1.4.0",
|
||||||
"angular": "1.6.10",
|
"angular": "1.6.10",
|
||||||
"angular-route": "1.6.10",
|
"angular-route": "1.6.10",
|
||||||
"angular-sanitize": "1.6.10",
|
"angular-sanitize": "1.6.10",
|
||||||
|
|
|
@ -329,6 +329,7 @@
|
||||||
<script src="../node_modules/jquery-slimscroll/jquery.slimscroll.min.js"></script>
|
<script src="../node_modules/jquery-slimscroll/jquery.slimscroll.min.js"></script>
|
||||||
<script src="../node_modules/sweetalert/dist/sweetalert.min.js"></script>
|
<script src="../node_modules/sweetalert/dist/sweetalert.min.js"></script>
|
||||||
<script src="../node_modules/bootstrap-contextmenu/bootstrap-contextmenu.js"></script>
|
<script src="../node_modules/bootstrap-contextmenu/bootstrap-contextmenu.js"></script>
|
||||||
|
<script src="../node_modules/natural-compare/index.js"></script>
|
||||||
<script src="../node_modules/angular-translate/dist/angular-translate.min.js"></script>
|
<script src="../node_modules/angular-translate/dist/angular-translate.min.js"></script>
|
||||||
<script src="../node_modules/angular-moment/angular-moment.min.js"></script>
|
<script src="../node_modules/angular-moment/angular-moment.min.js"></script>
|
||||||
<script src="../node_modules/angular-websocket/dist/angular-websocket.min.js"></script>
|
<script src="../node_modules/angular-websocket/dist/angular-websocket.min.js"></script>
|
||||||
|
|
|
@ -245,13 +245,7 @@
|
||||||
// Do Nothing
|
// Do Nothing
|
||||||
} else if (displayOrder === 'rpcAlias') {
|
} else if (displayOrder === 'rpcAlias') {
|
||||||
result.sort(function (rpc1, rpc2) {
|
result.sort(function (rpc1, rpc2) {
|
||||||
if (rpc1.rpcAlias < rpc2.rpcAlias) {
|
return String.naturalCompare(rpc1.rpcAlias, rpc2.rpcAlias);
|
||||||
return -1;
|
|
||||||
} else if (rpc1.rpcAlias > rpc2.rpcAlias) {
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue