Move the page margin config to frontend

This commit is contained in:
Alex Ling
2021-03-06 15:04:44 +00:00
parent f62344806a
commit d3f26ecbc9
4 changed files with 20 additions and 5 deletions

View File

@@ -20,7 +20,6 @@ class Config
property plugin_path : String = File.expand_path "~/mango/plugins",
home: true
property download_timeout_seconds : Int32 = 30
property page_margin : Int32 = 30
property disable_login = false
property default_username = ""
property auth_proxy_header_name = ""

View File

@@ -612,7 +612,6 @@ struct APIRouter
"width" => Int32,
"height" => Int32,
}],
"margin" => Int32?,
}
get "/api/dimensions/:tid/:eid" do |env|
begin
@@ -628,7 +627,6 @@ struct APIRouter
send_json env, {
"success" => true,
"dimensions" => sizes,
"margin" => Config.current.page_margin,
}.to_json
rescue e
send_json env, {

View File

@@ -25,11 +25,11 @@
<img
uk-img
:class="{'uk-align-center': true, 'spine': item.width < 50}"
:style="item.style"
:data-src="item.url"
:width="item.width"
:height="item.height"
:id="item.id"
:style="`margin-top:${margin}px; margin-bottom:${margin}px`"
@click="showControl($event)"
/>
</template>
@@ -80,6 +80,7 @@
</select>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="mode-select">Mode</label>
<div class="uk-form-controls">
@@ -90,6 +91,13 @@
</div>
</div>
<div class="uk-margin" x-show="mode === 'continuous'">
<label class="uk-form-label" for="margin-range" x-text="`Page Margin: ${margin}px`"></label>
<div class="uk-form-controls">
<input id="margin-range" class="uk-range" type="range" min="0" max="50" step="5" x-model="margin" @change="marginChanged()">
</div>
</div>
<hr class="uk-divider-icon">
<div class="uk-margin">