diff --git a/src/apps/wizard/controllers/start/index.html b/src/apps/wizard/controllers/start/index.html index 394959349..1c718df43 100644 --- a/src/apps/wizard/controllers/start/index.html +++ b/src/apps/wizard/controllers/start/index.html @@ -1,4 +1,4 @@ -
+
@@ -12,6 +12,10 @@

${ThisWizardWillGuideYou}


+
+ +
${LabelServerNameHelp}
+
diff --git a/src/apps/wizard/controllers/start/index.js b/src/apps/wizard/controllers/start/index.js index abbe00327..4bd9d68a9 100644 --- a/src/apps/wizard/controllers/start/index.js +++ b/src/apps/wizard/controllers/start/index.js @@ -6,12 +6,16 @@ import dom from 'scripts/dom'; import 'elements/emby-button/emby-button'; import 'elements/emby-select/emby-select'; -function loadPage(page, config, languageOptions) { - const elem = page.querySelector('#selectLocalizationLanguage'); - elem.innerHTML = languageOptions.map(function (l) { +function loadPage(page, systemInfo, config, languageOptions) { + const serverNameElem = page.querySelector('#txtServerName'); + serverNameElem.value = config.ServerName || systemInfo.ServerName; + + const languageElem = page.querySelector('#selectLocalizationLanguage'); + languageElem.innerHTML = languageOptions.map(function (l) { return ''; }).join(''); - elem.value = config.UICulture; + languageElem.value = config.UICulture; + loading.hide(); } @@ -19,7 +23,9 @@ function save(page) { loading.show(); const apiClient = ServerConnections.currentApiClient(); apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) { + config.ServerName = page.querySelector('#txtServerName').value; config.UICulture = page.querySelector('#selectLocalizationLanguage').value; + apiClient.ajax({ type: 'POST', data: JSON.stringify(config), @@ -38,17 +44,22 @@ function onSubmit(e) { export default function (view) { view.querySelector('.wizardStartForm').addEventListener('submit', onSubmit); + view.addEventListener('viewshow', function () { document.querySelector('.skinHeader').classList.add('noHomeButtonHeader'); loading.show(); const page = this; const apiClient = ServerConnections.currentApiClient(); - const promise1 = apiClient.getJSON(apiClient.getUrl('Startup/Configuration')); - const promise2 = apiClient.getJSON(apiClient.getUrl('Localization/Options')); - Promise.all([promise1, promise2]).then(function (responses) { - loadPage(page, responses[0], responses[1]); + + Promise.all([ + apiClient.getPublicSystemInfo(), + apiClient.getJSON(apiClient.getUrl('Startup/Configuration')), + apiClient.getJSON(apiClient.getUrl('Localization/Options')) + ]).then(([ systemInfo, config, languageOptions ]) => { + loadPage(page, systemInfo, config, languageOptions); }); }); + view.addEventListener('viewhide', function () { document.querySelector('.skinHeader').classList.remove('noHomeButtonHeader'); }); diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 21e3491bf..9f6e69f1c 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -1591,7 +1591,7 @@ "ThemeSongs": "Theme songs", "ThemeVideos": "Theme videos", "TheseSettingsAffectSubtitlesOnThisDevice": "These settings affect subtitles on this device", - "ThisWizardWillGuideYou": "This wizard will help guide you through the setup process. To begin, please select your preferred language.", + "ThisWizardWillGuideYou": "This wizard will help guide you through the setup process. To begin, please enter a server name and select your preferred language.", "Thumb": "Thumb", "ThumbCard": "Thumb Card", "Thursday": "Thursday",