Add the ability to set tools download source (Gitea)

This change adds 2 new options to gitea forge endpoints:

* Tools metadata URL
* Use internal tools URLs

By default, GARM looks in the releases page of the gitea arc_runner
to determine where it can download the runner binary from for a particular
OS/arch. The tools metadata URL option can be set on an endpoint and can point
to a mirror of the upstream repo. The requirement is that the asset names
exactly mirror upstream naming conventions.

The second option disables GARM calling out to the tools metadata URL entirely.
GARM has some hardcoded values for nightly binaries. If this option is checked,
GARM will use those values, without making any kind of outgoing API call to
determine availability. This is useful in air-gapped environments.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-09-26 15:03:19 +00:00 committed by Gabriel
parent 56618473d1
commit 5fdb69ac18
91 changed files with 700 additions and 185 deletions

View file

@ -52,12 +52,28 @@ func (g *CredentialCache) SetCredentialsRateLimit(credsID uint, rateLimit params
}
}
func (g *CredentialCache) UpdateCredentialsUsingEndpoint(ep params.ForgeEndpoint) {
g.mux.Lock()
defer g.mux.Unlock()
for _, creds := range g.cache {
if creds.Endpoint.Name == ep.Name {
creds.Endpoint = ep
g.setCredentialsAndUpdateEntities(creds)
}
}
}
func (g *CredentialCache) setCredentialsAndUpdateEntities(credentials params.ForgeCredentials) {
g.cache[credentials.ID] = credentials
UpdateCredentialsInAffectedEntities(credentials)
}
func (g *CredentialCache) SetCredentials(credentials params.ForgeCredentials) {
g.mux.Lock()
defer g.mux.Unlock()
g.cache[credentials.ID] = credentials
UpdateCredentialsInAffectedEntities(credentials)
g.setCredentialsAndUpdateEntities(credentials)
}
func (g *CredentialCache) GetCredentials(id uint) (params.ForgeCredentials, bool) {
@ -146,3 +162,7 @@ func GetAllGiteaCredentials() []params.ForgeCredentials {
func GetAllGiteaCredentialsAsMap() map[uint]params.ForgeCredentials {
return giteaCredentialsCache.GetAllCredentialsAsMap()
}
func UpdateCredentialsUsingEndpoint(ep params.ForgeEndpoint) {
giteaCredentialsCache.UpdateCredentialsUsingEndpoint(ep)
}

72
cache/endpoint_cache.go vendored Normal file
View file

@ -0,0 +1,72 @@
// Copyright 2025 Cloudbase Solutions SRL
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package cache
import (
"sync"
"github.com/cloudbase/garm/params"
)
var endpointCache *EndpointCache
func init() {
epCache := &EndpointCache{
endpoints: make(map[string]params.ForgeEndpoint),
}
endpointCache = epCache
}
type EndpointCache struct {
endpoints map[string]params.ForgeEndpoint
mux sync.Mutex
}
func (e *EndpointCache) SetEndpoint(ep params.ForgeEndpoint) {
e.mux.Lock()
defer e.mux.Unlock()
e.endpoints[ep.Name] = ep
UpdateCredentialsUsingEndpoint(ep)
}
func (e *EndpointCache) GetEndpoint(epName string) (params.ForgeEndpoint, bool) {
e.mux.Lock()
defer e.mux.Unlock()
ep, ok := e.endpoints[epName]
if ok {
return ep, true
}
return params.ForgeEndpoint{}, false
}
func (e *EndpointCache) RemoveEndpoint(epName string) {
e.mux.Lock()
defer e.mux.Unlock()
delete(e.endpoints, epName)
}
func SetEndpoint(ep params.ForgeEndpoint) {
endpointCache.SetEndpoint(ep)
}
func GetEndpoint(epName string) (params.ForgeEndpoint, bool) {
return endpointCache.GetEndpoint(epName)
}
func RemoveEndpoint(epName string) {
endpointCache.RemoveEndpoint(epName)
}

19
cache/entity_cache.go vendored
View file

@ -351,6 +351,21 @@ func (e *EntityCache) GetEntityScaleSets(entityID string) []params.ScaleSet {
return nil
}
func (e *EntityCache) GetEntitiesUsingEndpoint(endpoint params.ForgeEndpoint) []params.ForgeEntity {
e.mux.Lock()
defer e.mux.Unlock()
var entities []params.ForgeEntity
for _, cache := range e.entities {
if cache.Entity.Credentials.Endpoint.Name != endpoint.Name {
continue
}
entities = append(entities, cache.Entity)
}
sortByCreationDate(entities)
return entities
}
func (e *EntityCache) GetEntitiesUsingCredentials(creds params.ForgeCredentials) []params.ForgeEntity {
e.mux.Lock()
defer e.mux.Unlock()
@ -544,3 +559,7 @@ func GetPoolByID(poolID string) (params.Pool, bool) {
func GetScaleSetByID(scaleSetID uint) (params.ScaleSet, bool) {
return entityCache.GetScaleSetByID(scaleSetID)
}
func GetEntitiesUsingEndpoint(endpoint params.ForgeEndpoint) []params.ForgeEntity {
return entityCache.GetEntitiesUsingEndpoint(endpoint)
}

View file

@ -20,6 +20,12 @@ import (
apiClientEndpoints "github.com/cloudbase/garm/client/endpoints"
"github.com/cloudbase/garm/params"
"github.com/cloudbase/garm/util/appdefaults"
)
var (
toolsMetadataURL string
useInternalMetadata bool
)
var giteaEndpointCmd = &cobra.Command{
@ -151,25 +157,43 @@ var giteaEndpointUpdateCmd = &cobra.Command{
}
updateParams := params.UpdateGiteaEndpointParams{}
var hasChanges bool
if cmd.Flags().Changed("ca-cert-path") {
cert, err := parseAndReadCABundle()
if err != nil {
return err
}
updateParams.CACertBundle = cert
hasChanges = true
}
if cmd.Flags().Changed("tools-metadata-url") {
updateParams.ToolsMetadataURL = toolsMetadataURL
hasChanges = true
}
if cmd.Flags().Changed("use-internal-tools-metadata") {
updateParams.UseInternalToolsMetadata = &useInternalMetadata
hasChanges = true
}
if cmd.Flags().Changed("description") {
updateParams.Description = &endpointDescription
hasChanges = true
}
if cmd.Flags().Changed("base-url") {
updateParams.BaseURL = &endpointBaseURL
hasChanges = true
}
if cmd.Flags().Changed("api-base-url") {
updateParams.APIBaseURL = &endpointAPIBaseURL
hasChanges = true
}
if !hasChanges {
fmt.Println("no changes made")
return nil
}
newEndpointUpdateReq := apiClientEndpoints.NewUpdateGiteaEndpointParams()
@ -191,6 +215,8 @@ func init() {
giteaEndpointCreateCmd.Flags().StringVar(&endpointBaseURL, "base-url", "", "Base URL of the Gitea endpoint")
giteaEndpointCreateCmd.Flags().StringVar(&endpointAPIBaseURL, "api-base-url", "", "API Base URL of the Gitea endpoint")
giteaEndpointCreateCmd.Flags().StringVar(&endpointCACertPath, "ca-cert-path", "", "CA Cert Path of the Gitea endpoint")
giteaEndpointCreateCmd.Flags().StringVar(&toolsMetadataURL, "tools-metadata-url", appdefaults.GiteaRunnerReleasesURL, "URL to the releases page of the ACT runner.")
giteaEndpointCreateCmd.Flags().BoolVar(&useInternalMetadata, "use-internal-tools-metadata", false, "Use the static tools information (nightly) and do not attempt to fetch from metadata URL.")
giteaEndpointListCmd.Flags().BoolVarP(&long, "long", "l", false, "Include additional info.")
@ -202,6 +228,8 @@ func init() {
giteaEndpointUpdateCmd.Flags().StringVar(&endpointBaseURL, "base-url", "", "Base URL of the Gitea endpoint")
giteaEndpointUpdateCmd.Flags().StringVar(&endpointAPIBaseURL, "api-base-url", "", "API Base URL of the Gitea endpoint")
giteaEndpointUpdateCmd.Flags().StringVar(&endpointCACertPath, "ca-cert-path", "", "CA Cert Path of the Gitea endpoint")
giteaEndpointUpdateCmd.Flags().StringVar(&toolsMetadataURL, "tools-metadata-url", appdefaults.GiteaRunnerReleasesURL, "URL to the releases page of the ACT runner.")
giteaEndpointUpdateCmd.Flags().BoolVar(&useInternalMetadata, "use-internal-tools-metadata", false, "Use the static tools information (nightly) and do not attempt to fetch from metadata URL.")
giteaEndpointCmd.AddCommand(
giteaEndpointListCmd,
@ -221,11 +249,13 @@ func parseGiteaCreateParams() (params.CreateGiteaEndpointParams, error) {
}
ret := params.CreateGiteaEndpointParams{
Name: endpointName,
BaseURL: endpointBaseURL,
APIBaseURL: endpointAPIBaseURL,
Description: endpointDescription,
CACertBundle: certBundleBytes,
Name: endpointName,
BaseURL: endpointBaseURL,
APIBaseURL: endpointAPIBaseURL,
Description: endpointDescription,
CACertBundle: certBundleBytes,
ToolsMetadataURL: toolsMetadataURL,
UseInternalToolsMetadata: &useInternalMetadata,
}
return ret, nil
}

View file

@ -25,6 +25,7 @@ import (
apiClientEndpoints "github.com/cloudbase/garm/client/endpoints"
"github.com/cloudbase/garm/cmd/garm-cli/common"
"github.com/cloudbase/garm/params"
"github.com/cloudbase/garm/util/appdefaults"
)
var githubEndpointCmd = &cobra.Command{
@ -303,6 +304,19 @@ func formatOneEndpoint(endpoint params.ForgeEndpoint) {
if endpoint.UploadBaseURL != "" {
t.AppendRow([]interface{}{"Upload URL", endpoint.UploadBaseURL})
}
if endpoint.EndpointType == params.GiteaEndpointType {
metadataURL := appdefaults.GiteaRunnerReleasesURL
if endpoint.ToolsMetadataURL != "" {
metadataURL = endpoint.ToolsMetadataURL
}
var useInternal bool
if endpoint.UseInternalToolsMetadata != nil {
useInternal = *endpoint.UseInternalToolsMetadata
}
t.AppendRow([]interface{}{"Tools metadata URL", metadataURL})
t.AppendRow([]interface{}{"Use internal tools metadata URL", useInternal})
}
t.AppendRow([]interface{}{"API Base URL", endpoint.APIBaseURL})
if len(endpoint.CACertBundle) > 0 {
t.AppendRow([]interface{}{"CA Cert Bundle", string(endpoint.CACertBundle)})

View file

@ -26,9 +26,13 @@ import (
"github.com/cloudbase/garm/auth"
"github.com/cloudbase/garm/database/common"
"github.com/cloudbase/garm/params"
"github.com/cloudbase/garm/util/appdefaults"
)
func (s *sqlDatabase) CreateGiteaEndpoint(_ context.Context, param params.CreateGiteaEndpointParams) (ghEndpoint params.ForgeEndpoint, err error) {
if param.ToolsMetadataURL == "" {
param.ToolsMetadataURL = appdefaults.GiteaRunnerReleasesURL
}
defer func() {
if err == nil {
s.sendNotify(common.GithubEndpointEntityType, common.CreateOperation, ghEndpoint)
@ -40,12 +44,16 @@ func (s *sqlDatabase) CreateGiteaEndpoint(_ context.Context, param params.Create
return fmt.Errorf("gitea endpoint already exists: %w", runnerErrors.ErrDuplicateEntity)
}
endpoint = GithubEndpoint{
Name: param.Name,
Description: param.Description,
APIBaseURL: param.APIBaseURL,
BaseURL: param.BaseURL,
CACertBundle: param.CACertBundle,
EndpointType: params.GiteaEndpointType,
Name: param.Name,
Description: param.Description,
APIBaseURL: param.APIBaseURL,
BaseURL: param.BaseURL,
CACertBundle: param.CACertBundle,
EndpointType: params.GiteaEndpointType,
ToolsMetadataURL: param.ToolsMetadataURL,
}
if param.UseInternalToolsMetadata != nil {
endpoint.UseInternalToolsMetadata = *param.UseInternalToolsMetadata
}
if err := tx.Create(&endpoint).Error; err != nil {
@ -121,6 +129,12 @@ func (s *sqlDatabase) UpdateGiteaEndpoint(_ context.Context, name string, param
if param.Description != nil {
endpoint.Description = *param.Description
}
if param.UseInternalToolsMetadata != nil {
endpoint.UseInternalToolsMetadata = *param.UseInternalToolsMetadata
}
if param.ToolsMetadataURL != "" {
endpoint.ToolsMetadataURL = param.ToolsMetadataURL
}
if err := tx.Save(&endpoint).Error; err != nil {
return fmt.Errorf("error updating gitea endpoint: %w", err)

View file

@ -409,7 +409,9 @@ type GithubEndpoint struct {
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
EndpointType params.EndpointType `gorm:"index:idx_endpoint_type"`
EndpointType params.EndpointType `gorm:"index:idx_endpoint_type"`
ToolsMetadataURL string `gorm:"type:text collate nocase"`
UseInternalToolsMetadata bool
Description string `gorm:"type:text"`
APIBaseURL string `gorm:"type:text collate nocase"`

View file

@ -30,6 +30,7 @@ import (
"github.com/cloudbase/garm/auth"
dbCommon "github.com/cloudbase/garm/database/common"
"github.com/cloudbase/garm/params"
"github.com/cloudbase/garm/util/appdefaults"
)
func (s *sqlDatabase) sqlToParamsInstance(instance Instance) (params.Instance, error) {
@ -952,7 +953,7 @@ func (s *sqlDatabase) sqlGiteaToCommonForgeCredentials(creds GiteaCredentials) (
}
func (s *sqlDatabase) sqlToCommonGithubEndpoint(ep GithubEndpoint) (params.ForgeEndpoint, error) {
return params.ForgeEndpoint{
ret := params.ForgeEndpoint{
Name: ep.Name,
Description: ep.Description,
APIBaseURL: ep.APIBaseURL,
@ -962,7 +963,16 @@ func (s *sqlDatabase) sqlToCommonGithubEndpoint(ep GithubEndpoint) (params.Forge
CreatedAt: ep.CreatedAt,
EndpointType: ep.EndpointType,
UpdatedAt: ep.UpdatedAt,
}, nil
}
if ep.EndpointType == params.GiteaEndpointType {
ret.UseInternalToolsMetadata = &ep.UseInternalToolsMetadata
if ep.ToolsMetadataURL == "" {
ret.ToolsMetadataURL = appdefaults.GiteaRunnerReleasesURL
} else {
ret.ToolsMetadataURL = ep.ToolsMetadataURL
}
}
return ret, nil
}
func getUIDFromContext(ctx context.Context) (uuid.UUID, error) {

View file

@ -25,6 +25,7 @@ import (
"math"
"net"
"net/http"
"strings"
"time"
"github.com/bradleyfalzon/ghinstallation/v2"
@ -1175,17 +1176,19 @@ func (g ForgeEntity) GetForgeType() (EndpointType, error) {
}
func (g ForgeEntity) ForgeURL() string {
baseURL := strings.TrimRight(g.Credentials.BaseURL, "/")
switch g.Credentials.ForgeType {
case GiteaEndpointType:
return g.Credentials.Endpoint.APIBaseURL
default:
switch g.EntityType {
case ForgeEntityTypeRepository:
return fmt.Sprintf("%s/%s/%s", g.Credentials.BaseURL, g.Owner, g.Name)
return fmt.Sprintf("%s/%s/%s", baseURL, g.Owner, g.Name)
case ForgeEntityTypeOrganization:
return fmt.Sprintf("%s/%s", g.Credentials.BaseURL, g.Owner)
return fmt.Sprintf("%s/%s", baseURL, g.Owner)
case ForgeEntityTypeEnterprise:
return fmt.Sprintf("%s/enterprises/%s", g.Credentials.BaseURL, g.Owner)
return fmt.Sprintf("%s/enterprises/%s", baseURL, g.Owner)
}
}
return ""
@ -1237,14 +1240,16 @@ type ForgeEndpoints []ForgeEndpoint
// swagger:model ForgeEndpoint
type ForgeEndpoint struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
UploadBaseURL string `json:"upload_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
UploadBaseURL string `json:"upload_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
ToolsMetadataURL string `json:"tools_metadata_url,omitempty"`
UseInternalToolsMetadata *bool `json:"use_internal_tools_metadata,omitempty"`
EndpointType EndpointType `json:"endpoint_type,omitempty"`
}

View file

@ -645,11 +645,13 @@ type UpdateScaleSetParams struct {
// swagger:model CreateGiteaEndpointParams
type CreateGiteaEndpointParams struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
ToolsMetadataURL string `json:"tools_metadata_url,omitempty"`
UseInternalToolsMetadata *bool `json:"use_internal_tools_metadata,omitempty"`
}
func (c CreateGiteaEndpointParams) Validate() error {
@ -682,6 +684,18 @@ func (c CreateGiteaEndpointParams) Validate() error {
return runnerErrors.NewBadRequestError("invalid api_base_url")
}
if c.ToolsMetadataURL != "" {
url, err = url.Parse(c.ToolsMetadataURL)
if err != nil || url.Scheme == "" || url.Host == "" {
return runnerErrors.NewBadRequestError("invalid tools_metadata_url")
}
switch url.Scheme {
case httpsScheme, httpScheme:
default:
return runnerErrors.NewBadRequestError("invalid tools_metadata_url")
}
}
if c.CACertBundle != nil {
block, _ := pem.Decode(c.CACertBundle)
if block == nil {
@ -697,10 +711,12 @@ func (c CreateGiteaEndpointParams) Validate() error {
// swagger:model UpdateGiteaEndpointParams
type UpdateGiteaEndpointParams struct {
Description *string `json:"description,omitempty"`
APIBaseURL *string `json:"api_base_url,omitempty"`
BaseURL *string `json:"base_url,omitempty"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
Description *string `json:"description,omitempty"`
APIBaseURL *string `json:"api_base_url,omitempty"`
BaseURL *string `json:"base_url,omitempty"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
ToolsMetadataURL string `json:"tools_metadata_url,omitempty"`
UseInternalToolsMetadata *bool `json:"use_internal_tools_metadata,omitempty"`
}
func (u UpdateGiteaEndpointParams) Validate() error {
@ -738,6 +754,18 @@ func (u UpdateGiteaEndpointParams) Validate() error {
}
}
if u.ToolsMetadataURL != "" {
url, err := url.Parse(u.ToolsMetadataURL)
if err != nil || url.Scheme == "" || url.Host == "" {
return runnerErrors.NewBadRequestError("invalid tools_metadata_url")
}
switch url.Scheme {
case httpsScheme, httpScheme:
default:
return runnerErrors.NewBadRequestError("invalid tools_metadata_url")
}
}
return nil
}

View file

@ -43,6 +43,12 @@ const (
// metrics data update interval
DefaultMetricsUpdateInterval = 60 * time.Second
// GiteaRunnerReleasesURL is the public API URL that returns a json of all Gitea runner releases.
// By default it returns the last 10 releases, which is enough for our needs.
GiteaRunnerReleasesURL = "https://gitea.com/api/v1/repos/gitea/act_runner/releases"
// GiteaRunnerMinimumVersion is the minimum version we need in order to support ephemeral runners.
GiteaRunnerMinimumVersion = "v0.2.12"
)
var Version string

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{F as w}from"./cPTQ2Ibn.js";import{g as r}from"./DAIx0GOW.js";const m=!0,z=m,I=()=>window.location.port==="5173",b={isAuthenticated:!1,user:null,loading:!0,needsInitialization:!1},n=w(b);function f(t,a,e=7){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3),document.cookie=`${t}=${a};expires=${i.toUTCString()};path=/;SameSite=Lax`}function d(t){const a=t+"=",e=document.cookie.split(";");for(let i=0;i<e.length;i++){let o=e[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(a)===0)return o.substring(a.length,o.length)}return null}function g(t){document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/`}const c={async login(t,a){try{n.update(i=>({...i,loading:!0}));const e=await r.login({username:t,password:a});z&&(f("garm_token",e.token),f("garm_user",t)),r.setToken(e.token),n.set({isAuthenticated:!0,user:t,loading:!1,needsInitialization:!1})}catch(e){throw n.update(i=>({...i,loading:!1})),e}},logout(){g("garm_token"),g("garm_user"),n.set({isAuthenticated:!1,user:null,loading:!1,needsInitialization:!1})},async init(){try{n.update(e=>({...e,loading:!0})),await c.checkInitializationStatus();const t=d("garm_token"),a=d("garm_user");if(t&&a&&(r.setToken(t),await c.checkAuth())){n.set({isAuthenticated:!0,user:a,loading:!1,needsInitialization:!1});return}n.update(e=>({...e,loading:!1,needsInitialization:!1}))}catch{n.update(a=>({...a,loading:!1}))}},async checkInitializationStatus(){try{const t={Accept:"application/json"},a=d("garm_token"),e=I();e&&a&&(t.Authorization=`Bearer ${a}`);const i=await fetch("/api/v1/login",{method:"GET",headers:t,credentials:e?"omit":"include"});if(!i.ok){if(i.status===409&&(await i.json()).error==="init_required")throw n.update(s=>({...s,needsInitialization:!0,loading:!1})),new Error("Initialization required");return}return}catch(t){if(t instanceof Error&&t.message==="Initialization required")throw t;return}},async checkAuth(){try{return await c.checkInitializationStatus(),await r.getControllerInfo(),!0}catch(t){return t instanceof Error&&t.message==="Initialization required"?!1:t?.response?.status===409&&t?.response?.data?.error==="init_required"?(n.update(a=>({...a,needsInitialization:!0,loading:!1})),!1):(c.logout(),!1)}},async initialize(t,a,e,i,o){try{n.update(u=>({...u,loading:!0}));const s=await r.firstRun({username:t,email:a,password:e,full_name:i||t});await c.login(t,e);const l=window.location.origin,h=o?.metadataUrl||`${l}/api/v1/metadata`,p=o?.callbackUrl||`${l}/api/v1/callbacks`,k=o?.webhookUrl||`${l}/webhooks`;await r.updateController({metadata_url:h,callback_url:p,webhook_url:k}),n.update(u=>({...u,needsInitialization:!1}))}catch(s){throw n.update(l=>({...l,loading:!1})),s}}};export{n as a,c as b};
import{F as w}from"./DniTuB_0.js";import{g as r}from"./BZ2rxtTc.js";const m=!0,z=m,I=()=>window.location.port==="5173",b={isAuthenticated:!1,user:null,loading:!0,needsInitialization:!1},n=w(b);function f(t,a,e=7){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3),document.cookie=`${t}=${a};expires=${i.toUTCString()};path=/;SameSite=Lax`}function d(t){const a=t+"=",e=document.cookie.split(";");for(let i=0;i<e.length;i++){let o=e[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(a)===0)return o.substring(a.length,o.length)}return null}function g(t){document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/`}const c={async login(t,a){try{n.update(i=>({...i,loading:!0}));const e=await r.login({username:t,password:a});z&&(f("garm_token",e.token),f("garm_user",t)),r.setToken(e.token),n.set({isAuthenticated:!0,user:t,loading:!1,needsInitialization:!1})}catch(e){throw n.update(i=>({...i,loading:!1})),e}},logout(){g("garm_token"),g("garm_user"),n.set({isAuthenticated:!1,user:null,loading:!1,needsInitialization:!1})},async init(){try{n.update(e=>({...e,loading:!0})),await c.checkInitializationStatus();const t=d("garm_token"),a=d("garm_user");if(t&&a&&(r.setToken(t),await c.checkAuth())){n.set({isAuthenticated:!0,user:a,loading:!1,needsInitialization:!1});return}n.update(e=>({...e,loading:!1,needsInitialization:!1}))}catch{n.update(a=>({...a,loading:!1}))}},async checkInitializationStatus(){try{const t={Accept:"application/json"},a=d("garm_token"),e=I();e&&a&&(t.Authorization=`Bearer ${a}`);const i=await fetch("/api/v1/login",{method:"GET",headers:t,credentials:e?"omit":"include"});if(!i.ok){if(i.status===409&&(await i.json()).error==="init_required")throw n.update(s=>({...s,needsInitialization:!0,loading:!1})),new Error("Initialization required");return}return}catch(t){if(t instanceof Error&&t.message==="Initialization required")throw t;return}},async checkAuth(){try{return await c.checkInitializationStatus(),await r.getControllerInfo(),!0}catch(t){return t instanceof Error&&t.message==="Initialization required"?!1:t?.response?.status===409&&t?.response?.data?.error==="init_required"?(n.update(a=>({...a,needsInitialization:!0,loading:!1})),!1):(c.logout(),!1)}},async initialize(t,a,e,i,o){try{n.update(u=>({...u,loading:!0}));const s=await r.firstRun({username:t,email:a,password:e,full_name:i||t});await c.login(t,e);const l=window.location.origin,h=o?.metadataUrl||`${l}/api/v1/metadata`,p=o?.callbackUrl||`${l}/api/v1/callbacks`,k=o?.webhookUrl||`${l}/webhooks`;await r.updateController({metadata_url:h,callback_url:p,webhook_url:k}),n.update(u=>({...u,needsInitialization:!1}))}catch(s){throw n.update(l=>({...l,loading:!1})),s}}};export{n as a,c as b};

View file

@ -1 +1 @@
import{F as l}from"./cPTQ2Ibn.js";function c(){const{subscribe:a,set:s,update:r}=l(!1);return{subscribe:a,init:()=>{const t=localStorage.getItem("theme");let e=!1;t==="dark"?e=!0:t==="light"?e=!1:e=window.matchMedia("(prefers-color-scheme: dark)").matches,s(e),o(e)},toggle:()=>r(t=>{const e=!t;return localStorage.setItem("theme",e?"dark":"light"),o(e),e}),set:t=>{localStorage.setItem("theme",t?"dark":"light"),o(t),s(t)}}}function o(a){a?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}const d=c();export{d as t};
import{F as l}from"./DniTuB_0.js";function c(){const{subscribe:a,set:s,update:r}=l(!1);return{subscribe:a,init:()=>{const t=localStorage.getItem("theme");let e=!1;t==="dark"?e=!0:t==="light"?e=!1:e=window.matchMedia("(prefers-color-scheme: dark)").matches,s(e),o(e)},toggle:()=>r(t=>{const e=!t;return localStorage.setItem("theme",e?"dark":"light"),o(e),e}),set:t=>{localStorage.setItem("theme",t?"dark":"light"),o(t),s(t)}}}function o(a){a?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}const d=c();export{d as t};

View file

@ -1 +1 @@
import{H as l,I as u,J as m,K as _,L as p,M as h,N as v,O as b,P as g,Q as x}from"./cPTQ2Ibn.js";function E(s,i,d){l&&u();var r=s,a,n,e=null,t=null;function f(){n&&(x(n),n=null),e&&(e.lastChild.remove(),r.before(e),e=null),n=t,t=null}m(()=>{if(a!==(a=i())){var c=b();if(a){var o=r;c&&(e=document.createDocumentFragment(),e.append(o=p())),t=h(()=>d(o,a))}c?v.add_callback(f):f()}},_),l&&(r=g)}export{E as c};
import{H as l,I as u,J as m,K as _,L as p,M as h,N as v,O as b,P as g,Q as x}from"./DniTuB_0.js";function E(s,i,d){l&&u();var r=s,a,n,e=null,t=null;function f(){n&&(x(n),n=null),e&&(e.lastChild.remove(),r.before(e),e=null),n=t,t=null}m(()=>{if(a!==(a=i())){var c=b();if(a){var o=r;c&&(e=document.createDocumentFragment(),e.append(o=p())),t=h(()=>d(o,a))}c?v.add_callback(f):f()}},_),l&&(r=g)}export{E as c};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as j}from"./C7KraPli.js";import{p as E,E as G,f as S,d as t,r,s as g,u,q as p,z as m,t as q,e as z,i as f,b as D,c as H}from"./cPTQ2Ibn.js";import{h as y,s as h}from"./DAIx0GOW.js";import{p as v}from"./DqFqoVWr.js";import{g as o}from"./BW-Jb4Ad.js";var I=S('<fieldset><legend class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> </legend> <div class="grid grid-cols-2 gap-4"><button type="button"><!> <span class="mt-2 text-sm font-medium text-gray-900 dark:text-white">GitHub</span></button> <button type="button"><!> <span class="mt-2 text-sm font-medium text-gray-900 dark:text-white">Gitea</span></button></div></fieldset>');function M(x,s){E(s,!1);const k=G();let i=v(s,"selectedForgeType",12,""),_=v(s,"label",8,"Select Forge Type");function n(c){i(c),k("select",c)}j();var d=I(),l=t(d),F=t(l,!0);r(l);var b=g(l,2),e=t(b),w=t(e);y(w,()=>(p(o),u(()=>o("github","w-8 h-8")))),m(2),r(e);var a=g(e,2),T=t(a);y(T,()=>(p(o),u(()=>o("gitea","w-8 h-8")))),m(2),r(a),r(b),r(d),q(()=>{z(F,_()),h(e,1,`flex flex-col items-center justify-center p-6 border-2 rounded-lg transition-colors cursor-pointer ${i()==="github"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),h(a,1,`flex flex-col items-center justify-center p-6 border-2 rounded-lg transition-colors cursor-pointer ${i()==="gitea"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`)}),f("click",e,()=>n("github")),f("click",a,()=>n("gitea")),D(x,d),H()}export{M as F};
import"./DsnmJJEf.js";import{i as j}from"./TJn6xDN9.js";import{p as E,E as G,f as S,d as t,r,s as g,u,q as p,z as m,t as q,e as z,i as f,b as D,c as H}from"./DniTuB_0.js";import{h as y,s as h}from"./BZ2rxtTc.js";import{p as v}from"./DbNhg6mG.js";import{g as o}from"./CTcPpzia.js";var I=S('<fieldset><legend class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> </legend> <div class="grid grid-cols-2 gap-4"><button type="button"><!> <span class="mt-2 text-sm font-medium text-gray-900 dark:text-white">GitHub</span></button> <button type="button"><!> <span class="mt-2 text-sm font-medium text-gray-900 dark:text-white">Gitea</span></button></div></fieldset>');function M(x,s){E(s,!1);const k=G();let i=v(s,"selectedForgeType",12,""),_=v(s,"label",8,"Select Forge Type");function n(c){i(c),k("select",c)}j();var d=I(),l=t(d),F=t(l,!0);r(l);var b=g(l,2),e=t(b),w=t(e);y(w,()=>(p(o),u(()=>o("github","w-8 h-8")))),m(2),r(e);var a=g(e,2),T=t(a);y(T,()=>(p(o),u(()=>o("gitea","w-8 h-8")))),m(2),r(a),r(b),r(d),q(()=>{z(F,_()),h(e,1,`flex flex-col items-center justify-center p-6 border-2 rounded-lg transition-colors cursor-pointer ${i()==="github"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),h(a,1,`flex flex-col items-center justify-center p-6 border-2 rounded-lg transition-colors cursor-pointer ${i()==="gitea"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`)}),f("click",e,()=>n("github")),f("click",a,()=>n("gitea")),D(x,d),H()}export{M as F};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as _}from"./C7KraPli.js";import{p as h,f as x,t as u,b as g,c as k,s as w,d as o,u as d,q as e,r,e as y}from"./cPTQ2Ibn.js";import{h as b}from"./DAIx0GOW.js";import{p as m}from"./DqFqoVWr.js";import{g as l}from"./BW-Jb4Ad.js";var z=x('<div class="flex items-center"><div class="flex-shrink-0 mr-2"><!></div> <div class="text-sm text-gray-900 dark:text-white"> </div></div>');function U(v,i){h(i,!1);let t=m(i,"item",8),s=m(i,"iconSize",8,"w-5 h-5");_();var a=z(),n=o(a),f=o(n);b(f,()=>(e(l),e(t()),e(s()),d(()=>l(t()?.endpoint?.endpoint_type||t()?.endpoint_type||"unknown",s())))),r(n);var p=w(n,2),c=o(p,!0);r(p),r(a),u(()=>y(c,(e(t()),d(()=>t()?.endpoint?.name||t()?.endpoint_name||t()?.endpoint_type||"Unknown")))),g(v,a),k()}export{U as E};
import"./DsnmJJEf.js";import{i as _}from"./TJn6xDN9.js";import{p as h,f as x,t as u,b as g,c as k,s as w,d as o,u as d,q as e,r,e as y}from"./DniTuB_0.js";import{h as b}from"./BZ2rxtTc.js";import{p as m}from"./DbNhg6mG.js";import{g as l}from"./CTcPpzia.js";var z=x('<div class="flex items-center"><div class="flex-shrink-0 mr-2"><!></div> <div class="text-sm text-gray-900 dark:text-white"> </div></div>');function U(v,i){h(i,!1);let t=m(i,"item",8),s=m(i,"iconSize",8,"w-5 h-5");_();var a=z(),n=o(a),f=o(n);b(f,()=>(e(l),e(t()),e(s()),d(()=>l(t()?.endpoint?.endpoint_type||t()?.endpoint_type||"unknown",s())))),r(n);var p=w(n,2),c=o(p,!0);r(p),r(a),u(()=>y(c,(e(t()),d(()=>t()?.endpoint?.name||t()?.endpoint_name||t()?.endpoint_type||"Unknown")))),g(v,a),k()}export{U as E};

View file

@ -1,4 +1,4 @@
import"./DsnmJJEf.js";import{i as g}from"./C7KraPli.js";import{p as x,l as k,k as d,m as w,q as y,h as J,f as b,d as z,x as L,s as j,g as c,r as q,t as B,b as f,c as C}from"./cPTQ2Ibn.js";import{p as o,i as E}from"./DqFqoVWr.js";import{c as n,s as M}from"./DAIx0GOW.js";import{b as N}from"./B-_QCM7E.js";var O=b('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-red-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg></div>'),S=b('<div class="relative"><textarea style="tab-size: 2;" spellcheck="false"></textarea> <!></div>');function I(m,r){x(r,!1);let t=o(r,"value",12,""),p=o(r,"placeholder",8,"{}"),u=o(r,"rows",8,4),i=o(r,"disabled",8,!1),a=w(!0);k(()=>y(t()),()=>{if(t().trim())try{JSON.parse(t()),d(a,!0)}catch{d(a,!1)}else d(a,!0)}),J(),g();var l=S(),e=z(l);L(e);var v=j(e,2);{var h=s=>{var _=O();f(s,_)};E(v,s=>{c(a)||s(h)})}q(l),B(()=>{n(e,"placeholder",p()),n(e,"rows",u()),e.disabled=i(),M(e,1,`w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 font-mono text-sm resize-none
import"./DsnmJJEf.js";import{i as g}from"./TJn6xDN9.js";import{p as x,l as k,k as d,m as w,q as y,h as J,f as b,d as z,x as L,s as j,g as c,r as q,t as B,b as f,c as C}from"./DniTuB_0.js";import{p as o,i as E}from"./DbNhg6mG.js";import{c as n,s as M}from"./BZ2rxtTc.js";import{b as N}from"./CCQwxxp9.js";var O=b('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-red-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg></div>'),S=b('<div class="relative"><textarea style="tab-size: 2;" spellcheck="false"></textarea> <!></div>');function I(m,r){x(r,!1);let t=o(r,"value",12,""),p=o(r,"placeholder",8,"{}"),u=o(r,"rows",8,4),i=o(r,"disabled",8,!1),a=w(!0);k(()=>y(t()),()=>{if(t().trim())try{JSON.parse(t()),d(a,!0)}catch{d(a,!1)}else d(a,!0)}),J(),g();var l=S(),e=z(l);L(e);var v=j(e,2);{var h=s=>{var _=O();f(s,_)};E(v,s=>{c(a)||s(h)})}q(l),B(()=>{n(e,"placeholder",p()),n(e,"rows",u()),e.disabled=i(),M(e,1,`w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 font-mono text-sm resize-none
${c(a)?"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white":"border-red-300 dark:border-red-600 bg-red-50 dark:bg-red-900/20 text-red-900 dark:text-red-100"}
${i()?"opacity-50 cursor-not-allowed":""}
`)}),N(e,t),f(m,l),C()}export{I as J};

View file

@ -1 +1 @@
import{ag as h,ah as t,u as b,ae as k,ai as S}from"./cPTQ2Ibn.js";function u(r,a){return r===a||r?.[S]===a}function d(r={},a,f,T){return h(()=>{var i,s;return t(()=>{i=s,s=[],b(()=>{r!==f(...s)&&(a(r,...s),i&&u(f(...i),r)&&a(null,...i))})}),()=>{k(()=>{s&&u(f(...s),r)&&a(null,...s)})}}),r}export{d as b};
import{ag as h,ah as t,u as b,ae as k,ai as S}from"./DniTuB_0.js";function u(r,a){return r===a||r?.[S]===a}function d(r={},a,f,T){return h(()=>{var i,s;return t(()=>{i=s,s=[],b(()=>{r!==f(...s)&&(a(r,...s),i&&u(f(...i),r)&&a(null,...i))})}),()=>{k(()=>{s&&u(f(...s),r)&&a(null,...s)})}}),r}export{d as b};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as v}from"./C7KraPli.js";import{p as w,l as m,q as s,g as r,m as g,h as x,B as h,a as T,b as B,c as S,k,u}from"./cPTQ2Ibn.js";import{k as A}from"./BXAw3DlI.js";import{p as d}from"./DqFqoVWr.js";import{k as b,B as C}from"./BW-Jb4Ad.js";import{f as E}from"./ow_oMtSd.js";function j(_,i){w(i,!1);const c=g(),n=g();let e=d(i,"item",8),l=d(i,"statusType",8,"entity"),a=d(i,"statusField",8,"status");m(()=>(s(e()),s(a())),()=>{k(c,e()?.[a()]||"unknown")}),m(()=>(s(e()),s(l()),r(c),s(a())),()=>{k(n,(()=>{if(!e())return{variant:"error",text:"Unknown"};switch(l()){case"entity":return b(e());case"instance":let t="secondary";switch(r(c).toLowerCase()){case"running":t="success";break;case"stopped":t="info";break;case"creating":case"pending_create":t="warning";break;case"deleting":case"pending_delete":case"pending_force_delete":t="warning";break;case"error":case"deleted":t="error";break;case"active":case"online":t="success";break;case"idle":t="info";break;case"pending":case"installing":t="warning";break;case"failed":case"terminated":case"offline":t="error";break;case"unknown":default:t="secondary";break}return{variant:t,text:E(r(c))};case"enabled":return{variant:e().enabled?"success":"error",text:e().enabled?"Enabled":"Disabled"};case"custom":const o=e()[a()]||"Unknown";if(a()==="auth-type"){const f=o==="pat"||!o?"pat":"app";return{variant:f==="pat"?"success":"info",text:f==="pat"?"PAT":"App"}}return{variant:"info",text:o};default:return b(e())}})())}),x(),v();var p=h(),y=T(p);A(y,()=>(s(e()),s(a()),u(()=>`${e()?.name||"item"}-${e()?.[a()]||"status"}-${e()?.updated_at||"time"}`)),t=>{C(t,{get variant(){return r(n),u(()=>r(n).variant)},get text(){return r(n),u(()=>r(n).text)}})}),B(_,p),S()}export{j as S};
import"./DsnmJJEf.js";import{i as v}from"./TJn6xDN9.js";import{p as w,l as m,q as s,g as r,m as g,h as x,A as h,a as T,b as S,c as A,k,u}from"./DniTuB_0.js";import{k as B}from"./CKaB5fL4.js";import{p as d}from"./DbNhg6mG.js";import{k as b,B as C}from"./CTcPpzia.js";import{f as E}from"./ow_oMtSd.js";function j(_,i){w(i,!1);const c=g(),n=g();let e=d(i,"item",8),l=d(i,"statusType",8,"entity"),a=d(i,"statusField",8,"status");m(()=>(s(e()),s(a())),()=>{k(c,e()?.[a()]||"unknown")}),m(()=>(s(e()),s(l()),r(c),s(a())),()=>{k(n,(()=>{if(!e())return{variant:"error",text:"Unknown"};switch(l()){case"entity":return b(e());case"instance":let t="secondary";switch(r(c).toLowerCase()){case"running":t="success";break;case"stopped":t="info";break;case"creating":case"pending_create":t="warning";break;case"deleting":case"pending_delete":case"pending_force_delete":t="warning";break;case"error":case"deleted":t="error";break;case"active":case"online":t="success";break;case"idle":t="info";break;case"pending":case"installing":t="warning";break;case"failed":case"terminated":case"offline":t="error";break;case"unknown":default:t="secondary";break}return{variant:t,text:E(r(c))};case"enabled":return{variant:e().enabled?"success":"error",text:e().enabled?"Enabled":"Disabled"};case"custom":const o=e()[a()]||"Unknown";if(a()==="auth-type"){const f=o==="pat"||!o?"pat":"app";return{variant:f==="pat"?"success":"info",text:f==="pat"?"PAT":"App"}}return{variant:"info",text:o};default:return b(e())}})())}),x(),v();var p=h(),y=T(p);B(y,()=>(s(e()),s(a()),u(()=>`${e()?.name||"item"}-${e()?.[a()]||"status"}-${e()?.updated_at||"time"}`)),t=>{C(t,{get variant(){return r(n),u(()=>r(n).variant)},get text(){return r(n),u(()=>r(n).text)}})}),S(_,p),A()}export{j as S};

View file

@ -1 +1 @@
import{F as u}from"./cPTQ2Ibn.js";function c(){const{subscribe:s,set:i,update:o}=u([]),n={subscribe:s,add:e=>{const t=Math.random().toString(36).substr(2,9),r={...e,id:t,duration:e.duration??5e3};return o(a=>[...a,r]),r.duration&&r.duration>0&&setTimeout(()=>{o(a=>a.filter(d=>d.id!==t))},r.duration),t},remove:e=>{o(t=>t.filter(r=>r.id!==e))},clear:()=>{i([])},success:(e,t="",r)=>n.add({type:"success",title:e,message:t,duration:r}),error:(e,t="",r)=>n.add({type:"error",title:e,message:t,duration:r}),info:(e,t="",r)=>n.add({type:"info",title:e,message:t,duration:r}),warning:(e,t="",r)=>n.add({type:"warning",title:e,message:t,duration:r})};return n}const p=c();export{p as t};
import{F as u}from"./DniTuB_0.js";function c(){const{subscribe:s,set:i,update:o}=u([]),n={subscribe:s,add:e=>{const t=Math.random().toString(36).substr(2,9),r={...e,id:t,duration:e.duration??5e3};return o(a=>[...a,r]),r.duration&&r.duration>0&&setTimeout(()=>{o(a=>a.filter(d=>d.id!==t))},r.duration),t},remove:e=>{o(t=>t.filter(r=>r.id!==e))},clear:()=>{i([])},success:(e,t="",r)=>n.add({type:"success",title:e,message:t,duration:r}),error:(e,t="",r)=>n.add({type:"error",title:e,message:t,duration:r}),info:(e,t="",r)=>n.add({type:"info",title:e,message:t,duration:r}),warning:(e,t="",r)=>n.add({type:"warning",title:e,message:t,duration:r})};return n}const p=c();export{p as t};

View file

@ -1 +1 @@
import{aj as b,ak as o,u as h,ah as _,H as t,N as f,al as m}from"./cPTQ2Ibn.js";function y(e,a,c=a){var v=b(),d=new WeakSet;o(e,"input",r=>{var l=r?e.defaultValue:e.value;if(l=n(e)?s(l):l,c(l),f!==null&&d.add(f),v&&l!==(l=a())){var k=e.selectionStart,u=e.selectionEnd;e.value=l??"",u!==null&&(e.selectionStart=k,e.selectionEnd=Math.min(u,e.value.length))}}),(t&&e.defaultValue!==e.value||h(a)==null&&e.value)&&(c(n(e)?s(e.value):e.value),f!==null&&d.add(f)),_(()=>{var r=a();if(e===document.activeElement){var l=m??f;if(d.has(l))return}n(e)&&r===s(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function E(e,a,c=a){o(e,"change",v=>{var d=v?e.defaultChecked:e.checked;c(d)}),(t&&e.defaultChecked!==e.checked||h(a)==null)&&c(e.checked),_(()=>{var v=a();e.checked=!!v})}function n(e){var a=e.type;return a==="number"||a==="range"}function s(e){return e===""?null:+e}export{E as a,y as b};
import{aj as b,ak as o,u as h,ah as _,H as t,N as f,al as m}from"./DniTuB_0.js";function y(e,a,c=a){var v=b(),d=new WeakSet;o(e,"input",r=>{var l=r?e.defaultValue:e.value;if(l=n(e)?s(l):l,c(l),f!==null&&d.add(f),v&&l!==(l=a())){var k=e.selectionStart,u=e.selectionEnd;e.value=l??"",u!==null&&(e.selectionStart=k,e.selectionEnd=Math.min(u,e.value.length))}}),(t&&e.defaultValue!==e.value||h(a)==null&&e.value)&&(c(n(e)?s(e.value):e.value),f!==null&&d.add(f)),_(()=>{var r=a();if(e===document.activeElement){var l=m??f;if(d.has(l))return}n(e)&&r===s(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function E(e,a,c=a){o(e,"change",v=>{var d=v?e.defaultChecked:e.checked;c(d)}),(t&&e.defaultChecked!==e.checked||h(a)==null)&&c(e.checked),_(()=>{var v=a();e.checked=!!v})}function n(e){var a=e.type;return a==="number"||a==="range"}function s(e){return e===""?null:+e}export{E as a,y as b};

View file

@ -1 +1 @@
const w=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function x(t){const s=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${m(t).map(a=>{const i=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(i)return s.push({name:i[1],matcher:i[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const c=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(c)return s.push({name:c[1],matcher:c[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const n=a.split(/\[(.+?)\](?!\])/);return"/"+n.map((e,l)=>{if(l%2){if(e.startsWith("x+"))return h(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith("u+"))return h(String.fromCharCode(...e.slice(2).split("-").map(d=>parseInt(d,16))));const o=w.exec(e),[,u,p,_,g]=o;return s.push({name:_,matcher:g,optional:!!u,rest:!!p,chained:p?l===1&&n[0]==="":!1}),p?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return h(e)}).join("")}).join("")}/?$`),params:s}}function $(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function m(t){return t.slice(1).split("/").filter($)}function j(t,s,f){const a={},i=t.slice(1),c=i.filter(r=>r!==void 0);let n=0;for(let r=0;r<s.length;r+=1){const e=s[r];let l=i[r-n];if(e.chained&&e.rest&&n&&(l=i.slice(r-n,r+1).filter(o=>o).join("/"),n=0),l===void 0){e.rest&&(a[e.name]="");continue}if(!e.matcher||f[e.matcher](l)){a[e.name]=l;const o=s[r+1],u=i[r+1];o&&!o.rest&&o.optional&&u&&e.chained&&(n=0),!o&&!u&&Object.keys(a).length===c.length&&(n=0);continue}if(e.optional&&e.chained){n++;continue}return}if(!n)return a}function h(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}const b=/\[(\[)?(\.\.\.)?(\w+?)(?:=(\w+))?\]\]?/g;function k(t,s){return"/"+m(t).map(a=>a.replace(b,(i,c,n,r)=>{const e=s[r];if(!e){if(c||n&&e!==void 0)return"";throw new Error(`Missing parameter '${r}' in route ${t}`)}if(e.startsWith("/")||e.endsWith("/"))throw new Error(`Parameter '${r}' in route ${t} cannot start or end with a slash -- this would cause an invalid route like foo//bar`);return e})).filter(Boolean).join("/")}const v=globalThis.__sveltekit_1l07m9g?.base??"/ui",C=globalThis.__sveltekit_1l07m9g?.assets??v;export{C as a,v as b,j as e,x as p,k as r};
const w=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function x(t){const s=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${_(t).map(a=>{const i=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(i)return s.push({name:i[1],matcher:i[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const c=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(c)return s.push({name:c[1],matcher:c[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const n=a.split(/\[(.+?)\](?!\])/);return"/"+n.map((e,u)=>{if(u%2){if(e.startsWith("x+"))return h(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith("u+"))return h(String.fromCharCode(...e.slice(2).split("-").map(g=>parseInt(g,16))));const o=w.exec(e),[,l,p,m,d]=o;return s.push({name:m,matcher:d,optional:!!l,rest:!!p,chained:p?u===1&&n[0]==="":!1}),p?"([^]*?)":l?"([^/]*)?":"([^/]+?)"}return h(e)}).join("")}).join("")}/?$`),params:s}}function $(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function _(t){return t.slice(1).split("/").filter($)}function j(t,s,f){const a={},i=t.slice(1),c=i.filter(r=>r!==void 0);let n=0;for(let r=0;r<s.length;r+=1){const e=s[r];let u=i[r-n];if(e.chained&&e.rest&&n&&(u=i.slice(r-n,r+1).filter(o=>o).join("/"),n=0),u===void 0){e.rest&&(a[e.name]="");continue}if(!e.matcher||f[e.matcher](u)){a[e.name]=u;const o=s[r+1],l=i[r+1];o&&!o.rest&&o.optional&&l&&e.chained&&(n=0),!o&&!l&&Object.keys(a).length===c.length&&(n=0);continue}if(e.optional&&e.chained){n++;continue}return}if(!n)return a}function h(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}const b=/\[(\[)?(\.\.\.)?(\w+?)(?:=(\w+))?\]\]?/g;function k(t,s){return"/"+_(t).map(a=>a.replace(b,(i,c,n,r)=>{const e=s[r];if(!e){if(c||n&&e!==void 0)return"";throw new Error(`Missing parameter '${r}' in route ${t}`)}if(e.startsWith("/")||e.endsWith("/"))throw new Error(`Parameter '${r}' in route ${t} cannot start or end with a slash -- this would cause an invalid route like foo//bar`);return e})).filter(Boolean).join("/")}const v=globalThis.__sveltekit_1odpo7n?.base??"/ui",C=globalThis.__sveltekit_1odpo7n?.assets??v;export{C as a,v as b,j as e,x as p,k as r};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as u}from"./C7KraPli.js";import{p as v,E as m,f as h,d as r,r as d,i,b as k,c as g}from"./cPTQ2Ibn.js";import{i as b}from"./DAIx0GOW.js";var w=h('<div class="fixed inset-0 bg-black/30 dark:bg-black/50 overflow-y-auto h-full w-full z-50 flex items-center justify-center p-4" role="dialog" aria-modal="true" tabindex="-1"><div class="relative mx-auto bg-white dark:bg-gray-800 rounded-lg shadow-lg" role="document"><!></div></div>');function M(s,t){v(t,!1);const l=m();function n(){l("close")}function c(o){o.stopPropagation()}function f(o){o.key==="Escape"&&l("close")}u();var a=w(),e=r(a),p=r(e);b(p,t,"default",{}),d(e),d(a),i("click",e,c),i("click",a,n),i("keydown",a,f),k(s,a),g()}export{M};
import"./DsnmJJEf.js";import{i as u}from"./TJn6xDN9.js";import{p as v,E as m,f as h,d as r,r as d,i,b as k,c as g}from"./DniTuB_0.js";import{i as b}from"./BZ2rxtTc.js";var w=h('<div class="fixed inset-0 bg-black/30 dark:bg-black/50 overflow-y-auto h-full w-full z-50 flex items-center justify-center p-4" role="dialog" aria-modal="true" tabindex="-1"><div class="relative mx-auto bg-white dark:bg-gray-800 rounded-lg shadow-lg" role="document"><!></div></div>');function M(s,t){v(t,!1);const l=m();function n(){l("close")}function c(o){o.stopPropagation()}function f(o){o.key==="Escape"&&l("close")}u();var a=w(),e=r(a),p=r(e);b(p,t,"default",{}),d(e),d(a),i("click",e,c),i("click",a,n),i("keydown",a,f),k(s,a),g()}export{M};

View file

@ -1,4 +1,4 @@
import{d,s as w,f as x}from"./DAIx0GOW.js";import"./DsnmJJEf.js";import{i as k}from"./C7KraPli.js";import{p as b,l as _,q as c,h as v,f as y,t as h,b as E,c as B,k as z,m as L,d as M,r as j,g as T,e as U}from"./cPTQ2Ibn.js";import{p as o}from"./DqFqoVWr.js";function q(e){if(!e)return"N/A";try{return(typeof e=="string"?new Date(e):e).toLocaleString()}catch{return"Invalid Date"}}function A(e,r="w-4 h-4"){return e==="gitea"?`<svg class="${r}" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 640 640"><path d="m395.9 484.2-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5 21.2-17.9 33.8-11.8 17.2 8.3 27.1 13 27.1 13l-.1-109.2 16.7-.1.1 117.1s57.4 24.2 83.1 40.1c3.7 2.3 10.2 6.8 12.9 14.4 2.1 6.1 2 13.1-1 19.3l-61 126.9c-6.2 12.7-21.4 18.1-33.9 12" style="fill:#fff"/><path d="M622.7 149.8c-4.1-4.1-9.6-4-9.6-4s-117.2 6.6-177.9 8c-13.3.3-26.5.6-39.6.7v117.2c-5.5-2.6-11.1-5.3-16.6-7.9 0-36.4-.1-109.2-.1-109.2-29 .4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5c-9.8-.6-22.5-2.1-39 1.5-8.7 1.8-33.5 7.4-53.8 26.9C-4.9 212.4 6.6 276.2 8 285.8c1.7 11.7 6.9 44.2 31.7 72.5 45.8 56.1 144.4 54.8 144.4 54.8s12.1 28.9 30.6 55.5c25 33.1 50.7 58.9 75.7 62 63 0 188.9-.1 188.9-.1s12 .1 28.3-10.3c14-8.5 26.5-23.4 26.5-23.4S547 483 565 451.5c5.5-9.7 10.1-19.1 14.1-28 0 0 55.2-117.1 55.2-231.1-1.1-34.5-9.6-40.6-11.6-42.6M125.6 353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6 321.8 60 295.4c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5 38.5-30c13.8-3.7 31-3.1 31-3.1s7.1 59.4 15.7 94.2c7.2 29.2 24.8 77.7 24.8 77.7s-26.1-3.1-43-9.1m300.3 107.6s-6.1 14.5-19.6 15.4c-5.8.4-10.3-1.2-10.3-1.2s-.3-.1-5.3-2.1l-112.9-55s-10.9-5.7-12.8-15.6c-2.2-8.1 2.7-18.1 2.7-18.1L322 273s4.8-9.7 12.2-13c.6-.3 2.3-1 4.5-1.5 8.1-2.1 18 2.8 18 2.8L467.4 315s12.6 5.7 15.3 16.2c1.9 7.4-.5 14-1.8 17.2-6.3 15.4-55 113.1-55 113.1" style="fill:#609926"/><path d="M326.8 380.1c-8.2.1-15.4 5.8-17.3 13.8s2 16.3 9.1 20c7.7 4 17.5 1.8 22.7-5.4 5.1-7.1 4.3-16.9-1.8-23.1l24-49.1c1.5.1 3.7.2 6.2-.5 4.1-.9 7.1-3.6 7.1-3.6 4.2 1.8 8.6 3.8 13.2 6.1 4.8 2.4 9.3 4.9 13.4 7.3.9.5 1.8 1.1 2.8 1.9 1.6 1.3 3.4 3.1 4.7 5.5 1.9 5.5-1.9 14.9-1.9 14.9-2.3 7.6-18.4 40.6-18.4 40.6-8.1-.2-15.3 5-17.7 12.5-2.6 8.1 1.1 17.3 8.9 21.3s17.4 1.7 22.5-5.3c5-6.8 4.6-16.3-1.1-22.6 1.9-3.7 3.7-7.4 5.6-11.3 5-10.4 13.5-30.4 13.5-30.4.9-1.7 5.7-10.3 2.7-21.3-2.5-11.4-12.6-16.7-12.6-16.7-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3 4.7-9.7 9.4-19.3 14.1-29-4.1-2-8.1-4-12.2-6.1-4.8 9.8-9.7 19.7-14.5 29.5-6.7-.1-12.9 3.5-16.1 9.4-3.4 6.3-2.7 14.1 1.9 19.8z" style="fill:#609926"/></svg>`:e==="github"?`<div class="inline-flex ${r}"><svg class="${r} dark:hidden" width="98" height="96" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg><svg class="${r} hidden dark:block" width="98" height="96" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#fff"/></svg></div>`:`<svg class="${r} text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
import{d,s as w,f as x}from"./BZ2rxtTc.js";import"./DsnmJJEf.js";import{i as k}from"./TJn6xDN9.js";import{p as b,l as _,q as c,h as v,f as y,t as h,b as E,c as B,k as z,m as L,d as M,r as j,g as T,e as U}from"./DniTuB_0.js";import{p as o}from"./DbNhg6mG.js";function q(e){if(!e)return"N/A";try{return(typeof e=="string"?new Date(e):e).toLocaleString()}catch{return"Invalid Date"}}function A(e,r="w-4 h-4"){return e==="gitea"?`<svg class="${r}" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 640 640"><path d="m395.9 484.2-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5 21.2-17.9 33.8-11.8 17.2 8.3 27.1 13 27.1 13l-.1-109.2 16.7-.1.1 117.1s57.4 24.2 83.1 40.1c3.7 2.3 10.2 6.8 12.9 14.4 2.1 6.1 2 13.1-1 19.3l-61 126.9c-6.2 12.7-21.4 18.1-33.9 12" style="fill:#fff"/><path d="M622.7 149.8c-4.1-4.1-9.6-4-9.6-4s-117.2 6.6-177.9 8c-13.3.3-26.5.6-39.6.7v117.2c-5.5-2.6-11.1-5.3-16.6-7.9 0-36.4-.1-109.2-.1-109.2-29 .4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5c-9.8-.6-22.5-2.1-39 1.5-8.7 1.8-33.5 7.4-53.8 26.9C-4.9 212.4 6.6 276.2 8 285.8c1.7 11.7 6.9 44.2 31.7 72.5 45.8 56.1 144.4 54.8 144.4 54.8s12.1 28.9 30.6 55.5c25 33.1 50.7 58.9 75.7 62 63 0 188.9-.1 188.9-.1s12 .1 28.3-10.3c14-8.5 26.5-23.4 26.5-23.4S547 483 565 451.5c5.5-9.7 10.1-19.1 14.1-28 0 0 55.2-117.1 55.2-231.1-1.1-34.5-9.6-40.6-11.6-42.6M125.6 353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6 321.8 60 295.4c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5 38.5-30c13.8-3.7 31-3.1 31-3.1s7.1 59.4 15.7 94.2c7.2 29.2 24.8 77.7 24.8 77.7s-26.1-3.1-43-9.1m300.3 107.6s-6.1 14.5-19.6 15.4c-5.8.4-10.3-1.2-10.3-1.2s-.3-.1-5.3-2.1l-112.9-55s-10.9-5.7-12.8-15.6c-2.2-8.1 2.7-18.1 2.7-18.1L322 273s4.8-9.7 12.2-13c.6-.3 2.3-1 4.5-1.5 8.1-2.1 18 2.8 18 2.8L467.4 315s12.6 5.7 15.3 16.2c1.9 7.4-.5 14-1.8 17.2-6.3 15.4-55 113.1-55 113.1" style="fill:#609926"/><path d="M326.8 380.1c-8.2.1-15.4 5.8-17.3 13.8s2 16.3 9.1 20c7.7 4 17.5 1.8 22.7-5.4 5.1-7.1 4.3-16.9-1.8-23.1l24-49.1c1.5.1 3.7.2 6.2-.5 4.1-.9 7.1-3.6 7.1-3.6 4.2 1.8 8.6 3.8 13.2 6.1 4.8 2.4 9.3 4.9 13.4 7.3.9.5 1.8 1.1 2.8 1.9 1.6 1.3 3.4 3.1 4.7 5.5 1.9 5.5-1.9 14.9-1.9 14.9-2.3 7.6-18.4 40.6-18.4 40.6-8.1-.2-15.3 5-17.7 12.5-2.6 8.1 1.1 17.3 8.9 21.3s17.4 1.7 22.5-5.3c5-6.8 4.6-16.3-1.1-22.6 1.9-3.7 3.7-7.4 5.6-11.3 5-10.4 13.5-30.4 13.5-30.4.9-1.7 5.7-10.3 2.7-21.3-2.5-11.4-12.6-16.7-12.6-16.7-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3 4.7-9.7 9.4-19.3 14.1-29-4.1-2-8.1-4-12.2-6.1-4.8 9.8-9.7 19.7-14.5 29.5-6.7-.1-12.9 3.5-16.1 9.4-3.4 6.3-2.7 14.1 1.9 19.8z" style="fill:#609926"/></svg>`:e==="github"?`<div class="inline-flex ${r}"><svg class="${r} dark:hidden" width="98" height="96" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg><svg class="${r} hidden dark:block" width="98" height="96" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#fff"/></svg></div>`:`<svg class="${r} text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>`}function C(e,r){if(e.repo_name)return e.repo_name;if(e.org_name)return e.org_name;if(e.enterprise_name)return e.enterprise_name;if(e.repo_id&&!e.repo_name&&r?.repositories){const n=r.repositories.find(t=>t.id===e.repo_id);return n?`${n.owner}/${n.name}`:"Unknown Entity"}if(e.org_id&&!e.org_name&&r?.organizations){const n=r.organizations.find(t=>t.id===e.org_id);return n&&n.name?n.name:"Unknown Entity"}if(e.enterprise_id&&!e.enterprise_name&&r?.enterprises){const n=r.enterprises.find(t=>t.id===e.enterprise_id);return n&&n.name?n.name:"Unknown Entity"}return"Unknown Entity"}function H(e){return e.repo_id?"repository":e.org_id?"organization":e.enterprise_id?"enterprise":"unknown"}function P(e){return e.repo_id?d(`/repositories/${e.repo_id}`):e.org_id?d(`/organizations/${e.org_id}`):e.enterprise_id?d(`/enterprises/${e.enterprise_id}`):"#"}function V(e){e&&(e.scrollTop=e.scrollHeight)}function W(e){return{newPerPage:e,newCurrentPage:1}}function G(e){return e.pool_manager_status?.running?{text:"Running",variant:"success"}:{text:"Stopped",variant:"error"}}function J(e){switch(e.toLowerCase()){case"error":return{text:"Error",variant:"error"};case"warning":return{text:"Warning",variant:"warning"};case"info":return{text:"Info",variant:"info"};default:return{text:e,variant:"info"}}}function l(e,r,n){if(!r.trim())return e;const t=r.toLowerCase();return e.filter(a=>typeof n=="function"?n(a).toLowerCase().includes(t):n.some(i=>a[i]?.toString().toLowerCase().includes(t)))}function K(e,r){return l(e,r,["name","owner"])}function O(e,r){return l(e,r,["name"])}function Q(e,r){return l(e,r,n=>[n.name||"",n.description||"",n.endpoint?.name||""].join(" "))}function X(e,r){return l(e,r,["name","description","base_url","api_base_url"])}function Y(e,r,n){return e.slice((r-1)*n,r*n)}var I=y("<span> </span>");function Z(e,r){b(r,!1);const n=L();let t=o(r,"variant",8,"gray"),a=o(r,"size",8,"sm"),i=o(r,"text",8),g=o(r,"ring",8,!1);const u={success:"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",error:"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",warning:"bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200",info:"bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",gray:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",blue:"bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",green:"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",red:"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",yellow:"bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200",secondary:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200"},f={success:"ring-green-600/20 dark:ring-green-400/30",error:"ring-red-600/20 dark:ring-red-400/30",warning:"ring-yellow-600/20 dark:ring-yellow-400/30",info:"ring-blue-600/20 dark:ring-blue-400/30",gray:"ring-gray-500/20 dark:ring-gray-400/30",blue:"ring-blue-600/20 dark:ring-blue-400/30",green:"ring-green-600/20 dark:ring-green-400/30",red:"ring-red-600/20 dark:ring-red-400/30",yellow:"ring-yellow-600/20 dark:ring-yellow-400/30",secondary:"ring-gray-500/20 dark:ring-gray-400/30"},p={sm:"px-2 py-1 text-xs",md:"px-2.5 py-0.5 text-xs"};_(()=>(c(t()),c(a()),c(g())),()=>{z(n,["inline-flex items-center rounded-full font-semibold",u[t()],p[a()],g()?`ring-1 ring-inset ${f[t()]}`:""].filter(Boolean).join(" "))}),v(),k();var s=I(),m=M(s,!0);j(s),h(()=>{w(s,1,x(T(n))),U(m,i())}),E(e,s),B()}export{Z as B,X as a,q as b,W as c,J as d,C as e,Q as f,A as g,l as h,H as i,P as j,G as k,O as l,K as m,Y as p,V as s};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as ae}from"./C7KraPli.js";import{p as se,E as re,l as M,q as ie,k as r,g as t,m as k,h as le,f as p,d as v,s as $,r as f,b as l,c as oe,B as T,a as E,z as q,D as V,t as F,e as N,u as ne}from"./cPTQ2Ibn.js";import{p as R,i as m}from"./DqFqoVWr.js";import{g as h,B as G}from"./DAIx0GOW.js";import{t as y}from"./Bgbd8SZ5.js";import{e as de}from"./BZiHL9L3.js";var ce=p('<div class="flex items-center"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600 mr-2"></div> <span class="text-sm text-gray-500 dark:text-gray-400">Checking...</span></div>'),ve=p('<div class="ml-4 text-xs text-gray-500 dark:text-gray-400"> </div>'),fe=p('<div class="flex items-center"><svg class="w-4 h-4 text-green-500 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path></svg> <span class="text-sm text-green-700 dark:text-green-300">Webhook installed</span></div> <!>',1),he=p('<div class="flex items-center"><svg class="w-4 h-4 text-gray-400 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm0-2a6 6 0 100-12 6 6 0 000 12zm0-10a1 1 0 011 1v3a1 1 0 01-2 0V7a1 1 0 011-1z" clip-rule="evenodd"></path></svg> <span class="text-sm text-gray-500 dark:text-gray-400">No webhook installed</span></div>'),ue=p('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="flex items-center justify-between"><div><h3 class="text-lg font-medium text-gray-900 dark:text-white">Webhook Status</h3> <div class="mt-1 flex items-center"><!></div></div> <div class="flex space-x-2"><!></div></div></div></div>');function _e(H,g){se(g,!1);const x=k();let u=R(g,"entityType",8),s=R(g,"entityId",8),A=R(g,"entityName",8),i=k(null),o=k(!1),b=k(!0);const O=re();async function _(){if(s())try{r(b,!0),u()==="repository"?r(i,await h.getRepositoryWebhookInfo(s())):r(i,await h.getOrganizationWebhookInfo(s()))}catch(e){e&&typeof e=="object"&&"response"in e&&e.response?.status===404?r(i,null):(console.warn("Failed to check webhook status:",e),r(i,null))}finally{r(b,!1)}}async function J(){if(s())try{r(o,!0),u()==="repository"?await h.installRepositoryWebhook(s()):await h.installOrganizationWebhook(s()),y.success("Webhook Installed",`Webhook for ${u()} ${A()} has been installed successfully.`),await _(),O("webhookStatusChanged",{installed:!0})}catch(e){y.error("Webhook Installation Failed",e instanceof Error?e.message:"Failed to install webhook.")}finally{r(o,!1)}}async function K(){if(s())try{r(o,!0),u()==="repository"?await h.uninstallRepositoryWebhook(s()):await h.uninstallOrganizationWebhook(s()),y.success("Webhook Uninstalled",`Webhook for ${u()} ${A()} has been uninstalled successfully.`),await _(),O("webhookStatusChanged",{installed:!1})}catch(e){y.error("Webhook Uninstall Failed",de(e))}finally{r(o,!1)}}M(()=>ie(s()),()=>{s()&&_()}),M(()=>t(i),()=>{r(x,t(i)&&t(i).active)}),le(),ae();var w=ue(),P=v(w),j=v(P),W=v(j),D=$(v(W),2),Q=v(D);{var X=e=>{var d=ce();l(e,d)},Y=e=>{var d=T(),z=E(d);{var I=a=>{var n=fe(),B=$(E(n),2);{var c=C=>{var U=ve(),te=v(U);f(U),F(()=>N(te,`URL: ${t(i),ne(()=>t(i).url||"N/A")??""}`)),l(C,U)};m(B,C=>{t(i)&&C(c)})}l(a,n)},S=a=>{var n=he();l(a,n)};m(z,a=>{t(x)?a(I):a(S,!1)},!0)}l(e,d)};m(Q,e=>{t(b)?e(X):e(Y,!1)})}f(D),f(W);var L=$(W,2),Z=v(L);{var ee=e=>{var d=T(),z=E(d);{var I=a=>{G(a,{variant:"danger",size:"sm",get disabled(){return t(o)},$$events:{click:K},children:(n,B)=>{q();var c=V();F(()=>N(c,t(o)?"Uninstalling...":"Uninstall")),l(n,c)},$$slots:{default:!0}})},S=a=>{G(a,{variant:"primary",size:"sm",get disabled(){return t(o)},$$events:{click:J},children:(n,B)=>{q();var c=V();F(()=>N(c,t(o)?"Installing...":"Install Webhook")),l(n,c)},$$slots:{default:!0}})};m(z,a=>{t(x)?a(I):a(S,!1)})}l(e,d)};m(Z,e=>{t(b)||e(ee)})}f(L),f(j),f(P),f(w),l(H,w),oe()}export{_e as W};
import"./DsnmJJEf.js";import{i as ae}from"./TJn6xDN9.js";import{p as se,E as re,l as M,q as ie,k as r,g as t,m as k,h as le,f as p,d as v,s as A,r as f,b as l,c as oe,A as T,a as B,z as q,D as V,t as E,e as F,u as ne}from"./DniTuB_0.js";import{p as N,i as m}from"./DbNhg6mG.js";import{g as h,B as G}from"./BZ2rxtTc.js";import{t as y}from"./CBJzOE8U.js";import{e as de}from"./BZiHL9L3.js";var ce=p('<div class="flex items-center"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600 mr-2"></div> <span class="text-sm text-gray-500 dark:text-gray-400">Checking...</span></div>'),ve=p('<div class="ml-4 text-xs text-gray-500 dark:text-gray-400"> </div>'),fe=p('<div class="flex items-center"><svg class="w-4 h-4 text-green-500 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path></svg> <span class="text-sm text-green-700 dark:text-green-300">Webhook installed</span></div> <!>',1),he=p('<div class="flex items-center"><svg class="w-4 h-4 text-gray-400 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm0-2a6 6 0 100-12 6 6 0 000 12zm0-10a1 1 0 011 1v3a1 1 0 01-2 0V7a1 1 0 011-1z" clip-rule="evenodd"></path></svg> <span class="text-sm text-gray-500 dark:text-gray-400">No webhook installed</span></div>'),ue=p('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="flex items-center justify-between"><div><h3 class="text-lg font-medium text-gray-900 dark:text-white">Webhook Status</h3> <div class="mt-1 flex items-center"><!></div></div> <div class="flex space-x-2"><!></div></div></div></div>');function _e(H,g){se(g,!1);const x=k();let u=N(g,"entityType",8),s=N(g,"entityId",8),R=N(g,"entityName",8),i=k(null),o=k(!1),b=k(!0);const O=re();async function _(){if(s())try{r(b,!0),u()==="repository"?r(i,await h.getRepositoryWebhookInfo(s())):r(i,await h.getOrganizationWebhookInfo(s()))}catch(e){e&&typeof e=="object"&&"response"in e&&e.response?.status===404?r(i,null):(console.warn("Failed to check webhook status:",e),r(i,null))}finally{r(b,!1)}}async function J(){if(s())try{r(o,!0),u()==="repository"?await h.installRepositoryWebhook(s()):await h.installOrganizationWebhook(s()),y.success("Webhook Installed",`Webhook for ${u()} ${R()} has been installed successfully.`),await _(),O("webhookStatusChanged",{installed:!0})}catch(e){y.error("Webhook Installation Failed",e instanceof Error?e.message:"Failed to install webhook.")}finally{r(o,!1)}}async function K(){if(s())try{r(o,!0),u()==="repository"?await h.uninstallRepositoryWebhook(s()):await h.uninstallOrganizationWebhook(s()),y.success("Webhook Uninstalled",`Webhook for ${u()} ${R()} has been uninstalled successfully.`),await _(),O("webhookStatusChanged",{installed:!1})}catch(e){y.error("Webhook Uninstall Failed",de(e))}finally{r(o,!1)}}M(()=>ie(s()),()=>{s()&&_()}),M(()=>t(i),()=>{r(x,t(i)&&t(i).active)}),le(),ae();var w=ue(),P=v(w),j=v(P),W=v(j),D=A(v(W),2),Q=v(D);{var X=e=>{var d=ce();l(e,d)},Y=e=>{var d=T(),z=B(d);{var I=a=>{var n=fe(),C=A(B(n),2);{var c=U=>{var $=ve(),te=v($);f($),E(()=>F(te,`URL: ${t(i),ne(()=>t(i).url||"N/A")??""}`)),l(U,$)};m(C,U=>{t(i)&&U(c)})}l(a,n)},S=a=>{var n=he();l(a,n)};m(z,a=>{t(x)?a(I):a(S,!1)},!0)}l(e,d)};m(Q,e=>{t(b)?e(X):e(Y,!1)})}f(D),f(W);var L=A(W,2),Z=v(L);{var ee=e=>{var d=T(),z=B(d);{var I=a=>{G(a,{variant:"danger",size:"sm",get disabled(){return t(o)},$$events:{click:K},children:(n,C)=>{q();var c=V();E(()=>F(c,t(o)?"Uninstalling...":"Uninstall")),l(n,c)},$$slots:{default:!0}})},S=a=>{G(a,{variant:"primary",size:"sm",get disabled(){return t(o)},$$events:{click:J},children:(n,C)=>{q();var c=V();E(()=>F(c,t(o)?"Installing...":"Install Webhook")),l(n,c)},$$slots:{default:!0}})};m(z,a=>{t(x)?a(I):a(S,!1)})}l(e,d)};m(Z,e=>{t(b)||e(ee)})}f(L),f(j),f(P),f(w),l(H,w),oe()}export{_e as W};

View file

@ -1 +1 @@
import{L as G,J as re,R as X,H as D,S as ne,I as fe,g as Q,v as le,T as ie,U as se,V as W,W as g,P as O,X as ue,Y as te,M as J,O as ve,N as de,Z,m as _e,_ as z,a0 as K,a1 as oe,a2 as V,a3 as $,Q as ce,a4 as Y,a5 as he,a6 as B,a7 as k,a8 as Ee,a9 as me,aa as pe,ab as Te,ac as Ae,ad as y,ae as Ie,af as Ne}from"./cPTQ2Ibn.js";function Me(i,r){return r}function we(i,r,e){for(var u=i.items,v=[],d=r.length,s=0;s<d;s++)me(r[s].e,v,!0);var h=d>0&&v.length===0&&e!==null;if(h){var T=e.parentNode;pe(T),T.append(e),u.clear(),w(i,r[0].prev,r[d-1].next)}Te(v,()=>{for(var p=0;p<d;p++){var o=r[p];h||(u.delete(o.k),w(i,o.prev,o.next)),k(o.e,!h)}})}function Se(i,r,e,u,v,d=null){var s=i,h={flags:r,items:new Map,first:null},T=(r&y)!==0;if(T){var p=i;s=D?X(ne(p)):p.appendChild(G())}D&&fe();var o=null,C=!1,A=new Map,M=le(()=>{var _=e();return oe(_)?_:_==null?[]:K(_)}),n,t;function l(){xe(t,n,h,A,s,v,r,u,e),d!==null&&(n.length===0?o?$(o):o=J(()=>d(s)):o!==null&&ce(o,()=>{o=null}))}re(()=>{t??=Ae,n=Q(M);var _=n.length;if(C&&_===0)return;C=_===0;let m=!1;if(D){var I=ie(s)===se;I!==(_===0)&&(s=W(),X(s),g(!1),m=!0)}if(D){for(var x=null,c,a=0;a<_;a++){if(O.nodeType===ue&&O.data===te){s=O,m=!0,g(!1);break}var f=n[a],E=u(f,a);c=P(O,h,x,null,f,E,a,v,r,e),h.items.set(E,c),x=c}_>0&&X(W())}if(D)_===0&&d&&(o=J(()=>d(s)));else if(ve()){var H=new Set,b=de;for(a=0;a<_;a+=1){f=n[a],E=u(f,a);var S=h.items.get(E)??A.get(E);S?(r&(Y|V))!==0&&j(S,f,a,r):(c=P(null,h,null,null,f,E,a,v,r,e,!0),A.set(E,c)),H.add(E)}for(const[N,L]of h.items)H.has(N)||b.skipped_effects.add(L.e);b.add_callback(l)}else l();m&&g(!0),Q(M)}),D&&(s=O)}function xe(i,r,e,u,v,d,s,h,T){var p=(s&Ne)!==0,o=(s&(Y|V))!==0,C=r.length,A=e.items,M=e.first,n=M,t,l=null,_,m=[],I=[],x,c,a,f;if(p)for(f=0;f<C;f+=1)x=r[f],c=h(x,f),a=A.get(c),a!==void 0&&(a.a?.measure(),(_??=new Set).add(a));for(f=0;f<C;f+=1){if(x=r[f],c=h(x,f),a=A.get(c),a===void 0){var E=u.get(c);if(E!==void 0){u.delete(c),A.set(c,E);var H=l?l.next:n;w(e,l,E),w(e,E,H),F(E,H,v),l=E}else{var b=n?n.e.nodes_start:v;l=P(b,e,l,l===null?e.first:l.next,x,c,f,d,s,T)}A.set(c,l),m=[],I=[],n=l.next;continue}if(o&&j(a,x,f,s),(a.e.f&B)!==0&&($(a.e),p&&(a.a?.unfix(),(_??=new Set).delete(a))),a!==n){if(t!==void 0&&t.has(a)){if(m.length<I.length){var S=I[0],N;l=S.prev;var L=m[0],q=m[m.length-1];for(N=0;N<m.length;N+=1)F(m[N],S,v);for(N=0;N<I.length;N+=1)t.delete(I[N]);w(e,L.prev,q.next),w(e,l,L),w(e,q,S),n=S,l=q,f-=1,m=[],I=[]}else t.delete(a),F(a,n,v),w(e,a.prev,a.next),w(e,a,l===null?e.first:l.next),w(e,l,a),l=a;continue}for(m=[],I=[];n!==null&&n.k!==c;)(n.e.f&B)===0&&(t??=new Set).add(n),I.push(n),n=n.next;if(n===null)continue;a=n}m.push(a),l=a,n=a.next}if(n!==null||t!==void 0){for(var R=t===void 0?[]:K(t);n!==null;)(n.e.f&B)===0&&R.push(n),n=n.next;var U=R.length;if(U>0){var ee=(s&y)!==0&&C===0?v:null;if(p){for(f=0;f<U;f+=1)R[f].a?.measure();for(f=0;f<U;f+=1)R[f].a?.fix()}we(e,R,ee)}}p&&Ie(()=>{if(_!==void 0)for(a of _)a.a?.apply()}),i.first=e.first&&e.first.e,i.last=l&&l.e;for(var ae of u.values())k(ae.e);u.clear()}function j(i,r,e,u){(u&Y)!==0&&Z(i.v,r),(u&V)!==0?Z(i.i,e):i.i=e}function P(i,r,e,u,v,d,s,h,T,p,o){var C=(T&Y)!==0,A=(T&he)===0,M=C?A?_e(v,!1,!1):z(v):v,n=(T&V)===0?s:z(s),t={i:n,v:M,k:d,a:null,e:null,prev:e,next:u};try{if(i===null){var l=document.createDocumentFragment();l.append(i=G())}return t.e=J(()=>h(i,M,n,p),D),t.e.prev=e&&e.e,t.e.next=u&&u.e,e===null?o||(r.first=t):(e.next=t,e.e.next=t.e),u!==null&&(u.prev=t,u.e.prev=t.e),t}finally{}}function F(i,r,e){for(var u=i.next?i.next.e.nodes_start:e,v=r?r.e.nodes_start:e,d=i.e.nodes_start;d!==null&&d!==u;){var s=Ee(d);v.before(d),d=s}}function w(i,r,e){r===null?i.first=e:(r.next=e,r.e.next=e&&e.e),e!==null&&(e.prev=r,e.e.prev=r&&r.e)}export{Se as e,Me as i};
import{L as G,J as re,R as X,H as D,S as ne,I as fe,g as Q,v as le,T as ie,U as se,V as W,W as g,P as O,X as ue,Y as te,M as J,O as ve,N as de,Z,m as _e,_ as z,a0 as K,a1 as oe,a2 as V,a3 as $,Q as ce,a4 as Y,a5 as he,a6 as B,a7 as k,a8 as Ee,a9 as me,aa as pe,ab as Te,ac as Ae,ad as y,ae as Ie,af as Ne}from"./DniTuB_0.js";function Me(i,r){return r}function we(i,r,e){for(var u=i.items,v=[],d=r.length,s=0;s<d;s++)me(r[s].e,v,!0);var h=d>0&&v.length===0&&e!==null;if(h){var T=e.parentNode;pe(T),T.append(e),u.clear(),w(i,r[0].prev,r[d-1].next)}Te(v,()=>{for(var p=0;p<d;p++){var o=r[p];h||(u.delete(o.k),w(i,o.prev,o.next)),k(o.e,!h)}})}function Se(i,r,e,u,v,d=null){var s=i,h={flags:r,items:new Map,first:null},T=(r&y)!==0;if(T){var p=i;s=D?X(ne(p)):p.appendChild(G())}D&&fe();var o=null,C=!1,A=new Map,M=le(()=>{var _=e();return oe(_)?_:_==null?[]:K(_)}),n,t;function l(){xe(t,n,h,A,s,v,r,u,e),d!==null&&(n.length===0?o?$(o):o=J(()=>d(s)):o!==null&&ce(o,()=>{o=null}))}re(()=>{t??=Ae,n=Q(M);var _=n.length;if(C&&_===0)return;C=_===0;let m=!1;if(D){var I=ie(s)===se;I!==(_===0)&&(s=W(),X(s),g(!1),m=!0)}if(D){for(var x=null,c,a=0;a<_;a++){if(O.nodeType===ue&&O.data===te){s=O,m=!0,g(!1);break}var f=n[a],E=u(f,a);c=P(O,h,x,null,f,E,a,v,r,e),h.items.set(E,c),x=c}_>0&&X(W())}if(D)_===0&&d&&(o=J(()=>d(s)));else if(ve()){var H=new Set,b=de;for(a=0;a<_;a+=1){f=n[a],E=u(f,a);var S=h.items.get(E)??A.get(E);S?(r&(Y|V))!==0&&j(S,f,a,r):(c=P(null,h,null,null,f,E,a,v,r,e,!0),A.set(E,c)),H.add(E)}for(const[N,L]of h.items)H.has(N)||b.skipped_effects.add(L.e);b.add_callback(l)}else l();m&&g(!0),Q(M)}),D&&(s=O)}function xe(i,r,e,u,v,d,s,h,T){var p=(s&Ne)!==0,o=(s&(Y|V))!==0,C=r.length,A=e.items,M=e.first,n=M,t,l=null,_,m=[],I=[],x,c,a,f;if(p)for(f=0;f<C;f+=1)x=r[f],c=h(x,f),a=A.get(c),a!==void 0&&(a.a?.measure(),(_??=new Set).add(a));for(f=0;f<C;f+=1){if(x=r[f],c=h(x,f),a=A.get(c),a===void 0){var E=u.get(c);if(E!==void 0){u.delete(c),A.set(c,E);var H=l?l.next:n;w(e,l,E),w(e,E,H),F(E,H,v),l=E}else{var b=n?n.e.nodes_start:v;l=P(b,e,l,l===null?e.first:l.next,x,c,f,d,s,T)}A.set(c,l),m=[],I=[],n=l.next;continue}if(o&&j(a,x,f,s),(a.e.f&B)!==0&&($(a.e),p&&(a.a?.unfix(),(_??=new Set).delete(a))),a!==n){if(t!==void 0&&t.has(a)){if(m.length<I.length){var S=I[0],N;l=S.prev;var L=m[0],q=m[m.length-1];for(N=0;N<m.length;N+=1)F(m[N],S,v);for(N=0;N<I.length;N+=1)t.delete(I[N]);w(e,L.prev,q.next),w(e,l,L),w(e,q,S),n=S,l=q,f-=1,m=[],I=[]}else t.delete(a),F(a,n,v),w(e,a.prev,a.next),w(e,a,l===null?e.first:l.next),w(e,l,a),l=a;continue}for(m=[],I=[];n!==null&&n.k!==c;)(n.e.f&B)===0&&(t??=new Set).add(n),I.push(n),n=n.next;if(n===null)continue;a=n}m.push(a),l=a,n=a.next}if(n!==null||t!==void 0){for(var R=t===void 0?[]:K(t);n!==null;)(n.e.f&B)===0&&R.push(n),n=n.next;var U=R.length;if(U>0){var ee=(s&y)!==0&&C===0?v:null;if(p){for(f=0;f<U;f+=1)R[f].a?.measure();for(f=0;f<U;f+=1)R[f].a?.fix()}we(e,R,ee)}}p&&Ie(()=>{if(_!==void 0)for(a of _)a.a?.apply()}),i.first=e.first&&e.first.e,i.last=l&&l.e;for(var ae of u.values())k(ae.e);u.clear()}function j(i,r,e,u){(u&Y)!==0&&Z(i.v,r),(u&V)!==0?Z(i.i,e):i.i=e}function P(i,r,e,u,v,d,s,h,T,p,o){var C=(T&Y)!==0,A=(T&he)===0,M=C?A?_e(v,!1,!1):z(v):v,n=(T&V)===0?s:z(s),t={i:n,v:M,k:d,a:null,e:null,prev:e,next:u};try{if(i===null){var l=document.createDocumentFragment();l.append(i=G())}return t.e=J(()=>h(i,M,n,p),D),t.e.prev=e&&e.e,t.e.next=u&&u.e,e===null?o||(r.first=t):(e.next=t,e.e.next=t.e),u!==null&&(u.prev=t,u.e.prev=t.e),t}finally{}}function F(i,r,e){for(var u=i.next?i.next.e.nodes_start:e,v=r?r.e.nodes_start:e,d=i.e.nodes_start;d!==null&&d!==u;){var s=Ee(d);v.before(d),d=s}}function w(i,r,e){r===null?i.first=e:(r.next=e,r.e.next=e&&e.e),e!==null&&(e.prev=r,e.e.prev=r&&r.e)}export{Se as e,Me as i};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as E}from"./C7KraPli.js";import{p as H,E as L,f as h,t as f,b as c,c as z,d as e,r as a,s as x,e as d,z as M,D as q}from"./cPTQ2Ibn.js";import{p as i,i as C}from"./DqFqoVWr.js";import{B as F}from"./DAIx0GOW.js";var G=h('<div class="mt-4 sm:mt-0 flex items-center space-x-4"><!></div>'),I=h('<div class="sm:flex sm:items-center sm:justify-between"><div><h1 class="text-2xl font-bold text-gray-900 dark:text-white"> </h1> <p class="mt-2 text-sm text-gray-700 dark:text-gray-300"> </p></div> <!></div>');function S(u,t){H(t,!1);const _=L();let b=i(t,"title",8),k=i(t,"description",8),v=i(t,"actionLabel",8,null),g=i(t,"showAction",8,!0);function w(){_("action")}E();var r=I(),s=e(r),o=e(s),y=e(o,!0);a(o);var m=x(o,2),A=e(m,!0);a(m),a(s);var P=x(s,2);{var j=n=>{var l=G(),B=e(l);F(B,{variant:"primary",icon:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />',$$events:{click:w},children:(D,J)=>{M();var p=q();f(()=>d(p,v())),c(D,p)},$$slots:{default:!0}}),a(l),c(n,l)};C(P,n=>{g()&&v()&&n(j)})}a(r),f(()=>{d(y,b()),d(A,k())}),c(u,r),z()}export{S as P};
import"./DsnmJJEf.js";import{i as E}from"./TJn6xDN9.js";import{p as H,E as L,f as h,t as f,b as c,c as z,d as e,r as a,s as x,e as d,z as M,D as q}from"./DniTuB_0.js";import{p as i,i as C}from"./DbNhg6mG.js";import{B as F}from"./BZ2rxtTc.js";var G=h('<div class="mt-4 sm:mt-0 flex items-center space-x-4"><!></div>'),I=h('<div class="sm:flex sm:items-center sm:justify-between"><div><h1 class="text-2xl font-bold text-gray-900 dark:text-white"> </h1> <p class="mt-2 text-sm text-gray-700 dark:text-gray-300"> </p></div> <!></div>');function S(u,t){H(t,!1);const _=L();let b=i(t,"title",8),k=i(t,"description",8),v=i(t,"actionLabel",8,null),g=i(t,"showAction",8,!0);function w(){_("action")}E();var r=I(),s=e(r),o=e(s),y=e(o,!0);a(o);var m=x(o,2),A=e(m,!0);a(m),a(s);var P=x(s,2);{var j=n=>{var l=G(),B=e(l);F(B,{variant:"primary",icon:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />',$$events:{click:w},children:(D,J)=>{M();var p=q();f(()=>d(p,v())),c(D,p)},$$slots:{default:!0}}),a(l),c(n,l)};C(P,n=>{g()&&v()&&n(j)})}a(r),f(()=>{d(y,b()),d(A,k())}),c(u,r),z()}export{S as P};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as q}from"./C7KraPli.js";import{p as A,E as F,f as y,s as l,d as t,r as a,z as $,D as b,b as o,t as p,e as n,c as G}from"./cPTQ2Ibn.js";import{p as v,i as H}from"./DqFqoVWr.js";import{M as I}from"./CcMEt8CV.js";import{B as w}from"./DAIx0GOW.js";var J=y('<p class="mt-1 font-medium text-gray-900 dark:text-white"> </p>'),K=y('<div class="max-w-xl w-full p-6"><div class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-red-900 mb-4"><svg class="h-6 w-6 text-red-600 dark:text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg></div> <div class="text-center"><h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white mb-2"> </h3> <div class="text-sm text-gray-500 dark:text-gray-400"><p> </p> <!></div></div> <div class="mt-6 flex justify-end space-x-3"><!> <!></div></div>');function W(D,s){A(s,!1);let M=v(s,"title",8),j=v(s,"message",8),g=v(s,"itemName",8,""),d=v(s,"loading",8,!1);const c=F();function B(){c("confirm")}q(),I(D,{$$events:{close:()=>c("close")},children:(C,O)=>{var m=K(),f=l(t(m),2),u=t(f),P=t(u,!0);a(u);var h=l(u,2),x=t(h),z=t(x,!0);a(x);var E=l(x,2);{var L=e=>{var i=J(),r=t(i,!0);a(i),p(()=>n(r,g())),o(e,i)};H(E,e=>{g()&&e(L)})}a(h),a(f);var _=l(f,2),k=t(_);w(k,{variant:"secondary",get disabled(){return d()},$$events:{click:()=>c("close")},children:(e,i)=>{$();var r=b("Cancel");o(e,r)},$$slots:{default:!0}});var N=l(k,2);w(N,{variant:"danger",get disabled(){return d()},get loading(){return d()},$$events:{click:B},children:(e,i)=>{$();var r=b();p(()=>n(r,d()?"Deleting...":"Delete")),o(e,r)},$$slots:{default:!0}}),a(_),a(m),p(()=>{n(P,M()),n(z,j())}),o(C,m)},$$slots:{default:!0}}),G()}export{W as D};
import"./DsnmJJEf.js";import{i as q}from"./TJn6xDN9.js";import{p as A,E as F,f as y,s as l,d as t,r as a,z as $,D as b,b as o,t as p,e as n,c as G}from"./DniTuB_0.js";import{p as v,i as H}from"./DbNhg6mG.js";import{M as I}from"./CHjY0Kaf.js";import{B as w}from"./BZ2rxtTc.js";var J=y('<p class="mt-1 font-medium text-gray-900 dark:text-white"> </p>'),K=y('<div class="max-w-xl w-full p-6"><div class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-red-900 mb-4"><svg class="h-6 w-6 text-red-600 dark:text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg></div> <div class="text-center"><h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white mb-2"> </h3> <div class="text-sm text-gray-500 dark:text-gray-400"><p> </p> <!></div></div> <div class="mt-6 flex justify-end space-x-3"><!> <!></div></div>');function W(D,s){A(s,!1);let M=v(s,"title",8),j=v(s,"message",8),g=v(s,"itemName",8,""),d=v(s,"loading",8,!1);const c=F();function B(){c("confirm")}q(),I(D,{$$events:{close:()=>c("close")},children:(C,O)=>{var m=K(),f=l(t(m),2),u=t(f),P=t(u,!0);a(u);var h=l(u,2),x=t(h),z=t(x,!0);a(x);var E=l(x,2);{var L=e=>{var i=J(),r=t(i,!0);a(i),p(()=>n(r,g())),o(e,i)};H(E,e=>{g()&&e(L)})}a(h),a(f);var _=l(f,2),k=t(_);w(k,{variant:"secondary",get disabled(){return d()},$$events:{click:()=>c("close")},children:(e,i)=>{$();var r=b("Cancel");o(e,r)},$$slots:{default:!0}});var N=l(k,2);w(N,{variant:"danger",get disabled(){return d()},get loading(){return d()},$$events:{click:B},children:(e,i)=>{$();var r=b();p(()=>n(r,d()?"Deleting...":"Delete")),o(e,r)},$$slots:{default:!0}}),a(_),a(m),p(()=>{n(P,M()),n(z,j())}),o(C,m)},$$slots:{default:!0}}),G()}export{W as D};

View file

@ -1 +1 @@
import{s as e}from"./BWm3MK7c.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
import{s as e}from"./HMJxCnAR.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as _}from"./C7KraPli.js";import{p as k,f as E,t as C,u as i,q as t,e as f,b as P,c as j,s as q,d as l,r as o}from"./cPTQ2Ibn.js";import{c as z}from"./DAIx0GOW.js";import{p as n}from"./DqFqoVWr.js";import{j as x,e as c,i as u}from"./BW-Jb4Ad.js";var N=E('<div class="flex flex-col"><a class="text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300"> </a> <span class="text-xs text-gray-500 dark:text-gray-400 capitalize"> </span></div>');function F(d,r){k(r,!1);let e=n(r,"item",8),m=n(r,"eagerCache",8,null);_();var s=N(),a=l(s),v=l(a,!0);o(a);var p=q(a,2),g=l(p,!0);o(p),o(s),C((h,b,y)=>{z(a,"href",h),f(v,b),f(g,y)},[()=>(t(x),t(e()),i(()=>x(e()))),()=>(t(c),t(e()),t(m()),i(()=>c(e(),m()))),()=>(t(u),t(e()),i(()=>u(e())))]),P(d,s),j()}export{F as P};
import"./DsnmJJEf.js";import{i as _}from"./TJn6xDN9.js";import{p as k,f as E,t as C,u as i,q as t,e as f,b as P,c as j,s as q,d as l,r as o}from"./DniTuB_0.js";import{c as z}from"./BZ2rxtTc.js";import{p as n}from"./DbNhg6mG.js";import{j as x,e as c,i as u}from"./CTcPpzia.js";var N=E('<div class="flex flex-col"><a class="text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300"> </a> <span class="text-xs text-gray-500 dark:text-gray-400 capitalize"> </span></div>');function F(d,r){k(r,!1);let e=n(r,"item",8),m=n(r,"eagerCache",8,null);_();var s=N(),a=l(s),v=l(a,!0);o(a);var p=q(a,2),g=l(p,!0);o(p),o(s),C((h,b,y)=>{z(a,"href",h),f(v,b),f(g,y)},[()=>(t(x),t(e()),i(()=>x(e()))),()=>(t(c),t(e()),t(m()),i(()=>c(e(),m()))),()=>(t(u),t(e()),i(()=>u(e())))]),P(d,s),j()}export{F as P};

View file

@ -0,0 +1 @@
import"./DsnmJJEf.js";import"./TJn6xDN9.js";import{f as l,s as h,d as n,r as f,t as N,e as w,b as r,A as x,a as y}from"./DniTuB_0.js";import{p,i as b}from"./DbNhg6mG.js";import{s as O}from"./BZ2rxtTc.js";var P=l('<div class="absolute top-full left-1/2 transform -translate-x-1/2 border-4 border-transparent border-t-gray-900"></div>'),Q=l('<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 border-4 border-transparent border-b-gray-900"></div>'),R=l('<div class="absolute right-full top-1/2 transform -translate-y-1/2 border-4 border-transparent border-l-gray-900"></div>'),S=l('<div class="absolute left-full top-1/2 transform -translate-y-1/2 border-4 border-transparent border-r-gray-900"></div>'),U=l('<div class="relative group"><svg class="w-3 h-3 text-gray-400 cursor-help" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <div><div class="font-semibold mb-1"> </div> <div class="text-gray-300"> </div> <!></div></div>');function $(k,s){let z=p(s,"title",8),M=p(s,"content",8),t=p(s,"position",8,"top"),T=p(s,"width",8,"w-80");var m=U(),u=h(n(m),2),_=n(u),j=n(_,!0);f(_);var c=h(_,2),A=n(c,!0);f(c);var B=h(c,2);{var C=a=>{var i=P();r(a,i)},q=a=>{var i=x(),D=y(i);{var E=o=>{var v=Q();r(o,v)},F=o=>{var v=x(),G=y(v);{var H=e=>{var d=R();r(e,d)},I=e=>{var d=x(),J=y(d);{var K=g=>{var L=S();r(g,L)};b(J,g=>{t()==="right"&&g(K)},!0)}r(e,d)};b(G,e=>{t()==="left"?e(H):e(I,!1)},!0)}r(o,v)};b(D,o=>{t()==="bottom"?o(E):o(F,!1)},!0)}r(a,i)};b(B,a=>{t()==="top"?a(C):a(q,!1)})}f(u),f(m),N(()=>{O(u,1,`absolute ${t()==="top"?"bottom-full":t()==="bottom"?"top-full":t()==="left"?"right-full top-1/2 -translate-y-1/2":"left-full top-1/2 -translate-y-1/2"} left-1/2 transform -translate-x-1/2 ${t()==="top"?"mb-2":t()==="bottom"?"mt-2":"mx-2"} ${T()??""} p-3 bg-gray-900 text-white text-xs rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50`),w(j,z()),w(A,M())}),r(k,m)}export{$ as T};

View file

@ -1 +1 @@
import{J as Y,H as T,I as C,K as F,T as j,U as G,V as H,R as $,W as x,L as q,M as A,N as z,at as J,O as Z,a3 as Q,Q as V,P as W,au as D,m as X,av as k,k as U,G as ee,g as P,aw as re,ax as ne,ay as w,az as se,aA as M,ar as ae,v as ie,aB as te,ac as R,aC as ue,_ as fe,aD as le,u as oe,aE as ce,aF as de,aG as _e,aH as N,aI as L,aJ as pe,aK as ve,ai as B,aL as K,aM as m}from"./cPTQ2Ibn.js";function Ie(e,r,s=!1){T&&C();var n=e,a=null,i=null,l=J,d=s?F:0,p=!1;const S=(o,u=!0)=>{p=!0,_(u,o)};var f=null;function I(){f!==null&&(f.lastChild.remove(),n.before(f),f=null);var o=l?a:i,u=l?i:a;o&&Q(o),u&&V(u,()=>{l?i=null:a=null})}const _=(o,u)=>{if(l===(l=o))return;let g=!1;if(T){const E=j(n)===G;!!l===E&&(n=H(),$(n),x(!1),g=!0)}var b=Z(),c=n;if(b&&(f=document.createDocumentFragment(),f.append(c=q())),l?a??=u&&A(()=>u(c)):i??=u&&A(()=>u(c)),b){var h=z,t=l?a:i,v=l?i:a;t&&h.skipped_effects.delete(t),v&&h.skipped_effects.add(v),h.add_callback(I)}else I();g&&x(!0)};Y(()=>{p=!1,r(S),p||_(null,null)},d),T&&(n=W)}let O=!1,y=Symbol();function ge(e,r,s){const n=s[r]??={store:null,source:X(void 0),unsubscribe:D};if(n.store!==e&&!(y in s))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=D;else{var a=!0;n.unsubscribe=k(e,i=>{a?n.source.v=i:U(n.source,i)}),a=!1}return e&&y in s?ee(e):P(n.source)}function Ee(){const e={};function r(){re(()=>{for(var s in e)e[s].unsubscribe();ne(e,y,{enumerable:!1,value:!0})})}return[e,r]}function be(e){var r=O;try{return O=!1,[e(),O]}finally{O=r}}const he={get(e,r){if(!e.exclude.includes(r))return P(e.version),r in e.special?e.special[r]():e.props[r]},set(e,r,s){if(!(r in e.special)){var n=R;try{L(e.parent_effect),e.special[r]=Pe({get[r](){return e.props[r]}},r,M)}finally{L(n)}}return e.special[r](s),N(e.version),!0},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},deleteProperty(e,r){return e.exclude.includes(r)||(e.exclude.push(r),N(e.version)),!0},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function Oe(e,r){return new Proxy({props:e,exclude:r,special:{},version:fe(0),parent_effect:R},he)}const me={get(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(m(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n)return n[r]}},set(e,r,s){let n=e.props.length;for(;n--;){let a=e.props[n];m(a)&&(a=a());const i=w(a,r);if(i&&i.set)return i.set(s),!0}return!1},getOwnPropertyDescriptor(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(m(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n){const a=w(n,r);return a&&!a.configurable&&(a.configurable=!0),a}}},has(e,r){if(r===B||r===K)return!1;for(let s of e.props)if(m(s)&&(s=s()),s!=null&&r in s)return!0;return!1},ownKeys(e){const r=[];for(let s of e.props)if(m(s)&&(s=s()),!!s){for(const n in s)r.includes(n)||r.push(n);for(const n of Object.getOwnPropertySymbols(s))r.includes(n)||r.push(n)}return r}};function Te(...e){return new Proxy({props:e},me)}function Pe(e,r,s,n){var a=!ce||(s&de)!==0,i=(s&le)!==0,l=(s&pe)!==0,d=n,p=!0,S=()=>(p&&(p=!1,d=l?oe(n):n),d),f;if(i){var I=B in e||K in e;f=w(e,r)?.set??(I&&r in e?t=>e[r]=t:void 0)}var _,o=!1;i?[_,o]=be(()=>e[r]):_=e[r],_===void 0&&n!==void 0&&(_=S(),f&&(a&&se(),f(_)));var u;if(a?u=()=>{var t=e[r];return t===void 0?S():(p=!0,t)}:u=()=>{var t=e[r];return t!==void 0&&(d=void 0),t===void 0?d:t},a&&(s&M)===0)return u;if(f){var g=e.$$legacy;return function(t,v){return arguments.length>0?((!a||!v||g||o)&&f(v?u():t),t):u()}}var b=!1,c=((s&_e)!==0?ae:ie)(()=>(b=!1,u()));i&&P(c);var h=R;return function(t,v){if(arguments.length>0){const E=v?P(c):a&&i?te(t):t;return U(c,E),b=!0,d!==void 0&&(d=E),t}return ve&&b||(h.f&ue)!==0?c.v:P(c)}}export{ge as a,Te as b,Ie as i,Oe as l,Pe as p,Ee as s};
import{J as Y,H as T,I as C,K as F,T as j,U as G,V as H,R as $,W as x,L as q,M as A,N as z,at as J,O as Z,a3 as Q,Q as V,P as W,au as D,m as X,av as k,k as U,G as ee,g as P,aw as re,ax as ne,ay as w,az as se,aA as M,ar as ae,v as ie,aB as te,ac as R,aC as ue,_ as fe,aD as le,u as oe,aE as ce,aF as de,aG as _e,aH as N,aI as L,aJ as pe,aK as ve,ai as B,aL as K,aM as m}from"./DniTuB_0.js";function Ie(e,r,s=!1){T&&C();var n=e,a=null,i=null,l=J,d=s?F:0,p=!1;const S=(o,u=!0)=>{p=!0,_(u,o)};var f=null;function I(){f!==null&&(f.lastChild.remove(),n.before(f),f=null);var o=l?a:i,u=l?i:a;o&&Q(o),u&&V(u,()=>{l?i=null:a=null})}const _=(o,u)=>{if(l===(l=o))return;let g=!1;if(T){const E=j(n)===G;!!l===E&&(n=H(),$(n),x(!1),g=!0)}var b=Z(),c=n;if(b&&(f=document.createDocumentFragment(),f.append(c=q())),l?a??=u&&A(()=>u(c)):i??=u&&A(()=>u(c)),b){var h=z,t=l?a:i,v=l?i:a;t&&h.skipped_effects.delete(t),v&&h.skipped_effects.add(v),h.add_callback(I)}else I();g&&x(!0)};Y(()=>{p=!1,r(S),p||_(null,null)},d),T&&(n=W)}let O=!1,y=Symbol();function ge(e,r,s){const n=s[r]??={store:null,source:X(void 0),unsubscribe:D};if(n.store!==e&&!(y in s))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=D;else{var a=!0;n.unsubscribe=k(e,i=>{a?n.source.v=i:U(n.source,i)}),a=!1}return e&&y in s?ee(e):P(n.source)}function Ee(){const e={};function r(){re(()=>{for(var s in e)e[s].unsubscribe();ne(e,y,{enumerable:!1,value:!0})})}return[e,r]}function be(e){var r=O;try{return O=!1,[e(),O]}finally{O=r}}const he={get(e,r){if(!e.exclude.includes(r))return P(e.version),r in e.special?e.special[r]():e.props[r]},set(e,r,s){if(!(r in e.special)){var n=R;try{L(e.parent_effect),e.special[r]=Pe({get[r](){return e.props[r]}},r,M)}finally{L(n)}}return e.special[r](s),N(e.version),!0},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},deleteProperty(e,r){return e.exclude.includes(r)||(e.exclude.push(r),N(e.version)),!0},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function Oe(e,r){return new Proxy({props:e,exclude:r,special:{},version:fe(0),parent_effect:R},he)}const me={get(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(m(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n)return n[r]}},set(e,r,s){let n=e.props.length;for(;n--;){let a=e.props[n];m(a)&&(a=a());const i=w(a,r);if(i&&i.set)return i.set(s),!0}return!1},getOwnPropertyDescriptor(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(m(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n){const a=w(n,r);return a&&!a.configurable&&(a.configurable=!0),a}}},has(e,r){if(r===B||r===K)return!1;for(let s of e.props)if(m(s)&&(s=s()),s!=null&&r in s)return!0;return!1},ownKeys(e){const r=[];for(let s of e.props)if(m(s)&&(s=s()),!!s){for(const n in s)r.includes(n)||r.push(n);for(const n of Object.getOwnPropertySymbols(s))r.includes(n)||r.push(n)}return r}};function Te(...e){return new Proxy({props:e},me)}function Pe(e,r,s,n){var a=!ce||(s&de)!==0,i=(s&le)!==0,l=(s&pe)!==0,d=n,p=!0,S=()=>(p&&(p=!1,d=l?oe(n):n),d),f;if(i){var I=B in e||K in e;f=w(e,r)?.set??(I&&r in e?t=>e[r]=t:void 0)}var _,o=!1;i?[_,o]=be(()=>e[r]):_=e[r],_===void 0&&n!==void 0&&(_=S(),f&&(a&&se(),f(_)));var u;if(a?u=()=>{var t=e[r];return t===void 0?S():(p=!0,t)}:u=()=>{var t=e[r];return t!==void 0&&(d=void 0),t===void 0?d:t},a&&(s&M)===0)return u;if(f){var g=e.$$legacy;return function(t,v){return arguments.length>0?((!a||!v||g||o)&&f(v?u():t),t):u()}}var b=!1,c=((s&_e)!==0?ae:ie)(()=>(b=!1,u()));i&&P(c);var h=R;return function(t,v){if(arguments.length>0){const E=v?P(c):a&&i?te(t):t;return U(c,E),b=!0,d!==void 0&&(d=E),t}return ve&&b||(h.f&ue)!==0?c.v:P(c)}}export{ge as a,Te as b,Ie as i,Oe as l,Pe as p,Ee as s};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as R}from"./C7KraPli.js";import{p as j,l as w,h as A,f as g,t as k,b as v,c as B,s as D,d as u,k as _,m as y,r as m,q as f,u as h,g as d,e as U}from"./cPTQ2Ibn.js";import{p as o,i as F}from"./DqFqoVWr.js";import{c as b,s as G,d as n}from"./DAIx0GOW.js";var H=g('<div class="text-sm text-gray-500 dark:text-gray-400 truncate"> </div>'),J=g('<div class="w-full min-w-0 text-sm font-medium"><a> </a><!></div>');function V(x,a){j(a,!1);const i=y(),p=y();let e=o(a,"item",8),s=o(a,"entityType",8,"repository"),E=o(a,"showOwner",8,!1),I=o(a,"showId",8,!1),z=o(a,"fontMono",8,!1);function C(){if(!e())return"Unknown";switch(s()){case"repository":return E()?`${e().owner||"Unknown"}/${e().name||"Unknown"}`:e().name||"Unknown";case"organization":case"enterprise":return e().name||"Unknown";case"pool":return I()?e().id||"Unknown":e().name||"Unknown";case"scaleset":return e().name||"Unknown";case"instance":return e().name||"Unknown";case"template":return e().name||"Unknown";default:return e().name||e().id||"Unknown"}}function M(){if(!e())return"#";let t;switch(s()){case"instance":t=e().name;break;default:t=e().id||e().name;break}if(!t)return"#";switch(s()){case"repository":return n(`/repositories/${t}`);case"organization":return n(`/organizations/${t}`);case"enterprise":return n(`/enterprises/${t}`);case"pool":return n(`/pools/${t}`);case"scaleset":return n(`/scalesets/${t}`);case"instance":return n(`/instances/${encodeURIComponent(t)}`);case"template":return n(`/templates/${t}`);default:return"#"}}w(()=>{},()=>{_(i,C())}),w(()=>{},()=>{_(p,M())}),A(),R();var c=J(),r=u(c),N=u(r,!0);m(r);var O=D(r);{var T=t=>{var l=H(),q=u(l,!0);m(l),k(()=>U(q,(f(e()),h(()=>e().provider_id)))),v(t,l)};F(O,t=>{f(s()),f(e()),h(()=>s()==="instance"&&e()?.provider_id)&&t(T)})}m(c),k(()=>{b(r,"href",d(p)),G(r,1,`block w-full truncate text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 ${z()?"font-mono":""}`),b(r,"title",d(i)),U(N,d(i))}),v(x,c),B()}export{V as E};
import"./DsnmJJEf.js";import{i as R}from"./TJn6xDN9.js";import{p as j,l as w,h as A,f as g,t as k,b as v,c as B,s as D,d as u,k as _,m as y,r as m,q as f,u as h,g as d,e as U}from"./DniTuB_0.js";import{p as o,i as F}from"./DbNhg6mG.js";import{c as b,s as G,d as n}from"./BZ2rxtTc.js";var H=g('<div class="text-sm text-gray-500 dark:text-gray-400 truncate"> </div>'),J=g('<div class="w-full min-w-0 text-sm font-medium"><a> </a><!></div>');function V(x,a){j(a,!1);const i=y(),p=y();let e=o(a,"item",8),s=o(a,"entityType",8,"repository"),E=o(a,"showOwner",8,!1),I=o(a,"showId",8,!1),z=o(a,"fontMono",8,!1);function C(){if(!e())return"Unknown";switch(s()){case"repository":return E()?`${e().owner||"Unknown"}/${e().name||"Unknown"}`:e().name||"Unknown";case"organization":case"enterprise":return e().name||"Unknown";case"pool":return I()?e().id||"Unknown":e().name||"Unknown";case"scaleset":return e().name||"Unknown";case"instance":return e().name||"Unknown";case"template":return e().name||"Unknown";default:return e().name||e().id||"Unknown"}}function M(){if(!e())return"#";let t;switch(s()){case"instance":t=e().name;break;default:t=e().id||e().name;break}if(!t)return"#";switch(s()){case"repository":return n(`/repositories/${t}`);case"organization":return n(`/organizations/${t}`);case"enterprise":return n(`/enterprises/${t}`);case"pool":return n(`/pools/${t}`);case"scaleset":return n(`/scalesets/${t}`);case"instance":return n(`/instances/${encodeURIComponent(t)}`);case"template":return n(`/templates/${t}`);default:return"#"}}w(()=>{},()=>{_(i,C())}),w(()=>{},()=>{_(p,M())}),A(),R();var c=J(),r=u(c),N=u(r,!0);m(r);var O=D(r);{var T=t=>{var l=H(),q=u(l,!0);m(l),k(()=>U(q,(f(e()),h(()=>e().provider_id)))),v(t,l)};F(O,t=>{f(s()),f(e()),h(()=>s()==="instance"&&e()?.provider_id)&&t(T)})}m(c),k(()=>{b(r,"href",d(p)),G(r,1,`block w-full truncate text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 ${z()?"font-mono":""}`),b(r,"title",d(i)),U(N,d(i))}),v(x,c),B()}export{V as E};

View file

@ -1 +1 @@
import{F as C}from"./cPTQ2Ibn.js";function x(){const{subscribe:E,set:L,update:s}=C({connected:!1,connecting:!1,error:null,lastEvent:null});let e=null,b=0,W=50,k=1e3,f=1e3,m=3e4,d=null,r=[],i=!1;const l=new Map;function N(){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/api/v1/ws/events`}function u(){if(!(e&&(e.readyState===WebSocket.CONNECTING||e.readyState===WebSocket.OPEN))){i=!1,s(t=>({...t,connecting:!0,error:null}));try{const t=N();e=new WebSocket(t);const n=setTimeout(()=>{e&&e.readyState===WebSocket.CONNECTING&&e.close()},1e4);e.onopen=()=>{clearTimeout(n),b=0,f=k,s(a=>({...a,connected:!0,connecting:!1,error:null})),r.length>0&&g(r)},e.onmessage=a=>{try{const c=JSON.parse(a.data);s(o=>({...o,lastEvent:c})),(l.get(c["entity-type"])||[]).forEach(o=>{try{o(c)}catch(w){console.error("[WebSocket] Error in event callback:",w)}})}catch(c){console.error("[WebSocket] Error parsing message:",c)}},e.onclose=a=>{clearTimeout(n);const c=a.code===1e3&&i,S=a.code!==1e3?`Connection closed: ${a.reason||"Unknown reason"}`:null;s(o=>({...o,connected:!1,connecting:!1,error:S})),c||h()},e.onerror=a=>{clearTimeout(n),s(c=>({...c,connected:!1,connecting:!1,error:"WebSocket connection error"})),i||h()}}catch(t){s(n=>({...n,connected:!1,connecting:!1,error:t instanceof Error?t.message:"Failed to connect"}))}}}function M(){}function F(){}function h(){if(i)return;d&&clearTimeout(d),b++,b>W&&(b=1,f=k);const t=Math.min(f,m);d=window.setTimeout(()=>{if(!i){u();const n=Math.random()*1e3;f=Math.min(f*1.5+n,m)}},t)}function g(t){if(e&&e.readyState===WebSocket.OPEN){const n={"send-everything":!1,filters:t};e.send(JSON.stringify(n)),r=[...t]}}function y(){i=!0,d&&(clearTimeout(d),d=null),e&&(e.close(1e3,"Manual disconnect"),e=null),l.clear(),r=[],s(t=>({...t,connected:!1,connecting:!1,error:null,lastEvent:null}))}function O(){navigator.onLine&&!i&&setTimeout(()=>{(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&(b=0,f=k,u())},2e3)}typeof window<"u"&&(window.addEventListener("online",O),window.addEventListener("offline",()=>{s(t=>({...t,error:"Network offline"}))}),setInterval(()=>{i||(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&u()},1e4));function v(t,n,a){l.has(t)||l.set(t,[]),l.get(t).push(a);const c=r.findIndex(o=>o["entity-type"]===t),S={"entity-type":t,operations:n};if(c>=0){const o=r[c].operations;S.operations=Array.from(new Set([...o,...n])),r[c]=S}else r.push(S);return e&&e.readyState===WebSocket.OPEN&&g(r),(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&u(),()=>{const o=l.get(t);if(o){const w=o.indexOf(a);if(w>-1&&o.splice(w,1),o.length===0){l.delete(t);const p=r.findIndex(I=>I["entity-type"]===t);p>-1&&(r.splice(p,1),e&&e.readyState===WebSocket.OPEN&&g(r))}}}}return typeof window<"u"&&u(),{subscribe:E,connect:u,disconnect:y,subscribeToEntity:v}}const D=x();export{D as w};
import{F as C}from"./DniTuB_0.js";function x(){const{subscribe:E,set:L,update:s}=C({connected:!1,connecting:!1,error:null,lastEvent:null});let e=null,b=0,W=50,k=1e3,f=1e3,m=3e4,d=null,r=[],i=!1;const l=new Map;function N(){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/api/v1/ws/events`}function u(){if(!(e&&(e.readyState===WebSocket.CONNECTING||e.readyState===WebSocket.OPEN))){i=!1,s(t=>({...t,connecting:!0,error:null}));try{const t=N();e=new WebSocket(t);const n=setTimeout(()=>{e&&e.readyState===WebSocket.CONNECTING&&e.close()},1e4);e.onopen=()=>{clearTimeout(n),b=0,f=k,s(a=>({...a,connected:!0,connecting:!1,error:null})),r.length>0&&g(r)},e.onmessage=a=>{try{const c=JSON.parse(a.data);s(o=>({...o,lastEvent:c})),(l.get(c["entity-type"])||[]).forEach(o=>{try{o(c)}catch(w){console.error("[WebSocket] Error in event callback:",w)}})}catch(c){console.error("[WebSocket] Error parsing message:",c)}},e.onclose=a=>{clearTimeout(n);const c=a.code===1e3&&i,S=a.code!==1e3?`Connection closed: ${a.reason||"Unknown reason"}`:null;s(o=>({...o,connected:!1,connecting:!1,error:S})),c||h()},e.onerror=a=>{clearTimeout(n),s(c=>({...c,connected:!1,connecting:!1,error:"WebSocket connection error"})),i||h()}}catch(t){s(n=>({...n,connected:!1,connecting:!1,error:t instanceof Error?t.message:"Failed to connect"}))}}}function M(){}function F(){}function h(){if(i)return;d&&clearTimeout(d),b++,b>W&&(b=1,f=k);const t=Math.min(f,m);d=window.setTimeout(()=>{if(!i){u();const n=Math.random()*1e3;f=Math.min(f*1.5+n,m)}},t)}function g(t){if(e&&e.readyState===WebSocket.OPEN){const n={"send-everything":!1,filters:t};e.send(JSON.stringify(n)),r=[...t]}}function y(){i=!0,d&&(clearTimeout(d),d=null),e&&(e.close(1e3,"Manual disconnect"),e=null),l.clear(),r=[],s(t=>({...t,connected:!1,connecting:!1,error:null,lastEvent:null}))}function O(){navigator.onLine&&!i&&setTimeout(()=>{(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&(b=0,f=k,u())},2e3)}typeof window<"u"&&(window.addEventListener("online",O),window.addEventListener("offline",()=>{s(t=>({...t,error:"Network offline"}))}),setInterval(()=>{i||(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&u()},1e4));function v(t,n,a){l.has(t)||l.set(t,[]),l.get(t).push(a);const c=r.findIndex(o=>o["entity-type"]===t),S={"entity-type":t,operations:n};if(c>=0){const o=r[c].operations;S.operations=Array.from(new Set([...o,...n])),r[c]=S}else r.push(S);return e&&e.readyState===WebSocket.OPEN&&g(r),(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&u(),()=>{const o=l.get(t);if(o){const w=o.indexOf(a);if(w>-1&&o.splice(w,1),o.length===0){l.delete(t);const p=r.findIndex(I=>I["entity-type"]===t);p>-1&&(r.splice(p,1),e&&e.readyState===WebSocket.OPEN&&g(r))}}}}return typeof window<"u"&&u(),{subscribe:E,connect:u,disconnect:y,subscribeToEntity:v}}const D=x();export{D as w};

View file

@ -1 +1 @@
import{s as t,p as r}from"./BWm3MK7c.js";const e={get data(){return r.data},get error(){return r.error},get form(){return r.form},get params(){return r.params},get route(){return r.route},get state(){return r.state},get status(){return r.status},get url(){return r.url}};t.updated.check;const s=e;export{s as p};
import{s as t,p as r}from"./HMJxCnAR.js";const e={get data(){return r.data},get error(){return r.error},get form(){return r.form},get params(){return r.params},get route(){return r.route},get state(){return r.state},get status(){return r.status},get url(){return r.url}};t.updated.check;const s=e;export{s as p};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import"./C7KraPli.js";import{f as k,d as a,s as m,r as i,t as g,e as f,b as v,z as p,D as z}from"./cPTQ2Ibn.js";import{p as t,i as u}from"./DqFqoVWr.js";import{s as Y,h as Z,B as H}from"./DAIx0GOW.js";var $=k('<div class="flex-shrink-0"><!></div>'),ee=k('<div class="mt-4 sm:mt-0 flex space-x-3"><!> <!></div>'),te=k('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="sm:flex sm:items-center sm:justify-between"><div class="flex items-center space-x-3"><!> <div><h1> </h1> <p class="text-sm text-gray-500 dark:text-gray-400"> </p></div></div> <!></div></div></div>');function se(j,e){let E=t(e,"title",8),M=t(e,"subtitle",8),D=t(e,"forgeIcon",8,""),h=t(e,"onEdit",8,null),x=t(e,"onDelete",8,null),B=t(e,"editLabel",8,"Edit"),C=t(e,"deleteLabel",8,"Delete"),P=t(e,"editVariant",8,"secondary"),A=t(e,"deleteVariant",8,"danger"),q=t(e,"editDisabled",8,!1),F=t(e,"deleteDisabled",8,!1),G=t(e,"editIcon",8,"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'/>"),J=t(e,"deleteIcon",8,"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16'/>"),K=t(e,"titleClass",8,"");var _=te(),y=a(_),w=a(y),b=a(w),I=a(b);{var N=l=>{var d=$(),c=a(d);Z(c,D),i(d),v(l,d)};u(I,l=>{D()&&l(N)})}var L=m(I,2),o=a(L),O=a(o,!0);i(o);var V=m(o,2),Q=a(V,!0);i(V),i(L),i(b);var R=m(b,2);{var S=l=>{var d=ee(),c=a(d);{var T=r=>{H(r,{get variant(){return P()},size:"md",get disabled(){return q()},get icon(){return G()},$$events:{click(...s){h()?.apply(this,s)}},children:(s,X)=>{p();var n=z();g(()=>f(n,B())),v(s,n)},$$slots:{default:!0}})};u(c,r=>{h()&&r(T)})}var U=m(c,2);{var W=r=>{H(r,{get variant(){return A()},size:"md",get disabled(){return F()},get icon(){return J()},$$events:{click(...s){x()?.apply(this,s)}},children:(s,X)=>{p();var n=z();g(()=>f(n,C())),v(s,n)},$$slots:{default:!0}})};u(U,r=>{x()&&r(W)})}i(d),v(l,d)};u(R,l=>{(h()||x())&&l(S)})}i(w),i(y),i(_),g(()=>{Y(o,1,`text-2xl font-bold text-gray-900 dark:text-white ${K()??""}`),f(O,E()),f(Q,M())}),v(j,_)}export{se as D};
import"./DsnmJJEf.js";import"./TJn6xDN9.js";import{f as k,d as a,s as m,r as i,t as g,e as f,b as v,z as p,D as z}from"./DniTuB_0.js";import{p as t,i as u}from"./DbNhg6mG.js";import{s as Y,h as Z,B as H}from"./BZ2rxtTc.js";var $=k('<div class="flex-shrink-0"><!></div>'),ee=k('<div class="mt-4 sm:mt-0 flex space-x-3"><!> <!></div>'),te=k('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="sm:flex sm:items-center sm:justify-between"><div class="flex items-center space-x-3"><!> <div><h1> </h1> <p class="text-sm text-gray-500 dark:text-gray-400"> </p></div></div> <!></div></div></div>');function se(j,e){let E=t(e,"title",8),M=t(e,"subtitle",8),D=t(e,"forgeIcon",8,""),h=t(e,"onEdit",8,null),x=t(e,"onDelete",8,null),B=t(e,"editLabel",8,"Edit"),C=t(e,"deleteLabel",8,"Delete"),P=t(e,"editVariant",8,"secondary"),A=t(e,"deleteVariant",8,"danger"),q=t(e,"editDisabled",8,!1),F=t(e,"deleteDisabled",8,!1),G=t(e,"editIcon",8,"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'/>"),J=t(e,"deleteIcon",8,"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16'/>"),K=t(e,"titleClass",8,"");var _=te(),y=a(_),w=a(y),b=a(w),I=a(b);{var N=l=>{var d=$(),c=a(d);Z(c,D),i(d),v(l,d)};u(I,l=>{D()&&l(N)})}var L=m(I,2),o=a(L),O=a(o,!0);i(o);var V=m(o,2),Q=a(V,!0);i(V),i(L),i(b);var R=m(b,2);{var S=l=>{var d=ee(),c=a(d);{var T=r=>{H(r,{get variant(){return P()},size:"md",get disabled(){return q()},get icon(){return G()},$$events:{click(...s){h()?.apply(this,s)}},children:(s,X)=>{p();var n=z();g(()=>f(n,B())),v(s,n)},$$slots:{default:!0}})};u(c,r=>{h()&&r(T)})}var U=m(c,2);{var W=r=>{H(r,{get variant(){return A()},size:"md",get disabled(){return F()},get icon(){return J()},$$events:{click(...s){x()?.apply(this,s)}},children:(s,X)=>{p();var n=z();g(()=>f(n,C())),v(s,n)},$$slots:{default:!0}})};u(U,r=>{x()&&r(W)})}i(d),v(l,d)};u(R,l=>{(h()||x())&&l(S)})}i(w),i(y),i(_),g(()=>{Y(o,1,`text-2xl font-bold text-gray-900 dark:text-white ${K()??""}`),f(O,E()),f(Q,M())}),v(j,_)}export{se as D};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as V}from"./C7KraPli.js";import{p as B,E as D,l as t,q as s,g as e,m as a,h as P,f as T,t as q,i as S,b as F,c as G,u as I,d as w,k as o,r as z}from"./cPTQ2Ibn.js";import{e as J,h as K,s as N,f as O}from"./DAIx0GOW.js";import{l as C,p as l}from"./DqFqoVWr.js";var Q=T('<button><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><!></svg></button>');function Z(j,i){const M=C(i,["children","$$slots","$$events","$$legacy"]),L=C(M,["action","disabled","title","ariaLabel","size"]);B(i,!1);const u=a(),h=a(),p=a(),v=a(),g=a(),f=a(),n=a(),m=a(),b=a(),A=D();let r=l(i,"action",8,"edit"),x=l(i,"disabled",8,!1),y=l(i,"title",8,""),_=l(i,"ariaLabel",8,""),c=l(i,"size",8,"md");function H(){x()||A("click")}t(()=>{},()=>{o(u,"transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50")}),t(()=>s(c()),()=>{o(h,{sm:"p-1",md:"p-2"}[c()])}),t(()=>s(r()),()=>{o(p,{edit:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300 focus:ring-indigo-500",delete:"text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300 focus:ring-red-500",view:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-300 focus:ring-gray-500",add:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 focus:ring-green-500",copy:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 focus:ring-blue-500"}[r()])}),t(()=>s(c()),()=>{o(v,c()==="sm"?"h-4 w-4":"h-5 w-5")}),t(()=>(e(u),e(h),e(p)),()=>{o(g,[e(u),e(h),e(p)].join(" "))}),t(()=>{},()=>{o(f,{edit:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />',delete:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />',view:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />',add:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />',copy:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />'})}),t(()=>{},()=>{o(n,{edit:"Edit",delete:"Delete",view:"View",add:"Add",copy:"Clone"})}),t(()=>(s(y()),e(n),s(r())),()=>{o(m,y()||e(n)[r()])}),t(()=>(s(_()),e(n),s(r())),()=>{o(b,_()||`${e(n)[r()]} item`)}),P(),V();var d=Q();J(d,()=>({type:"button",class:e(g),disabled:x(),title:e(m),"aria-label":e(b),...L}));var k=w(d),E=w(k);K(E,()=>(e(f),s(r()),I(()=>e(f)[r()])),!0),z(k),z(d),q(()=>N(k,0,O(e(v)))),S("click",d,H),F(j,d),G()}export{Z as A};
import"./DsnmJJEf.js";import{i as V}from"./TJn6xDN9.js";import{p as B,E as D,l as t,q as s,g as e,m as a,h as P,f as T,t as q,i as S,b as F,c as G,u as I,d as w,k as o,r as z}from"./DniTuB_0.js";import{e as J,h as K,s as N,f as O}from"./BZ2rxtTc.js";import{l as C,p as l}from"./DbNhg6mG.js";var Q=T('<button><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><!></svg></button>');function Z(j,i){const M=C(i,["children","$$slots","$$events","$$legacy"]),L=C(M,["action","disabled","title","ariaLabel","size"]);B(i,!1);const u=a(),h=a(),p=a(),v=a(),g=a(),f=a(),n=a(),m=a(),b=a(),A=D();let r=l(i,"action",8,"edit"),x=l(i,"disabled",8,!1),y=l(i,"title",8,""),_=l(i,"ariaLabel",8,""),c=l(i,"size",8,"md");function H(){x()||A("click")}t(()=>{},()=>{o(u,"transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50")}),t(()=>s(c()),()=>{o(h,{sm:"p-1",md:"p-2"}[c()])}),t(()=>s(r()),()=>{o(p,{edit:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300 focus:ring-indigo-500",delete:"text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300 focus:ring-red-500",view:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-300 focus:ring-gray-500",add:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 focus:ring-green-500",copy:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 focus:ring-blue-500"}[r()])}),t(()=>s(c()),()=>{o(v,c()==="sm"?"h-4 w-4":"h-5 w-5")}),t(()=>(e(u),e(h),e(p)),()=>{o(g,[e(u),e(h),e(p)].join(" "))}),t(()=>{},()=>{o(f,{edit:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />',delete:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />',view:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />',add:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />',copy:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />'})}),t(()=>{},()=>{o(n,{edit:"Edit",delete:"Delete",view:"View",add:"Add",copy:"Clone"})}),t(()=>(s(y()),e(n),s(r())),()=>{o(m,y()||e(n)[r()])}),t(()=>(s(_()),e(n),s(r())),()=>{o(b,_()||`${e(n)[r()]} item`)}),P(),V();var d=Q();J(d,()=>({type:"button",class:e(g),disabled:x(),title:e(m),"aria-label":e(b),...L}));var k=w(d),E=w(k);K(E,()=>(e(f),s(r()),I(()=>e(f)[r()])),!0),z(k),z(d),q(()=>N(k,0,O(e(v)))),S("click",d,H),F(j,d),G()}export{Z as A};

View file

@ -1 +1 @@
import{am as g,an as d,ao as c,u as m,ap as b,aq as i,g as p,q as v,ar as h,as as k}from"./cPTQ2Ibn.js";function q(n=!1){const s=g,e=s.l.u;if(!e)return;let f=()=>v(s.s);if(n){let t=0,a={};const _=h(()=>{let l=!1;const r=s.s;for(const o in r)r[o]!==a[o]&&(a[o]=r[o],l=!0);return l&&t++,t});f=()=>p(_)}e.b.length&&d(()=>{u(s,f),i(e.b)}),c(()=>{const t=m(()=>e.m.map(b));return()=>{for(const a of t)typeof a=="function"&&a()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}k();export{q as i};
import{am as g,an as d,ao as c,u as m,ap as b,aq as i,g as p,q as v,ar as h,as as k}from"./DniTuB_0.js";function q(n=!1){const s=g,e=s.l.u;if(!e)return;let f=()=>v(s.s);if(n){let t=0,a={};const _=h(()=>{let l=!1;const r=s.s;for(const o in r)r[o]!==a[o]&&(a[o]=r[o],l=!0);return l&&t++,t});f=()=>p(_)}e.b.length&&d(()=>{u(s,f),i(e.b)}),c(()=>{const t=m(()=>e.m.map(b));return()=>{for(const a of t)typeof a=="function"&&a()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}k();export{q as i};

View file

@ -1 +1 @@
import"./DsnmJJEf.js";import{i as D}from"./C7KraPli.js";import{p as P,f as I,d as s,r as n,s as u,u as l,q as i,t as w,e as S,b as N,c as A}from"./cPTQ2Ibn.js";import{d as f,c as F}from"./DAIx0GOW.js";import{p as d}from"./DqFqoVWr.js";import{D as E,G,A as j}from"./BXAw3DlI.js";import{E as q}from"./DJXlZ9OJ.js";import{S as g}from"./BKMuKOVJ.js";var L=I('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="flex items-center justify-between mb-4"><h2 class="text-lg font-medium text-gray-900 dark:text-white"> </h2> <a class="text-sm text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300">View all instances</a></div> <!></div></div>');function O(y,a){P(a,!1);let e=d(a,"instances",8),h=d(a,"entityType",8),v=d(a,"onDeleteInstance",8);const b=[{key:"name",title:"Name",cellComponent:q,cellProps:{entityType:"instance",nameField:"name"}},{key:"status",title:"Status",cellComponent:g,cellProps:{statusType:"instance",statusField:"status"}},{key:"runner_status",title:"Runner Status",cellComponent:g,cellProps:{statusType:"instance",statusField:"runner_status"}},{key:"created",title:"Created",cellComponent:G,cellProps:{field:"created_at",type:"date"}},{key:"actions",title:"Actions",align:"right",cellComponent:j,cellProps:{actions:[{type:"delete",label:"Delete",title:"Delete instance",ariaLabel:"Delete instance",action:"delete"}]}}],x={entityType:"instance",primaryText:{field:"name",isClickable:!0,href:"/instances/{name}"},secondaryText:{field:"provider_id"},badges:[{type:"status",field:"status"}],actions:[{type:"delete",handler:t=>m(t)}]};function m(t){v()(t)}function C(t){m(t.detail.item)}D();var r=L(),p=s(r),o=s(p),c=s(o),T=s(c);n(c);var _=u(c,2);n(o);var k=u(o,2);E(k,{get columns(){return b},get data(){return e()},loading:!1,error:"",searchTerm:"",showSearch:!1,showPagination:!1,currentPage:1,get perPage(){return i(e()),l(()=>e().length)},totalPages:1,get totalItems(){return i(e()),l(()=>e().length)},itemName:"instances",emptyTitle:"No instances running",get emptyMessage(){return`No instances running for this ${h()??""}.`},emptyIconType:"cog",get mobileCardConfig(){return x},$$events:{delete:C}}),n(p),n(r),w(t=>{S(T,`Instances (${i(e()),l(()=>e().length)??""})`),F(_,"href",t)},[()=>(i(f),l(()=>f("/instances")))]),N(y,r),A()}export{O as I};
import"./DsnmJJEf.js";import{i as D}from"./TJn6xDN9.js";import{p as P,f as I,d as s,r as n,s as u,u as l,q as i,t as w,e as S,b as N,c as A}from"./DniTuB_0.js";import{d as f,c as F}from"./BZ2rxtTc.js";import{p as d}from"./DbNhg6mG.js";import{D as E,G,A as j}from"./CKaB5fL4.js";import{E as q}from"./Dh8uHEF5.js";import{S as g}from"./C1GM4Goa.js";var L=I('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="flex items-center justify-between mb-4"><h2 class="text-lg font-medium text-gray-900 dark:text-white"> </h2> <a class="text-sm text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300">View all instances</a></div> <!></div></div>');function O(y,a){P(a,!1);let e=d(a,"instances",8),h=d(a,"entityType",8),v=d(a,"onDeleteInstance",8);const b=[{key:"name",title:"Name",cellComponent:q,cellProps:{entityType:"instance",nameField:"name"}},{key:"status",title:"Status",cellComponent:g,cellProps:{statusType:"instance",statusField:"status"}},{key:"runner_status",title:"Runner Status",cellComponent:g,cellProps:{statusType:"instance",statusField:"runner_status"}},{key:"created",title:"Created",cellComponent:G,cellProps:{field:"created_at",type:"date"}},{key:"actions",title:"Actions",align:"right",cellComponent:j,cellProps:{actions:[{type:"delete",label:"Delete",title:"Delete instance",ariaLabel:"Delete instance",action:"delete"}]}}],x={entityType:"instance",primaryText:{field:"name",isClickable:!0,href:"/instances/{name}"},secondaryText:{field:"provider_id"},badges:[{type:"status",field:"status"}],actions:[{type:"delete",handler:t=>m(t)}]};function m(t){v()(t)}function C(t){m(t.detail.item)}D();var r=L(),p=s(r),o=s(p),c=s(o),T=s(c);n(c);var _=u(c,2);n(o);var k=u(o,2);E(k,{get columns(){return b},get data(){return e()},loading:!1,error:"",searchTerm:"",showSearch:!1,showPagination:!1,currentPage:1,get perPage(){return i(e()),l(()=>e().length)},totalPages:1,get totalItems(){return i(e()),l(()=>e().length)},itemName:"instances",emptyTitle:"No instances running",get emptyMessage(){return`No instances running for this ${h()??""}.`},emptyIconType:"cog",get mobileCardConfig(){return x},$$events:{delete:C}}),n(p),n(r),w(t=>{S(T,`Instances (${i(e()),l(()=>e().length)??""})`),F(_,"href",t)},[()=>(i(f),l(()=>f("/instances")))]),N(y,r),A()}export{O as I};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
import{l as o,a as r}from"../chunks/HMJxCnAR.js";export{o as load_css,r as start};

View file

@ -1 +0,0 @@
import{l as o,a as r}from"../chunks/BWm3MK7c.js";export{o as load_css,r as start};

View file

@ -1 +0,0 @@
import"../chunks/DsnmJJEf.js";import{i as h}from"../chunks/C7KraPli.js";import{p as c,f as l,a as v,t as u,b as _,c as d,d as s,r as e,s as g,e as p}from"../chunks/cPTQ2Ibn.js";import{p as o}from"../chunks/cm2N_5sv.js";var x=l("<h1> </h1> <p> </p>",1);function q(i,m){c(m,!1),h();var t=x(),r=v(t),f=s(r,!0);e(r);var a=g(r,2),n=s(a,!0);e(a),u(()=>{p(f,o.status),p(n,o.error?.message)}),_(i,t),d()}export{q as component};

View file

@ -0,0 +1 @@
import"../chunks/DsnmJJEf.js";import{i as h}from"../chunks/TJn6xDN9.js";import{p as c,f as l,a as v,t as u,b as _,c as d,d as s,r as e,s as g,e as p}from"../chunks/DniTuB_0.js";import{p as o}from"../chunks/Hb0uuDRx.js";var x=l("<h1> </h1> <p> </p>",1);function q(i,m){c(m,!1),h();var t=x(),r=v(t),f=s(r,!0);e(r);var a=g(r,2),n=s(a,!0);e(a),u(()=>{p(f,o.status),p(n,o.error?.message)}),_(i,t),d()}export{q as component};

View file

@ -1 +1 @@
import"../chunks/DsnmJJEf.js";import{i as Z}from"../chunks/C7KraPli.js";import{p as ee,o as ae,l as re,h as te,f as K,j as se,t as _,g as a,i as k,b as w,c as de,$ as oe,s as d,D as ie,m as f,d as r,u as q,q as B,k as i,r as t,z as D,e as I}from"../chunks/cPTQ2Ibn.js";import{i as le,s as ne,a as ce}from"../chunks/DqFqoVWr.js";import{B as me,d as l,c as T,r as U}from"../chunks/DAIx0GOW.js";import{b as C}from"../chunks/B-_QCM7E.js";import{p as ue}from"../chunks/D4Caz1gY.js";import{g as H}from"../chunks/BWm3MK7c.js";import{a as pe,b as ve}from"../chunks/DvSCpQg9.js";import{e as fe}from"../chunks/BZiHL9L3.js";var ge=K('<div class="rounded-md bg-red-50 dark:bg-red-900 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"></path></svg></div> <div class="ml-3"><p class="text-sm font-medium text-red-800 dark:text-red-200"> </p></div></div></div>'),he=K('<div class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8"><div class="max-w-md w-full space-y-8"><div><div class="mx-auto h-48 w-auto flex justify-center"><img alt="GARM" class="h-48 w-auto dark:hidden"/> <img alt="GARM" class="h-48 w-auto hidden dark:block"/></div> <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">Sign in to GARM</h2> <p class="mt-2 text-center text-sm text-gray-600 dark:text-gray-400">GitHub Actions Runner Manager</p></div> <form class="mt-8 space-y-6"><div class="rounded-md shadow-sm -space-y-px"><div><label for="username" class="sr-only">Username</label> <input id="username" name="username" type="text" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-700 rounded-t-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm" placeholder="Username"/></div> <div><label for="password" class="sr-only">Password</label> <input id="password" name="password" type="password" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-700 rounded-b-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm" placeholder="Password"/></div></div> <!> <div><!></div></form></div></div>');function Ae(W,F){ee(F,!1);const[J,N]=ne(),$=()=>ce(pe,"$authStore",J);let m=f(""),u=f(""),o=f(!1),n=f("");ae(()=>{O()});function O(){const e=localStorage.getItem("theme");let s=!1;e==="dark"?s=!0:e==="light"?s=!1:s=window.matchMedia("(prefers-color-scheme: dark)").matches,s?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}async function M(){if(!a(m)||!a(u)){i(n,"Please enter both username and password");return}i(o,!0),i(n,"");try{await ve.login(a(m),a(u)),H(l("/"))}catch(e){i(n,fe(e))}finally{i(o,!1)}}function L(e){e.key==="Enter"&&M()}re(()=>($(),l),()=>{$().isAuthenticated&&H(l("/"))}),te(),Z();var g=he();se(e=>{oe.title="Login - GARM"});var z=r(g),h=r(z),A=r(h),S=r(A),Q=d(S,2);t(A),D(4),t(h);var b=d(h,2),x=r(b),y=r(x),p=d(r(y),2);U(p),t(y);var P=d(y,2),v=d(r(P),2);U(v),t(P),t(x);var G=d(x,2);{var V=e=>{var s=ge(),c=r(s),E=d(r(c),2),j=r(E),Y=r(j,!0);t(j),t(E),t(c),t(s),_(()=>I(Y,a(n))),w(e,s)};le(G,e=>{a(n)&&e(V)})}var R=d(G,2),X=r(R);me(X,{type:"submit",variant:"primary",size:"md",fullWidth:!0,get disabled(){return a(o)},get loading(){return a(o)},children:(e,s)=>{D();var c=ie();_(()=>I(c,a(o)?"Signing in...":"Sign in")),w(e,c)},$$slots:{default:!0}}),t(R),t(b),t(z),t(g),_((e,s)=>{T(S,"src",e),T(Q,"src",s),p.disabled=a(o),v.disabled=a(o)},[()=>(B(l),q(()=>l("/assets/garm-light.svg"))),()=>(B(l),q(()=>l("/assets/garm-dark.svg")))]),C(p,()=>a(m),e=>i(m,e)),k("keypress",p,L),C(v,()=>a(u),e=>i(u,e)),k("keypress",v,L),k("submit",b,ue(M)),w(W,g),de(),N()}export{Ae as component};
import"../chunks/DsnmJJEf.js";import{i as Z}from"../chunks/TJn6xDN9.js";import{p as ee,o as ae,l as re,h as te,f as K,j as se,t as _,g as a,i as k,b as w,c as de,$ as oe,s as d,D as ie,m as f,d as r,u as q,q as B,k as i,r as t,z as D,e as I}from"../chunks/DniTuB_0.js";import{i as le,s as ne,a as ce}from"../chunks/DbNhg6mG.js";import{B as me,d as l,c as T,r as U}from"../chunks/BZ2rxtTc.js";import{b as C}from"../chunks/CCQwxxp9.js";import{p as ue}from"../chunks/D4Caz1gY.js";import{g as H}from"../chunks/HMJxCnAR.js";import{a as pe,b as ve}from"../chunks/1biM6o9g.js";import{e as fe}from"../chunks/BZiHL9L3.js";var ge=K('<div class="rounded-md bg-red-50 dark:bg-red-900 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"></path></svg></div> <div class="ml-3"><p class="text-sm font-medium text-red-800 dark:text-red-200"> </p></div></div></div>'),he=K('<div class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8"><div class="max-w-md w-full space-y-8"><div><div class="mx-auto h-48 w-auto flex justify-center"><img alt="GARM" class="h-48 w-auto dark:hidden"/> <img alt="GARM" class="h-48 w-auto hidden dark:block"/></div> <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">Sign in to GARM</h2> <p class="mt-2 text-center text-sm text-gray-600 dark:text-gray-400">GitHub Actions Runner Manager</p></div> <form class="mt-8 space-y-6"><div class="rounded-md shadow-sm -space-y-px"><div><label for="username" class="sr-only">Username</label> <input id="username" name="username" type="text" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-700 rounded-t-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm" placeholder="Username"/></div> <div><label for="password" class="sr-only">Password</label> <input id="password" name="password" type="password" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-700 rounded-b-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm" placeholder="Password"/></div></div> <!> <div><!></div></form></div></div>');function Ae(W,F){ee(F,!1);const[J,N]=ne(),$=()=>ce(pe,"$authStore",J);let m=f(""),u=f(""),o=f(!1),n=f("");ae(()=>{O()});function O(){const e=localStorage.getItem("theme");let s=!1;e==="dark"?s=!0:e==="light"?s=!1:s=window.matchMedia("(prefers-color-scheme: dark)").matches,s?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}async function M(){if(!a(m)||!a(u)){i(n,"Please enter both username and password");return}i(o,!0),i(n,"");try{await ve.login(a(m),a(u)),H(l("/"))}catch(e){i(n,fe(e))}finally{i(o,!1)}}function L(e){e.key==="Enter"&&M()}re(()=>($(),l),()=>{$().isAuthenticated&&H(l("/"))}),te(),Z();var g=he();se(e=>{oe.title="Login - GARM"});var z=r(g),h=r(z),A=r(h),S=r(A),Q=d(S,2);t(A),D(4),t(h);var b=d(h,2),x=r(b),y=r(x),p=d(r(y),2);U(p),t(y);var P=d(y,2),v=d(r(P),2);U(v),t(P),t(x);var G=d(x,2);{var V=e=>{var s=ge(),c=r(s),E=d(r(c),2),j=r(E),Y=r(j,!0);t(j),t(E),t(c),t(s),_(()=>I(Y,a(n))),w(e,s)};le(G,e=>{a(n)&&e(V)})}var R=d(G,2),X=r(R);me(X,{type:"submit",variant:"primary",size:"md",fullWidth:!0,get disabled(){return a(o)},get loading(){return a(o)},children:(e,s)=>{D();var c=ie();_(()=>I(c,a(o)?"Signing in...":"Sign in")),w(e,c)},$$slots:{default:!0}}),t(R),t(b),t(z),t(g),_((e,s)=>{T(S,"src",e),T(Q,"src",s),p.disabled=a(o),v.disabled=a(o)},[()=>(B(l),q(()=>l("/assets/garm-light.svg"))),()=>(B(l),q(()=>l("/assets/garm-dark.svg")))]),C(p,()=>a(m),e=>i(m,e)),k("keypress",p,L),C(v,()=>a(u),e=>i(u,e)),k("keypress",v,L),k("submit",b,ue(M)),w(W,g),de(),N()}export{Ae as component};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":"1758639968221"}
{"version":"1758898720212"}

View file

@ -71,21 +71,21 @@
})();
</script>
<link rel="modulepreload" href="/ui/_app/immutable/entry/start.DSuwuJpP.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/BWm3MK7c.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/cPTQ2Ibn.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/B0Z_RcO4.js">
<link rel="modulepreload" href="/ui/_app/immutable/entry/app.7rMW4fdF.js">
<link rel="modulepreload" href="/ui/_app/immutable/entry/start.CDo6YuQR.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/HMJxCnAR.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/DniTuB_0.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/CGAsTaG2.js">
<link rel="modulepreload" href="/ui/_app/immutable/entry/app.G6LK5zv-.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/DsnmJJEf.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/DqFqoVWr.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/41x1-UqF.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/Cwu7L3Xf.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/DbNhg6mG.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/BZLWIdPw.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/C-xTH-sp.js">
</head>
<body data-sveltekit-preload-data="hover" class="bg-gray-100 dark:bg-gray-900">
<div style="display: contents">
<script>
{
__sveltekit_1l07m9g = {
__sveltekit_1odpo7n = {
base: "/ui",
assets: "/ui"
};
@ -93,8 +93,8 @@
const element = document.currentScript.parentElement;
Promise.all([
import("/ui/_app/immutable/entry/start.DSuwuJpP.js"),
import("/ui/_app/immutable/entry/app.7rMW4fdF.js")
import("/ui/_app/immutable/entry/start.CDo6YuQR.js"),
import("/ui/_app/immutable/entry/app.G6LK5zv-.js")
]).then(([kit, app]) => {
kit.start(app, element);
});

View file

@ -226,6 +226,18 @@ export interface CreateGiteaEndpointParams {
* @memberof CreateGiteaEndpointParams
*/
'name'?: string;
/**
*
* @type {string}
* @memberof CreateGiteaEndpointParams
*/
'tools_metadata_url'?: string;
/**
*
* @type {boolean}
* @memberof CreateGiteaEndpointParams
*/
'use_internal_tools_metadata'?: boolean;
}
/**
*
@ -903,6 +915,12 @@ export interface ForgeEndpoint {
* @memberof ForgeEndpoint
*/
'name'?: string;
/**
*
* @type {string}
* @memberof ForgeEndpoint
*/
'tools_metadata_url'?: string;
/**
*
* @type {string}
@ -915,6 +933,12 @@ export interface ForgeEndpoint {
* @memberof ForgeEndpoint
*/
'upload_base_url'?: string;
/**
*
* @type {boolean}
* @memberof ForgeEndpoint
*/
'use_internal_tools_metadata'?: boolean;
}
/**
*
@ -2212,6 +2236,18 @@ export interface UpdateGiteaEndpointParams {
* @memberof UpdateGiteaEndpointParams
*/
'description'?: string;
/**
*
* @type {string}
* @memberof UpdateGiteaEndpointParams
*/
'tools_metadata_url'?: string;
/**
*
* @type {boolean}
* @memberof UpdateGiteaEndpointParams
*/
'use_internal_tools_metadata'?: boolean;
}
/**
*

View file

@ -13,6 +13,7 @@
import { extractAPIError } from '$lib/utils/apiError';
import DataTable from '$lib/components/DataTable.svelte';
import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
import Tooltip from '$lib/components/Tooltip.svelte';
let loading = true;
let endpoints: ForgeEndpoint[] = [];
@ -58,7 +59,9 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
base_url: '',
api_base_url: '',
upload_base_url: '',
ca_cert_bundle: ''
ca_cert_bundle: '',
tools_metadata_url: '',
use_internal_tools_metadata: false
};
// Track original values for comparison during updates
let originalFormData: typeof formData = { ...formData };
@ -203,7 +206,9 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
base_url: endpoint.base_url || '',
api_base_url: endpoint.api_base_url || '',
upload_base_url: endpoint.upload_base_url || '',
ca_cert_bundle: typeof endpoint.ca_cert_bundle === 'string' ? endpoint.ca_cert_bundle : ''
ca_cert_bundle: typeof endpoint.ca_cert_bundle === 'string' ? endpoint.ca_cert_bundle : '',
tools_metadata_url: (endpoint as any).tools_metadata_url || '',
use_internal_tools_metadata: (endpoint as any).use_internal_tools_metadata || false
};
// Store original values for comparison
originalFormData = { ...formData };
@ -223,7 +228,9 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
base_url: '',
api_base_url: '',
upload_base_url: '',
ca_cert_bundle: ''
ca_cert_bundle: '',
tools_metadata_url: '',
use_internal_tools_metadata: false
};
originalFormData = { ...formData };
}
@ -295,6 +302,17 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
}
}
// Gitea-only fields - only include if changed
if (editingEndpoint?.endpoint_type === 'gitea') {
if (formData.tools_metadata_url !== originalFormData.tools_metadata_url) {
updateParams.tools_metadata_url = formData.tools_metadata_url.trim();
}
if (formData.use_internal_tools_metadata !== originalFormData.use_internal_tools_metadata) {
updateParams.use_internal_tools_metadata = formData.use_internal_tools_metadata;
}
}
return updateParams;
}
@ -310,6 +328,14 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
upload_base_url: formData.upload_base_url
};
// Add Gitea-specific fields
if (formData.endpoint_type === 'gitea') {
if (formData.tools_metadata_url.trim() !== '') {
endpointParams.tools_metadata_url = formData.tools_metadata_url.trim();
}
endpointParams.use_internal_tools_metadata = formData.use_internal_tools_metadata;
}
// Convert ca_cert_bundle from base64 string to byte array if provided
if (formData.ca_cert_bundle && formData.ca_cert_bundle.trim() !== '') {
try {
@ -451,7 +477,7 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
on:delete={handleDelete}
>
<!-- Mobile card content -->
<svelte:fragment slot="mobile-card" let:item={endpoint} let:index>
<svelte:fragment slot="mobile-card" let:item={endpoint}>
<div class="flex items-center justify-between">
<div class="flex-1 min-w-0">
<div class="block">
@ -604,6 +630,52 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
/>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">If empty, Base URL will be used as API Base URL</p>
</div>
<!-- Gitea-specific tools metadata fields -->
<div>
<div class="flex items-center mb-1">
<label for="tools_metadata_url" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
Tools Metadata URL <span class="text-xs text-gray-500">(optional)</span>
</label>
<div class="ml-2">
<Tooltip
title="Tools Metadata URL"
content="URL where GARM checks for act_runner binary downloads and release information. Defaults to https://gitea.com/api/v1/repos/gitea/act_runner/releases if not specified. Use a custom URL to point to your own tools repository or mirror."
position="top"
width="w-80"
/>
</div>
</div>
<input
type="url"
id="tools_metadata_url"
bind:value={formData.tools_metadata_url}
autocomplete="off"
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
placeholder="https://gitea.com/api/v1/repos/gitea/act_runner/releases"
/>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Leave empty to use default Gitea releases URL</p>
</div>
<div class="flex items-center">
<input
id="use_internal_tools_metadata"
type="checkbox"
bind:checked={formData.use_internal_tools_metadata}
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded"
/>
<label for="use_internal_tools_metadata" class="ml-2 block text-sm font-medium text-gray-700 dark:text-gray-300">
Use Internal Tools Metadata
</label>
<div class="ml-2">
<Tooltip
title="Internal Tools Metadata"
content="When enabled, GARM uses built-in URLs for nightly act_runner binaries instead of calling the external tools metadata URL. This is useful in air-gapped environments where runner images already include the binaries and don't need to download them."
position="top"
width="w-80"
/>
</div>
</div>
{/if}
<!-- CA Certificate Upload -->
@ -758,6 +830,52 @@ import { EndpointCell, ActionsCell, GenericCell } from '$lib/components/cells';
/>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">If empty, Base URL will be used as API Base URL</p>
</div>
<!-- Gitea-specific tools metadata fields -->
<div>
<div class="flex items-center mb-1">
<label for="edit_tools_metadata_url" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
Tools Metadata URL <span class="text-xs text-gray-500">(optional)</span>
</label>
<div class="ml-2">
<Tooltip
title="Tools Metadata URL"
content="URL where GARM checks for act_runner binary downloads and release information. Defaults to https://gitea.com/api/v1/repos/gitea/act_runner/releases if not specified. Use a custom URL to point to your own tools repository or mirror."
position="top"
width="w-80"
/>
</div>
</div>
<input
type="url"
id="edit_tools_metadata_url"
bind:value={formData.tools_metadata_url}
autocomplete="off"
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
placeholder="https://gitea.com/api/v1/repos/gitea/act_runner/releases"
/>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Leave empty to use default Gitea releases URL</p>
</div>
<div class="flex items-center">
<input
id="edit_use_internal_tools_metadata"
type="checkbox"
bind:checked={formData.use_internal_tools_metadata}
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded"
/>
<label for="edit_use_internal_tools_metadata" class="ml-2 block text-sm font-medium text-gray-700 dark:text-gray-300">
Use Internal Tools Metadata
</label>
<div class="ml-2">
<Tooltip
title="Internal Tools Metadata"
content="When enabled, GARM uses built-in URLs for nightly act_runner binaries instead of calling the external tools metadata URL. This is useful in air-gapped environments where runner images already include the binaries and don't need to download them."
position="top"
width="w-80"
/>
</div>
</div>
{/if}
<!-- CA Certificate Upload -->

View file

@ -148,6 +148,12 @@ definitions:
name:
type: string
x-go-name: Name
tools_metadata_url:
type: string
x-go-name: ToolsMetadataURL
use_internal_tools_metadata:
type: boolean
x-go-name: UseInternalToolsMetadata
type: object
x-go-package: github.com/cloudbase/garm/params
CreateGithubCredentialsParams:
@ -549,6 +555,9 @@ definitions:
name:
type: string
x-go-name: Name
tools_metadata_url:
type: string
x-go-name: ToolsMetadataURL
updated_at:
format: date-time
type: string
@ -556,6 +565,9 @@ definitions:
upload_base_url:
type: string
x-go-name: UploadBaseURL
use_internal_tools_metadata:
type: boolean
x-go-name: UseInternalToolsMetadata
type: object
x-go-package: github.com/cloudbase/garm/params
ForgeEndpoints:
@ -1443,6 +1455,12 @@ definitions:
description:
type: string
x-go-name: Description
tools_metadata_url:
type: string
x-go-name: ToolsMetadataURL
use_internal_tools_metadata:
type: boolean
x-go-name: UseInternalToolsMetadata
type: object
x-go-package: github.com/cloudbase/garm/params
UpdateGithubCredentialsParams:

View file

@ -86,6 +86,24 @@ func (w *Worker) setCacheForEntity(entityGetter params.EntityGetter, pools []par
}
func (w *Worker) loadAllEntities() error {
endpoints, err := w.store.ListGiteaEndpoints(w.ctx)
if err != nil {
slog.ErrorContext(w.ctx, "failed to load gitea endpoints", "error", err)
} else {
for _, ep := range endpoints {
cache.SetEndpoint(ep)
}
}
endpoints, err = w.store.ListGithubEndpoints(w.ctx)
if err != nil {
slog.ErrorContext(w.ctx, "failed to load github endpoints", "error", err)
} else {
for _, ep := range endpoints {
cache.SetEndpoint(ep)
}
}
pools, err := w.store.ListAllPools(w.ctx)
if err != nil {
return fmt.Errorf("listing pools: %w", err)
@ -443,6 +461,27 @@ func (w *Worker) handleCredentialsEvent(event common.ChangePayload) {
}
}
func (w *Worker) handleEndpointEvent(event common.ChangePayload) {
endpoint, ok := event.Payload.(params.ForgeEndpoint)
if !ok {
slog.DebugContext(w.ctx, "invalid payload type for endpoint event", "payload", event.Payload)
return
}
switch event.Operation {
case common.UpdateOperation, common.CreateOperation:
cache.SetEndpoint(endpoint)
entities := cache.GetEntitiesUsingEndpoint(endpoint)
for _, entity := range entities {
worker, ok := w.toolsWorkes[entity.ID]
if ok {
worker.Reset()
}
}
case common.DeleteOperation:
cache.RemoveEndpoint(endpoint.Name)
}
}
func (w *Worker) handleControllerInfoEvent(event common.ChangePayload) {
ctrlInfo, ok := event.Payload.(params.ControllerInfo)
if !ok {
@ -473,6 +512,8 @@ func (w *Worker) handleEvent(event common.ChangePayload) {
w.handleControllerInfoEvent(event)
case common.TemplateEntityType:
w.handleTemplateEvent(event)
case common.GithubEndpointEntityType:
w.handleEndpointEvent(event)
default:
slog.DebugContext(w.ctx, "unknown entity type", "entity_type", event.EntityType)
}

View file

@ -27,14 +27,7 @@ import (
"golang.org/x/mod/semver"
commonParams "github.com/cloudbase/garm-provider-common/params"
)
const (
// GiteaRunnerReleasesURL is the public API URL that returns a json of all Gitea runner releases.
// By default it returns the last 10 releases, which is enough for our needs.
GiteaRunnerReleasesURL = "https://gitea.com/api/v1/repos/gitea/act_runner/releases"
// GiteaRunnerMinimumVersion is the minimum version we need in order to support ephemeral runners.
GiteaRunnerMinimumVersion = "v0.2.12"
"github.com/cloudbase/garm/util/appdefaults"
)
var githubArchMapping = map[string]string{
@ -134,38 +127,71 @@ func (g GiteaEntityTools) MinimumVersion() (GiteaEntityTool, bool) {
return GiteaEntityTool{}, false
}
for _, tool := range g {
if semver.Compare(tool.TagName, GiteaRunnerMinimumVersion) >= 0 {
if semver.Compare(tool.TagName, appdefaults.GiteaRunnerMinimumVersion) >= 0 {
return tool, true
}
}
return GiteaEntityTool{}, false
}
func getTools(ctx context.Context) ([]commonParams.RunnerApplicationDownload, error) {
resp, err := http.Get(GiteaRunnerReleasesURL)
func getReleasesFromURL(ctx context.Context, metadataURL string) (GiteaEntityTool, error) {
if metadataURL == "" {
metadataURL = appdefaults.GiteaRunnerReleasesURL
}
// We don't return the result to the user. We get the data and attempt to unmarshal
// the result as a specific json. If that fails, we error out. The value is set by the
// admin/user of GARM after authentication. If they have admin rights to GARM, they most
// likely have admin rights to the machine running GARM, in which case, they can just
// GET the metadataURL manually from that server.
resp, err := http.Get(metadataURL) // nolint
if err != nil {
return nil, err
return GiteaEntityTool{}, fmt.Errorf("failed to fetch URL %s: %w", metadataURL, err)
}
defer resp.Body.Close()
data, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
return GiteaEntityTool{}, fmt.Errorf("failed to read response from URL %s: %w", metadataURL, err)
}
var tools GiteaEntityTools
err = json.Unmarshal(data, &tools)
if err != nil {
return nil, err
return GiteaEntityTool{}, fmt.Errorf("failed to unmarshal response from URL %s: %w", metadataURL, err)
}
if len(tools) == 0 {
return nil, fmt.Errorf("no tools found")
return GiteaEntityTool{}, fmt.Errorf("no tools found from URL %s", metadataURL)
}
latest, ok := tools.MinimumVersion()
if !ok {
slog.InfoContext(ctx, "failed to find tools, falling back to nightly")
latest = nightlyActRunner
}
return latest, nil
}
func getTools(ctx context.Context, metadataURL string, useInternal bool) ([]commonParams.RunnerApplicationDownload, error) {
if metadataURL == "" {
metadataURL = appdefaults.GiteaRunnerReleasesURL
}
var latest GiteaEntityTool
var err error
if useInternal {
latest = nightlyActRunner
} else {
latest, err = getReleasesFromURL(ctx, metadataURL)
if err != nil {
slog.ErrorContext(ctx, "failed to get tools from metadata URL", "error", err)
if metadataURL != appdefaults.GiteaRunnerReleasesURL {
slog.InfoContext(ctx, "attempting to get tools from default upstream", "tools_url", appdefaults.GiteaRunnerReleasesURL)
latest, err = getReleasesFromURL(ctx, metadataURL)
if err != nil {
return nil, fmt.Errorf("failed to get upstream tools: %w", err)
}
}
}
}
ret := []commonParams.RunnerApplicationDownload{}
@ -184,6 +210,7 @@ func getTools(ctx context.Context) ([]commonParams.RunnerApplicationDownload, er
// filter out non compressed versions.
continue
}
slog.DebugContext(ctx, "found valid tools", "download_url", asset.DownloadURL, "os", os, "arch", arch, "file_name", asset.Name)
ret = append(ret, commonParams.RunnerApplicationDownload{
OS: os,
Architecture: arch,

View file

@ -28,10 +28,23 @@ import (
"github.com/cloudbase/garm/database/common"
"github.com/cloudbase/garm/params"
garmUtil "github.com/cloudbase/garm/util"
"github.com/cloudbase/garm/util/appdefaults"
"github.com/cloudbase/garm/util/github"
)
var (
// githubToolsUpdateDeadline in minutes
githubToolsUpdateDeadline = 40
// giteaToolsUpdateDeadline in minutes
giteaToolsUpdateDeadline = 180
)
func newToolsUpdater(ctx context.Context, entity params.ForgeEntity, store common.Store) *toolsUpdater {
workerID := fmt.Sprintf("tools-updater-%s-%s", entity, entity.Credentials.Endpoint.Name)
ctx = garmUtil.WithSlogContext(
ctx,
slog.Any("worker", workerID))
return &toolsUpdater{
ctx: ctx,
entity: entity,
@ -92,7 +105,7 @@ func (t *toolsUpdater) Stop() error {
}
func (t *toolsUpdater) updateTools() error {
slog.DebugContext(t.ctx, "updating tools", "entity", t.entity.String(), "forge_type", t.entity.Credentials.ForgeType)
slog.DebugContext(t.ctx, "updating tools", "last_update", t.lastUpdate, "entity", t.entity.String(), "forge_type", t.entity.Credentials.ForgeType)
entity, ok := cache.GetEntity(t.entity.ID)
if !ok {
return fmt.Errorf("getting entity from cache: %s", t.entity.ID)
@ -121,12 +134,7 @@ func (t *toolsUpdater) Reset() {
if !t.running {
return
}
if t.entity.Credentials.ForgeType == params.GiteaEndpointType {
// no need to reset the gitea tools updater when credentials
// are updated.
return
}
slog.DebugContext(t.ctx, "resetting tools worker", "reset", fmt.Sprintf("%v", t.reset))
if t.reset != nil {
close(t.reset)
@ -162,32 +170,84 @@ func (t *toolsUpdater) giteaUpdateLoop() {
randInt = big.NewInt(0)
}
t.sleepWithCancel(time.Duration(randInt.Int64()) * time.Millisecond)
tools, err := getTools(t.ctx)
// add some jitter
timerJitter, err := rand.Int(rand.Reader, big.NewInt(120))
if err != nil {
t.addStatusEvent(fmt.Sprintf("failed to update gitea tools: %q", err), params.EventError)
} else {
t.addStatusEvent("successfully updated tools", params.EventInfo)
cache.SetGithubToolsCache(t.entity, tools)
timerJitter = big.NewInt(0)
}
ticker := time.NewTicker(1*time.Minute + time.Duration(timerJitter.Int64())*time.Second)
defer ticker.Stop()
reset:
metadataURL := appdefaults.GiteaRunnerReleasesURL
var useInternal bool
ep, ok := cache.GetEndpoint(t.entity.Credentials.Endpoint.Name)
if ok {
if ep.ToolsMetadataURL != "" {
metadataURL = ep.ToolsMetadataURL
}
if ep.UseInternalToolsMetadata != nil {
useInternal = *ep.UseInternalToolsMetadata
}
}
// Once every 3 hours should be enough. Tools don't expire.
ticker := time.NewTicker(3 * time.Hour)
now := time.Now().UTC()
if now.After(t.lastUpdate.Add(time.Duration(giteaToolsUpdateDeadline) * time.Minute)) {
tools, err := getTools(t.ctx, metadataURL, useInternal)
if err != nil {
t.addStatusEvent(fmt.Sprintf("failed to update gitea tools: %q", err), params.EventError)
} else {
if useInternal {
t.addStatusEvent("using internal tools metadata", params.EventInfo)
} else {
t.addStatusEvent(fmt.Sprintf("successfully updated tools using metadata URL %s", metadataURL), params.EventInfo)
}
t.lastUpdate = now
cache.SetGithubToolsCache(t.entity, tools)
}
}
for {
t.mux.Lock()
if t.reset == nil {
t.reset = make(chan struct{})
}
t.mux.Unlock()
select {
case <-t.quit:
slog.DebugContext(t.ctx, "stopping tools updater")
return
case <-t.reset:
goto reset
case <-t.ctx.Done():
return
case <-ticker.C:
tools, err := getTools(t.ctx)
now := time.Now().UTC()
if !now.After(t.lastUpdate.Add(time.Duration(giteaToolsUpdateDeadline) * time.Minute)) {
continue
}
ep, ok := cache.GetEndpoint(t.entity.Credentials.Endpoint.Name)
if ok {
if ep.ToolsMetadataURL != "" {
metadataURL = ep.ToolsMetadataURL
}
if ep.UseInternalToolsMetadata != nil {
useInternal = *ep.UseInternalToolsMetadata
}
}
tools, err := getTools(t.ctx, metadataURL, useInternal)
if err != nil {
t.addStatusEvent(fmt.Sprintf("failed to update gitea tools: %q", err), params.EventError)
slog.DebugContext(t.ctx, "failed to update gitea tools", "error", err)
continue
}
t.addStatusEvent("successfully updated tools", params.EventInfo)
if useInternal {
t.addStatusEvent("using internal tools metadata", params.EventInfo)
} else {
t.addStatusEvent(fmt.Sprintf("successfully updated tools using metadata URL %s", metadataURL), params.EventInfo)
}
t.lastUpdate = now
cache.SetGithubToolsCache(t.entity, tools)
}
}
@ -204,62 +264,56 @@ func (t *toolsUpdater) loop() {
}
t.sleepWithCancel(time.Duration(randInt.Int64()) * time.Millisecond)
var resetTime time.Time
// add some jitter
timerJitter, err := rand.Int(rand.Reader, big.NewInt(120))
if err != nil {
timerJitter = big.NewInt(0)
}
timer := time.NewTicker(1*time.Minute + time.Duration(timerJitter.Int64())*time.Second)
defer timer.Stop()
reset:
now := time.Now().UTC()
if now.After(t.lastUpdate.Add(40 * time.Minute)) {
if now.After(t.lastUpdate.Add(time.Duration(githubToolsUpdateDeadline) * time.Minute)) {
slog.DebugContext(t.ctx, "last update after deadline", "last_update", t.lastUpdate, "deadline", t.lastUpdate.Add(time.Duration(githubToolsUpdateDeadline)*time.Minute))
if err := t.updateTools(); err != nil {
slog.ErrorContext(t.ctx, "updating tools", "error", err)
t.addStatusEvent(fmt.Sprintf("failed to update tools: %q", err), params.EventError)
resetTime = now.Add(5 * time.Minute)
} else {
// Tools are usually valid for 1 hour.
resetTime = t.lastUpdate.Add(40 * time.Minute)
t.lastUpdate = now
t.addStatusEvent("successfully updated tools", params.EventInfo)
}
}
for {
t.mux.Lock()
if t.reset == nil {
t.reset = make(chan struct{})
}
// add some jitter
randInt, err := rand.Int(rand.Reader, big.NewInt(300))
if err != nil {
randInt = big.NewInt(0)
}
timer := time.NewTimer(resetTime.Sub(now) + time.Duration(randInt.Int64())*time.Second)
t.mux.Unlock()
select {
case <-t.quit:
slog.DebugContext(t.ctx, "stopping tools updater")
timer.Stop()
return
case <-timer.C:
now := time.Now().UTC()
if !now.After(t.lastUpdate.Add(time.Duration(githubToolsUpdateDeadline) * time.Minute)) {
continue
}
slog.DebugContext(t.ctx, "updating tools")
now = time.Now().UTC()
if err := t.updateTools(); err != nil {
slog.ErrorContext(t.ctx, "updating tools", "error", err)
t.addStatusEvent(fmt.Sprintf("failed to update tools: %q", err), params.EventError)
resetTime = now.Add(5 * time.Minute)
} else {
// Tools are usually valid for 1 hour.
resetTime = t.lastUpdate.Add(40 * time.Minute)
t.addStatusEvent("successfully updated tools", params.EventInfo)
}
case <-t.reset:
slog.DebugContext(t.ctx, "resetting tools updater")
timer.Stop()
now = time.Now().UTC()
if err := t.updateTools(); err != nil {
slog.ErrorContext(t.ctx, "updating tools", "error", err)
t.addStatusEvent(fmt.Sprintf("failed to update tools: %q", err), params.EventError)
resetTime = now.Add(5 * time.Minute)
} else {
// Tools are usually valid for 1 hour.
resetTime = t.lastUpdate.Add(40 * time.Minute)
t.addStatusEvent("successfully updated tools", params.EventInfo)
}
goto reset
}
timer.Stop()
}
}