Skip to content

Commit

Permalink
CLI Client-side Autocomplete
Browse files Browse the repository at this point in the history
Executes silently `help`, `dump`, `get` on CLI open. Parses the output
and build autocomplete cache. Autcomplete hints are displayed in
popup lists.
  • Loading branch information
Cleric-K committed Mar 26, 2019
1 parent eb4a0d7 commit 9181bdd
Show file tree
Hide file tree
Showing 11 changed files with 458 additions and 8 deletions.
3 changes: 3 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4154,5 +4154,8 @@
},
"flashTab": {
"message": "Update Firmware"
},
"cliAutoComplete": {
"message": "Advanced CLI AutoComplete"
}
}
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"dependencies": {
"i18next": "^14.1.1",
"i18next-xhr-backend": "^2.0.0",
"jquery-textcomplete": "^1.8.5",
"lru_map": "^0.3.3",
"marked": "^0.6.0",
"object-hash": "^1.3.1",
Expand Down
52 changes: 52 additions & 0 deletions src/css/tabs/cli.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,55 @@

}


/* AutoComplete */
.cli-textcomplete-dropdown {
border: 1px solid #ddd;
background-color: white;
border-radius: 5px;
max-height: 50%;
overflow: auto;
}

.cli-textcomplete-dropdown::-webkit-scrollbar {
width: 6px;
}

.cli-textcomplete-dropdown::-webkit-scrollbar-track {
background: lightgrey;
border-radius: 3px;
}

.cli-textcomplete-dropdown::-webkit-scrollbar-thumb {
background: grey;
border-radius: 3px;
}

.cli-textcomplete-dropdown li {
padding: 2px 5px;
}

.cli-textcomplete-dropdown li:hover,
.cli-textcomplete-dropdown .active {
background-color: rgb(255, 187, 0);
}

.cli-textcomplete-dropdown {
list-style: none;
padding: 0;
margin: 0;
}

.cli-textcomplete-dropdown a:hover {
cursor: pointer;
}

.cli-textcomplete-dropdown a {
font-family: monospace;
}

.cli-textcomplete-dropdown a b {
font-family: monospace;
font-weight: bold;
}
/* End AutoComplete */
Loading

0 comments on commit 9181bdd

Please sign in to comment.