|
1 | 1 | <script>
|
2 |
| - import Sidebar from "./components/Sidebar.svelte"; |
3 |
| - import Content from "./components/Content.svelte"; |
4 |
| - import applyEnvForObject from "./lib/applyEnvForObject"; |
| 2 | + import Sidebar from './components/Sidebar.svelte'; |
| 3 | + import Content from './components/Content.svelte'; |
| 4 | + import applyEnvForObject from './lib/applyEnvForObject'; |
5 | 5 |
|
6 | 6 | export let config;
|
7 | 7 |
|
|
30 | 30 | }
|
31 | 31 | </script>
|
32 | 32 |
|
| 33 | +<svelte:head> |
| 34 | + <title>{config.workspace.name}</title> |
| 35 | +</svelte:head> |
| 36 | + |
| 37 | +<header style="border-top: 6px solid {color !== null ? color : '#6a57d5'};"> |
| 38 | + <div class="header-left"> |
| 39 | + <span class="hamburger-toggler" on:click={toggleHamburger}> |
| 40 | + <i class="fa fa-bars" aria-hidden="true" /> |
| 41 | + </span> |
| 42 | + |
| 43 | + <div class="logo"> |
| 44 | + <img src="logo.png" alt={config.workspace.name} /> |
| 45 | + </div> |
| 46 | + |
| 47 | + <h1 class="title">{config.workspace.name}</h1> |
| 48 | + </div> |
| 49 | + <div class="header-right"> |
| 50 | + <div class="run"> |
| 51 | + <a href={runInInsomniaLink} target="_blank"> |
| 52 | + <img src="https://insomnia.rest/images/run.svg" alt="Run in Insomnia" /> |
| 53 | + </a> |
| 54 | + </div> |
| 55 | + <div class="environment"> |
| 56 | + <label for="env" style="display:inline-block;">Environment:</label> |
| 57 | + <select id="env" bind:value={envId}> |
| 58 | + {#each config.environments as environment, idx} |
| 59 | + <option value={idx}>{environment.name}</option> |
| 60 | + {/each} |
| 61 | + </select> |
| 62 | + </div> |
| 63 | + <span |
| 64 | + class="example-toggler" |
| 65 | + class:inactive={!exampleVisible} |
| 66 | + on:click={toggleExample} |
| 67 | + title="Toggle request examples" |
| 68 | + > |
| 69 | + <i class="fa fa-code" aria-hidden="true" /> |
| 70 | + </span> |
| 71 | + </div> |
| 72 | +</header> |
| 73 | + |
| 74 | +<section class="wrapper" class:hide-right={!exampleVisible}> |
| 75 | + <Sidebar |
| 76 | + {requests} |
| 77 | + {groups} |
| 78 | + workspace={config.workspace} |
| 79 | + visible={menuVisible} |
| 80 | + /> |
| 81 | + <Content |
| 82 | + {requests} |
| 83 | + {groups} |
| 84 | + workspace={config.workspace} |
| 85 | + cookiejars={config.cookiejars} |
| 86 | + {env} |
| 87 | + /> |
| 88 | +</section> |
| 89 | + |
33 | 90 | <style type="scss" global>
|
34 |
| - @import "./styles/main"; |
| 91 | + @import './styles/main'; |
35 | 92 |
|
36 | 93 | header {
|
37 | 94 | box-sizing: border-box;
|
|
68 | 125 | vertical-align: middle;
|
69 | 126 | font-size: 22px;
|
70 | 127 | color: #000;
|
| 128 | + cursor: pointer; |
71 | 129 | }
|
72 | 130 |
|
73 | 131 | header .logo {
|
|
100 | 158 | vertical-align: middle;
|
101 | 159 | }
|
102 | 160 |
|
| 161 | + .example-toggler { |
| 162 | + cursor: pointer; |
| 163 | + } |
| 164 | +
|
103 | 165 | .wrapper {
|
104 | 166 | margin-top: 60px;
|
105 | 167 | }
|
106 | 168 | </style>
|
107 |
| - |
108 |
| -<svelte:head> |
109 |
| - <title>{config.workspace.name}</title> |
110 |
| -</svelte:head> |
111 |
| - |
112 |
| -<header style="border-top: 6px solid {color !== null ? color : '#6a57d5'};"> |
113 |
| - <div class="header-left"> |
114 |
| - <a href="javascript:" class="hamburger-toggler" on:click={toggleHamburger}> |
115 |
| - <i class="fa fa-bars" aria-hidden="true"></i> |
116 |
| - </a> |
117 |
| - |
118 |
| - <div class="logo"> |
119 |
| - <img src="logo.png" alt={config.workspace.name} /> |
120 |
| - </div> |
121 |
| - |
122 |
| - <h1 class="title">{config.workspace.name}</h1> |
123 |
| - </div> |
124 |
| - <div class="header-right"> |
125 |
| - <div class="run"> |
126 |
| - <a href={runInInsomniaLink} target="_blank"> |
127 |
| - <img src="https://insomnia.rest/images/run.svg" alt="Run in Insomnia" /> |
128 |
| - </a> |
129 |
| - </div> |
130 |
| - <div class="environment"> |
131 |
| - <label for="env" style="display:inline-block;">Environment:</label> |
132 |
| - <select id="env" bind:value={envId}> |
133 |
| - {#each config.environments as environment, idx} |
134 |
| - <option value={idx}>{environment.name}</option> |
135 |
| - {/each} |
136 |
| - </select> |
137 |
| - </div> |
138 |
| - <a |
139 |
| - href="javascript:;" |
140 |
| - class="example-toggler" |
141 |
| - class:inactive={!exampleVisible} |
142 |
| - on:click={toggleExample} |
143 |
| - title="Toggle request examples"> |
144 |
| - <i class="fa fa-code" aria-hidden="true"></i> |
145 |
| - </a> |
146 |
| - </div> |
147 |
| -</header> |
148 |
| - |
149 |
| -<section class="wrapper" class:hide-right={!exampleVisible}> |
150 |
| - <Sidebar |
151 |
| - {requests} |
152 |
| - {groups} |
153 |
| - workspace={config.workspace} |
154 |
| - visible={menuVisible} /> |
155 |
| - <Content |
156 |
| - {requests} |
157 |
| - {groups} |
158 |
| - workspace={config.workspace} |
159 |
| - cookiejars={config.cookiejars} |
160 |
| - {env} /> |
161 |
| -</section> |
|
0 commit comments