-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webui): statically embed js/css assets (#2348)
* feat(webui): statically embed js/css assets Signed-off-by: Ettore Di Giacinto <[email protected]> * update font assets Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: Ettore Di Giacinto <[email protected]>
- Loading branch information
Showing
51 changed files
with
20,497 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/go-skynet/LocalAI/pkg/downloader" | ||
"github.com/go-skynet/LocalAI/pkg/utils" | ||
"gopkg.in/yaml.v3" | ||
) | ||
|
||
type Asset struct { | ||
FileName string `yaml:"filename"` | ||
URL string `yaml:"url"` | ||
SHA string `yaml:"sha"` | ||
} | ||
|
||
func main() { | ||
|
||
// read the YAML file which contains a list of assets | ||
// and download them in the asset path | ||
assets := []Asset{} | ||
|
||
assetFile := os.Args[1] | ||
destPath := os.Args[2] | ||
|
||
// read the YAML file | ||
f, err := os.ReadFile(assetFile) | ||
if err != nil { | ||
panic(err) | ||
} | ||
// unmarshal the YAML data into a struct | ||
if err := yaml.Unmarshal(f, &assets); err != nil { | ||
panic(err) | ||
} | ||
|
||
// download the assets | ||
for _, asset := range assets { | ||
if err := downloader.DownloadFile(asset.URL, filepath.Join(destPath, asset.FileName), asset.SHA, 1, 1, utils.DisplayDownloadFunction); err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
fmt.Println("Finished downloading assets") | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+303 KB
core/http/static/assets/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZg.ttf
Binary file not shown.
Binary file added
BIN
+302 KB
core/http/static/assets/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYMZg.ttf
Binary file not shown.
Binary file added
BIN
+296 KB
core/http/static/assets/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZg.ttf
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Roboto:wght@400;500&display=swap | ||
*/ | ||
|
||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400; | ||
font-display: swap; | ||
src: url(/static/assets/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZg.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 600; | ||
font-display: swap; | ||
src: url(/static/assets/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYMZg.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 700; | ||
font-display: swap; | ||
src: url(/static/assets/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZg.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Roboto'; | ||
font-style: normal; | ||
font-weight: 400; | ||
font-display: swap; | ||
src: url(/static/assets/KFOmCnqEu92Fr1Me5Q.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Roboto'; | ||
font-style: normal; | ||
font-weight: 500; | ||
font-display: swap; | ||
src: url(/static/assets/KFOlCnqEu92Fr1MmEU9vAw.ttf) format('truetype'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&display=swap | ||
*/ | ||
|
||
@font-face { | ||
font-family: 'Roboto'; | ||
font-style: normal; | ||
font-weight: 300; | ||
font-display: swap; | ||
src: url(/static/assets//KFOlCnqEu92Fr1MmSU5fBBc9.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Roboto'; | ||
font-style: normal; | ||
font-weight: 400; | ||
font-display: swap; | ||
src: url(/static/assets//KFOmCnqEu92Fr1Mu4mxP.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Roboto'; | ||
font-style: normal; | ||
font-weight: 500; | ||
font-display: swap; | ||
src: url(/static/assets//KFOlCnqEu92Fr1MmEU9fBBc9.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Roboto'; | ||
font-style: normal; | ||
font-weight: 700; | ||
font-display: swap; | ||
src: url(/static/assets//KFOlCnqEu92Fr1MmWUlfBBc9.ttf) format('truetype'); | ||
} | ||
@font-face { | ||
font-family: 'Roboto'; | ||
font-style: normal; | ||
font-weight: 900; | ||
font-display: swap; | ||
src: url(/static/assets//KFOlCnqEu92Fr1MmYUtfBBc9.ttf) format('truetype'); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.