2018-01-26 14:35:01 +00:00
|
|
|
<?php
|
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
use App\Application;
|
|
|
|
use App\Http\Controllers\Auth\LoginController;
|
2022-12-10 23:31:30 +00:00
|
|
|
use App\Http\Controllers\HealthController;
|
2022-11-29 21:20:38 +00:00
|
|
|
use App\Http\Controllers\HomeController;
|
|
|
|
use App\Http\Controllers\ImportController;
|
|
|
|
use App\Http\Controllers\ItemController;
|
|
|
|
use App\Http\Controllers\ItemRestController;
|
|
|
|
use App\Http\Controllers\SearchController;
|
|
|
|
use App\Http\Controllers\SettingsController;
|
|
|
|
use App\Http\Controllers\TagController;
|
|
|
|
use App\Http\Controllers\UserController;
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
2023-03-07 11:32:58 +00:00
|
|
|
use Illuminate\Http\Request;
|
2022-11-29 21:20:38 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2018-10-28 20:41:46 +00:00
|
|
|
|
2018-01-26 14:35:01 +00:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Web Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2022-03-19 13:54:34 +00:00
|
|
|
if (config('app.url') !== 'http://localhost') {
|
|
|
|
URL::forceRootUrl(config('app.url'));
|
2019-06-18 09:51:51 +00:00
|
|
|
}
|
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::get('/userselect/{user}', [LoginController::class, 'setUser'])->name('user.set');
|
|
|
|
Route::get('/userselect', [UserController::class, 'selectUser'])->name('user.select');
|
|
|
|
Route::get('/autologin/{uuid}', [LoginController::class, 'autologin'])->name('user.autologin');
|
|
|
|
|
|
|
|
Route::get('/', [ItemController::class,'dash'])->name('dash');
|
|
|
|
Route::get('check_app_list', [ItemController::class,'checkAppList'])->name('applist');
|
2018-10-14 15:17:55 +00:00
|
|
|
|
2022-03-19 13:54:32 +00:00
|
|
|
Route::get('single/{appid}', function ($appid) {
|
2022-11-29 21:20:38 +00:00
|
|
|
return json_encode(Application::single($appid));
|
2022-03-14 15:56:36 +00:00
|
|
|
})->name('single');
|
2018-01-29 12:41:57 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
/**
|
|
|
|
* Tag Routes
|
|
|
|
*/
|
|
|
|
Route::resource('tags', TagController::class);
|
|
|
|
|
|
|
|
Route::group([
|
|
|
|
'as' => 'tags.',
|
|
|
|
'prefix' => 'tag',
|
|
|
|
], function () {
|
|
|
|
Route::get('/{slug}', [TagController::class, 'show'])->name('show');
|
|
|
|
Route::get('/add/{tag}/{item}', [TagController::class, 'add'])->name('add');
|
|
|
|
Route::get('/restore/{id}', [TagController::class, 'restore'])->name('restore');
|
|
|
|
});
|
|
|
|
|
2018-02-17 00:13:38 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
/**
|
|
|
|
* Item Routes
|
|
|
|
*/
|
|
|
|
Route::resource('items', ItemController::class);
|
2018-02-17 00:13:38 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::group([
|
|
|
|
'as' => 'items.',
|
|
|
|
'prefix' => 'items',
|
|
|
|
], function () {
|
|
|
|
Route::get('/websitelookup/{url}', [ItemController::class, 'websitelookup'])->name('lookup');
|
|
|
|
Route::get('/pin/{id}', [ItemController::class, 'pin'])->name('pin');
|
|
|
|
Route::get('/restore/{id}', [ItemController::class, 'restore'])->name('restore');
|
|
|
|
Route::get('/unpin/{id}', [ItemController::class, 'unpin'])->name('unpin');
|
|
|
|
Route::get('/pintoggle/{id}/{ajax?}/{tag?}', [ItemController::class, 'pinToggle'])->name('pintoggle');
|
|
|
|
});
|
2018-02-04 20:50:59 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::post('order', [ItemController::class,'setOrder'])->name('items.order');
|
|
|
|
Route::post('appload', [ItemController::class,'appload'])->name('appload');
|
|
|
|
Route::post('test_config', [ItemController::class,'testConfig'])->name('test_config');
|
|
|
|
Route::get('get_stats/{id}', [ItemController::class,'getStats'])->name('get_stats');
|
2018-02-05 19:43:24 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::get('/search', [SearchController::class,'index'])->name('search');
|
2019-01-18 15:21:50 +00:00
|
|
|
|
2018-02-05 23:08:37 +00:00
|
|
|
Route::get('view/{name_view}', function ($name_view) {
|
2018-10-29 19:43:08 +00:00
|
|
|
return view('SupportedApps::'.$name_view)->render();
|
2018-02-05 23:08:37 +00:00
|
|
|
});
|
|
|
|
|
2018-10-28 20:41:46 +00:00
|
|
|
Route::get('titlecolour', function (Request $request) {
|
|
|
|
$color = $request->input('color');
|
2022-03-19 13:54:32 +00:00
|
|
|
if ($color) {
|
2018-10-28 20:41:46 +00:00
|
|
|
return title_color($color);
|
2022-03-19 13:54:32 +00:00
|
|
|
}
|
2022-11-29 22:13:24 +00:00
|
|
|
return '';
|
2022-03-19 13:54:32 +00:00
|
|
|
})->name('titlecolour');
|
2018-10-28 20:41:46 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::resource('users', UserController::class);
|
2018-10-12 13:57:46 +00:00
|
|
|
|
2018-02-04 20:50:59 +00:00
|
|
|
/**
|
|
|
|
* Settings.
|
|
|
|
*/
|
|
|
|
Route::group([
|
|
|
|
'as' => 'settings.',
|
|
|
|
'prefix' => 'settings',
|
|
|
|
], function () {
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::get('/', [SettingsController::class,'index'])->name('index');
|
|
|
|
Route::get('edit/{id}', [SettingsController::class,'edit'])->name('edit');
|
|
|
|
Route::get('clear/{id}', [SettingsController::class,'clear'])->name('clear');
|
|
|
|
Route::patch('edit/{id}', [SettingsController::class,'update']);
|
2018-10-14 16:27:28 +00:00
|
|
|
});
|
2022-11-29 21:20:38 +00:00
|
|
|
|
2023-05-20 19:56:34 +00:00
|
|
|
Auth::routes(['register' => false]);
|
2018-10-14 16:27:28 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::get('/home', [HomeController::class,'index'])->name('home');
|
2022-11-26 13:35:36 +00:00
|
|
|
|
2022-11-29 21:20:38 +00:00
|
|
|
Route::resource('api/item', ItemRestController::class);
|
|
|
|
Route::get('import', ImportController::class)->name('items.import');
|
2022-12-10 23:31:30 +00:00
|
|
|
|
|
|
|
Route::get('/health', HealthController::class)->name('health');
|