BLUE-8: new storage locations can be created setting the required OpenStack details

This commit is contained in:
Andy Heathershaw 2016-10-28 04:54:38 +01:00
parent baff6145d8
commit 9141398da8
13 changed files with 875 additions and 11 deletions

View File

@ -3,7 +3,7 @@
<component name="WebServers"> <component name="WebServers">
<option name="servers"> <option name="servers">
<webServer id="b14a34b0-0127-4886-964a-7be75a2281ac" name="Development" url="http://blue-twilight-dev.andys.eu"> <webServer id="b14a34b0-0127-4886-964a-7be75a2281ac" name="Development" url="http://blue-twilight-dev.andys.eu">
<fileTransfer host="scar.andys.eu" port="22" rootFolder="/srv/www/blue-twilight-dev" accessType="SFTP"> <fileTransfer host="scar.andys.eu" port="22" privateKey="C:\Users\aheathershaw\.ssh\id_rsa" rootFolder="/srv/www/blue-twilight-dev" accessType="SFTP" keyPair="true">
<advancedOptions> <advancedOptions>
<advancedOptions dataProtectionLevel="Private" /> <advancedOptions dataProtectionLevel="Private" />
</advancedOptions> </advancedOptions>

View File

@ -0,0 +1,86 @@
<?php
namespace App\AlbumSources;
use App\Photo;
use Symfony\Component\HttpFoundation\File\File;
/**
* Driver for managing files on the local filesystem.
* @package App\AlbumSources
*/
class OpenStackSource extends AlbumSourceBase implements IAlbumSource
{
/**
* Deletes an entire album's media contents.
* @return void
*/
function deleteAlbumContents()
{
// TODO: Implement deleteAlbumContents() method.
}
/**
* Deletes a thumbnail file for a photo.
* @param Photo $photo Photo to delete the thumbnail from.
* @param string $thumbnail Thumbnail to delete (or null to delete the original.)
* @return void
*/
function deleteThumbnail(Photo $photo, $thumbnail = null)
{
// TODO: Implement deleteThumbnail() method.
}
/**
* Gets the name of this album source.
* @return string
*/
function getName()
{
return 'global.album_sources.openstack';
}
/**
* Gets the absolute path to the given photo file.
* @param Photo $photo Photo to get the path to.
* @param string $thumbnail Thumbnail to get the image to.
* @return string
*/
function getPathToPhoto(Photo $photo, $thumbnail = null)
{
// TODO: Implement getPathToPhoto() method.
}
/**
* Gets the absolute URL to the given photo file.
* @param Photo $photo Photo to get the URL to.
* @param string $thumbnail Thumbnail to get the image to.
* @return string
*/
function getUrlToPhoto(Photo $photo, $thumbnail = null)
{
// TODO: Implement getUrlToPhoto() method.
}
/**
* Saves a generated thumbnail to its permanent location.
* @param Photo $photo Photo the thumbnail relates to.
* @param string $thumbnailInfo Information about the thumbnail.
* @param string $tempFilename Filename containing the thumbnail.
* @return mixed
*/
function saveThumbnail(Photo $photo, $thumbnailInfo, $tempFilename)
{
// TODO: Implement saveThumbnail() method.
}
/**
* Saves an uploaded file to the container and returns the filename.
* @param File $uploadedFile The photo uploaded
* @param string $overrideFilename Specific file name to use, or null to randomly generate one.
* @return File
*/
function saveUploadedPhoto(File $uploadedFile, $overrideFilename = null)
{
// TODO: Implement saveUploadedPhoto() method.
}
}

View File

@ -5,6 +5,7 @@ namespace App\Helpers;
use App\Album; use App\Album;
use App\AlbumSources\IAlbumSource; use App\AlbumSources\IAlbumSource;
use App\AlbumSources\LocalFilesystemSource; use App\AlbumSources\LocalFilesystemSource;
use App\AlbumSources\OpenStackSource;
use App\Configuration; use App\Configuration;
class ConfigHelper class ConfigHelper
@ -29,7 +30,8 @@ class ConfigHelper
$results = []; $results = [];
$classes = [ $classes = [
LocalFilesystemSource::class LocalFilesystemSource::class,
OpenStackSource::class
]; ];
foreach ($classes as $class) foreach ($classes as $class)
{ {

View File

@ -68,10 +68,32 @@ class StorageController extends Controller
$this->authorize('admin-access'); $this->authorize('admin-access');
$storage = new Storage(); $storage = new Storage();
$storage->fill($request->only(['name', 'source', 'location'])); $storage->fill($request->only([
'name',
'source',
'location',
'auth_url',
'tenant_name',
'username',
'password',
'service_name',
'service_region',
'container_name'
]));
$storage->is_active = true; $storage->is_active = true;
$storage->is_default = (strtolower($request->get('is_default')) == 'on'); $storage->is_default = (strtolower($request->get('is_default')) == 'on');
$storage->is_internal = false; $storage->is_internal = false;
if ($storage->source != 'LocalFilesystemSource' && isset($storage->location))
{
unset($storage->location);
}
if (isset($storage->password) && !empty($storage->password))
{
$storage->password = encrypt($storage->password);
}
$storage->save(); $storage->save();
if ($storage->is_default) if ($storage->is_default)

View File

@ -32,9 +32,21 @@ class StoreStorageRequest extends FormRequest
'source' => 'required|max:255', 'source' => 'required|max:255',
]; ];
if ($this->get('source') == 'LocalFilesystemSource') switch ($this->get('source'))
{ {
case 'LocalFilesystemSource':
$result['location'] = 'sometimes|required|is_dir|dir_empty|is_writeable'; $result['location'] = 'sometimes|required|is_dir|dir_empty|is_writeable';
break;
case 'OpenStackSource':
$result['auth_url'] = 'sometimes|required';
$result['tenant_name'] = 'sometimes|required';
$result['username'] = 'sometimes|required';
$result['password'] = 'sometimes|required';
$result['service_name'] = 'sometimes|required';
$result['service_region'] = 'sometimes|required';
$result['container_name'] = 'sometimes|required';
break;
} }
return $result; return $result;

View File

@ -15,7 +15,19 @@ class Storage extends Model
* @var array * @var array
*/ */
protected $fillable = [ protected $fillable = [
'name', 'source', 'is_default', 'location', 'is_internal', 'is_active' 'name',
'source',
'is_default',
'location',
'is_internal',
'is_active',
'auth_url',
'tenant_name',
'username',
'password',
'service_name',
'service_region',
'container_name'
]; ];
public function albums() public function albums()

View File

@ -7,7 +7,9 @@
"require": { "require": {
"php": ">=5.6.4", "php": ">=5.6.4",
"laravel/framework": "5.3.*", "laravel/framework": "5.3.*",
"laravelcollective/html": "5.3.*" "laravelcollective/html": "5.3.*",
"rackspace/php-opencloud": "^1.16",
"doctrine/dbal": "^2.5"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",

583
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "c3e85190a6742649a1f169529151e61a", "hash": "a5bcf947cf94af4452c3bbb308f3231c",
"content-hash": "d5b24ed9a8a6b89d2dd2f6f3b8049a0e", "content-hash": "8da0234bc3f5e6de745254c161031630",
"packages": [ "packages": [
{ {
"name": "classpreloader/classpreloader", "name": "classpreloader/classpreloader",
@ -94,6 +94,354 @@
"description": "implementation of xdg base directory specification for php", "description": "implementation of xdg base directory specification for php",
"time": "2014-10-24 07:27:01" "time": "2014-10-24 07:27:01"
}, },
{
"name": "doctrine/annotations",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/30e07cf03edc3cd3ef579d0dd4dd8c58250799a5",
"reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5",
"shasum": ""
},
"require": {
"doctrine/lexer": "1.*",
"php": "^5.6 || ^7.0"
},
"require-dev": {
"doctrine/cache": "1.*",
"phpunit/phpunit": "^5.6.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Docblock Annotations Parser",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"docblock",
"parser"
],
"time": "2016-10-24 11:45:47"
},
{
"name": "doctrine/cache",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/f8af318d14bdb0eff0336795b428b547bd39ccb6",
"reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6",
"shasum": ""
},
"require": {
"php": "~5.5|~7.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"phpunit/phpunit": "~4.8|~5.0",
"predis/predis": "~1.0",
"satooshi/php-coveralls": "~0.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"cache",
"caching"
],
"time": "2015-12-31 16:37:02"
},
{
"name": "doctrine/collections",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Collections\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Collections Abstraction library",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"array",
"collections",
"iterator"
],
"time": "2015-04-14 22:21:58"
},
{
"name": "doctrine/common",
"version": "v2.6.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "a579557bc689580c19fee4e27487a67fe60defc0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/a579557bc689580c19fee4e27487a67fe60defc0",
"reference": "a579557bc689580c19fee4e27487a67fe60defc0",
"shasum": ""
},
"require": {
"doctrine/annotations": "1.*",
"doctrine/cache": "1.*",
"doctrine/collections": "1.*",
"doctrine/inflector": "1.*",
"doctrine/lexer": "1.*",
"php": "~5.5|~7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8|~5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "lib/Doctrine/Common"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"collections",
"eventmanager",
"persistence",
"spl"
],
"time": "2015-12-25 13:18:31"
},
{
"name": "doctrine/dbal",
"version": "v2.5.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
"reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
"shasum": ""
},
"require": {
"doctrine/common": ">=2.4,<2.7-dev",
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"symfony/console": "2.*||^3.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": [
"bin/doctrine-dbal"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\DBAL\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Database Abstraction Layer",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"database",
"dbal",
"persistence",
"queryobject"
],
"time": "2016-09-09 19:13:33"
},
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
"version": "v1.1.0", "version": "v1.1.0",
@ -161,6 +509,153 @@
], ],
"time": "2015-11-06 14:35:42" "time": "2015-11-06 14:35:42"
}, },
{
"name": "doctrine/lexer",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"lexer",
"parser"
],
"time": "2014-09-09 13:34:57"
},
{
"name": "guzzle/guzzle",
"version": "v3.8.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba",
"reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=5.3.3",
"symfony/event-dispatcher": ">=2.1"
},
"replace": {
"guzzle/batch": "self.version",
"guzzle/cache": "self.version",
"guzzle/common": "self.version",
"guzzle/http": "self.version",
"guzzle/inflection": "self.version",
"guzzle/iterator": "self.version",
"guzzle/log": "self.version",
"guzzle/parser": "self.version",
"guzzle/plugin": "self.version",
"guzzle/plugin-async": "self.version",
"guzzle/plugin-backoff": "self.version",
"guzzle/plugin-cache": "self.version",
"guzzle/plugin-cookie": "self.version",
"guzzle/plugin-curlauth": "self.version",
"guzzle/plugin-error-response": "self.version",
"guzzle/plugin-history": "self.version",
"guzzle/plugin-log": "self.version",
"guzzle/plugin-md5": "self.version",
"guzzle/plugin-mock": "self.version",
"guzzle/plugin-oauth": "self.version",
"guzzle/service": "self.version",
"guzzle/stream": "self.version"
},
"require-dev": {
"doctrine/cache": "*",
"monolog/monolog": "1.*",
"phpunit/phpunit": "3.7.*",
"psr/log": "1.0.*",
"symfony/class-loader": "*",
"zendframework/zend-cache": "<2.3",
"zendframework/zend-log": "<2.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.8-dev"
}
},
"autoload": {
"psr-0": {
"Guzzle": "src/",
"Guzzle\\Tests": "tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Guzzle Community",
"homepage": "https://github.com/guzzle/guzzle/contributors"
}
],
"description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"abandoned": "guzzlehttp/guzzle",
"time": "2014-01-28 22:29:15"
},
{ {
"name": "jakub-onderka/php-console-color", "name": "jakub-onderka/php-console-color",
"version": "0.1", "version": "0.1",
@ -571,6 +1066,33 @@
], ],
"time": "2016-08-10 08:55:11" "time": "2016-08-10 08:55:11"
}, },
{
"name": "mikemccabe/json-patch-php",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/mikemccabe/json-patch-php.git",
"reference": "b3af30a6aec7f6467c773cd49b2d974a70f7c0d4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mikemccabe/json-patch-php/zipball/b3af30a6aec7f6467c773cd49b2d974a70f7c0d4",
"reference": "b3af30a6aec7f6467c773cd49b2d974a70f7c0d4",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-4": {
"mikemccabe\\JsonPatch\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"description": "Produce and apply json-patch objects",
"time": "2015-01-05 21:19:54"
},
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "1.21.0", "version": "1.21.0",
@ -958,6 +1480,63 @@
], ],
"time": "2016-03-09 05:03:14" "time": "2016-03-09 05:03:14"
}, },
{
"name": "rackspace/php-opencloud",
"version": "v1.16.0",
"source": {
"type": "git",
"url": "https://github.com/rackspace/php-opencloud.git",
"reference": "d6b71feed7f9e7a4b52e0240a79f06473ba69c8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rackspace/php-opencloud/zipball/d6b71feed7f9e7a4b52e0240a79f06473ba69c8c",
"reference": "d6b71feed7f9e7a4b52e0240a79f06473ba69c8c",
"shasum": ""
},
"require": {
"guzzle/guzzle": "~3.8",
"mikemccabe/json-patch-php": "~0.1",
"php": ">=5.4",
"psr/log": "~1.0"
},
"require-dev": {
"apigen/apigen": "~4.0",
"fabpot/php-cs-fixer": "1.0.*@dev",
"jakub-onderka/php-parallel-lint": "0.*",
"phpspec/prophecy": "~1.4",
"phpunit/phpunit": "4.3.*",
"satooshi/php-coveralls": "0.6.*@dev"
},
"type": "library",
"autoload": {
"psr-0": {
"OpenCloud": [
"lib/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Jamie Hannaford",
"email": "jamie.hannaford@rackspace.com",
"homepage": "https://github.com/jamiehannaford"
}
],
"description": "PHP SDK for Rackspace/OpenStack APIs",
"keywords": [
"Openstack",
"nova",
"opencloud",
"rackspace",
"swift"
],
"time": "2016-01-29 10:34:57"
},
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
"version": "3.5.1", "version": "3.5.1",

View File

@ -0,0 +1,46 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStorageOpenstackColumns extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('storages', function (Blueprint $table) {
$table->string('auth_url')->nullable();
$table->string('tenant_name')->nullable();
$table->string('username')->nullable();
$table->string('password')->nullable();
$table->string('service_name')->nullable();
$table->string('service_region')->nullable();
$table->string('container_name')->nullable();
$table->string('location')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('storages', function (Blueprint $table) {
$table->string('location')->change();
$table->dropColumn('container_name');
$table->dropColumn('service_region');
$table->dropColumn('service_name');
$table->dropColumn('password');
$table->dropColumn('username');
$table->dropColumn('tenant_name');
$table->dropColumn('auth_url');
});
}
}

View File

@ -30,8 +30,14 @@ return [
'settings_restrict_originals_download' => 'Restrict access to original images', 'settings_restrict_originals_download' => 'Restrict access to original images',
'settings_restrict_originals_download_help' => 'With this option enabled, only the photo\'s owner can download the original high-resolution images.', 'settings_restrict_originals_download_help' => 'With this option enabled, only the photo\'s owner can download the original high-resolution images.',
'storage_active_label' => 'Location is active. Uncheck to prevent creating new albums in this location.', 'storage_active_label' => 'Location is active. Uncheck to prevent creating new albums in this location.',
'storage_auth_url_label' => 'Authentication URL:',
'storage_container_name_label' => 'Container name:',
'storage_driver_label' => 'Storage driver:', 'storage_driver_label' => 'Storage driver:',
'storage_location_label' => 'Physical location:', 'storage_location_label' => 'Physical location:',
'storage_service_name_label' => 'Service name:',
'storage_service_region_label' => 'Region:',
'storage_tenant_name_label' => 'Tenant:',
'username_label' => 'Username:',
'upload_action' => 'Upload', 'upload_action' => 'Upload',
'save_action' => 'Save Changes' 'save_action' => 'Save Changes'
]; ];

View File

@ -1,7 +1,8 @@
<?php <?php
return [ return [
'album_sources' => [ 'album_sources' => [
'filesystem' => 'Local filesystem' 'filesystem' => 'Local filesystem',
'openstack' => 'OpenStack cloud storage'
], ],
'app_name' => 'Blue Twilight', 'app_name' => 'Blue Twilight',
'copyright' => '© :years :link_startAndy Heathershaw:link_end', 'copyright' => '© :years :link_startAndy Heathershaw:link_end',

View File

@ -52,6 +52,100 @@
@endif @endif
</div> </div>
</div> </div>
<div id="local-filesystem" data-bind="visible: selectedLocation() == 'OpenStackSource'">
<div class="row">
<div class="col-md-6">
<div class="form-group{{ $errors->has('auth_url') ? ' has-error' : '' }}">
{!! Form::label('auth_url', trans('forms.storage_auth_url_label'), ['class' => 'control-label']) !!}
{!! Form::text('auth_url', old('auth_url'), ['class' => 'form-control']) !!}
@if ($errors->has('auth_url'))
<span class="help-block">
<strong>{{ $errors->first('auth_url') }}</strong>
</span>
@endif
</div>
</div>
<div class="col-md-6">
<div class="form-group{{ $errors->has('tenant_name') ? ' has-error' : '' }}">
{!! Form::label('tenant_name', trans('forms.storage_tenant_name_label'), ['class' => 'control-label']) !!}
{!! Form::text('tenant_name', old('tenant_name'), ['class' => 'form-control']) !!}
@if ($errors->has('tenant_name'))
<span class="help-block">
<strong>{{ $errors->first('tenant_name') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
{!! Form::label('username', trans('forms.username_label'), ['class' => 'control-label']) !!}
{!! Form::text('username', old('username'), ['class' => 'form-control']) !!}
@if ($errors->has('username'))
<span class="help-block">
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
</div>
<div class="col-md-6">
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
{!! Form::label('password', trans('forms.password_label'), ['class' => 'control-label']) !!}
{!! Form::text('password', old('password'), ['class' => 'form-control']) !!}
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group{{ $errors->has('service_name') ? ' has-error' : '' }}">
{!! Form::label('service_name', trans('forms.storage_service_name_label'), ['class' => 'control-label']) !!}
{!! Form::text('service_name', old('service_name'), ['class' => 'form-control']) !!}
@if ($errors->has('service_name'))
<span class="help-block">
<strong>{{ $errors->first('service_name') }}</strong>
</span>
@endif
</div>
</div>
<div class="col-md-6">
<div class="form-group{{ $errors->has('service_region') ? ' has-error' : '' }}">
{!! Form::label('service_region', trans('forms.storage_service_region_label'), ['class' => 'control-label']) !!}
{!! Form::text('service_region', old('service_region'), ['class' => 'form-control']) !!}
@if ($errors->has('service_region'))
<span class="help-block">
<strong>{{ $errors->first('service_region') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="form-group{{ $errors->has('container_name') ? ' has-error' : '' }}">
{!! Form::label('container_name', trans('forms.storage_container_name_label'), ['class' => 'control-label']) !!}
{!! Form::text('container_name', old('container_name'), ['class' => 'form-control']) !!}
@if ($errors->has('container_name'))
<span class="help-block">
<strong>{{ $errors->first('container_name') }}</strong>
</span>
@endif
</div>
</div>
</div> </div>
<div class="checkbox"> <div class="checkbox">

View File

@ -36,7 +36,9 @@
{{ $storage->name }} {{ $storage->name }}
@if ($storage->is_default) <i class="fa fa-fw fa-check text-success"></i>@endif @if ($storage->is_default) <i class="fa fa-fw fa-check text-success"></i>@endif
@if (!$storage->is_active) <i class="fa fa-fw fa-minus-circle text-danger"></i>@endif @if (!$storage->is_active) <i class="fa fa-fw fa-minus-circle text-danger"></i>@endif
</span><br/>{{ $storage->location }} </span><br/>
@if ($storage->source == 'LocalFilesystemSource'){{ $storage->location }}@endif
@if ($storage->source == 'OpenStackSource'){{ $storage->container_name }} - {{ $storage->service_name }}, {{ $storage->service_region }}@endif
</td> </td>
<td class="text-right"> <td class="text-right">
<a href="{{ route('storage.edit', ['id' => $storage->id]) }}" class="btn btn-default">@lang('forms.edit_action')</a> <a href="{{ route('storage.edit', ['id' => $storage->id]) }}" class="btn btn-default">@lang('forms.edit_action')</a>