Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3736)

Unified Diff: appengine/auth_service/static/js/config_page.js

Issue 1148073005: Use luci-config for infrequently changing settings, part 2. (Closed) Base URL: git@github.com:luci/luci-py@master
Patch Set: fix pylint (??!) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/auth_service/proto/config_pb2.py ('k') | appengine/components/components/auth/ui/rest_api.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/auth_service/static/js/config_page.js
diff --git a/appengine/auth_service/static/js/config_page.js b/appengine/auth_service/static/js/config_page.js
index 5d2360f038abc5326da3148b3113e714b640aaa1..aeba5412baf133be9453314fe10de0f8d3a55f52 100644
--- a/appengine/auth_service/static/js/config_page.js
+++ b/appengine/auth_service/static/js/config_page.js
@@ -31,13 +31,7 @@ exports.onContentLoaded = function() {
// Handle 'Save' button.
$('#import-config').submit(function(event) {
event.preventDefault();
- var config = null;
- try {
- config = JSON.parse($('#import-config textarea[name="config"]').val())
- } catch(err) {
- showResult('error', 'Bad JSON.', err.message);
- return;
- }
+ var config = $('#import-config textarea[name="config"]').val();
common.setInteractionDisabled($('#import-config'), true);
writeImporterConfig({'config': config}).then(function(response) {
showResult('success', 'Config updated.');
@@ -49,8 +43,7 @@ exports.onContentLoaded = function() {
// Read the config, show the page only when it's available.
readImporterConfig().then(function(response) {
- var str = JSON.stringify(response.data['config'], undefined, 2);
- $('#import-config textarea[name="config"]').val(str);
+ $('#import-config textarea[name="config"]').val(response.data['config']);
common.presentContent();
}, function(error) {
common.presentError(error.text);
« no previous file with comments | « appengine/auth_service/proto/config_pb2.py ('k') | appengine/components/components/auth/ui/rest_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698