diff --git a/agkyra/resources/nwgui/settings.html b/agkyra/resources/nwgui/settings.html index 80d550fdd6ec09bdb445f41e5cb5b4de14d0427d..e80a9af97c386c62e5922d127e9e48be822aab1b 100644 --- a/agkyra/resources/nwgui/settings.html +++ b/agkyra/resources/nwgui/settings.html @@ -93,11 +93,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. var logout_win = null; var got_cookie = false; var show_creds = true; + + function creds_on() { + $('#get_creds').removeClass("off"); + $('#get_creds').addClass("on"); + + } + + function creds_off() { + $('#get_creds').removeClass("on"); + $('#get_creds').addClass("off"); + } + function get_credentials() { var cookie_name = '_pithos2_a'; var lurl = get_account_ui() + '/logout?next=' + get_pithos_ui() show_creds = false; - $('#get_creds').hide(); + creds_off(); got_cookie = false; cred_win = gui.Window.open(lurl, { focus: true, width: 820, height: 580, toolbar: false @@ -131,6 +143,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. if(!url) { $('#cloud-error small').text(errors.cloud_url_empty); $('#cloud-error').addClass('error'); + creds_off(); return false; } else { refresh_endpoints(url); @@ -229,6 +242,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. document.getElementById('directory_label').innerHTML = SETTINGS.DIRECTORY || "Directory"; document.getElementById('dirdialogue_label').innerHTML = SETTINGS.DIRDIALOGUE || "Select directory"; document.getElementById('sync_button').innerHTML = SETTINGS.SAVE; + document.getElementById('explain_cloud').innerHTML = SETTINGS["EXPLAIN CLOUD"] || "Go to the cloud site, login, click API ACCESS and copy the Authentication URL in the first box."; + document.getElementById('explain_sync').innerHTML = SETTINGS["EXPLAIN SYNC"] || "Pair a remote Pithos+ container with a local directory"; var cloud_placeholder = SETTINGS["CLOUD URL PLACEHOLDER"] || "Authentication URL"; $('#cloud-url').attr('placeholder', cloud_placeholder); @@ -256,9 +271,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. window.setInterval(function() { // Refresh get_creds visibility, until refresh_endpoints // changes are in effect - if (get_pithos_ui() && show_creds) { - $('#get_creds').show(); - } else {$('#get_creds').hide();} + if (get_pithos_ui() && show_creds) creds_on(); + else creds_off(); check_cloud_url(); check_token(); }, 500); @@ -291,6 +305,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. </fieldset> <fieldset> <legend id="cloud_label">Cloud</legend> + <div id="explain_cloud" class="row clearfix explain"> </div> <div class="clearfix"> <div class="small-3 columns"> <label id="url_label" for="cloud-url" class="right inline">Cloud URL</label> @@ -318,15 +333,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. </div> <div class="clearfix"> - <div class="small-8 columns"></div> + <div class="small-9 columns"></div> <a id="get_creds" - class="small-4 columns button right" style="display: none;" + class="small-3 columns button right off" onclick="get_credentials();">Login to retrieve token</a> </div> </fieldset> <fieldset> <legend id="sync_label">What to sync</legend> + <div id="explain_sync" class="row clearfix explain"> </div> <div class="row clearfix"> <div class="small-3 columns"> <label id="container_label" for="container" class="right inline">Remote container</label> @@ -348,11 +364,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. Select</div> </div> <div class="row clearfix"> - <div class="small-3 columns"> </div> <div id="directory-error" class="small-6 columns"> <small>Invalid entry</small> </div> - <div class="small-3 columns"> </div> </div> <input type="file" id="choose-dir" nwdirectory diff --git a/agkyra/resources/nwgui/static/stylesheets/main.css b/agkyra/resources/nwgui/static/stylesheets/main.css index e2b1eaae5981023af916a539bcfa93233c0bda10..3bb89e471f13776823d05e32df918e632dcaad5b 100644 --- a/agkyra/resources/nwgui/static/stylesheets/main.css +++ b/agkyra/resources/nwgui/static/stylesheets/main.css @@ -154,6 +154,14 @@ button, .button, .pickdir { transition: background-color 300ms ease-out; } +a.on { + background-color: #008CBA; +} +a.off { + background-color: #cccccc; + pointer-events: none; +} + input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="url"], textarea { -webkit-appearance: none; -moz-appearance: none; @@ -214,6 +222,17 @@ textarea { height: 150px; max-height: 150px; } +div.explain { + padding: 0.2rem 0.2rem; + margin: 0 0.85rem 0.35rem; + font-size: 65%; + font-weight: 100; + font-style: italic; + color: #a0a0a0; + border-color: #a0a0a0; + border-style: dashed; + border-width: 0.1rem; +} #directory { padding-top: 0.35rem; diff --git a/agkyra/resources/ui_data/common_el.json b/agkyra/resources/ui_data/common_el.json index cddfacaf13265cb44502fad44784af5f297edbba..c1f4097ebf6d5e4e83b9c12f5fabb175e3b5d892 100644 --- a/agkyra/resources/ui_data/common_el.json +++ b/agkyra/resources/ui_data/common_el.json @@ -66,15 +66,17 @@ "DIRECTORY": "΀οΟΞΉΞΊΟΟ ΟάκΡλοΟ", "DIRDIALOGUE": "ΞΟιλογΞ� ΟΞ±ΞΊΞΞ»ΞΏΟ ", "SAVE": "ΞΟΞΏΞΈΞ�ΞΊΞ΅Ο ΟΞ·", - "CLOUD URL PLACEHOLDER": "ΞΞΉΞ΅ΟΞΈΟ Ξ½ΟΞ· (URL) Ξ΅ΞΎΞΏΟ ΟΞΉΞΏΞ΄ΟΟΞ·ΟΞ·Ο", - "TOKEN PLACEHOLDER": "ΞλΡιδί (token) ΟΟΟΟΞ²Ξ±ΟΞ·Ο", - "CONTAINER PLACEHOLDER": "ΞΟΞΏΞΌΞ±ΞΊΟΟ ΟΞΌΞΞ½ΞΏΟ ΟΞ΅ΟΞΉΞΞΊΟΞ·Ο Pithos+", + "CLOUD URL PLACEHOLDER": "https://accounts.example.com/identity/v2.0", + "TOKEN PLACEHOLDER": "ΞΞ½ΟΞΉΞ³ΟΞ¬ΟΟΞ Ξ΅Ξ΄Ο ΟΞΏ κλΡιδί (token) ΟΟΟΟΞ²Ξ±ΟΞ·Ο", + "CONTAINER PLACEHOLDER": "ΠληκΟΟολογΞ�ΟΟΞ΅ ΟΞΏΞ½ ΟΞ΅ΟΞΉΞΞΊΟΞ· (container)", "CLOUD URL IS EMPTY": "ΞΟΟΟΞ΅ ΟΞ· ΞΞΉΞ΅ΟΞΈΟ Ξ½ΟΞ· (URL) Ξ΅ΞΎΞΏΟ ΟΞΉΞΏΞ΄ΟΟΞ·ΟΞ·Ο ΟΞΏΟ Ξ½ΞΟΞΏΟ Ο", "CLOUD URL UNEXPECTED RESPONSE": "Ξ Ξ±ΟΟΞΊΟΞΉΟΞ· ΟΞΏΟ Ξ½ΞΟΞΏΟ Ο Ξ΄Ξ΅Ξ½ Ξ�ΟΞ±Ξ½ Ξ· αναμΡνΟμΡνη", "TOKEN IS EMPTY": "ΞΟΟΟΞ΅ ΟΞΏ κλΡιδί ΟΟΟΟΞ²Ξ±ΟΞ·Ο (token) Ξ� Ξ΅ΟΞΉΞ»ΞΞΎΟΞ΅ ΡίΟοδο ΞΌΞ΅ ΟΞ½ΞΏΞΌΞ± ΟΟΞ�ΟΟΞ·/ΞΊΟδικΟ", "AUTHENTICATION FAILED": "Ξ Ξ΅ΞΎΞΏΟ ΟΞΉΞΏΞ΄ΟΟΞ·ΟΞ· Ξ±ΟΞΟΟ ΟΞ΅", "TOKEN WITHOUT CLOUD": "ΞΡν ΞΟΞ΅ΟΞ΅ Ξ΄ΟΟΡι διΡΟΞΈΟ Ξ½ΟΞ· Ξ½ΞΟΞΏΟ Ο", "PROVIDE CONTAINER": "ΞΟΟΟΞ΅ ΟΞΏ ΟΞ½ΞΏΞΌΞ± ΟΞΏΟ ΟΞ΅ΟΞΉΞΞΊΟΞ· (container) Pithos+", - "SELECT DIRECTORY": "ΞΟΞΉΞ»ΞΞΎΟΞ΅ ΞΞ½Ξ± ΟΞΏΟΞΉΞΊΟ ΟάκΡλο" + "SELECT DIRECTORY": "ΞΟΞΉΞ»ΞΞΎΟΞ΅ ΞΞ½Ξ± ΟΞΏΟΞΉΞΊΟ ΟάκΡλο", + "EXPLAIN CLOUD": "ΞΞΉΞ± Ξ½Ξ± ΟΟ ΞΈΞΌΞ―ΟΞ΅ΟΞ΅ ΟΞ·Ξ½ ΟΟΟΟΞ²Ξ±ΟΞ·, Ξ΅ΟΞΉΟΞΊΞ΅Ο ΞΈΞ΅Ξ―ΟΞ΅ ΟΞ· ΟΡλίδα ΟΞΏΟ Ξ½ΞΟΞΏΟ Ο ΞΊΞ±ΞΉ ΞΌΞ΅ΟΞ¬ ΟΞ·Ξ½ ΡίΟοδο Ξ΅ΟΞΉΞ»ΞΞΎΟΞ΅ <u>API Access</u>. ΞΟΡίΟΞ΅ ΟΞΏ URL ΞΊΞ±ΞΉ ΟΞΏ κλΡιδί (token) ΞΊΞ±ΞΉ Ξ±Ξ½ΟΞΉΞ³ΟΞ¬ΟΟΞ΅ ΟΞ± ΟΞ±ΟΞ±ΞΊΞ¬ΟΟ, ΡίΟΞ΅ Ξ±Ξ½ΟΞΉΞ³ΟΞ¬ΟΟΞ΅ ΞΌΟΞ½ΞΏ ΟΞΏ URL ΞΊΞ±ΞΉ ΡιΟΞλθΡΟΞ΅ ΞΌΞ΅ ΟΞ½ΞΏΞΌΞ± ΟΟΞ�ΟΟΞ·/ΞΊΟδικΟ.", + "EXPLAIN SYNC": "ΞΞΉΞ± Ξ½Ξ± ΞΈΞΟΞ΅ΟΞ΅ ΞΞ½Ξ± ΞΆΞ΅ΟΞ³ΞΏΟ ΟΞ΅ΟΞΉΞΞΊΟΞ· (container) - ΟΞΏΟΞΉΞΊΞΏΟ ΟΞ±ΞΊΞΞ»ΞΏΟ , ΟληκΟΟολογΞ�ΟΟΞ΅ ΟΞΏΞ½ ΟΞ΅ΟΞΉΞΞΊΟΞ· ΞΊΞ±ΞΉ ΟΟΞ·ΟΞΉΞΌΞΏΟΞΏΞΉΞ�ΟΟΞ΅ ΟΞΏ ΞΊΞΏΟ ΞΌΟΞ― <u>ΞΟιλογΞ� ΟΞ±ΞΊΞΞ»ΞΏΟ </u>. ΞΞ½ ΞΏ ΟΞ΅ΟΞΉΞΞΊΟΞ·Ο Ξ΄Ξ΅Ξ½ Ο ΟΞ¬ΟΟΡι ΟΟΞΏ Ξ±ΟΞΏΞΌΞ±ΞΊΟΟ ΟΞΌΞΞ½ΞΏ ΟΟΟΟΞ·ΞΌΞ±, ΞΈΞ± Ξ΄Ξ·ΞΌΞΉΞΏΟ ΟγηθΡί Ξ±Ο ΟΟΞΌΞ±ΟΞ±." } } diff --git a/agkyra/resources/ui_data/common_en.json b/agkyra/resources/ui_data/common_en.json index 60c7b10a41c76c84ce70468532e0317f28da6967..c0ebd417c518c9029d96e4ed125138ae47571bd4 100644 --- a/agkyra/resources/ui_data/common_en.json +++ b/agkyra/resources/ui_data/common_en.json @@ -66,15 +66,17 @@ "DIRECTORY": "Local directory", "DIRDIALOGUE": "Select directory", "SAVE": "Save", - "CLOUD URL PLACEHOLDER": "Authentication URL", - "TOKEN PLACEHOLDER": "User token", - "CONTAINER PLACEHOLDER": "Pithos+ container", + "CLOUD URL PLACEHOLDER": "https://accounts.example.com/identity/v2.0", + "TOKEN PLACEHOLDER": "Copy your token here", + "CONTAINER PLACEHOLDER": "Type a Pithos+ container here", "CLOUD URL IS EMPTY": "Provide a Cloud Authentication URL", "CLOUD URL UNEXPECTED RESPONSE": "Cloud URL did not respond as expected", "TOKEN IS EMPTY": "Provide a user token or login with user name/password", "AUTHENTICATION FAILED": "Failed to authenticate", "TOKEN WITHOUT CLOUD": "The cloud URL is missing", "PROVIDE CONTAINER": "Provide the name of the Pithos+ container", - "SELECT DIRECTORY": "Select the local directory" + "SELECT DIRECTORY": "Select the local directory", + "EXPLAIN CLOUD": "To get the cloud credentials, browse to your cloud website, log in and click on <u>API Access</u>. Find the URL and token and copy them bellow, or copy the URL and click the button to login with username/password.", + "EXPLAIN SYNC": "To pair a container with a directory, type the container and click on <u>Select directory</u>. If the container does not exist on the remote site, it will be created." } }