|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +{{template "views/partials/head" .}} |
| 4 | + |
| 5 | +<body class="bg-gray-900 text-gray-200"> |
| 6 | +<div class="flex flex-col min-h-screen"> |
| 7 | + |
| 8 | + {{template "views/partials/navbar" .}} |
| 9 | + |
| 10 | + <div class="container mx-auto px-4 flex-grow"> |
| 11 | + <div class="header text-center py-12"> |
| 12 | + <h1 class="text-5xl font-bold text-gray-100">Welcome to <i>your</i> LocalAI instance!</h1> |
| 13 | + <p class="mt-4 text-lg">The FOSS alternative to OpenAI, Claude, ...</p> |
| 14 | + <a href="https://localai.io" target="_blank" class="mt-4 inline-block bg-blue-500 text-white py-2 px-4 rounded-lg shadow transition duration-300 ease-in-out hover:bg-blue-700 hover:shadow-lg"> |
| 15 | + <i class="fas fa-book-reader pr-2"></i>Documentation |
| 16 | + </a> |
| 17 | + </div> |
| 18 | + |
| 19 | + <div class="models mt-4"> |
| 20 | + {{template "views/partials/inprogress" .}} |
| 21 | + {{ if eq (len .ModelsConfig) 0 }} |
| 22 | + <h2 class="text-center text-3xl font-semibold text-gray-100"> <i class="text-yellow-200 ml-2 fa-solid fa-triangle-exclamation animate-pulse"></i> Ouch! seems you don't have any models installed from the LocalAI gallery!</h2> |
| 23 | + <p class="text-center mt-4 text-xl">..install something from the <a class="text-gray-400 hover:text-white ml-1 px-3 py-2 rounded" href="/browse">🖼️ Gallery</a> or check the <a href="https://localai.io/basics/getting_started/" class="text-gray-400 hover:text-white ml-1 px-3 py-2 rounded"> <i class="fa-solid fa-book"></i> Getting started documentation </a></p> |
| 24 | + |
| 25 | + {{ if ne (len .Models) 0 }} |
| 26 | + <hr class="my-4"> |
| 27 | + <h3 class="text-center text-xl font-semibold text-gray-100"> |
| 28 | + However, It seems you have installed some models installed without a configuration file: |
| 29 | + </h3> |
| 30 | + {{ range .Models }} |
| 31 | + <div class="bg-gray-800 border-b border-gray-700 p-4 mt-4"> |
| 32 | + <h4 class="text-md font-bold text-gray-200">{{.}}</h4> |
| 33 | + </div> |
| 34 | + {{end}} |
| 35 | + {{end}} |
| 36 | + {{ else }} |
| 37 | + {{ $modelsN := len .ModelsConfig}} |
| 38 | + {{ $modelsN = add $modelsN (len .Models)}} |
| 39 | + <h2 class="text-center text-3xl font-semibold text-gray-100">{{$modelsN}} Installed model(s)</h2> |
| 40 | + <table class="table-auto mt-4 w-full text-left text-gray-200"> |
| 41 | + <thead class="text-xs text-gray-400 uppercase bg-gray-700"> |
| 42 | + <tr> |
| 43 | + <th class="px-4 py-2"></th> |
| 44 | + <th class="px-4 py-2">Model Name</th> |
| 45 | + <th class="px-4 py-2">Backend</th> |
| 46 | + <th class="px-4 py-2 float-right">Actions</th> |
| 47 | + </tr> |
| 48 | + </thead> |
| 49 | + <tbody> |
| 50 | + {{$galleryConfig:=.GalleryConfig}} |
| 51 | + {{$noicon:="https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg"}} |
| 52 | + {{ range .ModelsConfig }} |
| 53 | + {{ $cfg:= index $galleryConfig .Name}} |
| 54 | + <tr class="bg-gray-800 border-b border-gray-700"> |
| 55 | + <td class="px-4 py-3"> |
| 56 | + {{ with $cfg }} |
| 57 | + <img {{ if $cfg.Icon }} |
| 58 | + src="{{$cfg.Icon}}" |
| 59 | + {{ else }} |
| 60 | + src="{{$noicon}}" |
| 61 | + {{ end }} |
| 62 | + class="rounded-t-lg max-h-24 max-w-24 object-cover mt-3" |
| 63 | + > |
| 64 | + {{ else}} |
| 65 | + <img src="{{$noicon}}" class="rounded-t-lg max-h-24 max-w-24 object-cover mt-3"> |
| 66 | + {{ end }} |
| 67 | + </td> |
| 68 | + <td class="px-4 py-3 font-bold"> |
| 69 | + <p class="font-bold text-white flex items-center"><i class="fas fa-brain pr-2"></i><a href="/browse?term={{.Name}}">{{.Name}}</a></p> |
| 70 | + </td> |
| 71 | + <td class="px-4 py-3 font-bold"> |
| 72 | + {{ if .Backend }} |
| 73 | + <!-- Badge for Backend --> |
| 74 | + <span class="inline-block bg-blue-500 text-white py-1 px-3 rounded-full text-xs"> |
| 75 | + {{.Backend}} |
| 76 | + </span> |
| 77 | + {{ else }} |
| 78 | + <span class="inline-block bg-yellow-500 text-white py-1 px-3 rounded-full text-xs"> |
| 79 | + auto |
| 80 | + </span> |
| 81 | + {{ end }} |
| 82 | + </td> |
| 83 | + |
| 84 | + <td class="px-4 py-3"> |
| 85 | + <button |
| 86 | + class="float-right inline-block rounded bg-red-800 px-6 pb-2.5 mb-3 pt-2.5 text-xs font-medium uppercase leading-normal text-white shadow-primary-3 transition duration-150 ease-in-out hover:bg-red-accent-300 hover:shadow-red-2 focus:bg-red-accent-300 focus:shadow-primary-2 focus:outline-none focus:ring-0 active:bg-red-600 active:shadow-primary-2 dark:shadow-black/30 dark:hover:shadow-dark-strong dark:focus:shadow-dark-strong dark:active:shadow-dark-strong" |
| 87 | + data-twe-ripple-color="light" data-twe-ripple-init="" hx-confirm="Are you sure you wish to delete the model?" hx-post="/browse/delete/model/{{.Name}}" hx-swap="outerHTML"><i class="fa-solid fa-cancel pr-2"></i>Delete</button> |
| 88 | + </td> |
| 89 | + {{ end }} |
| 90 | + {{ range .Models }} |
| 91 | + <tr class="bg-gray-800 border-b border-gray-700"> |
| 92 | + <td class="px-4 py-3"> |
| 93 | + <img src="{{$noicon}}" class="rounded-t-lg max-h-24 max-w-24 object-cover mt-3"> |
| 94 | + </td> |
| 95 | + <td class="px-4 py-3 font-bold"> |
| 96 | + <p class="font-bold text-white flex items-center"><i class="fas fa-brain pr-2"></i>{{.}}</p> |
| 97 | + </td> |
| 98 | + <td class="px-4 py-3 font-bold"> |
| 99 | + <span class="inline-block bg-yellow-500 text-white py-1 px-3 rounded-full text-xs"> |
| 100 | + auto |
| 101 | + </span> |
| 102 | + </td> |
| 103 | + |
| 104 | + <td class="px-4 py-3"> |
| 105 | + <span class="float-right inline-block bg-red-800 text-white py-1 px-3 rounded-full text-xs"> |
| 106 | + No Configuration |
| 107 | + </span> |
| 108 | + </td> |
| 109 | + {{end}} |
| 110 | + </tbody> |
| 111 | + </table> |
| 112 | + {{ end }} |
| 113 | + </div> |
| 114 | + </div> |
| 115 | + |
| 116 | + {{template "views/partials/footer" .}} |
| 117 | +</div> |
| 118 | + |
| 119 | +</body> |
| 120 | +</html> |
0 commit comments