diff --git a/app/renderer/css/preference.css b/app/renderer/css/preference.css index 70a44115..86168fba 100644 --- a/app/renderer/css/preference.css +++ b/app/renderer/css/preference.css @@ -2,18 +2,20 @@ html, body { height: 100%; margin: 0; cursor: default; + font-size: 14px; + color: #333; + background: #fff; } #content { display: flex; height: 100%; font-family: sans-serif; - background: #fff; } #sidebar { width: 80px; - padding: 40px; + padding: 30px; display: flex; flex-direction: column; font-size: 16px; @@ -32,18 +34,122 @@ html, body { .tab.active { color: #464e5a; cursor: default; + position: relative; } .tab.active::before { - color: #464e5a; - cursor: default; + background: #464e5a; + width: 3px; + height: 16px; + position: absolute; + left: -8px; + content: ''; } + #settings-header { - font-size: 24px; + font-size: 22px; color: #5c6166; } -.settings-container { +#settings-container { width: 100%; display: flex; + padding: 30px; +} + +.server-info-container { + margin: 20px 0; +} + +.title { + padding: 4px 0 6px 0; + font-size: 18px; + color: #000; +} + +img.server-info-icon { + background: #a4d3c4; + background-size: 100%; + border-radius: 4px; + width: 44px; + height: 44px; +} + +.server-info-left { + margin-right: 20px; +} + +.server-info-right { + flex-grow: 1; +} + +.server-info-row { + display: flex; + line-height: 26px; + height: 40px; +} + +.server-info-key { + width: 40px; + margin-right: 20px; + text-align: right; +} + +.server-info-value { + flex-grow: 1; + font-size: 14px; + height: 24px; + border: none; + border-bottom: #ddd 1px solid; + outline-width: 0; + background: transparent; +} + +.server-info-value:focus { + border-bottom: #b0d8ce 2px solid; +} + +.actions-container { + display: flex; + font-size: 14px; + color: #235d3a; + vertical-align: middle; + margin: 10px 0; +} + +.action { + display: flex; + align-items: center; + margin-right: 20px; +} + +.action i { + margin-right: 5px; + font-size: 18px; +} + +.settings-pane { + flex-grow: 1; +} + +.action:hover { + cursor: pointer; +} + +.action.disabled:hover { + cursor: default; +} + +.action.disabled { + color: #999; +} + +.server-info.active { + background: #ecf4ef; + padding: 20px; +} + +.server-info { + display: flex; + margin: 20px 0; } \ No newline at end of file diff --git a/app/renderer/js/preference.js b/app/renderer/js/preference.js index e69de29b..37aed47c 100644 --- a/app/renderer/js/preference.js +++ b/app/renderer/js/preference.js @@ -0,0 +1,63 @@ +'use strict'; + +const path = require("path"); +const DomainUtil = require(path.resolve(('app/renderer/js/utils/domain-util.js'))); +class PreferenceView { + constructor() { + this.$newServerButton = document.getElementById('new-server-action'); + this.$saveServerButton = document.getElementById('save-server-action'); + this.$serverInfoContainer = document.querySelector('.server-info-container'); + } + + init() { + this.domainUtil = new DomainUtil(); + this.initServers(); + } + + initServers() { + const servers = this.domainUtil.getDomains(); + for (let server of servers) { + this.initServer(server); + } + } + + initServer(server) { + const { + alias, + url, + icon + } = server; + const serverInfoTemplate = ` +