This commit is contained in:
Bozhidar Slaveykov 2023-11-27 23:28:41 +02:00
parent e788c4f49a
commit ed26b30f71
3 changed files with 34 additions and 0 deletions

View file

@ -23,6 +23,10 @@ sed -i "s/%USER%/${USER}/g" $SITES_AVAILABLE_DIR/$DOMAIN.conf
SERVER_ROOT_ESCAPED=$(printf '%s\n' "$SERVER_ROOT" | sed -e 's/[\/&]/\\&/g') SERVER_ROOT_ESCAPED=$(printf '%s\n' "$SERVER_ROOT" | sed -e 's/[\/&]/\\&/g')
sed -i "s#%SERVER_ROOT%#${SERVER_ROOT_ESCAPED}#g" $SITES_AVAILABLE_DIR/$DOMAIN.conf sed -i "s#%SERVER_ROOT%#${SERVER_ROOT_ESCAPED}#g" $SITES_AVAILABLE_DIR/$DOMAIN.conf
cp -f /usr/local/phyre/samples/sample-website-index.html $SERVER_ROOT/index.html
sed -i "s/%DOMAIN%/${DOMAIN}/g" $SERVER_ROOT/index.html
# Reload NGINX # Reload NGINX
service nginx reload service nginx reload

View file

@ -0,0 +1,23 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="flex flex-col bg-gray-50 justify-center h-screen text-center">
<div>
<h1 class="text-3xl font-bold">
%DOMAIN%
</h1>
</div>
<div class="mt-4">
<p class="text-xl">
Welcome to PhyrePanel! <br />
The simplest way to manage your websites.
</p>
</div>
</div>
</body>
</html>

View file

@ -29,6 +29,13 @@ class WebsiteResource extends Resource
Forms\Components\TextInput::make('domain') Forms\Components\TextInput::make('domain')
->required() ->required()
->disabled(function ($record) {
if (isset($record->exists)) {
return $record->exists;
} else {
return false;
}
})
->suffixIcon('heroicon-m-globe-alt'), ->suffixIcon('heroicon-m-globe-alt'),
Forms\Components\TextInput::make('root') Forms\Components\TextInput::make('root')