Skip to content

Commit c70aa52

Browse files
ui fixes and adds more status codes to registry
1 parent e22ae9d commit c70aa52

File tree

7 files changed

+69
-12
lines changed

7 files changed

+69
-12
lines changed

ui/src/components/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function App() {
2929
const [showDelete] = useLocalStorage('showDelete', 'true');
3030
const [showPut] = useLocalStorage('showPut', 'true');
3131
const [showPatch] = useLocalStorage('showPatch', 'true');
32-
const [showHead] = useLocalStorage('showHead', 'true');
32+
const [showHead] = useLocalStorage('showHead', 'false');
3333

3434
const searchOptions = {
3535
keys: ['uri', 'doc_block'],

ui/src/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function Sidebar(props: Props) {
1313

1414
return (
1515
<>
16-
<aside>
16+
<aside className='no-scrollbar'>
1717
<h2 className="title pl-5 pt-2 mb-5">
1818
<ListBulletIcon className='inline-block w-4 h-4 mr-1' />
1919
API List <span className='text-slate-500 capitalize float-right mr-5'>Total {lrdDocsJson.length}</span>

ui/src/components/elements/ApiActionInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function ApiActionInfo(props: Props) {
5050
{lrdDocsItem.middlewares.length != 0 && (
5151
<tr>
5252
<th>Middlewares</th>
53-
<td>
53+
<td className='no-scrollbar'>
5454
{lrdDocsItem.middlewares.map((middleware) => (
5555
<div key={shortid.generate()}>
5656
<span className="badge badge-ghost badge-md mb-1 rounded-sm">{middleware}</span>

ui/src/components/elements/ApiActionRequest.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export default function ApiActionRequest(props: Props) {
7676
<>
7777
<div className="form-control">
7878
<label className="input-group input-group-sm">
79-
<span className={`method-${method}`}>{method}</span>
80-
<input type="text" defaultValue={requestUri} onChange={(e) => setRequestUri(e.target.value)} placeholder="Type here" className="focus:outline-none input w-full input-bordered input-sm" />
79+
<span className={`method-${method} pr-2`}>{method}</span>
80+
<input type="text" defaultValue={requestUri} onChange={(e) => setRequestUri(e.target.value)} placeholder="Type here" className="focus:outline-none input w-4/5 input-bordered input-sm mr-2" />
8181
<button className="btn btn-sm btn-success" onClick={handleSendRequest}>
8282
GO <PaperAirplaneIcon className='inline-block w-4 h-4 ml-1' />
8383
</button>

ui/src/components/elements/ApiActionTabs.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ export default function ApiActionTabs(props: Props) {
2727
<a className={`tab ${activeTab == 'info' ? 'tab-active' : ''}`} onClick={() => setActiveTab('info')}>
2828
<InformationCircleIcon className='inline-block w-5 h-5' /> Info
2929
</a>
30-
<a className={`tab ${activeTab == 'request' ? 'tab-active' : ''}`} onClick={() => setActiveTab('request')}>
31-
<span className='text-success font-bold'>
30+
<a className={`tab ${activeTab == 'request' ? 'tab-active' : 'text-success'}`} onClick={() => setActiveTab('request')}>
31+
<span className='font-bold'>
3232
<PaperAirplaneIcon className='inline-block w-5 h-5' /> Send
3333
</span>
3434
</a>
35-
<span className='pr-1 mb-1'>
36-
<EllipsisVerticalIcon className='inline-block w-5 h-5' />
37-
</span>
3835
<a className={`pl-0 tab ${activeTab == 'response' ? 'tab-active' : ''}`} onClick={() => setActiveTab('response')}>
3936
<ReceiptRefundIcon className='inline-block w-5 h-5' /> Response
4037
{responseStatus != 0 && (

ui/src/global.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
html {
77
font-family: 'Roboto', sans-serif;
88
}
9-
9+
@layer utilities {
10+
/* Hide scrollbar for Chrome, Safari and Opera */
11+
.no-scrollbar::-webkit-scrollbar {
12+
display: none;
13+
}
14+
/* Hide scrollbar for IE, Edge and Firefox */
15+
.no-scrollbar {
16+
-ms-overflow-style: none; /* IE and Edge */
17+
scrollbar-width: none; /* Firefox */
18+
}
19+
}
1020
.ace_editor {
1121
@apply rounded;
1222
}
@@ -23,6 +33,7 @@ html {
2333
width: 100%;
2434

2535
}
36+
2637
aside {
2738
@apply h-screen;
2839
position: fixed;

ui/src/libs/constants.tsx

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,64 @@
11
export const responsesText: {[key: string]: string} = {
2+
"100": "Continue",
3+
"101": "Switching Protocols",
4+
"102": "Processing",
5+
"103": "Early Hints",
26
"200": "OK",
37
"201": "Created",
48
"202": "Accepted",
9+
"203": "Non-Authoritative Information",
510
"204": "No Content",
11+
"205": "Reset Content",
12+
"206": "Partial Content",
13+
"207": "Multi-Status",
14+
"208": "Already Reported",
15+
"226": "IM Used",
16+
"300": "Multiple Choices",
17+
"301": "Moved Permanently",
18+
"302": "Found",
19+
"303": "See Other",
20+
"304": "Not Modified",
21+
"305": "Use Proxy",
22+
"307": "Temporary Redirect",
23+
"308": "Permanent Redirect",
624
"400": "Bad Request",
725
"401": "Unauthorized",
26+
"402": "Payment Required",
827
"403": "Forbidden",
928
"404": "Not Found",
1029
"405": "Method Not Allowed",
30+
"406": "Not Acceptable",
31+
"407": "Proxy Authentication Required",
32+
"408": "Request Timeout",
33+
"409": "Conflict",
34+
"410": "Gone",
35+
"411": "Length Required",
36+
"412": "Precondition Failed",
37+
"413": "Payload Too Large",
38+
"414": "URI Too Long",
39+
"415": "Unsupported Media Type",
40+
"416": "Range Not Satisfiable",
41+
"417": "Expectation Failed",
42+
"418": "I'm a teapot",
43+
"421": "Misdirected Request",
1144
"422": "Unprocessable Entity",
45+
"423": "Locked",
46+
"424": "Failed Dependency",
47+
"425": "Too Early",
48+
"426": "Upgrade Required",
49+
"428": "Precondition Required",
1250
"429": "Too Many Requests",
51+
"431": "Request Header Fields Too Large",
52+
"451": "Unavailable For Legal Reasons",
1353
"500": "Internal Server Error",
54+
"501": "Not Implemented",
55+
"502": "Bad Gateway",
1456
"503": "Service Unavailable",
15-
}
57+
"504": "Gateway Timeout",
58+
"505": "HTTP Version Not Supported",
59+
"506": "Variant Also Negotiates",
60+
"507": "Insufficient Storage",
61+
"508": "Loop Detected",
62+
"510": "Not Extended",
63+
"511": "Network Authentication Required"
64+
};

0 commit comments

Comments
 (0)