Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion core/Controller/SetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
namespace OC\Core\Controller;

use OC\Setup;
use OCP\IInitialStateService;
use OCP\IURLGenerator;
use OCP\Template\ITemplateManager;
use OCP\Util;
use Psr\Log\LoggerInterface;
Expand All @@ -19,6 +21,8 @@ public function __construct(
protected Setup $setupHelper,
protected LoggerInterface $logger,
protected ITemplateManager $templateManager,
protected IInitialStateService $initialStateService,
protected IURLGenerator $urlGenerator,
) {
$this->autoConfigFile = \OC::$configDir . 'autoconfig.php';
}
Expand Down Expand Up @@ -72,6 +76,8 @@ public function display(array $post): void {
'dbtablespace' => '',
'dbhost' => 'localhost',
'dbtype' => '',
'hasAutoconfig' => false,
'serverRoot' => \OC::$SERVERROOT,
];
$parameters = array_merge($defaults, $post);

Expand All @@ -80,9 +86,18 @@ public function display(array $post): void {
// include common nextcloud webpack bundle
Util::addScript('core', 'common');
Util::addScript('core', 'main');
Util::addScript('core', 'install');
Util::addTranslations('core');

$this->templateManager->printGuestPage('', 'installation', $parameters);
$this->initialStateService->provideInitialState('core', 'config', $parameters);
$this->initialStateService->provideInitialState('core', 'data', false);
$this->initialStateService->provideInitialState('core', 'links', [
'adminInstall' => $this->urlGenerator->linkToDocs('admin-install'),
'adminSourceInstall' => $this->urlGenerator->linkToDocs('admin-source_install'),
'adminDBConfiguration' => $this->urlGenerator->linkToDocs('admin-db-configuration'),
]);

$this->templateManager->printGuestPage('', 'installation');
}

private function finishSetup(): void {
Expand All @@ -107,6 +122,7 @@ public function loadAutoConfig(array $post): array {
$this->logger->info('Autoconfig file found, setting up Nextcloud…');
$AUTOCONFIG = [];
include $this->autoConfigFile;
$post['hasAutoconfig'] = count($AUTOCONFIG) > 0;
$post = array_merge($post, $AUTOCONFIG);
}

Expand Down
156 changes: 0 additions & 156 deletions core/src/install.js

This file was deleted.

49 changes: 49 additions & 0 deletions core/src/install.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import Vue from 'vue'
import Setup from './views/Setup.vue'

type Error = {
error: string
hint: string
}

export type DbType = 'sqlite' | 'mysql' | 'pgsql' | 'oci'

export type SetupConfig = {
adminlogin: string
adminpass: string
dbuser: string
dbpass: string
dbname: string
dbtablespace: string
dbhost: string
dbtype: DbType | ''

hasSQLite: boolean
hasMySQL: boolean
hasPostgreSQL: boolean
hasOracle: boolean
databases: Record<DbType, string>

dbIsSet: boolean
directory: string
directoryIsSet: boolean
hasAutoconfig: boolean
htaccessWorking: boolean
serverRoot: string

errors: string[]|Error[]
}

export type SetupLinks = {
adminInstall: string
adminSourceInstall: string
adminDBConfiguration: string
}

const SetupVue = Vue.extend(Setup)
new SetupVue().$mount('#content')
Loading
Loading