Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

3.4 KB
Raw Blame
// 设置区(views/settings、views/system、views/integrations)各页面共用的版式 mixin:
// 页面标题块、设置行、行内说明 / 控件列、行内保存状态。
// 页面保留自己的 class 名,只把重复声明换成 mixin 调用,需要偏离时在调用后覆盖。
//
//   @import (reference) '@/components/css/settings-section.less';
//   .section-header { .settings-section-header(); }
//   .setting-row { .setting-row(); }
//   .setting-info { .setting-info(); }
//   .setting-control { .setting-control(); }

.settings-section-header() {
  margin-bottom: 28px;

  h2 {
    margin: 0 0 8px;
    color: var(--td-text-color-primary);
    font-size: var(--app-text-3xl);
    font-weight: 600;
    line-height: 28px;
  }

  .section-description {
    margin: 0;
    color: var(--td-text-color-secondary);
    font-size: var(--app-text-base);
    line-height: 1.5;
  }

  // 标题左、操作按钮右
  &__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
}

.setting-row() {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--td-component-stroke);

  &:last-child {
    border-bottom: none;
  }
}

.setting-info() {
  flex: 1;
  min-width: 0;
  max-width: 65%;

  label,
  .setting-label {
    display: block;
    margin-bottom: 4px;
    color: var(--td-text-color-primary);
    font-size: var(--app-text-lg);
    font-weight: 500;
    line-height: 1.4;
  }

  .desc,
  .setting-desc {
    margin: 0;
    color: var(--td-text-color-secondary);
    font-size: var(--app-text-md);
    line-height: 1.5;
  }
}

.setting-control() {
  flex-shrink: 0;
  min-width: 280px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

// 改即存设置项的行内反馈(替代 toast)
.setting-save-state() {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  min-width: 52px;
  font-size: var(--app-text-sm);
  color: var(--td-text-color-secondary);

  &--success {
    color: var(--td-success-color);
  }
}

// 标题旁的补充说明入口,保持设置页标题本身的字号与字重。
.settings-title-help() {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--app-radius-sm);
  background: transparent;
  color: var(--td-text-color-placeholder);
  cursor: help;

  &:hover {
    color: var(--td-text-color-secondary);
    background: var(--td-bg-color-container-hover);
  }

  &:focus-visible {
    outline: 2px solid var(--td-brand-color);
    outline-offset: 2px;
  }
}

// 资源管理类设置页:固定顶部工具栏,列表在剩余空间内滚动。
.settings-list-page() {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--td-text-color-primary);
}

.settings-list-action() {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--td-component-stroke);
  border-radius: var(--app-radius-sm);
  background: var(--td-bg-color-container);
  color: var(--td-text-color-primary);
  font-size: var(--app-text-md);
  font-weight: 400;

  &:hover:not(:disabled) {
    background: var(--td-bg-color-container-hover);
  }

  &:focus-visible {
    outline: 2px solid var(--td-brand-color);
    outline-offset: 2px;
  }

  :deep(.t-icon) { color: var(--td-brand-color); }
}